# quantize

##### Functions for the quantization of notes

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

- Keywords
- utilities

##### 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:

Vector of length `parts`

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

Same as `notes`

, but for the `energy`

argument.

integer representation of a note (see Arguments).

1/duration of a note (see `minlength`

in Section Arguments),
if `punctuation = FALSE`

.

Whether the note should be punctuated. If `TRUE`

,
the real duration is 1.5 times the duration given in `duration`

.

currently always `FALSE`

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

##### 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.

*Documentation reproduced from package tuneR, version 1.3.3, License: GPL-2 | GPL-3*