Browse Source

Make the keys send notes to the selected plugin(s)

tags/1.9.4
falkTX 10 years ago
parent
commit
704b59914f
1 changed files with 17 additions and 0 deletions
  1. +17
    -0
      source/carla_patchbay.py

+ 17
- 0
source/carla_patchbay.py View File

@@ -69,6 +69,7 @@ class CarlaPatchbayW(QFrame):
self.fParent = parent
self.fPluginCount = 0
self.fPluginList = []
self.fSelectedPlugins = []

self.fCanvasWidth = 0
self.fCanvasHeight = 0
@@ -107,6 +108,9 @@ class CarlaPatchbayW(QFrame):

self.fMiniCanvasPreview.miniCanvasMoved.connect(self.slot_miniCanvasMoved)

self.fKeys.keyboard.noteOn.connect(self.slot_noteOn)
self.fKeys.keyboard.noteOff.connect(self.slot_noteOff)

if not doSetup: return

parent.ui.act_plugins_enable.triggered.connect(self.slot_pluginsEnable)
@@ -352,6 +356,7 @@ class CarlaPatchbayW(QFrame):
@pyqtSlot(list)
def slot_canvasPluginSelected(self, pluginList):
self.fKeys.setEnabled(len(pluginList) != 0)
self.fSelectedPlugins = pluginList

@pyqtSlot(float, float)
def slot_miniCanvasMoved(self, xp, yp):
@@ -363,6 +368,18 @@ class CarlaPatchbayW(QFrame):

# -----------------------------------------------------------------

@pyqtSlot(int)
def slot_noteOn(self, note):
for pluginId in self.fSelectedPlugins:
Carla.host.send_midi_note(pluginId, 0, note, 100)

@pyqtSlot(int)
def slot_noteOff(self, note):
for pluginId in self.fSelectedPlugins:
Carla.host.send_midi_note(pluginId, 0, note, 0)

# -----------------------------------------------------------------

@pyqtSlot()
def slot_pluginsEnable(self):
if not Carla.host.is_engine_running():


Loading…
Cancel
Save