]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/creating-custom-dynamics-in-midi-output.ly
Run makelsr
[lilypond.git] / Documentation / snippets / creating-custom-dynamics-in-midi-output.ly
1 % DO NOT EDIT this file manually; it is automatically
2 % generated from Documentation/snippets/new
3 % Make any changes in Documentation/snippets/new/
4 % and then run scripts/auxiliar/makelsr.py
5 %
6 % This file is in the public domain.
7 %% Note: this file works from version 2.18.0
8 \version "2.18.0"
9
10 \header {
11
12   lsrtags = "scheme-language, midi"
13
14   texidoc = "The following example shows how to create a dynamic
15   marking, not included in the default list, and assign it a specific
16   value so that it can be used to affect MIDI output.
17
18   The dynamic mark @code{\\rfz} (@notation{rinforzando}) is assigned a
19   value of @code{0.9}."
20
21   doctitle = "Creating custom dynamics in MIDI output"
22 } % begin verbatim
23
24
25 #(define (myDynamics dynamic)
26     (if (equal? dynamic "rfz")
27       0.9
28       (default-dynamic-absolute-volume dynamic)))
29
30 \score {
31   \new Staff {
32     \set Staff.midiInstrument = #"cello"
33     \set Score.dynamicAbsoluteVolumeFunction = #myDynamics
34     \new Voice {
35       \relative c'' {
36         a4\pp b c-\rfz
37       }
38     }
39   }
40   \layout {}
41   \midi {}
42 }