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.
@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.
-\version "2.1.7"
+\version "2.1.19"
% #(ly:set-point-and-click 'line-column)
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 |
-\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
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 ------
}
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 }
>>
}
\context Staff = bass \bass
- \apply #(drums->paper 'drums) \drums
+ \new DrumStaff { \drumContents }
>>
>>
- \midi { \tempo 4 = 75 }
\paper {
linewidth = 15.0 \cm
\translator { \RemoveEmptyStaffContext }
skipBars = ##t
}
}
+ \midi { \tempo 4 = 75 }
}
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;
}
;
partCombineListener = \paper {
\translator {
\VoiceContext
- \denies Thread
\consists Note_heads_engraver
\consists Rest_engraver
\type "Recording_group_engraver"
\StaffContext
\remove "Axis_group_engraver"
\consistsend "Hara_kiri_engraver"
- \accepts "Voice"
-
- % hara kiri & auto knee don't work together.
Beam \override #'auto-knee-gap = #'()
}
\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 }
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!")