]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/midi-stream.cc (operator <<): rewrite.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 28 Sep 2003 20:34:45 +0000 (20:34 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 28 Sep 2003 20:34:45 +0000 (20:34 +0000)
* lily/note-head.cc (internal_brew_molecule):
only make ledgers when the Staff symbol has lines.

ChangeLog
Documentation/user/refman.itely
lily/key-signature-interface.cc
lily/midi-item.cc
lily/midi-stream.cc
lily/note-head.cc
scm/define-grobs.scm

index 0158c935a8d9a8b2624c5fba4e17d298fc047c36..b498fc0e596133d1697029a9894fc312513f165c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2003-09-28  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
 
+       * lily/midi-stream.cc (operator <<): rewrite.
+
+       * lily/note-head.cc (internal_brew_molecule): 
+       only make ledgers when the Staff symbol has lines.
+
        * ly/property-init.ly (arpeggioBracket): simplify
 
        * lily/translator-group.cc (execute_pushpop_property): use
index 1a00120e023fd42421e6d8ca9c7d917341e6c772..7ea49d592e3795c6c7516a660177f51b25b167d8 100644 (file)
@@ -1197,10 +1197,11 @@ small, short-lived voices or for single chords:
 }
 @end lilypond
 
-The separator causes @internalsref{Voice} contexts to be
-instantiated. They 
-bear the names @code{"1"}, @code{"2"}, etc. In each of these
-contexts, vertical direction of slurs, stems, etc. is set
+The separator causes @internalsref{Voice} contexts@footnote{Polyphonic
+voices are sometimes called "layers" other notation packages}
+@cindex layers
+to be instantiated. They bear the names @code{"1"}, @code{"2"}, etc. In
+each of these contexts, vertical direction of slurs, stems, etc. is set
 appropriately.
 
 This can also be done by instantiating @internalsref{Voice} contexts
index 762e703fae52d06365da8779854f544df3eb7481..76817e5e4bac4a896c4c3ddef839783678bb27fe 100644 (file)
@@ -50,6 +50,8 @@ const int NATURAL_TOP_PITCH = 4;
   - lots of values trivially shared (key doesn't change very
   often). Compute those once, and use that as cache for the rest.
 
+  TODO: can  we do without c0pos? it's partly musical. 
+
 */
 int
 alteration_pos  (SCM what, int alter, int c0p)
index db6bdc12c166f125946d86580c44797a65ee8148..2452a46951e62daa384fe839d940e8f10b624d31 100644 (file)
@@ -231,14 +231,6 @@ Moment
 Midi_note::get_length () const
 {
   Moment m = audio_->length_mom_;
-#if 0
-  //junkme?
-  if (m < Moment (Rational (1, 1000)))
-    {
-      warning (_ ("silly duration"));
-      m = 1;
-     }
-#endif
   return m;
 }
 
index 221658a71dc62f3eeab485dd2fb6ef87751b3781..d7333052283fe1fd8a5537a45028349d049c38a9 100644 (file)
@@ -31,17 +31,16 @@ Midi_stream::~Midi_stream ()
 Midi_stream&
 Midi_stream::operator << (String str)
 {
-  Byte *b = str.get_bytes ();
-#if 0
-  for (int sz = str.length (); sz--;)
+  size_t sz = sizeof (Byte);
+  size_t n = str.length ();
+  size_t written = fwrite (str.get_bytes (),
+                          sz, n, out_file_);
+
+  if (written != sz * n)
     {
-      fputc (*b, out_file_);
-      b++;
+      warning ("Could not write file. Disk full?");
     }
-#else
-  for (int i = 0, n = str.length (); i < n; i++)
-    fputc (b[i], out_file_);
-#endif
+
   return *this;
 }
 
index 4c291ae32d9c107f799ada95b4daa30724799c13..1bf1ed66c5aa9cf77643e4454dd68c8601103f96 100644 (file)
@@ -69,12 +69,12 @@ Note_head::brew_ledger_lines (Grob *me,
                               bool take_space)
 {
   Real inter_f = Staff_symbol_referencer::staff_space (me)/2;
-  int lines_i = abs (pos) < interspaces
+  int line_count = (abs (pos) < interspaces)
     ? 0
     : (abs (pos) - interspaces) / 2;
   Molecule molecule = Molecule();
 
-  if (lines_i)
+  if (line_count)
     {
       Real ledgerlinethickness =
        (me->get_paper ()->get_realvar (ly_symbol2scm ("ledgerlinethickness")));
@@ -95,7 +95,7 @@ Note_head::brew_ledger_lines (Grob *me,
       Real offs = (Staff_symbol_referencer::on_staffline (me, pos))
         ? 0.0
         : -dir * inter_f;
-      for (int i = 0; i < lines_i; i++)
+      for (int i = 0; i < line_count; i++)
         {
           Molecule ledger_line (proto_ledger_line);
           ledger_line.translate_axis (-dir * inter_f * i * 2 + offs, Y_AXIS);
@@ -129,7 +129,8 @@ internal_brew_molecule (Grob *me, bool ledger_take_space)
 
   int interspaces = Staff_symbol_referencer::line_count (me)-1;
   int pos = (int)rint (Staff_symbol_referencer::get_position (me));
-  if (abs (pos) - interspaces > 1)
+  if (interspaces >= 0
+      && abs (pos) - interspaces > 1)
     {
       Interval hd = out.extent (X_AXIS);
       Real left_ledger_protusion = hd.length ()/4;
index 7135a0d92ac336b3b90858c88ac11704f22124d4..b71c5787fca49cbb08f12ddb4a513d4a49ae0849 100644 (file)
 
     (RepeatSlash
      . (
-       (molecule-callback . , Percent_repeat_item_interface::beat_slash)
+       (molecule-callback . ,Percent_repeat_item_interface::beat_slash)
        (thickness . 0.48)
        (slope . 1.7)
        (meta . ((interfaces . (percent-repeat-interface item-interface ))))