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
.
Arguments
- x
An input vector.
The
x
argument can be any (atomic) vector, or a rational (rhythmInterval), orNULL
.Must be parsable as rhythm infromation.
- ...
Arguments passed to the rhythm parser.
There are also two hidden (advanced) arguments you can specify:
memoize
anddeparse
(see the details below).- scale
A
numeric
or rational value which is used as the output unit of measurement.Defaults to
rational(1, 1)
.Must be
numeric
or rational.- inPlace
Should non-rhythm information be retained in the output string?
Defaults to
FALSE
.Must be a singleton
logical
value: an on/off switch.Defaults to
FALSE
.A singleton
logical
value, orNA
.See "Grace notes" section below.
Details
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:
Examples
tokens <- c('4.GG', '8G', '16E', '16F#', '16G', '16D', 'q8D#', '4E')
notehead(tokens)
#> **notehead (character)
#> [1] 𝅘𝅥 𝅭 𝅘𝅥𝅮 𝅘𝅥𝅯 𝅘𝅥𝅯 𝅘𝅥𝅯 𝅘𝅥𝅯 . 𝅘𝅥
if (FALSE) {
B075 <- readHumdrum(humdrumRroot, "HumdrumData/BeethovenVariations/B075_00_05_a.krn")
with(B075[[,3:4]], notehead(Token)) |> table()
}