On Sat, Sep 16, 2023 at 6:01 AM <msk...@ansuz.sooke.bc.ca> wrote:

> 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 { }
> }
>

Try moving the Dynamic performer to the Staff level.

\version "2.24.2"

MyMusic = { c'1 c'1 }
MyDynamics = { s1\ppp s1\fff }

\score {
  \new Staff << \MyMusic \MyDynamics >>
  \layout { }
  \midi {
    \context {
      \Staff
      \consists "Dynamic_performer"
    }
    \context {
      \Voice
      \remove "Dynamic_performer"
    }
  }
}


--
Knute Snortum

Reply via email to