noteToPeriod: Extract period value for a specific note

View source: R/01supporting_functions.r

noteToPeriodR Documentation

Extract period value for a specific note

Description

Extracts the ProTracker period value for a specific note.

Usage

noteToPeriod(note = "C-3", finetune = 0)

Arguments

note

character string representing a note and octave for which the ProTracker period value needs to be determined

finetune

integer value ranging from -8 up to 7. A value used to tune an audio sample.

Details

ProTracker uses a period_table to link period values to certain octaves and notes. This function serves to look up corresponding period values for specific notes and octaves.

Value

Returns the numeric ProTracker period value for a corresponding note, octave and fineTune. Returns 0 if a note could not be found in the table.

Author(s)

Pepijn de Vries

See Also

Other period.operations: note(), octave(), periodToChar(), period_table, sampleRate

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

Examples

## Determine the period value corresponding with note 'A-3':
noteToPeriod("A-3")

## get the period values for notes 'A-3' and 'A#3' with finetune at -1:
noteToPeriod(c("A-3", "A#3"), -1)

## get the period values for note 'A-3' with finetune at 0 and 1:
noteToPeriod("A-3", 0:1)


ProTrackR documentation built on Aug. 23, 2023, 1:07 a.m.