lilypond-1.3.95
authorfred <fred>
Tue, 26 Mar 2002 23:57:06 +0000 (23:57 +0000)
committerfred <fred>
Tue, 26 Mar 2002 23:57:06 +0000 (23:57 +0000)
lily/include/note-head.hh
lily/include/rest.hh
lily/include/rhythmic-head.hh
lily/include/spacing-spanner.hh
lily/spacing-spanner.cc
ly/engraver.ly
scm/basic-properties.scm
scripts/abc2ly.py

index 8974b9828d5dbc1ea4c8cb336c44196a398758b9..6703c443bb90fc18a155cdca3dc9cd5ab181664f 100644 (file)
 #include "lily-guile.hh"
 #include "molecule.hh"
 
-/** ball at the end of the stem. Takes care of:
+/** ball at the end of the stem. Also takes care of ledger lines.
 
-  * help lines  
-
-  Properties
+    NoteHead is a kind of RhythmicHead, see there.
 
+  Read-only:
+  
   style -- symbol that sets note head style
-
-  */
+*/
 
 class Note_head 
 {
index 204c19f407ce48d18561dd07e84ef372ca6a3175..051bdaf98990cc34f68a7bca629a9fa01b9fd444 100644 (file)
 
 /**
    A pause.
+
+   See also Rhythmic_head, Staff_symbol_referencer.
    
-   Properties
+   Read-only properties:
 
    style -- string specifying glyph style
  */
index 855f84b7f7beef921a7e6fbe72104c0b6a6b5ea8..50b1b87187f11a2265f8de8a608a9f937db047ed 100644 (file)
 /*
   Properties
   
-  duration-log -- 2-log of the notehead duration
-
   dot -- reference to Dots object.
 
+  stem -- pointer to Stem object
+
+  Read-only
+
+  duration-log -- 2-log of the notehead duration
+
 */
 class Rhythmic_head
 {
index 7f678043eee3b7d4a1e82af8f984540a9bfc0b85..f0f81dde7612c38c72117665dd79cede71db83ac 100644 (file)
 
 #include "spanner.hh"
 
+/**
+   Read-only properties
+
+   maximum-duration-for-spacing -- rational: space as if a duration of
+     this type is available in this measure.
+
+
+   
+   Read properties from paper-column
+
+   dir-list -- list of stem directions
+
+   shortest-playing-duration -- duration of the shortest playing in that column.
+
+   shortest-starter-duration -- duration of the shortest notes that starts
+     exactly in that column.
+
+   contains-grace -- boolean. Used to widen entries for grace notes.
+
+   extra-space --  pair of distances
+
+   stretch-distance -- pair of distances
+ */
 class Spacing_spanner
 {
 public:
index 5483955386c4fd83684bc8a2678f33d639ad0e68..43ef9b974ad0480587fc86f14d8d382914422829 100644 (file)
@@ -340,3 +340,41 @@ Spacing_spanner::set_springs (SCM smob)
 
 
 
+/*
+  maximum-duration-for-spacing
+From: bf250@freenet.carleton.ca (John Sankey)
+To: gnu-music-discuss@gnu.org
+Subject: note spacing suggestion
+Date: Mon, 10 Jul 2000 11:28:03 -0400 (EDT)
+
+Currently, Lily spaces notes by starting with a basic distance,
+arithmetic_multiplier, which it applies to the minimum duration note
+of the bar. Then she adds a logarithmic increment, scaled from
+arithmetic_basicspace, for longer notes. (Then, columns are aligned
+and justified.) Fundamentally, this matches visual spacing to musical
+weight and works well.
+
+A lot of the time in music, I see a section basically in melodic
+notes that occasionally has a rapid ornamental run (scale). So, there
+will be a section in 1/4 notes, then a brief passage in 1/32nds, then
+a return to long notes. Currently, Lily gives the same horizontal
+space to the 1/32nd notes in their bar (even if set in small size as
+is commonly done for cadenzii) as she gives to 1/4 notes in bars
+where 1/4 note is the minimum duration. The resulting visual weight
+does not match the musical weight over the page.
+
+Looking at the music I am typesetting, I feel that Lily's spacing
+could be significantly improved if, with no change in the basic
+method used, arithmetic_multiplier could be applied referred to the
+same duration throughout a piece. Of course, the current method
+should be retained for those who have already set music in it, so I
+suggest a property called something like arithmetic_base=16 to fix
+1/16 duration as the reference for arithmetic_multiplier; the default
+would be a dynamic base is it is now.
+
+Does anyone else feel that this would be a useful improvement for
+their music? (Of course, if arithmetic_multiplier became a regular
+property, this could be used to achieve a similar result by
+tweaking.)
+  
+ */
index b5f51c2f0b120df898d942ea3aa86040336e87bb..53c4a8aab11c50abd5660ad3b7d6793e7ca8480b 100644 (file)
@@ -31,8 +31,8 @@ StaffContext=\translator {
        \consists "Collision_engraver";
        \consists "Rest_collision_engraver";
        \consists "Local_key_engraver";
-
        \consists "Piano_pedal_engraver";
+       \consists "Arpeggio_engraver";
 
        \consistsend "Axis_group_engraver";
 
@@ -191,6 +191,7 @@ GrandStaffContext=\translator{
        \type "Engraver_group_engraver";
        \name GrandStaff;
        \consists "Span_bar_engraver";
+       \consists "Span_arpeggio_engraver";
        \consists "System_start_delimiter_engraver";
        systemStartDelimiterGlyph = #'brace
        
@@ -199,24 +200,27 @@ GrandStaffContext=\translator{
        \accepts "Staff";
 }
 
-PianoStaffContext = \translator{\GrandStaffContext
-       alignmentReference = \center;
+PianoStaffContext = \translator{
+       \GrandStaffContext
+       \name "PianoStaff";
 
        \consists "Vertical_align_engraver";
 
+       alignmentReference = \center;
        VerticalAlignment \push #'threshold = #'(12 . 12) 
 
 %      \consistsend "Axis_group_engraver";
-       \name "PianoStaff";
 }
 
 StaffGroupContext= \translator {
        \type "Engraver_group_engraver";
+       \name StaffGroup;
+
        \consists "Span_bar_engraver";
+       \consists "Span_arpeggio_engraver";
        \consists "Output_property_engraver";   
+       systemStartDelimiterGlyph = #'bracket
        \consists "System_start_delimiter_engraver";
-       systemStartDelimiterGlyph = #'bracket
-       \name StaffGroup;
        \accepts "Staff";
        \accepts "RhythmicStaff";
        \accepts "GrandStaff";
@@ -337,6 +341,7 @@ ScoreContext = \translator {
 
        \consists "Lyric_phrasing_engraver";
        \consists "Bar_number_engraver";
+       \consists "Span_arpeggio_engraver";
 
        
        \accepts "Staff";
@@ -433,6 +438,11 @@ ScoreContext = \translator {
        % distances are given in stafflinethickness (thicknesses) and
        % staffspace (distances)
        %
+       Arpeggio = #`(
+               (interfaces . (arpeggio-interface))
+               (molecule-callback . ,Arpeggio::brew_molecule)
+               (name . "arpeggio") 
+       )
        BarLine = #`(
                (interfaces . (bar-interface staff-bar-interface))
                (break-align-symbol . Staff_bar)
@@ -541,7 +551,7 @@ ScoreContext = \translator {
                (interfaces . (dot-interface))
                (molecule-callback . ,Dots::brew_molecule)
                (dot-count . 1)
-               (position . 0.0)
+               (staff-position . 0.0)
                (Y-offset-callbacks  . (,Dots::quantised_position_callback ,Staff_symbol_referencer::callback))
 
                (name . "Dots")         
@@ -754,7 +764,11 @@ ScoreContext = \translator {
                (maximum-duration-for-spacing . ,(make-moment 1 8))
                (name . "SpacingSpanner")
        )
-
+       SpanArpeggio = #`(
+               (interfaces . (span-arpeggio-interface))
+               (molecule-callback . ,Span_arpeggio::brew_molecule)
+               (name . "SpanArpeggio") 
+       )
        SpanBar = #`(
                (interfaces . (bar-interface span-bar-interface))
                (break-align-symbol . Staff_bar)
index d07db3311eac5938d54468348e560e80f105bd4d..37fe4c19446bb0ffff9696c61616a26f24e89c50 100644 (file)
                          (":|" . (":|" . nil))
                          ("||" . ("||" . nil))
                          (".|." . (".|." . nil))
+                         ("empty" . ("nil" . nil))
                          ("brace" . (nil . "brace"))
                          ("bracket" . (nil . "bracket"))  
                          )
index cc0d03c07ef07e94ba710aad9f4c351d55a5679f..dc08ba9395177ddd6eb721bf428d7ecff70a129e 100644 (file)
@@ -6,7 +6,7 @@
 #
 # (not finished.)
 # ABC standard v1.6:  http://www.gre.ac.uk/~c.walshaw/abc2mtex/abc.txt
-# 
+#
 # Enhancements  (Roy R. Rankin)
 #
 # Header section moved to top of lilypond file
 # Chord strings([-^]"string") can contain a '#'
 # Header fields enclosed by [] in notes string processed
 # W: words output after tune as abc2ps does it (they failed before)
+
+# Enhancements (Laura Conrad)
+#
+# Beaming now preserved between ABC and lilypond
 #
 # Limitations
 #
 # Multiple tunes in single file not supported
 # Blank T: header lines should write score and open a new score
 # Not all header fields supported
-# Beaming not preserved between ABC and lilypond
 # ABC line breaks are ignored
 # Block comments generate error and are ignored
 # Postscript commands are ignored
@@ -71,6 +74,7 @@ current_lyric_idx = -1
 lyric_idx = -1
 part_names = 0
 default_len = 8
+length_specified = 0
 global_key = [0] * 7                   # UGH
 names = ["One", "Two", "Three"]
 DIGITS='0123456789'
@@ -147,6 +151,10 @@ def dump_lyrics (outf):
                        outf.write ("\n")
                outf.write("    >\n    \\paper{}\n}\n")
 
+def dump_default_bar (outf):
+       outf.write ("\n\\property Score.defaultBarType=\"empty\"\n")
+
+
 def dump_slyrics (outf):
        ks = voice_idx_dict.keys()
        ks.sort ()
@@ -161,6 +169,7 @@ def dump_voices (outf):
        ks.sort ()
        for k in ks:
                outf.write ("\nvoice%s = \\notes {" % k)
+               dump_default_bar(outf)
                outf.write ("\n" + voices [voice_idx_dict[k]])
                outf.write ("\n}")
        
@@ -201,6 +210,7 @@ def set_default_length (s):
        m =  re.search ('1/([0-9]+)', s)
        if m:
                __main__.default_len = string.atoi ( m.group (1))
+               length_specified = 1
 
 def set_default_len_from_time_sig (s):
        m =  re.search ('([0-9]+)/([0-9]+)', s)
@@ -502,8 +512,8 @@ def try_parse_header_line (ln, state):
                                        state.common_time = 1
                                        voices_append ("\\property Staff.timeSignatureStyle=\"C\"\n")
                                a = '2/2'
-#                      global_voice_stuff.append ('\\time %s;' % a)
-                       set_default_len_from_time_sig (a)
+                       if not length_specified:
+                               set_default_len_from_time_sig (a)
                        voices_append ('\\time %s;' % a)
                        state.next_bar = ''
                if g == 'K': # KEY
@@ -595,12 +605,9 @@ def parse_num (str):
 
 def duration_to_mudela_duration  (multiply_tup, defaultlen, dots):
        base = 1
-
        # (num /  den)  / defaultlen < 1/base
        while base * multiply_tup[0] < multiply_tup[1]:
                base = base * 2
-
-
        return '%d%s' % ( base, '.'* dots)
 
 class Parser_state:
@@ -889,7 +896,8 @@ bar_dict = {
 '::' : '::',
 '|1' : '|',
 '|2' : '|',
-':|2' : ':|'
+':|2' : ':|',
+'|' :  '|'
 }
 
 
@@ -899,7 +907,7 @@ def try_parse_bar (str,state):
        bs = None
 
        # first try the longer one
-       for trylen in [3,2]:
+       for trylen in [3,2,1]:
                if str[:trylen] and bar_dict.has_key (str[:trylen]):
                        s = str[:trylen]
                        bs = "\\bar \"%s\";" % bar_dict[s]