Browse Source

protect auditioner against unloaded keyswitches

master
Nils 2 years ago
parent
commit
4bdaf67d7b
  1. 4
      engine/auditioner.py
  2. 2
      engine/instrument.py

4
engine/auditioner.py

@ -165,11 +165,11 @@ class Auditioner(object):
def triggerNoteOnCallback(self, timestamp, channel, pitch, velocity):
"""args are: timestamp, channel, note, velocity.
consider to change eventloop.slowConnect to fastConnect. And also disconnect in self.disable()"""
if self.idKey:
if self.idKey and self.instrumentLayer:
self.parentData.instrumentMidiNoteOnActivity(self.idKey, pitch, velocity)
def triggerNoteOffCallback(self, timestamp, channel, pitch, velocity):
"""args are: timestamp, channel, note, velocity.
consider to change eventloop.slowConnect to fastConnect. And also disconnect in self.disable()"""
if self.idKey:
if self.idKey and self.instrumentLayer:
self.parentData.instrumentMidiNoteOffActivity(self.idKey, pitch, velocity)

2
engine/instrument.py

@ -436,7 +436,7 @@ class Instrument(object):
This is only for permanent sw_last, not momentary sw_up and sw_down
"""
if not self.currentVariantKeySwitches:
if not self.currentVariantKeySwitches or not self.instrumentLayer:
return #optimisation.
if not force is None:

Loading…
Cancel
Save