mirror of
https://github.com/badvision/jace.git
synced 2024-11-28 10:52:33 +00:00
When switching midi devices, first send all notes off, all sound off on every channel just so it doesn't leave phantom notes playing.
This commit is contained in:
parent
b57d3e06e0
commit
3b9d6a232e
@ -572,6 +572,20 @@ public class PassportMidiInterface extends Card {
|
|||||||
private void suspendACIA() {
|
private void suspendACIA() {
|
||||||
// TODO: Stop ACIA thread...
|
// TODO: Stop ACIA thread...
|
||||||
if (midiOut != null) {
|
if (midiOut != null) {
|
||||||
|
currentMessage = new ShortMessage();
|
||||||
|
// Send a note-off on every channel
|
||||||
|
for (int channel = 0; channel < 16; channel++) {
|
||||||
|
try {
|
||||||
|
// All Notes Off
|
||||||
|
currentMessage.setMessage(0x0B0 | channel, 123, 0);
|
||||||
|
midiOut.send(currentMessage, 0);
|
||||||
|
// All Oscillators Off
|
||||||
|
currentMessage.setMessage(0x0B0 | channel, 120, 0);
|
||||||
|
midiOut.send(currentMessage, 0);
|
||||||
|
} catch (InvalidMidiDataException ex) {
|
||||||
|
Logger.getLogger(PassportMidiInterface.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
midiOut.close();
|
midiOut.close();
|
||||||
midiOut = null;
|
midiOut = null;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user