From 6df64e126239a5aad33708b287cf3b4f979a8ebc Mon Sep 17 00:00:00 2001 From: Dandaedre Date: Tue, 30 Apr 2019 21:25:22 +0200 Subject: [PATCH] Initial setup --- config.py | 33 +++++++++++++++++++++++++++++++++ gmaPy.py | 2 ++ patch/default.ini | 18 ++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 config.py create mode 100644 gmaPy.py create mode 100644 patch/default.ini diff --git a/config.py b/config.py new file mode 100644 index 0000000..dbd4a03 --- /dev/null +++ b/config.py @@ -0,0 +1,33 @@ +# Load the config and return an action class +class Binding(object): + """Binding class, simple binding between note and actions""" + + def __init__(self, config): + self.config=config + self.loadConfig() + + def loadConfig(self): + pass + #Detect config error + #Bind all actions to a return message + #Make a easy list to acess list of actions + def read(gmaMessage): + """Read the gmaMessage and return a list of action""" + #Readmessage + #Parse message with config + #Handle Errors + #Return Action or ActionList that can be .run + return ActionList() + +class ActionList(object): + """List of action to play after a message is receaved""" + + def __init__(self,list): + """Takes the list of actions detected and + pass + +class Action(object): + """Action itself, a mapper for the midi library""" + + def __init__(self,actiontype): + self.actiontype=actiontype diff --git a/gmaPy.py b/gmaPy.py new file mode 100644 index 0000000..8070695 --- /dev/null +++ b/gmaPy.py @@ -0,0 +1,2 @@ +if __name__ == '__main__': + main() diff --git a/patch/default.ini b/patch/default.ini new file mode 100644 index 0000000..012ca36 --- /dev/null +++ b/patch/default.ini @@ -0,0 +1,18 @@ +[interface] + input="Scarlett i6" + output="Scarlett i6" + inputchanel = 1 + outputchannel = 1 + +#Patching faders +[patch:1] #Patches layer 1 +1 = cc/10 #Send (midi) control change (10) with value mapped to the fader (1) value (fader 1 => cc 10) +5-50 = cc/11 #Map the faders 5-50 to the control change 11-45 (Straight patch) +56 = note/152 #Map fader 56 to note 152 +56/val = lambda f: x>50 #Function choosing the value to send instead of a simple mapping + +[executor] +13 = note/10 +15 = cc/44/127 #Send control change with value 127 +17-27 = cc/45/127 # Send control change 45-55 with value 127 +38 = cc/65/124;cc/79/100;note/25 (Stack the action to link to)