HzToNotes: Convert Hz to notes

View source: R/math.R

HzToNotesR Documentation

Convert Hz to notes

Description

Converts from Hz to musical notation like A4 - note A of the fourth octave above C0 (16.35 Hz).

Usage

HzToNotes(h, showCents = FALSE, A4 = 440)

Arguments

h

vector or matrix of frequencies (Hz)

showCents

if TRUE, show cents to the nearest notes (cent = 1/100 of a semitone)

A4

frequency of note A in the fourth octave (modern standard ISO 16 or concert pitch = 440 Hz)

See Also

notesToHz HzToSemitones

Examples

HzToNotes(c(440, 293, 115, 16.35, 4))

HzToNotes(c(440, 415, 80, 81), showCents = TRUE)
# 80 Hz is almost exactly midway (+49 cents) between D#2 and E2

# Baroque tuning A415, half a semitone flat relative to concert pitch A440
HzToNotes(c(440, 415, 16.35), A4 = 415)

soundgen documentation built on Sept. 12, 2024, 6:29 a.m.