View source: R/1-construct-key.R
Key | R Documentation |
Key
ObjectCreate a Key
object to represent a key signature.
Key(key, bar = NULL, to = NULL, scope = NULL)
key |
A single integer between -7 and 7, which indicates the number of flat or sharp symbols in the key signature. |
bar |
Optional. A positive integer, which indicates the number of the measure where to add the key signature. By default, the key signature will be added at the first measure. |
to |
Optional. A single character or a single positive integer, which indicates the musical line where to add the key signature. By default, the key signature will be added to the whole music rather than some specific musical line. |
scope |
Optional. A single character of |
A list of class Key
.
+.Music()
for adding a key signature to a Music
object.
# Create a G major
g <- Key(1, to = 1)
g
# Add it only to some part of a `Music`
music <-
Music() +
Meter(4, 4) +
Line(c("C4", "D4")) +
Line("G3") +
g
music
# Generate the music score
if (interactive()) {
show(music)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.