Skip to contents

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

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.

See also

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

Author

Pepijn de Vries

Examples


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


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


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


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


data("mod.intro")

## Raise the notes of all cells in pattern
## number 2 of mod.intro:
noteUp(PTPattern(mod.intro, 2))
#>       [,1]         [,2]         [,3]         [,4]        
#>  [1,] "C#3 01 A08" "C#3 02 C40" "B-1 03 F06" "B-2 04 000"
#>  [2,] "--- 01 A08" "C#3 02 C30" "--- 00 A01" "--- 00 A02"
#>  [3,] "--- 01 A08" "C#3 02 000" "--- 00 A01" "C#3 04 000"
#>  [4,] "--- 00 000" "C#3 02 000" "--- 00 A02" "--- 00 A02"
#>  [5,] "--- 01 A08" "C#3 02 000" "--- 00 120" "D#3 04 000"
#>  [6,] "--- 00 000" "F#3 04 C08" "--- 00 A02" "--- 00 A02"
#>  [7,] "--- 01 A08" "C#3 02 000" "--- 00 220" "E-3 04 000"
#>  [8,] "--- 00 000" "G#3 04 C08" "--- 00 A01" "--- 00 A02"
#>  [9,] "--- 01 A08" "C#3 02 000" "--- 00 A01" "F#3 04 000"
#> [10,] "--- 00 000" "D#3 04 C08" "--- 00 A01" "--- 00 A02"
#> [11,] "--- 01 A08" "C#3 02 000" "--- 00 A01" "E-3 04 000"
#> [12,] "--- 00 000" "F#3 04 C08" "--- 00 A01" "--- 00 A02"
#> [13,] "G#3 01 000" "C#3 02 000" "--- 00 A01" "D#3 04 000"
#> [14,] "--- 00 A08" "F#3 04 C08" "--- 00 000" "--- 00 A02"
#> [15,] "F#3 01 000" "C#3 02 000" "--- 00 000" "C#3 04 000"
#> [16,] "--- 00 A08" "E-3 04 C08" "--- 00 000" "--- 00 A02"
#> [17,] "C#3 01 A08" "C#3 02 C40" "B-1 03 F06" "B-2 04 000"
#> [18,] "--- 01 A08" "C#3 02 C30" "--- 00 A01" "--- 00 A08"
#> [19,] "--- 01 A08" "C#3 02 000" "--- 00 A01" "B-2 04 000"
#> [20,] "--- 00 000" "C#3 02 000" "--- 00 A02" "--- 00 A08"
#> [21,] "--- 01 A08" "C#3 02 000" "--- 00 120" "F#2 04 000"
#> [22,] "--- 00 000" "B-2 04 C08" "--- 00 A02" "--- 00 A08"
#> [23,] "--- 01 A08" "C#3 02 000" "--- 00 220" "F#2 04 000"
#> [24,] "--- 00 000" "B-2 04 C08" "--- 00 A01" "--- 00 A08"
#> [25,] "--- 01 A08" "C#3 02 000" "--- 00 A01" "B-2 04 000"
#> [26,] "--- 00 000" "F#2 04 C08" "--- 00 A01" "--- 00 A01"
#> [27,] "--- 01 A08" "C#3 02 000" "--- 00 A01" "--- 00 000"
#> [28,] "--- 00 000" "F#2 04 C08" "--- 00 A01" "--- 00 A01"
#> [29,] "G#2 01 000" "C#3 02 000" "--- 00 A01" "--- 00 000"
#> [30,] "--- 00 A08" "F#2 04 C08" "--- 00 000" "--- 00 A01"
#> [31,] "A#2 01 000" "C#3 02 000" "--- 00 000" "--- 00 000"
#> [32,] "--- 00 A08" "G#2 04 C08" "--- 00 000" "--- 00 A01"
#> [33,] "F-3 01 A08" "C#3 02 C40" "D#2 03 000" "D#3 04 000"
#> [34,] "--- 01 A08" "C#3 02 C30" "--- 00 A01" "--- 00 000"
#> [35,] "--- 01 A08" "C#3 02 000" "--- 00 A01" "--- 00 A02"
#> [36,] "--- 00 000" "C#3 02 000" "--- 00 A02" "F-3 04 000"
#> [37,] "--- 01 A08" "C#3 02 000" "--- 00 126" "F#3 04 000"
#> [38,] "--- 00 000" "D#3 04 C08" "--- 00 A02" "--- 00 A02"
#> [39,] "--- 01 A08" "C#3 02 000" "--- 00 226" "F-3 04 000"
#> [40,] "--- 00 000" "D#3 04 C08" "--- 00 A01" "F#3 04 000"
#> [41,] "--- 01 A08" "C#3 02 000" "--- 00 A01" "G#3 04 000"
#> [42,] "--- 00 000" "D#3 04 C08" "--- 00 A01" "--- 00 A02"
#> [43,] "--- 01 A08" "C#3 02 000" "--- 00 A01" "F#3 04 000"
#> [44,] "--- 00 000" "D#3 04 C08" "--- 00 A01" "--- 00 A02"
#> [45,] "B-3 01 000" "C#3 02 000" "--- 00 A01" "F-3 04 000"
#> [46,] "--- 00 A08" "C#3 04 C08" "--- 00 000" "--- 00 A02"
#> [47,] "A#3 01 000" "C#3 02 000" "--- 00 000" "D#3 04 000"
#> [48,] "--- 00 A08" "F-3 04 C08" "--- 00 000" "--- 00 A02"
#> [49,] "D#3 01 A08" "C#3 02 C40" "C#2 03 000" "F-3 04 000"
#> [50,] "--- 01 A08" "C#3 02 C30" "--- 00 A01" "--- 00 A02"
#> [51,] "--- 01 A08" "C#3 02 000" "--- 00 A01" "D#3 04 000"
#> [52,] "--- 00 000" "C#3 02 000" "--- 00 A02" "--- 00 A02"
#> [53,] "--- 01 A08" "C#3 02 000" "--- 00 12B" "C#3 04 000"
#> [54,] "--- 00 000" "G#2 04 C08" "--- 00 A02" "--- 00 A02"
#> [55,] "--- 01 A08" "C#3 02 000" "--- 00 22B" "D#3 04 000"
#> [56,] "--- 00 000" "C#3 04 C08" "--- 00 A01" "--- 00 A02"
#> [57,] "--- 01 A08" "C#3 02 000" "--- 00 A01" "C#3 04 000"
#> [58,] "--- 00 000" "G#2 04 C08" "--- 00 A01" "--- 00 A01"
#> [59,] "--- 01 A08" "C#3 02 000" "--- 00 A01" "--- 00 000"
#> [60,] "--- 00 000" "C#2 04 C08" "--- 00 A01" "--- 00 A01"
#> [61,] "A#3 01 000" "C#3 02 000" "--- 00 A01" "--- 00 000"
#> [62,] "--- 00 A08" "F-2 04 C08" "--- 00 000" "--- 00 A01"
#> [63,] "G#3 01 000" "D#2 04 C08" "--- 00 000" "--- 00 000"
#> [64,] "--- 00 A08" "C#2 04 C08" "--- 00 000" "--- 00 A01"

