]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/parser.yy (chord_body_element): add DRUM_PITCH to chords
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 5 Feb 2004 14:34:06 +0000 (14:34 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 5 Feb 2004 14:34:06 +0000 (14:34 +0000)
(i.e. < > )

* ly/performer-init.ly: add DrumStaff

* ly/engraver-init.ly: remove Lyrics context.
(TabVoice): add noteheads engraver

* ly/engraver-init.ly: remove Thread

* scripts/convert-ly.py (conv): \harmonic rule

* ly/engraver-init.ly: add DrumStaff and DrumVoice contexts

ChangeLog
Documentation/topdocs/NEWS.texi
input/mutopia/J.S.Bach/baerenreiter-sarabande.ly
input/template/jazz-combo.ly
lily/parser.yy
ly/declarations-init.ly
ly/engraver-init.ly
ly/performer-init.ly
scripts/convert-ly.py

index 1bc89e70aa6af180e15119a1d7f0fdb0deaea0b9..0cc0b84a6c950fc340218f78264863a6fa487b5a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2004-02-05  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
+       * lily/parser.yy (chord_body_element): add DRUM_PITCH to chords
+       (i.e. < > )
+
+       * ly/performer-init.ly: add DrumStaff
+
        * lily/axis-group-engraver.cc (acknowledge_grob): also take
        lyric-interface; this prevents lines with only extender lines from
        being junked.
index 0961eb2f514aba41ff06475fb1671737637e24a4..17fd15d29f08e39b2c8ed9c38e7ea73c06c4c0bd 100644 (file)
@@ -17,6 +17,8 @@ Version 2.1.13
 @end ignore
 
 @itemize @bullet
+@item The @code{Lyrics} context has been removed. Lyrics should only
+be constructed in @code{LyricsVoice}.
 
 @item The @code{Thread} context has been removed. Note heads and rests
 are now constructed at @code{Voice} level.
index e921a6c5b395a417771b4ecd81b6e22c9deb3de0..658588d7ea3cb2411dec3af8dc4b8303dc03484c 100644 (file)
@@ -1,4 +1,4 @@
-\version "2.1.7"
+\version "2.1.19"
 
 % #(ly:set-point-and-click 'line-column)
 
@@ -121,7 +121,7 @@ sarabandeA =  \context Voice \notes \relative c {
   d'[ cis] |
   %%  d4 d,,2 |
   d4
-  \property Thread.NoteHead
+  \property Voice.NoteHead
   \override #'after-line-breaking-callback
   = #(lambda (smob) (assert-system-count smob 6))
   d,,2 |
index fa59fe0a1a68fb53119ba7f6496560afe4921236..65ecdd424d6ab8d415138efae096a27c4ad9b803 100644 (file)
@@ -1,4 +1,4 @@
-\version "2.1.13"
+\version "2.1.19"
 \header {
         title = "Song"
         subtitle = "(tune)"
 %%%%%%%%%%%% Some macros %%%%%%%%%%%%%%%%%%%
 
 sl = {
-          \property Voice.NoteHead \override #'style = #'slash
-          \property Voice.Stem \override #'length = #0 }
+    \property Voice.NoteHead \override #'style = #'slash
+    \property Voice.Stem \override #'transparent = ##t
+}
 nsl = {
-         \property Voice.NoteHead \revert #'style
-         \property Voice.Stem \revert #'length }
+    \property Voice.NoteHead \revert #'style
+    \property Voice.Stem \revert #'transparent
+}
 cr = \property Voice.NoteHead \override #'style = #'cross
 ncr = \property Voice.NoteHead \revert #'style
 
@@ -27,29 +29,30 @@ ncr = \property Voice.NoteHead \revert #'style
 
 jzchords = { } 
 
+
 %%%%%%%%%%%% Keys'n'thangs %%%%%%%%%%%%%%%%%
 
 global = \notes {
-        \time 4/4
+    \time 4/4
 }
 
-Key = \notes \key c \major
+Key = \notes { \key c \major }
 
 % ############ Horns ############
 % ------ Trumpet ------
 trpt = \notes \transpose c d \relative c'' {
-       \Key
-        c1 c c
+    \Key
+    c1 c c
 }
 
 trpharmony = \chords \transpose c' d { \jzchords }
 trumpet = {
-        \global 
-        \property Staff.instrument = #"Trumpet"
-        \clef treble
-        \context Staff <<
-                \trpt
-        >>
+    \global 
+    \property Staff.instrument = #"Trumpet"
+    \clef treble
+    \context Staff <<
+       \trpt
+    >>
 }
 
 % ------ Alto Saxophone ------
@@ -178,31 +181,33 @@ bass = \notes \relative c {
 }
 
 bass = {
-        \global
-        \property Staff.instrument = #"Bass"
-        \clef bass
-        \context Staff <<
-                \bass
-        >>
+    \global
+    \property Staff.instrument = #"Bass"
+    \clef bass
+    \context Staff <<
+       \bass
+    >>
 }
 
-% ------ Drums ------
-\include "drumpitch-init.ly"
-up = \notes {
-        hh4 <<hh4 sn>> hh4 <<hh4 sn>> hh4 <<hh4 sn>> hh4 <<hh4 sn>>
-       hh4 <<hh4 sn>> hh4 <<hh4 sn>>
+                               % ------ Drums ------
+
+up = \drums {
+    hh4 <hh sn>4 hh <hh sn> hh <hh sn>4
+    hh4 <hh sn>4
+    hh4 <hh sn>4
+    hh4 <hh sn>4
 }
-down = \notes {
-        bd4 s bd s bd s bd s bd s bd s
+
+down = \drums {
+    bd4 s bd s bd s bd s bd s bd s
 }
 
-drums = \context Staff = drums {
+drumContents = {
        \global
-       \property Staff.instrument = #"Drums"
-       \clef percussion
        <<
-               \context Voice = first { \voiceOne \up }
-               \context Voice = second { \voiceTwo \down }
+               \property DrumStaff.instrument = #"Drums"
+               \new DrumVoice { \voiceOne \up }
+               \new DrumVoice { \voiceTwo \down }
        >>
 }
 
@@ -229,10 +234,9 @@ drums = \context Staff = drums {
                 
                 \context Staff = bass \bass
                 
-                \apply #(drums->paper 'drums) \drums
+                \new DrumStaff { \drumContents }
         >>
 >>
-        \midi { \tempo 4 = 75 }
         \paper {
                 linewidth = 15.0 \cm
                 \translator { \RemoveEmptyStaffContext }
@@ -243,5 +247,6 @@ drums = \context Staff = drums {
                         skipBars = ##t
                 }
         }
+        \midi { \tempo 4 = 75 }
 }
 
index de733ff58cf6bd8cec313eaa200959e06ed856a6..5debced12e9b9385577b137e64d526b8ff286d3f 100644 (file)
@@ -1288,9 +1288,22 @@ chord_body_element:
                if ($2 % 2 || $3 % 2)
                        n->set_mus_property ("force-accidental", SCM_BOOL_T);
 
-               SCM arts = scm_reverse_x ($4, SCM_EOL);
-               n->set_mus_property ("articulations", arts);
+               if (gh_pair_p ($4)) {
+                       SCM arts = scm_reverse_x ($4, SCM_EOL);
+                       n->set_mus_property ("articulations", arts);
+               }
+               $$ = n;
+       }
+       | DRUM_PITCH post_events {
+               Music *n =  MY_MAKE_MUSIC("NoteEvent");
+               n->set_mus_property ("duration" ,$2);
+               n->set_mus_property ("drum-type" , $1);
+               n->set_spot (THIS->here_input());
 
+               if (gh_pair_p ($2)) {
+                       SCM arts = scm_reverse_x ($2, SCM_EOL);
+                       n->set_mus_property ("articulations", arts);
+               }
                $$ = n;
        }
        ;
index 344e00f0b1874bf53f4dd08fcbd9a1c873909f1a..a9247573c0046b83fb8182227c800e5647e32c6e 100644 (file)
@@ -114,7 +114,6 @@ paperTwentysix = \paper {
 partCombineListener = \paper {
  \translator {
          \VoiceContext
-         \denies Thread
          \consists Note_heads_engraver
          \consists Rest_engraver
          \type "Recording_group_engraver"
index 4b9421e64797689c61c579e29953ae13c9e4faab..5663553a91d1d736aec5cf8c5c84073a50c9adb5 100644 (file)
@@ -387,9 +387,6 @@ RemoveEmptyStaffContext= \translator {
     \StaffContext
     \remove "Axis_group_engraver"
     \consistsend "Hara_kiri_engraver"
-    \accepts "Voice"
-
-                               % hara kiri & auto knee don't work together.
     Beam \override #'auto-knee-gap = #'()
 }
 
index b3e27bb34b90efb53899c9e9e5bd2288c3307af9..244f0eb5e4f1b3e13ec41fa9c1032a3afbdcb501 100644 (file)
 \version "2.1.19"
 
-%
-% setup for Request->Element conversion. Guru-only
-%
+                               %
+                               % setup for Request->Element conversion. Guru-only
+                               %
 \translator {
-       \type "Staff_performer"
-       \name Staff
-       \accepts Voice
+    \type "Staff_performer"
+    \name Staff
+    \accepts Voice
 
-       \consists "Key_performer"
-       \consists "Tempo_performer"
-       \consists "Time_signature_performer"
+    \consists "Key_performer"
+    \consists "Tempo_performer"
+    \consists "Time_signature_performer"
 
 }
-
 \translator {
-       \type "Performer_group_performer"
-       \name Voice
-       \consists "Dynamic_performer"
-       \consists "Span_dynamic_performer"
-       \consists "Tie_performer"
-       \consists "Piano_pedal_performer"
-       \accepts "Voice"
+    \StaffContext
+    \name DrumStaff
+    \accepts DrumVoice
 }
 
 \translator {
-       \type "Performer_group_performer"
-       \name Voice
-       \consists "Note_performer"
+    \type "Performer_group_performer"
+    \name Voice
+    \consists "Dynamic_performer"
+    \consists "Span_dynamic_performer"
+    \consists "Tie_performer"
+    \consists "Piano_pedal_performer"
 }
 
 \translator {
-       \type "Performer_group_performer"
-       \name FiguredBass 
-       \consists "Swallow_performer"
+    \VoiceContext
+    \name DrumVoice
 }
 
 \translator {
-       \type "Performer_group_performer"
-       \name GrandStaff
-       \accepts RhythmicStaff
-       \accepts Staff
+    \type "Performer_group_performer"
+    \name Voice
+    \consists "Note_performer"
 }
 
 \translator {
-        \type "Performer_group_performer"
-       \name "PianoStaff"
-       \accepts Staff
+    \type "Performer_group_performer"
+    \name FiguredBass 
+    \consists "Swallow_performer"
 }
 
 \translator {
-        \type "Performer_group_performer"
-       \name "TabVoice"
-       \consists "Swallow_performer"
+    \type "Performer_group_performer"
+    \name GrandStaff
+    \accepts RhythmicStaff
+    \accepts Staff
 }
 
 \translator {
-        \type "Performer_group_performer"
-       \name "Devnull"
-       \consists "Swallow_performer"
+    \type "Performer_group_performer"
+    \name "PianoStaff"
+    \accepts Staff
+    \accepts DrumStaff
 }
+
 \translator {
-        \type "Performer_group_performer"
-       \name "TabStaff"
-       \accepts "TabVoice"
+    \type "Performer_group_performer"
+    \name "TabVoice"
+    \consists "Swallow_performer"
 }
 
 \translator {
-       \type "Score_performer"
-
-       \name Score
-       \alias Timing
-       instrument = #"bright acoustic"
-       \accepts Staff
-       \accepts GrandStaff
-       \accepts PianoStaff
-       \accepts TabStaff
-       \accepts StaffGroup
-       \accepts Devnull
-       \accepts ChoirStaff
-       \accepts RhythmicStaff
-       \accepts ChordNames
-       \accepts FiguredBass
+    \type "Performer_group_performer"
+    \name "Devnull"
+    \consists "Swallow_performer"
+}
+\translator {
+    \type "Performer_group_performer"
+    \name "TabStaff"
+    \accepts "TabVoice"
+}
 
-       \alias "Timing"
-       \consists "Timing_translator"
-       \consists "Swallow_performer"
-       
-       dynamicAbsoluteVolumeFunction = #default-dynamic-absolute-volume
-       instrumentEqualizer = #default-instrument-equalizer
+\translator {
+    \type "Score_performer"
+
+    \name Score
+    \alias Timing
+    instrument = #"bright acoustic"
+    \accepts Staff
+    \accepts DrumStaff
+    \accepts GrandStaff
+    \accepts PianoStaff
+    \accepts TabStaff
+    \accepts Staff
+    \accepts StaffGroup
+    \accepts Devnull
+    \accepts ChoirStaff
+    \accepts RhythmicStaff
+    \accepts ChordNames
+    \accepts FiguredBass
+
+    \alias "Timing"
+    \consists "Timing_translator"
+    \consists "Swallow_performer"
+    
+    dynamicAbsoluteVolumeFunction = #default-dynamic-absolute-volume
+    instrumentEqualizer = #default-instrument-equalizer
 }
 
 
 \translator {
-       \type "Staff_performer" % Performer_group_performer ?
-       \consists "Lyric_performer"
-       \name LyricsVoice
-       \consists "Time_signature_performer"
-       \consists "Tempo_performer"
+    \type "Staff_performer" % Performer_group_performer ?
+    \consists "Lyric_performer"
+    \name LyricsVoice
+    \consists "Time_signature_performer"
+    \consists "Tempo_performer"
 }
 
 \translator{
-       \type "Performer_group_performer"
-       \name ChoirStaff
-       \accepts Staff
+    \type "Performer_group_performer"
+    \name ChoirStaff
+    \accepts Staff
+    \accepts DrumStaff
 }
 
 
 \translator {
-       \type "Staff_performer"
-       \accepts ChordNameVoice
-       \name ChordNames
+    \type "Staff_performer"
+    \accepts ChordNameVoice
+    \name ChordNames
 }
 
 \translator {
-       \type "Performer_group_performer"
-       \consists "Note_performer"
-       \name ChordNameVoice    
+    \type "Performer_group_performer"
+    \consists "Note_performer"
+    \name ChordNameVoice       
 }
 
 \translator {
-       \type "Performer_group_performer"
+    \type "Performer_group_performer"
 
-       \name StaffGroup
-       \accepts Staff
+    \name StaffGroup
+    \accepts Staff
+    \accepts DrumStaff
 }
 
 \translator { \StaffContext \name RhythmicStaff }
index 318198c5fedcfc599249174fccc9e7224cf703b6..2754d6cb8999661c21491a939e39b641109e62d0 100644 (file)
@@ -1776,9 +1776,12 @@ conversions.append (((2,1,18), conv, """\\newpartcombine -> \\partcombine,
 
 
 def conv (str):
-       str = re.sub (r'\\include "drumpitch-init.ly','', str)
+       str = re.sub (r'\\include "drumpitch-init.ly"','', str)
        str = re.sub (r'\\pitchnames ','pitchnames = ', str)
        str = re.sub (r'\\chordmodifiers ','chordmodifiers = ', str)
+       str = re.sub (r'\bdrums\b\s*=','drumContents = ', str)
+       str = re.sub (r'\\drums\b','\\drumContents ', str)
+       
 
        if re.search ('drums->paper', str):
                sys.stderr.write ("\nDrum notation found. Check file manually!")