]> git.donarmstrong.com Git - lilypond.git/commitdiff
* server.ly: use Completion_heads_engraver
authorhanwen <hanwen>
Thu, 28 Jul 2005 15:29:57 +0000 (15:29 +0000)
committerhanwen <hanwen>
Thu, 28 Jul 2005 15:29:57 +0000 (15:29 +0000)
use version number.

* notation.py (add_start_skip):  new function

README
notation.py
server.ly

diff --git a/README b/README
index a3241494d84fa5516aca8edf83a821270914fd39..a441a4a1519bbe55f655b8ae9a75fce23736c9ae 100644 (file)
--- a/README
+++ b/README
@@ -12,6 +12,8 @@ USAGE:
 KEYS
 
 a..g           pitch
+A..G            add chord pitch
+up,down         move between chord notes
 , '            octave
 r              rest
 space          enter note
@@ -20,8 +22,13 @@ left,right   move
 * /            duration longer/shorter
 + -            alteration up/down
 backspace      delete note
-
-
+Ctrl+@          double flat
+@              flat
+!               natural 
+x               double sharp 
+#               sharp
+Shift+up,down   change pitch
+~               arpeggio
 
 CAVEAT
 
index 13021ade4f2814e83fe14667361ba9fdb68f136c..5fa77eb264c437e7c4b0c2be839091eed63d48b0 100644 (file)
@@ -18,11 +18,17 @@ def get_display_dpi():
         display_dpi = (string.atoi (m.group (2)) + string.atoi (m.group (2)))/2
 
 
+scale_alterations = [0, 0, -2, 0, 0,-2,-2]  
+
 copy_lilypond_input = 1
 time_sig = (4, 4)
 measure_length = Rational (time_sig[0], time_sig[1])
+measure_count = 4
+
+scale_str = ("'(%s)" % 
+             string.join (['(%d . %d)' % (i , scale_alterations[i]) for i in range (0,7)], ' '))
 
-scale = "'((0 . 0) (1 . 0) (2 . -2) (3 . 0) (4 . 0) (5 . -2) (6 . -2))"
+"'((0 . 0) (1 . 0) (2 . -2) (3 . 0) (4 . 0) (5 . -2) (6 . -2))"
 clefsetting = """
       (context-spec-music
        (make-property-set 'clefGlyph "clefs.C") 'Staff)
@@ -83,7 +89,7 @@ def set_measure_number (str, num):
        'Staff)
 
     %s))""" % (time_sig[0], time_sig[1], time_sig[0],
-               time_sig[1], time_sig[1], num, scale, str)
+               time_sig[1], time_sig[1], num, scale_str, str)
 
 def render_score (filename, ly):
     print ly
@@ -176,9 +182,6 @@ class Notation_controller:
         start_note = expr.find_first (sub2)
 
         start_skip = start_note.start - start_note.start.floor()
-
-        print 'start_skip = ' ,  start_skip
-        
         
        str = expr.lisp_sub_expression (sub)
         str = add_start_skip (str, start_skip)
@@ -190,7 +193,7 @@ class Notation_controller:
 
     def ensure_visible (self, when):
         new_start =  max ((when - measure_length).floor(), Rational(0))
-        new_stop = new_start + Rational (3) * measure_length
+        new_stop = new_start + Rational (measure_count) * measure_length
 
         if new_start <> self.start_moment or new_stop <> self.stop_moment:
             print "render interval", new_start, new_stop
@@ -318,12 +321,15 @@ class Notation:
         
     def backspace (self):
         mus = self.music_cursor
-        if mus.parent.name() == 'EventChord' and len (mus.parent.elements) <= 1:
+        if (mus.parent.name() == 'EventChord'
+            and len (mus.parent.elements) <= 1):
+            
             mus = mus.parent
 
         neighbor = mus.parent.get_neighbor (mus, -1)
         mus.parent.delete_element (neighbor)
         self.touch_document ()
+        
     def change_octave (self, dir):
         if self.music_cursor.name() == 'NoteEvent':
             p = self.music_cursor.pitch
@@ -338,6 +344,7 @@ class Notation:
             p = self.music_cursor.pitch
             p1 = p.copy()
             p1.step = step
+            p1.alteration = scale_alterations [step]
             
             orig_steps = p.steps ()
             new_steps = p1.steps ()
@@ -396,6 +403,8 @@ class Notation:
             elif p1.step < 0:
                 p1.step += 7
                 p1.octave -= 1
+
+            p1.alteration = scale_alterations [p1.step]
                 
             self.music_cursor.pitch = p1
             self.touch_document ()
@@ -410,7 +419,7 @@ class Notation:
             dur = self.music_cursor.duration
             dl = dur.duration_log
             dl += dir
-            if dl <= 6 and dl >= -3:
+            if dl <= 6 and dl >= -2:
                 dur.duration_log = dl
                 
             self.touch_document ()
index 446e7071d1572c311843b3a37f87439f9d0cdb7d..78389b267416f8a5581cac8ac268e6200c37a6f8 100644 (file)
--- a/server.ly
+++ b/server.ly
                                 (sockaddr:addr client-details)))
                 (newline)
                 ;; Send back the greeting to the client port
-                (display "hello LilyPond 2.7.1\n" client)
+                (display (format
+                         "hello LilyPond ~a\n"
+                         (lilypond-version))
+                         client)
 
               (let* ((question (read client))
                      (music (eval question (current-module))))