## Raise only the notes of sample number 4
## in pattern number 2 of mod.intro:
noteUp(PTPattern(mod.intro, 2), 4)
#>       [,1]         [,2]         [,3]         [,4]        
#>  [1,] "C-3 01 A08" "C-3 02 C40" "A#1 03 F06" "B-2 04 000"
#>  [2,] "--- 01 A08" "C-3 02 C30" "--- 00 A01" "--- 00 A02"
#>  [3,] "--- 01 A08" "C-3 02 000" "--- 00 A01" "C#3 04 000"
#>  [4,] "--- 00 000" "C-3 02 000" "--- 00 A02" "--- 00 A02"
#>  [5,] "--- 01 A08" "C-3 02 000" "--- 00 120" "D#3 04 000"
#>  [6,] "--- 00 000" "F#3 04 C08" "--- 00 A02" "--- 00 A02"
#>  [7,] "--- 01 A08" "C-3 02 000" "--- 00 220" "E-3 04 000"
#>  [8,] "--- 00 000" "G#3 04 C08" "--- 00 A01" "--- 00 A02"
#>  [9,] "--- 01 A08" "C-3 02 000" "--- 00 A01" "F#3 04 000"
#> [10,] "--- 00 000" "D#3 04 C08" "--- 00 A01" "--- 00 A02"
#> [11,] "--- 01 A08" "C-3 02 000" "--- 00 A01" "E-3 04 000"
#> [12,] "--- 00 000" "F#3 04 C08" "--- 00 A01" "--- 00 A02"
#> [13,] "G-3 01 000" "C-3 02 000" "--- 00 A01" "D#3 04 000"
#> [14,] "--- 00 A08" "F#3 04 C08" "--- 00 000" "--- 00 A02"
#> [15,] "F-3 01 000" "C-3 02 000" "--- 00 000" "C#3 04 000"
#> [16,] "--- 00 A08" "E-3 04 C08" "--- 00 000" "--- 00 A02"
#> [17,] "C-3 01 A08" "C-3 02 C40" "A#1 03 F06" "B-2 04 000"
#> [18,] "--- 01 A08" "C-3 02 C30" "--- 00 A01" "--- 00 A08"
#> [19,] "--- 01 A08" "C-3 02 000" "--- 00 A01" "B-2 04 000"
#> [20,] "--- 00 000" "C-3 02 000" "--- 00 A02" "--- 00 A08"
#> [21,] "--- 01 A08" "C-3 02 000" "--- 00 120" "F#2 04 000"
#> [22,] "--- 00 000" "B-2 04 C08" "--- 00 A02" "--- 00 A08"
#> [23,] "--- 01 A08" "C-3 02 000" "--- 00 220" "F#2 04 000"
#> [24,] "--- 00 000" "B-2 04 C08" "--- 00 A01" "--- 00 A08"
#> [25,] "--- 01 A08" "C-3 02 000" "--- 00 A01" "B-2 04 000"
#> [26,] "--- 00 000" "F#2 04 C08" "--- 00 A01" "--- 00 A01"
#> [27,] "--- 01 A08" "C-3 02 000" "--- 00 A01" "--- 00 000"
#> [28,] "--- 00 000" "F#2 04 C08" "--- 00 A01" "--- 00 A01"
#> [29,] "G-2 01 000" "C-3 02 000" "--- 00 A01" "--- 00 000"
#> [30,] "--- 00 A08" "F#2 04 C08" "--- 00 000" "--- 00 A01"
#> [31,] "A-2 01 000" "C-3 02 000" "--- 00 000" "--- 00 000"
#> [32,] "--- 00 A08" "G#2 04 C08" "--- 00 000" "--- 00 A01"
#> [33,] "E-3 01 A08" "C-3 02 C40" "D-2 03 000" "D#3 04 000"
#> [34,] "--- 01 A08" "C-3 02 C30" "--- 00 A01" "--- 00 000"
#> [35,] "--- 01 A08" "C-3 02 000" "--- 00 A01" "--- 00 A02"
#> [36,] "--- 00 000" "C-3 02 000" "--- 00 A02" "F-3 04 000"
#> [37,] "--- 01 A08" "C-3 02 000" "--- 00 126" "F#3 04 000"
#> [38,] "--- 00 000" "D#3 04 C08" "--- 00 A02" "--- 00 A02"
#> [39,] "--- 01 A08" "C-3 02 000" "--- 00 226" "F-3 04 000"
#> [40,] "--- 00 000" "D#3 04 C08" "--- 00 A01" "F#3 04 000"
#> [41,] "--- 01 A08" "C-3 02 000" "--- 00 A01" "G#3 04 000"
#> [42,] "--- 00 000" "D#3 04 C08" "--- 00 A01" "--- 00 A02"
#> [43,] "--- 01 A08" "C-3 02 000" "--- 00 A01" "F#3 04 000"
#> [44,] "--- 00 000" "D#3 04 C08" "--- 00 A01" "--- 00 A02"
#> [45,] "B-3 01 000" "C-3 02 000" "--- 00 A01" "F-3 04 000"
#> [46,] "--- 00 A08" "C#3 04 C08" "--- 00 000" "--- 00 A02"
#> [47,] "A-3 01 000" "C-3 02 000" "--- 00 000" "D#3 04 000"
#> [48,] "--- 00 A08" "F-3 04 C08" "--- 00 000" "--- 00 A02"
#> [49,] "D-3 01 A08" "C-3 02 C40" "C-2 03 000" "F-3 04 000"
#> [50,] "--- 01 A08" "C-3 02 C30" "--- 00 A01" "--- 00 A02"
#> [51,] "--- 01 A08" "C-3 02 000" "--- 00 A01" "D#3 04 000"
#> [52,] "--- 00 000" "C-3 02 000" "--- 00 A02" "--- 00 A02"
#> [53,] "--- 01 A08" "C-3 02 000" "--- 00 12B" "C#3 04 000"
#> [54,] "--- 00 000" "G#2 04 C08" "--- 00 A02" "--- 00 A02"
#> [55,] "--- 01 A08" "C-3 02 000" "--- 00 22B" "D#3 04 000"
#> [56,] "--- 00 000" "C#3 04 C08" "--- 00 A01" "--- 00 A02"
#> [57,] "--- 01 A08" "C-3 02 000" "--- 00 A01" "C#3 04 000"
#> [58,] "--- 00 000" "G#2 04 C08" "--- 00 A01" "--- 00 A01"
#> [59,] "--- 01 A08" "C-3 02 000" "--- 00 A01" "--- 00 000"
#> [60,] "--- 00 000" "C#2 04 C08" "--- 00 A01" "--- 00 A01"
#> [61,] "A-3 01 000" "C-3 02 000" "--- 00 A01" "--- 00 000"
#> [62,] "--- 00 A08" "F-2 04 C08" "--- 00 000" "--- 00 A01"
#> [63,] "G-3 01 000" "D#2 04 C08" "--- 00 000" "--- 00 000"
#> [64,] "--- 00 A08" "C#2 04 C08" "--- 00 000" "--- 00 A01"

