On 25 December 2017 at 14:42, Malte Meyn <[email protected]> wrote:

>
>
> Am 25.12.2017 um 14:22 schrieb Gianmaria Lari:
>
>> This code generate some 'regular', staccato and staccatissimo notes:
>>
>>     \version "2.19.80"
>>     \score {
>>        \fixed c' {c8 d e-. f-. g-! a-! r4}
>>        \midi{}
>>        \layout {}
>>     }
>>
>>
>> Is there any way to change the default duration of 'regular', staccato
>> and staccatissimo notes?
>>
>
> Have a look at the definition of staccato in the file script-init.ly:
>
> staccato = #(make-articulation "staccato"
>              'midi-length
>              (lambda (len context)
>                (moment-min (ly:moment-mul len (ly:make-moment 1/2))
>                            (seconds->moment 1/2 context)))
>              'midi-extra-velocity 4)
>
> Maybe this can be copied and changed?
>

Thank you Malte!!!

I had a look to the script-init.ly and then I tried to modify the staccato
like this:

\version "2.19.80"
staccato = #(make-articulation "staccato"
             'midi-length
             (lambda (len context)
               (moment-min (ly:moment-mul len (ly:make-moment 1/1))
                           (seconds->moment 1/1 context)))
             'midi-extra-velocity 4)
\score {
  \fixed c' {c8 d e\staccato f-. }
  \midi{}
  \layout {}
}


The result is that "e\staccato" plays perfectly accordingly my changes (in
my previous example the staccato became "legato :))
Now some questions:

- What's the difference between the two fractions

(ly:make-moment 1/1)

and

(seconds->moment 1/1 context)

?

- What's

'midi-extra-velocity 4


?

- The previous code works for the \staccato but not for the shorthand ".".
Any idea how to fix it?

- Any idea how to change also the duration of the 'regular' note (not
staccato/staccatissimo etc.)?

Thank you Malte!
g.
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to