Hey guys,
i wanted to explore the midi api, but i am completely stuck. The documentation is kind of… , well at least for me. Would you be so kind to guide me in the right direction?
I have followed the getting started section step by step, but when i create a simple test js file in my local folder, and i refresh the scripts , it does not show up. Please guys call me stupid, i can code js files and vst plugins, but i cant manage to get this running.
@bencatmanvfx I’m four days behind you and this post was SO helpful - I don’t think I would have ever cracked the code on this otherwise.
I now have the right file structure and naming, the right devicedriver and the right named MIDI ports… I’m going in!
Would you mind if I message you on any other impenetrable pieces I find? Like you said at the top, the documentation might be obvious if you do this day in, day out… I don’t.
Thank you, appreciated! I wasted hours last night trying to work out why faders weren’t mapping properly, only to discover that the hardware (Panorama P1) has a mute faders button that I’d accidentally pressed, which stops the faders sending MIDI
Any idea if you can get complex with the coding, eg IF statements?
I may as well ask if this exists already - is there a routine available for the scripting that emulates Channel Visibility Configurations, as I believe that isn;t supported in the current MIDI remote API?
If not, I was thinking that I could try something along the lines of “if this button is pressed, cycle through all the tracks and if they’re not blue [bass in my setup], hide in the mixer and don’t control that track on the MIDI device”.
As far as I know the “and don’t take control of that track on the midi device” part is not possible.
For a midi remote device with 8 volume faders for example, you would define 8 “MixBankChannel Objects” in the midi remote script, relying on the .makeMixerBankChannel() method. But there is no way to influence which channels gets banked or not banked in these Objects from within the midi remote script. This part is entirely done by cubase and it will bank tracks that are hidden if they are adjacent to your selected track.
@Martin.Jirsak I can call visibility presets, but they don’t hide the tracks on the controller - as Joshua says, the bank still contains them, so if you’ve hidden channel 2, fader 2 still controls it, it’s just not visible.
@Joshua_Reiners I might have found a way around this however, but I tried so much stuff yesterday that I’d have to recreate to confirm. Basically I repeated the makeMixerBankChannel line of code three times in between each assignment and ended up with faders 1, 2 and 3 controlling channels 3, 6 and 9… as I say though I’d need to rebuild to check that I wasn’t imagining it.
You weren’t imagining it
What you actually did (the way you describe it), was creating a bank of 24 tracks, and assigning your faders/knobs to just one for each three of then. However, this is not a generic solution to avoid mapping to hidden tracks. It’s exactly as @Joshua_Reiners said.
The thing is that (apart from the “following visibility” not yet implemented, which will obviously solve such cases immediately) currently there’s no “hidden” or “visible” property for the tracks of the mixer. If something like this was provided, rest assured that I (and other members) would provide a snippet for properly remapping to shown tracks.
Now concerning doable (for the moment) workarounds, since the API exposes track names and track colors, among many other properties. IF one is OK with creating PLEs, for example to add a specific prefix/suffix to the names of let’s say hidden tracks, or to the tracks he/she wants to control, or even PLEs to alter the color of the tracks we aim to control, then it’s surely doable even though it may be a bit resource hungry. You see, in order to do it, one first has to create a mixer bank zone, with at least as many tracks as usually present in their projects, and then create pseudo-mixer zones by taking advantage of the custom host variables functionality.
Sure, at a glance:
Say you have 4 tracks in your project, they’re controlled by your midi remote. Now, say, you decide to hide one of them in the project window (and/or mixer). Your midi remote will continue to control it, i.e. will not respect the visibility of the mixer. There’s a function in the API yet to be implemented, till then (hopefully not far) dealing with visibility unfortunately needs workarounds and not too efficient ones as well.
Thanks @m.c - I’ve noted your comment that hopefully this isn’t too far away so maybe I’m putting too much time into a workaround, but hey, sometimes it’s fun to have a problem to chew on
Sounds like you guys have all been here before, here are my thoughts at the moment if you don’t mind acting as a sanity check.
Thank you for confirming I wasn’t going mad. I was thinking about using an attribute to basically “skip” or “include” a channel from the controller, with IF statements repeating the makeMixerBankChannel statement. I already use colours for tracks in almost a 1:1 match with my channel visibility configs (group tracks being the easily catered for exception) so my thinking was to for example “include” blue (bass) tracks in the massive mixer bank zone, and “skip” other tracks. At least that way I’d avoid having to use PLE as well as scripting, in theory.
Simpler alternative. I could just change my template to have 8 (or 10 - I’ll explain in a moment) tracks of each type… 8 bass, 8 electric guitar, 8 drums, 8 cymbals etc. Then each bank would effectively be a visibility config. Not foolproof but better than the current position - I think.
I have a Softube Fader mk II on order, hence the “or 10 tracks” comment. I want to be able to use it with MIDI remote and not have to insert the Softube plugin on every track. What I’d like to be able to do is set up all of the buttons as (I think) pages in MIDI remote, so that the faders can control volume, sends, high cut, low cut etc depending on the “mode” selected… and why not pan as well, even though the unit itself doesn’t do Pan on faders afaik.
I’m already thinking after one day of looking at the scripting that it would be a LOT of work to have both the selected channels as variables, and the Cubase attribute as a variable. Tell me if I’m wrong on this! In which case, just having 10 guitar tracks per bank would make this way easier.
This is what I actually do as well in a similar manner. My projects are no more than 24-32 tracks in general, excluding fxs. Now, I will always find my track 1 to be a “key”, 2 a “bass”,3 a “pad” and so on, you surely get it. This way I’m controlling almost blindly all my tracks.
However, it’s my understanding that the visibility configs are more for larger, much more complicated projects, with perhaps different arranging rules/methodologies involved, so I do see the request to have the followVisibility functionality available
@bencatmanvfx m.c has explained this well, here’s an even more detailed example:
set up a controller to control an 8 track project with faders 1-8 with MIDI remote
hide track 3 in Cubase
the screen shows you tracks 1, 2, 4, 5, 6, 7 and 8. So track 4 is the third track up.
the faders though are still mapped as they were before you hid the track. So fader 3 is controlling track 3… but you can’t see it on screen any more. And you have to move the “wrong” fader to control tracks 4-8.
This is even more problematic if you have channel visibility configurations set up. If you want to have tracks on screen that are spread throughout the project… all bets are off, moving a fader on the controller can have completely unpredicted (and invisible) results.
Ok, thanks for all the inputs here. Def very interesting. One common question (sorry for highjacking) - but do y guys have any idea how (or even IF) i can expose track names via midi api? I hate doing it with mackie…