Welcome to toymir’s documentation!¶
toymir is a Python package for use within the ISMIR 2018 Open Source and Reproducibility tutorial session.
It is based on the Shablona package developed by Ariel Rokem at the University of Washington’s eScience Institute.
This is an example of documentation of the software, using sphinx.
Contents:
This is a theory section¶
I might want to describe some equations:
\[\int_0^\infty e^{-x^2} dx=\frac{\sqrt{\pi}}{2}\]
And refer to a paper [author2015].
[author2015] | first a., second a., cheese b. (2015). The title of their paper. Journal of papers, 15: 1023-1049. |
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
See also
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
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.