Learn R Programming

musicXML (version 1.0.1)

duration: duration constructor.

Description

Creates a new instance of a 'duration' object

Usage

duration(
  type,
  dot = FALSE,
  triplet = FALSE,
  mxlDivision = 96,
  mxlDuration = typeToMXLDuration(type, dot, triplet)
)

Value

An object of class 'duration'.

Arguments

type

Integer in 2^(0:6), note type (longest 1=whole, shortest 64=64th). 1 = whole, 2 = half, 4 = quarter, 8 = eighth, etc. down to 64 = 64th

dot

Logical, is note dotted?

triplet

Logical, is note triplet? (play 3 for 2)

mxlDivision

Positive integer, musicXML "division" defining the time resolution, i.e. the shortest possible note. It is expressed as a fraction of a quarter note. The value of 96 allows allows using 64th notes and their triplet/dotted versions.

mxlDuration

Positive integer, music XML "duration" expressed in number of mxlDivision's. In general, mxlDivision/mxlDuration should not be modified.

Examples

Run this code
d <- duration(8,dot=TRUE)

Run the code above in your browser using DataLab