## 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))
#>       [,1]         [,2]         [,3]         [,4]        
#>  [1,] "C-3 01 A08" "C#3 02 C40" "A#1 03 F06" "B-2 04 000"
#>  [2,] "--- 01 A08" "C#3 02 C30" "--- 00 A01" "--- 00 A02"
#>  [3,] "--- 01 A08" "C#3 02 000" "--- 00 A01" "C#3 04 000"
#>  [4,] "--- 00 000" "C#3 02 000" "--- 00 A02" "--- 00 A02"
#>  [5,] "--- 01 A08" "C#3 02 000" "--- 00 120" "D#3 04 000"
#>  [6,] "--- 00 000" "F#3 04 C08" "--- 00 A02" "--- 00 A02"
#>  [7,] "--- 01 A08" "C#3 02 000" "--- 00 220" "E-3 04 000"
#>  [8,] "--- 00 000" "G#3 04 C08" "--- 00 A01" "--- 00 A02"
#>  [9,] "--- 01 A08" "C#3 02 000" "--- 00 A01" "F#3 04 000"
#> [10,] "--- 00 000" "D#3 04 C08" "--- 00 A01" "--- 00 A02"
#> [11,] "--- 01 A08" "C#3 02 000" "--- 00 A01" "E-3 04 000"
#> [12,] "--- 00 000" "F#3 04 C08" "--- 00 A01" "--- 00 A02"
#> [13,] "G-3 01 000" "C#3 02 000" "--- 00 A01" "D#3 04 000"
#> [14,] "--- 00 A08" "F#3 04 C08" "--- 00 000" "--- 00 A02"
#> [15,] "F-3 01 000" "C#3 02 000" "--- 00 000" "C#3 04 000"
#> [16,] "--- 00 A08" "E-3 04 C08" "--- 00 000" "--- 00 A02"
#> [17,] "C-3 01 A08" "C#3 02 C40" "A#1 03 F06" "B-2 04 000"
#> [18,] "--- 01 A08" "C#3 02 C30" "--- 00 A01" "--- 00 A08"
#> [19,] "--- 01 A08" "C#3 02 000" "--- 00 A01" "B-2 04 000"
#> [20,] "--- 00 000" "C#3 02 000" "--- 00 A02" "--- 00 A08"
#> [21,] "--- 01 A08" "C#3 02 000" "--- 00 120" "F#2 04 000"
#> [22,] "--- 00 000" "B-2 04 C08" "--- 00 A02" "--- 00 A08"
#> [23,] "--- 01 A08" "C#3 02 000" "--- 00 220" "F#2 04 000"
#> [24,] "--- 00 000" "B-2 04 C08" "--- 00 A01" "--- 00 A08"
#> [25,] "--- 01 A08" "C#3 02 000" "--- 00 A01" "B-2 04 000"
#> [26,] "--- 00 000" "F#2 04 C08" "--- 00 A01" "--- 00 A01"
#> [27,] "--- 01 A08" "C#3 02 000" "--- 00 A01" "--- 00 000"
#> [28,] "--- 00 000" "F#2 04 C08" "--- 00 A01" "--- 00 A01"
#> [29,] "G-2 01 000" "C#3 02 000" "--- 00 A01" "--- 00 000"
#> [30,] "--- 00 A08" "F#2 04 C08" "--- 00 000" "--- 00 A01"
#> [31,] "A-2 01 000" "C#3 02 000" "--- 00 000" "--- 00 000"
#> [32,] "--- 00 A08" "G#2 04 C08" "--- 00 000" "--- 00 A01"
#> [33,] "E-3 01 A08" "C#3 02 C40" "D-2 03 000" "D#3 04 000"
#> [34,] "--- 01 A08" "C#3 02 C30" "--- 00 A01" "--- 00 000"
#> [35,] "--- 01 A08" "C#3 02 000" "--- 00 A01" "--- 00 A02"
#> [36,] "--- 00 000" "C#3 02 000" "--- 00 A02" "F-3 04 000"
#> [37,] "--- 01 A08" "C#3 02 000" "--- 00 126" "F#3 04 000"
#> [38,] "--- 00 000" "D#3 04 C08" "--- 00 A02" "--- 00 A02"
#> [39,] "--- 01 A08" "C#3 02 000" "--- 00 226" "F-3 04 000"
#> [40,] "--- 00 000" "D#3 04 C08" "--- 00 A01" "F#3 04 000"
#> [41,] "--- 01 A08" "C#3 02 000" "--- 00 A01" "G#3 04 000"
#> [42,] "--- 00 000" "D#3 04 C08" "--- 00 A01" "--- 00 A02"
#> [43,] "--- 01 A08" "C#3 02 000" "--- 00 A01" "F#3 04 000"
#> [44,] "--- 00 000" "D#3 04 C08" "--- 00 A01" "--- 00 A02"
#> [45,] "B-3 01 000" "C#3 02 000" "--- 00 A01" "F-3 04 000"
#> [46,] "--- 00 A08" "C#3 04 C08" "--- 00 000" "--- 00 A02"
#> [47,] "A-3 01 000" "C#3 02 000" "--- 00 000" "D#3 04 000"
#> [48,] "--- 00 A08" "F-3 04 C08" "--- 00 000" "--- 00 A02"
#> [49,] "D-3 01 A08" "C#3 02 C40" "C-2 03 000" "F-3 04 000"
#> [50,] "--- 01 A08" "C#3 02 C30" "--- 00 A01" "--- 00 A02"
#> [51,] "--- 01 A08" "C#3 02 000" "--- 00 A01" "D#3 04 000"
#> [52,] "--- 00 000" "C#3 02 000" "--- 00 A02" "--- 00 A02"
#> [53,] "--- 01 A08" "C#3 02 000" "--- 00 12B" "C#3 04 000"
#> [54,] "--- 00 000" "G#2 04 C08" "--- 00 A02" "--- 00 A02"
#> [55,] "--- 01 A08" "C#3 02 000" "--- 00 22B" "D#3 04 000"
#> [56,] "--- 00 000" "C#3 04 C08" "--- 00 A01" "--- 00 A02"
#> [57,] "--- 01 A08" "C#3 02 000" "--- 00 A01" "C#3 04 000"
#> [58,] "--- 00 000" "G#2 04 C08" "--- 00 A01" "--- 00 A01"
#> [59,] "--- 01 A08" "C#3 02 000" "--- 00 A01" "--- 00 000"
#> [60,] "--- 00 000" "C#2 04 C08" "--- 00 A01" "--- 00 A01"
#> [61,] "A-3 01 000" "C#3 02 000" "--- 00 A01" "--- 00 000"
#> [62,] "--- 00 A08" "F-2 04 C08" "--- 00 000" "--- 00 A01"
#> [63,] "G-3 01 000" "D#2 04 C08" "--- 00 000" "--- 00 000"
#> [64,] "--- 00 A08" "C#2 04 C08" "--- 00 000" "--- 00 A01"