Minor Changes
- 85fd7b8: New
@audio-ui/core/midientry: MIDI with no framework in it.parseMidiMessagereads note on and off, control change and pitch bend with their channel and values from 0 to 1 (pitch bend from -1 to 1, both ends reached);parseMidiFilereads a Standard MIDI File into notes with their track, tempos and time signatures, andencodeMidiFilewrites one;createMidiInputlistens to the Web MIDI inputs of the page as one source. A file that is truncated, malformed or counts time in SMPTE frames raises aMidiFileErrorthat says what is wrong. The folders of the package now tell the two kinds of module apart:primitives/holds the logic of the interface primitives andaudio/the audio logic with no interface (pitch,midi). - 43f455f: New
@audio-ui/core/pitchentry: the maths of pitch with no framework or Web Audio in it.noteToFrequencyandfrequencyToNoteconvert between MIDI notes and hertz (equal temperament, A4 at 440 Hz or the reference you pass, fractional notes for cents),nearestNotenames the note nearest a frequency with its offset in cents, anddetectPitchfinds the fundamental of an array of samples, such as an analyser's time-domain data, with the YIN algorithm.pitchName,isBlackKeyand the newpitchClassNamecome with it. Input that is not a number a note or a frequency can be (zero, negative,NaN) givesNaNornull, never a wrong note.