2008/12/18 Kieren MacMillan <kieren_macmil...@sympatico.ca>: > Nicely done! Definitely LSR-worthy…
Will do. Here's a better version, that also demonstrates a slight bug (the cross-staff slur doesn't work well) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% one = { \repeat unfold 4 { a4 b c' d'} \break \repeat unfold 4 { a4 b c' d'} \break \repeat unfold 4 { a4 b c' d'} \break a1 } two = { \clef bass \repeat unfold 4 { a4 b c' d'} \break \repeat unfold 4 { a4.-> \ottava #1 << c' \\ c >> \ottava #0 \change Staff = down c'8( \change Staff = up d')} \break R1*4 \break a1 } three = { \clef bass \repeat unfold 4 { a,4 b, c d} \break R1*4 \break R1*4 \break a1 } \layout { \context { \RemoveEmptyStaffContext } \context { \name PseudoVoice \type Engraver_group \consists Note_heads_engraver \consists Pitch_squash_engraver squashedPosition = #0 \override NoteHead #'stencil = #empty-stencil } \context { \Staff \accepts PseudoVoice } } #(define (remove music) "Sends the whole thing to Devnull whenever possible" (context-spec-music music 'Devnull)) #(define (event-filter event) (let ((n (ly:music-property event 'name))) (if (or (eq? n 'ContextSpeccedMusic) ; to avoid clefs and ottavas (eq? n 'ContextChange)) ; cross-staff voices are supported (music-map remove event)) (if (eq? n 'SimultaneousMusic) ; we don't want a new Voice to be created (ly:music-set-property! event 'name 'NoteEvent)))) makeGhost = #(define-music-function (parser location music) (ly:music?) (context-spec-music (music-filter event-filter music) 'PseudoVoice)) LetsTryThis= #(define-music-function (parser location up down) (ly:music? ly:music?) #{<< \new Staff = "up" \with { \remove Accidental_engraver } << \new Voice \with { \consists Accidental_engraver } { \clef treble $up } \new Voice { \makeGhost $down } >> \new Staff = "down" \with { \remove Accidental_engraver } << \new Voice \with { \consists Accidental_engraver } { \clef bass $down } \new Voice { \makeGhost $up } >> >> #}) { << \new Staff \one \new PianoStaff \LetsTryThis \two \three >> } %%%%%%%%%%%%%%%%%%%%%%%%%%%% Anyway, I've compiled my opera with it and it works like a charm. Cheers, Valentin
_______________________________________________ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user