lamepantallas wrote:How do I tell M8 not to use its automatic midi mapping structure and have my own for example, at least to establish a more stable mapping?
What solutions are there?
Thanks and cheers!
. not sure what you're asking in the question above... you can assign MIDI mapping via the main interface or you can write a module that listens for MIDI in DirectEvent()..
. a module seems to be the best way to go b/c you will be able to read all of the current values for everything (?) in modul8 and transmit them to your controller (if it is capable of receiving the information) so it shows the current state (for things like TouchOSC, maschine, etc.).
. if the controller doesn't have any way of showing the 'state' of the current parameter you're changing, then a module will know the current value and you can 'listen' to the incoming MIDI/OSC messages and not actually update the values in modul8 until it is in sync... so, don't create a one to one relationship w/a slider and and ctrl_layer_alpha from the main window... instead, create a module that has a slider in it and assign the MIDI controller to it. then in the module, you can compare the incoming value to the current stored value and only start changing it once you've passed the relevant threshold.
. as a rough example :
. using ctrl_layer_alpha on three layers - layer 1 at 1.00 (100%), layer 2 at 0.50 (50%) and layer 3 at 0.75 (75%)
. and you have one slider (current value is 0.25) in your module. you change your module to update layer 2 ctrl_layer_alpha.... you could use something like this pseudo code (which i'm sure a more adept programmer could implement better
- this is meant as more of illustration):
Code: Select all
lockedOn = False # not a one to one relationship yet...
lastCheck = '' # the last known state of the MIDI controller vs. modul8 value ('high' or 'low')
myM8Val = modul8.getValue(keyword and layer we're changing)
myMidiVal = module.getValue(element in the module and layer that is assigned to your MIDI controller)
if lockedOn == False : # they are not in sync
if myMidiVal < myM8Val :
if lastCheck == 'high' :
lockedOn = True # if the MIDI was less than the m8 value and now it is more - we've crossed our threshold
lastCheck ='low'
elif myMidiVal > myM8Val :
if lastCheck == 'low' :
lockedOn = True # if the MIDI was greater than the m8 value and now it is less - we've crossed our threshold
lastCheck = 'high'
if lockedOn: ## this means we're locked on
modul8.setValue(modul8 keyword, layer, module.getvalue(module keyword + layer) )
. so, when you start moving your MIDI controller (@ 0.25 ) lastCheck will equal 'low' until it becomes greater than the value for the ctrl_layer_alpha (0.50 in this example) then when you hit 0.51 - myMidiVal will be greater than myM8Val, lastCheck will equal 'low' -so lockedOn would get set to 'True' - and in the second logic block it should assign the current slider value to the modul8 parameter.
. i'm sure this could use some tweaking, but this is they way i've always approached it.
. good luck !
-james
(a nomad. )