CVSROOT:        /cvsroot/lilypond
Module name:    ikebana
Branch:         
Changes by:     Han-Wen Nienhuys <[EMAIL PROTECTED]>    05/07/28 15:29:57

Modified files:
        .              : README notation.py server.ly 

Log message:
        * server.ly: use Completion_heads_engraver
        use version number.
        
        * notation.py (add_start_skip):  new function

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/ikebana/README.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/ikebana/notation.py.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/ikebana/server.ly.diff?tr1=1.2&tr2=1.3&r1=text&r2=text

Patches:
Index: ikebana/README
diff -u ikebana/README:1.2 ikebana/README:1.3
--- ikebana/README:1.2  Wed Jul 13 21:12:43 2005
+++ ikebana/README      Thu Jul 28 15:29:57 2005
@@ -12,6 +12,8 @@
 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 @@
 * /            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: ikebana/notation.py
diff -u ikebana/notation.py:1.6 ikebana/notation.py:1.7
--- ikebana/notation.py:1.6     Thu Jul 28 11:14:10 2005
+++ ikebana/notation.py Thu Jul 28 15:29:57 2005
@@ -18,11 +18,17 @@
         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 @@
        '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 @@
         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 @@
 
     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 @@
         
     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 @@
             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 @@
             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 @@
             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: ikebana/server.ly
diff -u ikebana/server.ly:1.2 ikebana/server.ly:1.3
--- ikebana/server.ly:1.2       Thu Jul 28 11:14:10 2005
+++ ikebana/server.ly   Thu Jul 28 15:29:57 2005
@@ -51,7 +51,10 @@
                                 (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))))


_______________________________________________
Lilypond-cvs mailing list
Lilypond-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-cvs

Reply via email to