Learn R Programming

ProTrackR (version 0.4.4)

noteUp: Raise or lower notes and octaves

Description

Methods to raise or lower notes in PTCell, PTTrack and PTPattern objects.

Usage

# S4 method for PTCell
noteUp(x, sample.nr = "all")

# S4 method for PTCell noteDown(x, sample.nr = "all")

# S4 method for PTCell octaveUp(x, sample.nr = "all")

# S4 method for PTCell octaveDown(x, sample.nr = "all")

# S4 method for PTTrack noteUp(x, sample.nr = "all")

# S4 method for PTTrack noteDown(x, sample.nr = "all")

# S4 method for PTTrack octaveUp(x, sample.nr = "all")

# S4 method for PTTrack octaveDown(x, sample.nr = "all")

# S4 method for PTPattern noteUp(x, sample.nr = "all")

# S4 method for PTPattern noteDown(x, sample.nr = "all")

# S4 method for PTPattern octaveUp(x, sample.nr = "all")

# S4 method for PTPattern octaveDown(x, sample.nr = "all")

Value

Returns an object of the same class as object x, in which the notes for samples selected with sample.nr are raised or lowered.

In case raised or lowered notes would lead to notes that are out of ProTracker's range, the returned notes remain unchanged.

Arguments

x

A PTCell, PTTrack or PTPattern object for which the notes need to be lowered or raised.

sample.nr

A single positive integer value, or a vector of positive integers, listing the indices of samples, for which the notes need to be lowered or raised. A character string equal to "all" is also allowed (this is in fact the default), in which case notes of all sample indices are raised or lowered.

Author

Pepijn de Vries

See Also

Other note.and.octave.operations: noteToPeriod(), note(), octave(), periodToChar(), sampleRate

Examples

Run this code

## raise note from C-2 to C#2:
noteUp(PTCell("C-2 01 000"))


## lower note from C-2 to B-1:
noteDown(PTCell("C-2 01 000"))


## raise note from octave 2 to octave 3:
octaveUp(PTCell("C-2 01 000"))


## lower note from octave 2 to octave 1:
octaveDown(PTCell("C-2 01 000"))


data("mod.intro")

## Raise the notes of all cells in pattern
## number 2 of mod.intro:
noteUp(PTPattern(mod.intro, 2))

## Raise only the notes of sample number 4
## in pattern number 2 of mod.intro:
noteUp(PTPattern(mod.intro, 2), 4)

## Raise only the notes of samples number 2 and 4
## in pattern number 2 of mod.intro:
noteUp(PTPattern(mod.intro, 2), c(2, 4))

Run the code above in your browser using DataLab