tactus: Extract levels from meters

View source: R/Metric.R

tactusR Documentation

Extract levels from meters

Description

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 class 'meter'
tactus(x, deparser = recip, sep = "+", ...)

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

## S3 method for class ''NULL''
tactus(x)

measure(x, deparser, ...)

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

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

## S3 method for class ''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")

tactus("M6/8")

measure("M4/4")

measure("M6/8")

measure("M6/8", deparser = duration)
 

Computational-Cognitive-Musicology-Lab/humdrumR documentation built on Oct. 22, 2024, 9:28 a.m.