Hello,
I'm mapping some parameters from Ableton Live to configure a Mackie controller using OSC, as my MIDI controller (WORLDE Easy Control) doesn't have settings for more specific parameters like PitchWheel for the volume faders.
I managed to configure a script that makes the fader of my MIDI controller move the fader of the OSC that is controlling the volume of the track in Ableton, but even this fader moving, it does not send a MIDI signal, but when I directly move the fader in the OSC with the Mouse, it sends signal.
if I move the OSC fader directly with the mouse, it moves the volume of the track in the DAW, but if I move the controller fader, the OSC fader moves, but does not change the volume of the track.
I'm using Protokol to monitor the MIDI signal, and the same thing happens there. The OSC fader signal sends a MIDI signal only when it is moved with the computer mouse, or by touch, but if it is moved with the MIDI controller, it does not send a signal.
Note the interactive property to false. it's up to you.
The custom module to be load
/* Greenman - 14-07-2022 */
module.exports = {
init: function()
{
console.log("Youpi init") // this will be executed once when the osc server starts
},
oscInFilter:function(data){
// Filter incoming osc messages
var {address, args, host, port} = data
// do what you want
// address = string
// args = array of {value, type} objects
// host = string
// port = integer
console.log("inside oscInFilter")
console.log(data)
if (host === 'midi') {
console.log(" midi détecté via la valeur de host !")
console.log('adresse du message : ' + address)
// on teste si c'est un message midi /note via la variable address
// comparaison avec l'opérateur ===
if(address === '/control'){
// on dispatche les valeurs de args dans tes variables différentes
// assign args to variables
// https://openstagecontrol.ammd.net/docs/custom-module/examples/#midi-routing
var [channel, ctrl, value] = args.map(arg=>arg.value)
// simple condition
// on my apc i press the button sending /note 1, 32, 127
// when released sending /note 1, 32, 0
if (ctrl === 23)
{
// if you don't want to use the fader_1, comment this line
// you need to insert that as we bypass the 'normal' return
receive('/SET', 'fader_1', value )
// set the fader_2 widget to 10 times the fader_1 value. it's an example :-)
receive('/SET', 'fader_2', 10 * value )
}
else console.log('Autre valeur de ctrl')
}
return // bypass the normal return
}
// return data if you want the message to be processed
return {address, args, host, port}
}
}
You have to adapt the address as i use /control for the purpose of the demo.
Use the fader in ableton midi mapped to channel 1, number cc 23, it will move the fader_2 for the pitch represented by a fader with values from 0 to 1270.
Hope it helps. If others find some errors, please notice me