Skip to contents

These functions take meter() objects---or values parseable as meters---and return specific levels from the meter. tactus() extracts the tactus of a meter; measure() extracts the length of the full measure of a meter. nbeats() counts the number of tactus beats in the meter. These functions are particularly useful as arguments to the timecount and subpos functions.

Usage

tactus(x, deparser, ...)

# S3 method for meter
tactus(x, deparser = recip, sep = "+", ...)

# S3 method for character
tactus(x, deparser = recip)

# S3 method for `NULL`
tactus(x)

measure(x, deparser, ...)

# S3 method for meter
measure(x, deparser = recip)

# S3 method for character
measure(x, deparser = recip)

# S3 method for `NULL`
measure(x)

Arguments

x

The input to compute the desired duration from.

Must be a meter() object or a character vector.

A character input is parsed using meter(); failures to parse result in errors.

deparser

What output format is desired?

The default is recip().

Must be a rhythm function or NULL.

sep

Seperator between irregular beat patterns.

Defaults to "+".

A singleton character value.

If the tactus is a pattern of irregular beats, they are pasted together using this separator.

Details

By default, tactus() and measure() deparse their output as recip(); an alternative deparser (output format) can be chosen using the deparser argument.

See also

Other Metric functions: meter, tatum()

Examples


tactus("M4/4")
#> [1] "4"

tactus("M6/8")
#> [1] "4."

measure("M4/4")
#> **recip (character)
#> [1] 1

measure("M6/8")
#> **recip (character)
#> [1] 2.

measure("M6/8", deparser = duration)
#> **duration (numeric)
#> [1] 0.75