freq_to_midi: Convert frequencies to MIDI note numbers

View source: R/scales.R

freq_to_midiR Documentation

Convert frequencies to MIDI note numbers

Description

Converts frequencies (Hz) to MIDI note numbers, optionally using stretched octaves. Non-integer MIDI note numbers are permitted as output.

Usage

freq_to_midi(frequency, stretched_octave = FALSE, tuning_ref_Hz = 440)

Arguments

frequency

Numeric vector of frequencies (Hz).

stretched_octave

Logical scalar; whether or not to use a stretched octave. Default is FALSE

tuning_ref_Hz

The tuning reference point in Hz, should correspond to the frequency of the A above middle C (typically 440 Hz)

Value

Numeric vector of frequencies in Hz


pmcharrison/hrep documentation built on Feb. 18, 2024, 2:33 a.m.