This library allows you to play music directly in the browser using a variety of instruments. These are provided, courtesy of Benjamin Gleitzman's package of pre-rendered sound fonts. You can either load them remotely from the Gleitzman GitHub account or else host then locally on your own server. They load as dictionaries of AudioBuffers - one for each note on each selected instrument. Once loaded. you can play individual notes or groups of notes on your instruments of choice.
Also included is conversion to a Melody type which is suitable for use in a soundfont player widget.
The conversion of a Gleitzman note name (e.g. Ab4) to a MIDI pitch uses middle C = C4.
- When building an AudioBuffer for each note in an instrument SoundFont.
- When playing a note that uses an AudioBuffer.
- In functions canPlayOgg and isWebAudioEnabled.
bower install purescript-soundfonts
Module documentation is published on Pursuit.