surikov / webaudiofont

Use full GM set of musical instruments to play MIDI and single sounds or effects. Support for reverberation and equaliser. No plugins, no Flash. Pure HTML5 implementation compatible with desktop and mobile browser. See live examples.
https://surikov.github.io/webaudiofont/
GNU General Public License v3.0
891 stars 92 forks source link

Playing multiple notes #64

Closed mohammadalmalt closed 4 years ago

mohammadalmalt commented 4 years ago

Hello,

I would like to know how can i play 2 or more notes after each other. When I do the following, the notes are played together: player.queueWaveTable(audioContext, audioContext.destination , instr, 0, 12 5+ 0, 1); player.queueWaveTable(audioContext, audioContext.destination , instr, 0, 12 5+ 4, 1);

Also, how can I make the playing continue while I am pressing a button and stops when i release the button?

Many thanks for your great code, I really enjoyed it.

surikov commented 4 years ago

Look to examples https://github.com/surikov/webaudiofont#code-examples Read docs https://github.com/surikov/webaudiofont/wiki Ask one question per issue. Add full code to issue if you need to fix it.