fix: send CC64=0 + CC121=0 before noteOff (reset sustain + all controllers)
This commit is contained in:
@@ -173,10 +173,14 @@
|
||||
stopNote: function (channel, pitch) {
|
||||
if (channel < 0 || channel > 15) return;
|
||||
if (_initialized && _synthInstance) {
|
||||
// Ensure sustain is OFF before noteOff (SpessaSynth uses >=8192 threshold)
|
||||
try { _synthInstance.controllerChange(channel, 64, 0); } catch (e) {}
|
||||
// Standard noteOff with multiple velocity variants
|
||||
try { _synthInstance.noteOff(channel, pitch); } catch (e) {}
|
||||
try { _synthInstance.noteOff(channel, pitch, 0); } catch (e) {}
|
||||
try { _synthInstance.allNotesOff(channel); } catch (e) {}
|
||||
// Backup: All Notes Off + reset controllers
|
||||
try { _synthInstance.controllerChange(channel, 123, 0); } catch (e) {}
|
||||
try { _synthInstance.controllerChange(channel, 121, 0); } catch (e) {}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user