.octToFreq | R Documentation |
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.
.octToFreq(oct)
oct |
A |
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.
A numeric
value of length 1, which is a frequency
in Hertz.
sonaes
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.