lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: custom dynamics with midi output


From: Karim Haddad
Subject: Re: custom dynamics with midi output
Date: Sat, 8 Jun 2019 18:58:40 +0200
User-agent: NeoMutt/20170113 (1.7.2)

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 <address@hidden>:
> >
> > 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
> > address@hidden
> > https://lists.gnu.org/mailman/listinfo/lilypond-user

-- 
Karim Haddad

email   : address@hidden
webpage : http://karim.haddad.free.fr



reply via email to

[Prev in Thread] Current Thread [Next in Thread]