msk...@ansuz.sooke.bc.ca writes:

> On Sat, 16 Sep 2023, David Kastrup wrote:
>
>> Try
>>
>> \new Staff << \MyMusic \MyDynamics >>
>>
>> since otherwise the variables will end up in separate Staff contexts.
>
> With the following code, the notes in the MIDI file still are both at
> default velocity.  Explicitly instantiating the Staff does make a
> difference in the visual output.
>
> MyMusic = { c'1 c'1 }
> MyDynamics = { s1\ppp s1\fff }
>
> \score {
>   \new Staff << \MyMusic \MyDynamics >>
>   \layout { }
>   \midi { }
> }

My mistake: Dynamic_performer by default lives at Voice level, so you'd
need \new Voice here in order to issue the dynamics on a level visible
to MIDI.

-- 
David Kastrup

Reply via email to