I forgot to say: The way LilyPond is designed today, you can only have one MIDI instrument within each MIDI track, which means that the solution I propose below will work for a PianoStaff but if you try the same trick on a GrandStaff containing several staves with different instruments, then your MIDI output will use the same instrument for all of them.
/Mats
Mats Bengtsson wrote:
Stephen wrote:
Note also that these bugs have low priority among developers, since there are
plans to rewrite the midi system from scratch.>
My comments can be taken two ways, as suggestions for a rewrite of span-dynamic-performer.cc or as a wish-list for the new implementation. If I where to contribute to the new implementation, I would need to start by analysing the drawbacks of the current implementation of midi in Lilypond. When it comes to things like this, I fail to see the distinction. We learn from each other, hopefully.
One thing I want to do in midi is to say:
\remove Voice.Span_dynamic_performer \consists PianoStaff.Span_dynamic_performer
to controll the scope of the dynamic changes, whether they only affect the voice, the staff, the piano part, of the entire score. I don't know if that is possible yet.
That will give technical problem, since each Staff context in the .ly file will translate into one MIDI track (I hope I remember the correct terminology here) and as far as I know, the dynamics are set per track in MIDI. One solution is to redefine the MIDI contexts so that the full PianoStaff is typeset in the same track. Technically, this means that the PianoStaff context should be changed to be of type "Staff_performer" and that the ordinary Staff context should have type "Performer_group_performer". This is done with the following lines in your .ly file:
\midi { \tempo 4=60 \context { \type "Staff_performer" \name "PianoStaff" \accepts Staff \accepts DrumStaff }
\context { \type "Performer_group_performer" \name Staff \accepts Voice
\consists "Key_performer" \consists "Tempo_performer" \consists "Time_signature_performer" }
Once you have done that, there's no need to move the Dynamic_performer or Span_dynamic_performer, since any dynamic setting that will appear within the same track will affect all the remaining notes in the track.
To see the original context definitions for the MIDI processing, see the file ly/performer-init.ly
/Mats
-- ============================================= Mats Bengtsson Signal Processing Signals, Sensors and Systems Royal Institute of Technology SE-100 44 STOCKHOLM Sweden Phone: (+46) 8 790 8463 Fax: (+46) 8 790 7260 Email: [EMAIL PROTECTED] WWW: http://www.s3.kth.se/~mabe =============================================
_______________________________________________ lilypond-devel mailing list [email protected] http://lists.gnu.org/mailman/listinfo/lilypond-devel
