Hello, I need some light to better understand how the custom module works and specifically the port addresses filtering.
I have an OSC patch that allows me to manage midi track articulations and display GUI interfaces depending on the tracks (plugin) selected in Cubase.
The track controllers are sent to the custom module on DAWtoOSC port, ch 1 ctrl 116 to 127, the GUI controllers are sent on midictrl port ch 1 to 16 on all controllers via generic remote in cubase.
My problem: there is obviously a conflict between the ports on ctrl 116 to 127 between DAWtoOSC and midictrl, the display works but always jumps to the last case. the solution I found is to release the GUI ctrl 116 to 127 from the generic remote and route them to other ch/ctrl.
I'm sure there is probably a better solution in the custom modul but I can't find it.
here a sample of my probleme :
module.exports = {
oscInFilter:function(data)
{
var {address, args, host, port} = data
if (address !=='/control') return {address, args, host, port}
if (args[1].value < 115) return {address, args, host, port}
if (args[1].value == 127)
{send('midi','OSCtoDAW','/control', 1,126,1)
return {address, args, host, port}}
else if (args[1].value == 116 && args[2].value == 4)
{
receive('/EDIT', 'Quick controls', {html:'Absynth'});
receive('/EDIT', 'Quick controls',{
widgets: [...]})return }
/// other GUI case here... and the last
else if(args[1].value>=117)
{
bank = (args[1].value - 117)
patch = (bank * 128) + args[2].value;
labelTexts = instruments[patch].trackarticulations
var len = labelTexts.length
for (i = 0; i < len; i++)
{
receive(Object.values(buttons)[i], {type:'i', value: 1})
receive(Object.values(labels)[i], {type:'s', value: labelTexts[i]})
for(z of colors){
for(y of colortrack[z]){
if(labelTexts[i] == y) {
var colorcode = z
receive(Object.values(labelscolor)[i], colorcode);}}}}
receive('/EDIT', 'Quick controls', {html:'Kontakt - '+ instruments[patch].trackname})
receive('/EDIT', 'Quick controls',{
widgets: [...]})
return } return {address, args, host, port}},}
Otherwise, I have two other small questions:
How to make the content of a modal adjusted to the content?
I can hide/show a tab from the custom module with receive('/Tab1/visible',1); but what is the syntax to make a tab active from the custom module?
Z