In humdrumR
, we define a tatum as the greatest common denominator of
a set of durations.
In other words, given a set of durations, the largest duration that divides all the given beats is the tatum---a common unit
which can measure any of the other durations
Usage
tatum(x, ...)
# S3 method for meter
tatum(x, deparser = recip)
# S3 method for character
tatum(x, deparser = recip)
# S3 method for numeric
tatum(x, deparser = duration)
# S3 method for rational
tatum(x)
# S3 method for token
tatum(x)
# S3 method for `NULL`
tatum(x)
Arguments
- x
The input to compute the tatum of.
Must be a
meter()
object, a singletoncharacter
value, or vector of eithercharacter
,numeric
, orrational()
values.For
character
input, valuest that match the regular expression"^\*?M"
are parsed as a time signature usingmeter()
, while other strings are parsed as durations usingrhythmInterval()
.numeric
input is also parsed usingrhythmInterval()
; parse failures result in errors.- deparser
What output format is desired?
For
character
ormeter
input, the default isrecip()
; fornumeric
input, the default isduration()
.Must be a rhythm function or
NULL
.
Details
tatum()
is a generic function; it can read any input which can be parsed by the rhythm parser.
If can also take a meter()
object or character
string of the form "MX/Y"
.
The tatum of a meter()
is the tatum of all that meters metric levels.
If meters and durations are provided---like tatum(c('M4/4', '6')
---, the tatum of all the meters'
levels and all the durations is computed.
The deparser
argument is a rhythm function which controls the output format.
If deparser
is NULL
, the tatum is returned as a rational()
value.