octToFreq: Convert from csound-style oct notation for pitches to...

.octToFreqR Documentation

Convert from csound-style oct notation for pitches to frequency in Hertz

Description

This function converts from the ‘oct’ notation notation for pitches, where 8 is middle C and 1 represents an octave, to the corresponding frequency in Hertz.

Usage

  .octToFreq(oct)

Arguments

oct

A numeric of length 1, which is a pitch in ‘oct’ notation

Details

Most users of playitbyr will not need this function, but those wishing to make add-ons may find it useful.

The conversion to Hertz is quite simple:

440*2^(oct-8.75)

where oct is the input value. Note that both 440 Hz and 8.75 are tuning A.

Value

A numeric value of length 1, which is a frequency in Hertz.

See Also

sonaes

Examples

## In oct, middle c is 8
.octToFreq(8)

## An octave below tuning A, in Hz
.octToFreq(7.75)

## A little more than that, in Hz
.octToFreq(7.76)

statisfactions/playitbyr documentation built on Jan. 27, 2024, 1:33 p.m.