-
Notifications
You must be signed in to change notification settings - Fork 0
/
handlers.py
58 lines (49 loc) · 1.91 KB
/
handlers.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
### Handlers. Set events as handled.
# Imports
import variables as var, constants as cons, knobs
import midi
#from cust_gen import *
import cust_gen
#from fruity_gen import flex, sytrus, harmor
#from fruity_gen import *
import fruity_gen
from mxr import embdeq
def PadHandler(midiId, data1): # Specific handler for pads.
handled = "" # Handled variable. If true, then FL Studio will show a yellow icon.
if midiId == midi.MIDI_NOTEON:
if not var.PADSTATUS == "Drum":
handled = True
return bool(handled)
def SceneHandler(midiId, data1): # Handler for CC messages.
handled = "" # Handled variable. If true, then FL Studio will show a yellow icon.
customsynths = [] # List of custom synths names.
for i in cust_gen.__all__:
customsynths.append("cust_gen." + i + ".Handled")
fruitysynths = [] # List of native synths names.
for i in fruity_gen.__all__:
fruitysynths.append("fruity_gen." + i + ".Handled")
if midiId == (midi.MIDI_CONTROLCHANGE):
if not var.SHIFT_STATUS:
if data1 in knobs.knobs.values():
if var.KNOBSTATUS in ("Volume", "Pan"):
handled = True
else:
handled = False
else:
handled = True
else:
if data1 == cons.shift_DATA1 or cons.play_button:
if not data1 == cons.record_button:
if not data1 in knobs.knobs.values():
handled = True
else:
handled = False
else:
handled = False
for i in customsynths + fruitysynths:
if not var.SHIFT_STATUS:
if eval(i):
handled = True
#if embdeq.Handled(): # Comment disables the embedded EQ in mixer mode.
# handled = True
return handled