Function freqToMidi

  • Get the midi number from a frequency in hertz. The midi number can contain decimals (with two digits precision)

    Parameters

    • freq: number

    Returns number

    Example

    import { freqToMidi} from '../midi'
    freqToMidi(220)); //=> 57
    freqToMidi(261.62)); //=> 60
    freqToMidi(261)); //=> 59.96