tuplet: Tuplets

View source: R/phrase_helpers.R

tupletR Documentation

Tuplets

Description

Helper function for generating tuplet syntax.

Usage

tuplet(x, n, string = NULL, a = 3, b = 2)

triplet(x, n, string = NULL)

Arguments

x

noteworthy string or phrase object.

n

integer, duration of each tuplet note, e.g., 8 for 8th note tuplet.

string

character, optional string or vector with same number of timesteps as x that specifies which strings to play for each specific note. Only applies when x is a noteworthy string.

a

integer, notes per tuplet.

b

integer, beats per tuplet.

Details

This function gives control over tuplet construction. The default arguments a = 3 and b = 2 generates a triplet where three triplet notes, each lasting for two thirds of a beat, take up two beats. ⁠n} is used to describe the beat duration with the same fraction-of-measure denominator notation used for notes in ⁠tabr' phrases, e.g., 16th note triplet, 8th note triplet, etc.

If you provide a note sequence for multiple tuplets in a row of the same type, they will be connected automatically. It is not necessary to call tuplet() each time when the pattern is constant. If you provide a complete phrase object, it will simply be wrapped in the tuplet tag, so take care to ensure the phrase contents make sense as part of a tuplet.

Value

phrase

Examples

tuplet("c c# d", 8)
triplet("c c# d", 8)
tuplet("c c# d c c# d", 4, a = 6, b = 4)

p1 <- phrase("c c# d", "8-. 8( 8)", "5*3")
tuplet(p1, 8)

tabr documentation built on Sept. 12, 2024, 6:18 a.m.