API

Functions

toymir.freq.hz_to_midi(frequencies)

Get MIDI note number(s) for given frequencies

Parameters:
frequencies : float or np.ndarray [shape=(n,), dtype=float]

frequencies to convert

Returns:
note_nums : number or np.ndarray [shape=(n,), dtype=float]

MIDI notes to frequencies

Examples

>>> hz_to_midi(60)
34.506
>>> hz_to_midi([110, 220, 440])
array([ 45.,  57.,  69.])
toymir.freq.hz_to_period(frequencies)

Get the period of a frequency (Hz) in seconds.

Parameters:
frequencies : float or np.ndarray [shape=(n,), dtype=float]

frequencies to convert

Returns:
period : number or np.ndarray [shape=(n,), dtype=float]

period (periods) of frequencies in seconds.

See also

hz_to_midi

Examples

>>> hz_to_period(100)
0.01
>>> hz_to_period([110, 220, 440])
array([0.00909091, 0.00454545, 0.0030303 ])
toymir.freq.midi_to_hz(notes)

Hello Part 6! You should add documentation to this function.