Learn R Programming

musicXML (version 1.0.1)

MXLDurationToType: MXL duration to (type-dot-triplet)

Description

Convert a MusicXML duration into a (type-dot-triplet), or a list of (type-dot-triplet) summing up to the requested duration. The requested MusicXML duration may be trimmed if it cannot be expressed as a multiple of the smallest available duration.

Usage

MXLDurationToType(mxlDuration, mxlDivision = 96)

Value

A list with the following fields:

  1. type, numeric vector of types

  2. dot, logical vector of dot flags

  3. triplet, logical vector of triplet flags

  4. exact, logical, FALSE if the requested duration had to be trimmed

Arguments

mxlDuration

Positive integer, music XML "duration" expressed in number of mxlDivision's.

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.

Examples

Run this code
MXLDurationToType(972)

Run the code above in your browser using DataLab