Thanx a lot Harm, This is just what i was looking for..
Awesome. Best K On Sat, Jun 08, 2019 at 06:53:05PM +0200, Thomas Morley wrote: > Am Sa., 8. Juni 2019 um 18:03 Uhr schrieb Karim Haddad > <[email protected]>: > > > > Dear All, > > > > In the following documentation's snippet : > > > > doctitle = "Creating custom dynamics in MIDI output" > > } % begin verbatim > > > > #(define (myDynamics dynamic) > > (if (equal? dynamic "rfz") > > 0.9 > > (default-dynamic-absolute-volume dynamic))) > > > > \score { > > \new Staff { > > \set Staff.midiInstrument = #"cello" > > \set Score.dynamicAbsoluteVolumeFunction = #myDynamics > > \new Voice { > > \relative { > > a'4\pp b c-\rfz > > } > > } > > } > > \layout {} > > \midi {} > > } > > > > all works well. But if we need some more dynamic customization like : > > > > psub = \markup {\center-column { \dynamic p } \lower #0.5 \normal-text { > > \tiny \italic sub.}} > > dpsub=#(make-dynamic-script psub) > > > > #(define (myDynamics dynamic) > > (if (equal? dynamic "dpsub") > > It does not work, because this check will never be true. You compare a > simple string, "dpsub", with some `dynamic´ > You need to compare `dynamic´ with the content of dpsub, i.e. psub. > Below works here: > > > psub = > \markup {\center-column { \dynamic p } \lower #0.5 \normal-text { > \tiny \italic sub.}} > dpsub= #(make-dynamic-script psub) > > #(define (myDynamics dynamic) > ;; some debugging output > (display-scheme-music > ;dynamic > (equal? dynamic psub) > ) > (if (equal? dynamic psub) > 0.2 > (default-dynamic-absolute-volume dynamic))) > > \score { > \new Staff { > \set Staff.midiInstrument = #"cello" > \set Score.dynamicAbsoluteVolumeFunction = #myDynamics > \new Voice { > \relative { a'4\pp b c-\dpsub > } > } > } > \layout {} > \midi {} > } > > Cheers, > Harm > > > 0.2 > > (default-dynamic-absolute-volume dynamic))) > > > > > > this doesn't work. Maybe should we use another scheme function in this case. > > Any ideas ? > > > > > > thank you and best to you all. > > > > -- > > Karim Haddad > > > > > > webpage : http://karim.haddad.free.fr > > > > _______________________________________________ > > lilypond-user mailing list > > [email protected] > > https://lists.gnu.org/mailman/listinfo/lilypond-user -- Karim Haddad email : [email protected] webpage : http://karim.haddad.free.fr _______________________________________________ lilypond-user mailing list [email protected] https://lists.gnu.org/mailman/listinfo/lilypond-user
