On Mon, Jun 8, 2020 at 6:33 PM Paolo Prete <paolopr...@gmail.com> wrote:

> Hello,
>
> it can be useful to create dynamics that can be heard only in the midi
> output. Then I used the below procedure. However, if I try to make a
> function with the same command, there's a syntax error. How can I fix it?
> Thanks!
>
>
> %%%%%%%%%%%%%%
> midiDynamic = #(define-music-function (parser location dyn) (ly:music?)
> #{ -\tag #'display \! -\tag #'midi $dyn #})
>
> music = {
>
> c'\pp
>
> % WORKS
> c'-\tag #'display \! -\tag #'midi \ff
>
> % DOESN'T WORK, FIXME
> % c'\midiDynamic \fff
>
> }
>
> \score {
>   \keepWithTag #'layout
>   \new Staff { \music }
>   \layout {}
> }
>
> \score {
>   \keepWithTag #'midi
>   \new Staff { \music }
>   \midi {}
> }
> %%%%%%%%%%%%%%
>

Note too that the "\!" symbol is here used to make it work at the end of
hairpins too.

Reply via email to