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