Creating custom dynamics in MIDI output: Difference between revisions
Appearance
Import snippet from LSR |
m New category Tags: Mobile edit Mobile web edit |
||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 3: | Line 3: | ||
The dynamic mark <code>\rfz</code> gets value <code>0.9</code>. | The dynamic mark <code>\rfz</code> gets value <code>0.9</code>. | ||
<lilypond version="2.24 | <lilypond version="2.24"> | ||
#(define (myDynamics dynamic) | #(define (myDynamics dynamic) | ||
(if (equal? dynamic "rfz") | (if (equal? dynamic "rfz") | ||
| Line 27: | Line 27: | ||
[[Category:Scheme]] | [[Category:Scheme]] | ||
[[Category:Included in the official documentation]] | [[Category:Included in the official documentation]] | ||
[[Category:Snippet]] | |||
Latest revision as of 23:14, 21 November 2025
The following example shows how to create a dynamic marking, not included in the default list, and assign a specific value to it so that it affects MIDI output.
The dynamic mark \rfz gets value 0.9.
\version "2.24"
#(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 {}
}