fix(piano-roll): loop only on btn + instant stop

- Sub-tab selection loop only active when st.isLooping is true
- End-of-playback loop uses st.isLooping, not global isLoopingSelection
- SonicSF.stopAll() sets gain 0 and stops oscillators immediately
This commit is contained in:
2026-07-26 12:16:01 +07:00
parent 653c0747cb
commit b0d7f35a1e
4 changed files with 12 additions and 10 deletions
+3 -6
View File
@@ -170,17 +170,14 @@
try {
if (entry.gain) {
entry.gain.gain.cancelScheduledValues(now);
entry.gain.gain.setValueAtTime(entry.gain.gain.value || 0.8, now);
entry.gain.gain.linearRampToValueAtTime(0, now + 0.02);
entry.gain.gain.setValueAtTime(0, now);
}
if (entry.osc) {
try { entry.osc.stop(now + 0.025); } catch (e) { }
try { entry.osc.stop(now); } catch (e) { }
}
} catch (e) { }
});
setTimeout(() => {
Object.keys(activeOscillators).forEach(k => delete activeOscillators[k]);
}, 50);
Object.keys(activeOscillators).forEach(k => delete activeOscillators[k]);
},
// Save user SoundFont to IndexedDB via window.SonicStorage