notehead | R Documentation |
This function outputs duration information in as traditional note value. symbols, as in Western notation.
If notehead()
is applied to a humdrumR data class
you may use the data's fields as arguments.
If no field names are specified, the first selectedField is used as x
.
## Default S3 method:
notehead(x, ..., parseArgs = list(), scale = 1, unit = 1, inPlace = FALSE)
humData |> select(Token) |> notehead()
humData |> notehead(Token)
humData |> notehead(simple = TRUE)
notehead(x, ..., parseArgs = list(), scale = 1, unit = 1, inPlace = FALSE)
x |
An input vector. The Must be parsable as rhythm infromation. |
... |
Arguments passed to the rhythm parser. There are also two hidden (advanced) arguments you can specify: |
scale |
A Defaults to Must be |
inPlace |
Should non-rhythm information be retained in the output string? Defaults to Must be a singleton Defaults to A singleton See "Grace notes" section below. |
Note-value symbols are simply encoded in character
vectors, since the
unicode character table includes these musical symbols.
Of course, this depends on your system having a unicode font installed and working:
the symbols might not show up properly on your machine!
In fact, the symbols always print a bit strangely (out of alignment) and can be hard to manipulate
like "normal" character
strings.
The note-value symbols are most useful for making the labels of plots.
For example, if you tabulate note values and use barplot()
, you get nice bar labels:
chorales <- readHumdrum(humdrumRroot, 'HumdrumData/Chorales/.*krn') with(chorales, barplot(table(notehead(Token)), cex.names = 2))
To better understand how this function works, read about the family of rhythm functions, or how rhythms are parsed and deparsed.
Other rhythm functions:
duration()
,
grid()
,
recip()
tokens <- c('4.GG', '8G', '16E', '16F#', '16G', '16D', 'q8D#', '4E')
notehead(tokens)
## Not run:
B075 <- readHumdrum(humdrumRroot, "HumdrumData/BeethovenVariations/B075_00_05_a.krn")
with(B075[[,3:4]], notehead(Token)) |> table()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.