recip | R Documentation |
The standard approach to representing conventional note values in humdrum
is the "reciprocal" **recip.
Representation.
The **recip
rhythmic values are often used as a part of **kern
representation,
which also includes pitch information and notation details.
If recip()
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:
recip(
x,
...,
sep = "%",
parseArgs = list(),
scale = 1,
unit = 1,
inPlace = FALSE
)
## humdrumR S3 method:
humData |> select(Token) |> recip()
humData |> recip(simple = TRUE)
humData |> recip(Token, Key = Key)
recip(
x,
...,
sep = "%",
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: |
sep |
The separator printed between numerator and denominator. A single Must be a single |
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. |
**recip
values are literally the reciprocal of a duration value.
Since most note values in conventional music notation are simple fractions
the reciprocal approach is highly concise and very similar to conventional western notation and terminology.
A "quarter note" is represented as the reciprocal of 1/4: simply "4"
.
Full reciprocal fractions can be specified: "2%3"
to indicate 3/2.
The %
separator can be changed using the sep
argument.
As in conventional note values, "dots" can be added after a value to increase the duration by
the ratio of (2 - (2^{-n}))
, where n
is the number of dots.
(One dot is 3/2; two dots is 7/4; etc.).
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()
,
notehead()
tokens <- c('4.GG', '8G', '16E', '16F#', '16G', '16D', 'q8D#', '4E')
recip(tokens)
recip(tokens, parse(grace = NA))
recip(tokens, scale = 2)
recip(c(.25, .25, .25, .25, .5, 1))
recip(c(.25, .25, .25, .25, .5, 1), parse(unit = '4'))
## Not run:
B075 <- readHumdrum(humdrumRroot, "HumdrumData/BeethovenVariations/B075_00_05_a.krn")
within(B075, subset = Spine > 2, recip(Token))
with(B075, subset = Spine > 2, recip(Token)) |> table()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.