Hi,
Say a. fader on my midi controller sends CC 16 can I transform it with midi remote scripting to CC1?
is it possible? Thanks in advance
Hi,
Say a. fader on my midi controller sends CC 16 can I transform it with midi remote scripting to CC1?
is it possible? Thanks in advance
You can use the Input Transformer for this task. MIDI Remote doesn’t output MIDI.
Correct, and I see no reason to mess with the MR for this.
? It does. You can send data to an output port. BUT, yes, you cannot send to an input port, unless it’s a loopback one, i.e. treated like an output for our script. In this case, it will work properly. Still, I don’t see the need for this, as you already pointed out, unless there’s a use case out of Cubase?
I’ve created a script for Allen and Heath Xone:K1 currently it’s a two layer/ page script but later I’m gonna add a third layer.
so currently I’m on Main page and the CC 16 controls currently selected track volume… and I want to transform to CC1 in mode 2 or three…
I hope the picture is clear now.
Why? The very same CC can have a different assignment in a different page. What is CC1 supposed to do in your second page?
Because I want it when I’m In the second mode page to control CC1 Modulation wheel
Fine. You will need a virtual loopback port for this.
Here’s a snippet for giving you an idea:
var midiremote_api=require('midiremote_api_v1')
var deviceDriver=midiremote_api.makeDeviceDriver("Test","Transform messages","m.c")
var midiInput1=deviceDriver.mPorts.makeMidiInput("anInput1")
var midiOutput1=deviceDriver.mPorts.makeMidiOutput("anOutput1")
var midiInput2=deviceDriver.mPorts.makeMidiInput("anInput2")
var midiOutput2=deviceDriver.mPorts.makeMidiOutput("anOutput2")
var detectionUnit=deviceDriver.makeDetectionUnit()
detectionUnit.detectPortPair(midiInput1, midiOutput1)
.expectInputNameEquals("an input 1")
.expectOutputNameEquals("an output 1")
detectionUnit.detectPortPair(midiInput2, midiOutput2)
.expectInputNameEquals("an input 2")
.expectOutputNameEquals("an output 2")
var surface=deviceDriver.mSurface
var fader=surface.makeFader(0,0,1,5)
fader.mSurfaceValue.mMidiBinding
.setInputPort(midiInput1)
.bindToControlChange(0,16)
var mapping=deviceDriver.mMapping
var page1=mapping.makePage("Default")
page1.makeValueBinding(fader.mSurfaceValue,page1.mHostAccess.mTrackSelection.mMixerChannel.mValue.mVolume)
var page2=mapping.makePage("A second page")
var customHostValue=page2.mCustom.makeHostValueVariable("customHostValue")
page2.makeValueBinding(fader.mSurfaceValue,customHostValue).mOnValueChange=function(activeDevice,activeMapping,value,diff){
midiOutput2.sendMidi(activeDevice,[0xb0,1,Math.round(127*value)])
}
As seen at the start of the snippet, you will need a second pair of ports, loopback ones. What we do here is to control the volume of the selected track in our first page. In the second page, we bind the fader to a customHostVariable. Inside this, we transform the CC message and send it to our virtual MIDI Port. If we have our track setup to follow for e.g. “All MIDI”, it will work.
Of course. I think my reply was longer in my head that what got written down.
I think I meant to say something like, MR doesn’t output MIDI to Cubase. But as you correctly stated, you can use a virtual MIDI port to circumvent this “limitation”.
How about I transform the midi right from the start to CC1 using the midi input transformer this way instruments automatically sees it as modulation… and then use your code to transform CC1 to Cc16 and there wouldnt be a need for a virtual port do you think this approach would work? I dont have my laptop with me right now to try it.
cubase would still be able to control the volume of a fader with a CC1 transformed to a CC16 right?
There would, since my code is based on a second port pair, which needs a loopback port.
Correct.
A piece of advice please. I 've used your method to create a dedicated VSTi page and transform pitchbend faders (I’m in MCU mode) to CCs. Its like having simple CC faders unassigned to work with some VSTi or just a second bank of QC if you prefer. My thing is that after using a fader, it is pushed back to previous position and I assume this happens because of binding my pitchbend faders to mixerbank volume previously. I do not expect faders to follow midi events, I know that can’t be done. But is there a way to keep the fader’s last position as long as I’m in “VSTi” page?
Hi, please post in a separate thread, so I can surely have a look and respond. And try to present the case with as much details as possible, even by providing the code snippet you used. (Was it mine?)
Thanks, I will