g200kg / webaudio-tinysynth

Light-weight GM mapped WebAudio-JavaScript Synthesizer Engine / MIDI Player
Apache License 2.0
229 stars 22 forks source link

noteOff doesn't seem to work the same for all timbres #30

Closed guibar closed 6 months ago

guibar commented 6 months ago

If I send an noteOn command followed by a noteOff command with a delay value of t (in the code below t=50), am I supposed to get the note playing for a duration of 50?

This is what happens when I use the timbre 14 like in the example below. But for some other timbres (like 44), the note doesn´t stop playing.

synth = new WebAudioTinySynth();
synth.setQuality(1);
synth.setProgram(0, 14);
synth.noteOn(0, 60, 66);
synth.noteOff(0, 60, 50);
guibar commented 6 months ago

I just understood that the time unit seems to be seconds. So 50 is long. If I use a value of 1 or 2, it works as expected.