Skip to contents

The syncopation() function takes a vector of rhythmic duration values and a meter and identifies which durations are syncopated, return TRUE for synocopations and FALSE otherwise. The output syncopation depends a lot on how meter is specified/interpreted so check out the meter() documentation if you are looking for more control of the output.

Usage

# S3 method for default
syncopation(dur, meter = duple(5), levels = "all", groupby = list())

syncopation(dur, meter = duple(5), levels = "all", groupby = list())

Arguments

dur

An input vector of rhythmic durations.

Must be a character or numeric vector.

Is parsed using rhythmInterval(); Wherever the input can't be parsed as a duration, that element is treated as a duration of zero.

meter

The meter(s) to compute levels from.

Defaults to a standard, five-level duple (4/4) meter.

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

For character input, the string is parsed using meter(); a failure to parse will result in an error.

levels

On which metrics levels should we identify syncopations?

Defaults to "all".

Must be a non-empty character or numeric vector.

If levels is simply the singleton string "all", syncopations at any metric level are identified. Otherwise, the levels are parsed with rhythmInterval(); fail to parse may lead to an error. The parsed levels must be levels of the given meter().

groupby

A list of vectors to group x.

Defaults to list().

Must be a list; every element of the list must be length length(x).

To function as a by-record timeline, the groupby list music include a named Piece and Record fields. Luckily, these are automatically passed by with(in).humdrumR, so you won't need to worry about it!

Details

A syncopation occurs whenever a rhythmic duration is longer than the highest metric level that it lands on.

In some cases, we might want to restrict our attention to syncopations that occur at a specific metric level: for example, "eighth-note syncpations." We can proved a set of metric levels to the levels argument, to do this restriction. The levels must be parsable as durations which match the levels of the meter().