Description Usage Arguments Examples
View source: R/utilities_math.R
Converts from Hz to semitones above C0 (~16.4 Hz). This may not seem very
useful, but note that (1) this gives you a nice logarithmic scale for
generating natual pitch transitions, (2) with the added benefit of getting
musical notation for free from notesDict
(see examples).
1 |
h |
vector or matrix of frequencies (Hz) |
1 2 3 4 | s = HzToSemitones(c(440, 293, 115))
# to convert to musical notation
notesDict$note[1 + round(s)]
# note the "1 +": semitones ABOVE C0, i.e. notesDict[1, ] is C0
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.