Create a Dynamic
object to represent a dynamic marking.
Dynamic(marking, i, to = NULL, velocity = NULL, above = NULL)
A single character, which represents the dynamic symbol on
the score. If marking
is on the list in the Details section, and
velocity
is not specified, the corresponding velocity on the list will
be used. Otherwise, velocity
must be specified, or the Dynamic
will
have no sound effect.
A single positive integer, which represents the position
of the Dynamic
object in a musical line.
Optional. A single character or a single positive integer,
which indicates the musical line where to add the Dynamic
.
Optional. A single integer between 0
and 127
,
which indicates the loudness of the Dynamic
.
Optional. A single logical, which indicates whether the dynamic symbol should appear above or below the staff.
A list of class Dynamic
.
Common used dynamic markings and their velocities in MuseScore:
pppppp: 1
ppppp: 5
pppp: 10
ppp: 16
pp: 33
p: 49
mp: 64
mf: 80
f: 96
ff: 112
fff: 126
ffff: 127
fffff: 127
ffffff: 127
fp: 96
pf: 49
sf: 112
sfz: 112
sff: 126
sffz: 126
sfp: 112
sfpp: 112
rfz: 112
rf: 112
fz: 112
m: 96
r: 112
s: 112
z: 80
n: 49
+.Music()
for adding an Dynamic
to a Music
object.
# Create a `Dynamic`
f <- Dynamic("f", 1)
f
#> Dynamic "f"
#>
#> * of velocity 96
#> * to be added at position 1
# Add it to a `Music`
music <- Music() + Meter(4, 4) + Line(c("C4", "D4")) + f
music
#> Music
#>
#> $meters
#> # A tibble: 1 × 6
#> bar number unit actual_number actual_unit invisible
#> <int> <int> <int> <int> <int> <lgl>
#> 1 1 4 4 4 4 FALSE
#>
#> $notes
#> # A tibble: 2 × 7
#> line i j pitch midi duration length
#> <int> <int> <int> <chr> <int> <chr> <dbl>
#> 1 1 1 NA C4 60 NA 1
#> 2 1 2 NA D4 62 NA 1
#>
#> $lines
#> # A tibble: 1 × 7
#> part staff voice segment bar offset name
#> <int> <int> <int> <int> <int> <dbl> <chr>
#> 1 1 1 1 1 1 0 NA
#>
#> $dynamics
#> # A tibble: 1 × 5
#> line i marking velocity above
#> <int> <int> <chr> <int> <lgl>
#> 1 1 1 f 96 FALSE
#>
# Generate the music score
if (interactive()) {
show(music)
}