Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/skratchdot/timbre.soundfont.js

play soundfont urls using timbre.js
https://github.com/skratchdot/timbre.soundfont.js

Last synced: 23 days ago
JSON representation

play soundfont urls using timbre.js

Awesome Lists containing this project

README

        

# timbre.soundfont.js

A library that lets you play soundfont urls via timbre.js.

Currently it uses the [free-midi](https://code.google.com/p/free-midi/)
repo to get it's sounds via jsonp.

You can play all the instruments in the
[general midi standard](http://en.wikipedia.org/wiki/General_MIDI#Program_change_events) by
default, or you can set a different url template, and pull sounds from your own site.

## Demo

[Timbre.js Soundfont Demo](http://projects.skratchdot.com/timbre.soundfont.js/)

## Dependencies

- [timbre.js](https://github.com/mohayonao/timbre.js/)

- [jsmad](https://github.com/audiocogs/jsmad/) - (If your soundfonts are in mp3 format)

- [timbre.mp3_decode.js](https://github.com/skratchdot/timbre.mp3_decode.js/) - (If your soundfonts are in mp3 format)

- [audio-jsonp.js](http://mohayonao.github.io/timbre.js/src/extras/audio-jsonp.js) - (If your soundfonts are on a different domain)

## Usage

```html





// play note 64
timbre.soundfont.play(64);

// set instrument and play again
timbre.soundfont.setInstrument(5);
timbre.soundfont.play(64);

// only play if this note has already been cached
timbre.soundfont.play(70, false);

```