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

noteManipulation

Raise or lower notes and octaves


Description

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

Usage

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

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

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

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

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

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

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

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

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

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

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

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

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.

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.

Author(s)

Pepijn de Vries

See Also

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

Examples

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

ProTrackR

Manipulate and Play 'ProTracker' Modules

v0.3.7
GPL-3
Authors
Pepijn de Vries [aut, cre, dtc]
Initial release
2020-02-03

We don't support your browser anymore

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