Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iBundin/Open-Web-Piano
Virtual piano based on Web Audio API and Web MIDI API
https://github.com/iBundin/Open-Web-Piano
musical-instrument piano webaudio-api webmidi
Last synced: 26 days ago
JSON representation
Virtual piano based on Web Audio API and Web MIDI API
- Host: GitHub
- URL: https://github.com/iBundin/Open-Web-Piano
- Owner: iBundin
- Created: 2017-02-26T14:18:05.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-13T23:09:02.000Z (over 7 years ago)
- Last Synced: 2024-08-03T16:09:57.192Z (4 months ago)
- Topics: musical-instrument, piano, webaudio-api, webmidi
- Language: JavaScript
- Homepage: http://ibundin.github.io/Open-Web-Piano
- Size: 767 KB
- Stars: 29
- Watchers: 2
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
- awesome-javascript-audio - iBundin/Open-Web-Piano - nice piano, user-friendly: supports choosing a MIDI device on load (MIDI instruments / Piano)
README
Lightweight virtual web piano. There is only one sample per octave, however samples are mixed with each other for realistic sound with correct full-length sustain. Lowpass filters are used to emulate dynamics. This instrument works well with sustain pedal.
## Installation
Simply copy **_openWebPiano.js_** and **_audio_** folder. See index.html for the example.
## API
0. **init(context)** - load all samples and start;
1. **noteOn(note 21 - 105, velocity 0 - 127 )** - start a note with a particular velocity level in standard MIDI format;
2. **noteOff(note)** - stop a note;
3. **sustain(value)** - any value higher then 0 switches sustain on, 0 value switches sustain off.## Example
```javascript
var audioCtx = new AudioContext();
openWebPiano.init(audioCtx);
//on event(note,velocity) ->
openWebPiano.noteOn(note, velocity);```
## License[MIT](https://github.com/nishanths/license/blob/master/LICENSE)