Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

quantize

Functions for the quantization of notes


Description

These functions apply (static) quantization of notes in order to produce sheet music by pressing the notes into bars.

Usage

quantize(notes, energy, parts)
quantMerge(notes, minlength, barsize, bars)

Arguments

notes

Series of notes, a vector of integers such as returned by noteFromFF. At least one argument (notes and/or energy) must be specified.

energy

Series of energy values, a vector of numerics such as corresponding components of a Wspec object.

parts

Number of outcoming parts. The notes vector is divided into parts bins, the outcome is a vector of the modes of all bins.

minlength

1/(length of the shortest note).
Example: if the shortest note is a quaver (1/8), set minlength = 8.

barsize

One bar contains barsize number of notes of length minlength.

bars

We expect bars number of bars.

Value

quantize returns a list with components:

notes

Vector of length parts corresponding to the input data The data is binned and modes corresponding to the data in those bins are returned.

energy

Same as notes, but for the energy argument.


quantMerge returns a data.frame with components:

note

integer representation of a note (see Arguments).

duration

1/duration of a note (see minlength in Section Arguments), if punctuation = FALSE.

punctuation

Whether the note should be punctuated. If TRUE, the real duration is 1.5 times the duration given in duration.

slur

currently always FALSE, sensible processing is not yet implemented.
It is supposed to indicate the beginning and ending positions of slurs.

Author(s)

See Also

to get the input: noteFromFF, for plotting: quantplot, for further processing: lilyinput, to get notenames: notenames; for an example, see the help in tuneR.


tuneR

Analysis of Music and Speech

v1.3.3
GPL-2 | GPL-3
Authors
Uwe Ligges <ligges@statistik.tu-dortmund.de> with contributions from Sebastian Krey, Olaf Mersmann, Sarah Schnackenberg, Guillaume Guenard, Andrea Preusser, Anita Thieler, Johanna Mielke and Claus Weihs, as well as code fragments and ideas from the former package 'sound' by Matthias Heymann and functions from 'rastamat' by Daniel P. W. Ellis. The included parts of the libmad MPEG audio decoder library are authored by Underbit Technologies.
Initial release
2018-07-03

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.