Learn R Programming

tuneR (version 0.2-6)

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:
  • notesVector of length parts corresponding to the input data The data is binned and modes corresponding to the data in those bins are returned.
  • energySame as notes, but for the energy argument.
  • quantMerge returns a data.frame with components:
  • noteinteger representation of a note (see Arguments).
  • duration1/duration of a note (see minlength in Section Arguments), if punctuation=FALSE.
  • punctuationWhether the note should be punctuated. If TRUE, the real duration is 1.5 times the duration given in duration.
  • slurcurrently always FALSE, sensible processing is not yet implemented. It is supposed to indicate the beginning and ending positions of slurs.

concept

  • quantization
  • bin
  • bar
  • note

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.