Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/danigb/sampler.js
A simple web audio piano player using soundfont samples
https://github.com/danigb/sampler.js
Last synced: about 2 months ago
JSON representation
A simple web audio piano player using soundfont samples
- Host: GitHub
- URL: https://github.com/danigb/sampler.js
- Owner: danigb
- License: mit
- Created: 2015-12-03T11:38:15.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-06T17:11:09.000Z (almost 9 years ago)
- Last Synced: 2024-04-20T19:39:09.620Z (5 months ago)
- Language: JavaScript
- Size: 746 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG
- License: LICENSE
Awesome Lists containing this project
- awesome-javascript-audio - danigb/sampler.js - simple sampler, defines instruments as JSON, with base64 mp3s in them (Sound assets / SoundFonts)
README
# sampler.js
A simple audio sampler:
```js
var ac = new AudioContext()
var sampler = require('sampler-inst')(ac)
var loader = require('soundfont-loader')(ac)
loader.load('piano', loader.).then(function (audioBuffers) {
piano = sampler.instrument(audioBuffers, { poly: 8, adsr: [0.2, 0.2, 0.7, 1] })
})var saw = sampler(ac, buffers, {
poly: 1,
loop: true, // loop samples
map: { 1: [1, 10] }
mapMode: 'transpose'
})