I'm trying to use a Dynamics context to put dynamics between the staves of a PianoStaff. As such, I've got my notes and my dynamics in two separate variables. For MIDI output, I'd like to merge the contents of the music variable and the dynamics variable and generate MIDI from the result. But I can't find a way to merge the two variables and have the dynamics really affect the MIDI velocity of the notes.
Here's some code I've tried; I've also tried many much more complicated variations. Note that although the Dynamics context is part of the motivation for this question, the question is about merging music variables and the problem shows up even without the existence of a Dynamics context. MyMusic = { c'1 c'1 } MyDynamics = { s1\ppp s1\fff } \score { << \MyMusic \MyDynamics >> \layout { } \midi { } } After compiling that, I get a MIDI file in which the notes are just at the default velocity without any dynamics being applied. This code seems to be parallel to examples I've seen online of templates for use of the Dynamics context, and I've seen examples both on this list and elsewhere of people doing what seems to be exactly the same thing I'm doing, with << >> for combining the variables to generate MIDI output; but I haven't found any example of merging dynamics with notes that actually works with MIDI when I compile it myself. I wonder if something may have changed in a recent version of LilyPond such that older examples no longer work. I've also tried << { } \\ { } >>, partCombine, several different arrangements of explicitly instantiated Voices or Staffs, and so on. Although I can get the visual output to look good, nothing seems to work for applying the dynamics from one variable to the notes from another in a way that will really appear in MIDI output. What is the correct way to merge the variables in this situation? -- Matthew Skala msk...@ansuz.sooke.bc.ca People before tribes. https://ansuz.sooke.bc.ca/