-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
wheels.py
47 lines (36 loc) · 1.11 KB
/
wheels.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
import ui
from midi import *
import mixer
import channels
import playlist
from utility import Utility
import midi
from config import Config
class ModWheel():
mod_value = 0
def process(event):
ModWheel.set_mod_value(event)
ModWheel.mod_scroll(event)
def set_mod_value(event):
ModWheel.mod_value = event.data2
def get_mod_value():
return ModWheel.mod_value
def get_pl_mod_value():
return int(Utility.mapvalues(ModWheel.get_mod_value(), Config.PLAYLIST_REACH, 1, 0, 127))
def mod_scroll(event):
if ui.getFocused(0):
mixer.setTrackNumber(int(Utility.mapvalues(event.data2, 0, 64, 0, 127)))
ui.scrollWindow(midi.widMixer, mixer.trackNumber())
elif ui.getFocused(1):
channels.selectOneChannel(int(round(Utility.mapvalues(event.data2, channels.channelCount()-1, 0, 0, 127), 0)))
elif ui.getFocused(2):
playlist.deselectAll()
playlist.selectTrack(ModWheel.get_pl_mod_value())
class PitchWheel():
pitch_value = 0
def process(event):
PitchWheel.set_pitch_value(event)
def set_pitch_value(event):
PitchWheel.pitch_value = event.data2
def get_pitch_value():
return PitchWheel.pitch_value