# Tutorial: Auto-Select Keyswitches in Lemur When Changing Tracks in Cubase



## rgames (Dec 28, 2015)

To be continued...!!!


----------



## mohurwitzmusic (Dec 28, 2015)




----------



## rgames (Dec 28, 2015)

If you'd like to know how to automatically change keyswitches in Lemur when you change Cubase channels, feel free to contact me. Some good hints in this thread: http://vi-control.net/community/thr...very-time-you-select-a-track-in-cubase.49043/

It's a great enhancement to MIDI Kinetics' excellent Composer Tools product!

rgames

EDIT: to be clear, the MIDI Kinetics product has a "Synch" button that you can press to manually select keyswitches for the active channel. The technique we came up with does not require the user to press the "Synch" button. When you change tracks in Cubase, it *automatically* selects the appropriate set of keyswitches in the Lemur project, so there's no need to press the "Synch" button. As I said, it's a great mod to the MIDI Kinetics product or addition to your own Lemur projects.


----------



## FriFlo (Dec 29, 2015)

Are you gonna make a video on that?


----------



## rgames (Dec 29, 2015)

No - it builds upon a technique similar to that embedded in the MIDI Kinetics product. It's a totally independent technique with different functionality (no need for the synch button) but it's hard to describe the added function without giving details of the more basic function.

The tweak I made added two bits of functionality:

1. It limits the MIDI data going back to the Lemur project (a concern for large templates)

2. It removes the need for the user to press the synch button - when you select a new track in Cubase, the Lemur project automatically selects the new Keyswitches.

So suffice it to say that those bits of functionality can be added if you combine ides from around the Web (I combined them with specific details of my template controller in the original post). If you check out the MIDI Kinetics Composer Tools video (at 5:00) and then take a look at the thread I linked (especially afterlight82's post) then you can add that functionality to your projects.

I think the MIDI Kinetics products are great so I don't want to cause any issues for the developer.

Hope that helps.


----------



## Whatisvalis (Dec 29, 2015)

I always found it frustrating that you needed a fixed template when using track select, is that still the case?


----------



## afterlight82 (Dec 29, 2015)

Nope. You can get around that. No fixed template required. "On selected" in generic remote triggering the lemur to ask the sequencer which track you are on when you change track is all that is needed. Saves hours. Literally.


----------



## afterlight82 (Dec 29, 2015)

I did ask Steinberg about inserting a feature whereby a midi message can be sent on track select as part of the track quick controls, and received a fairly positive response...it'd be an immensely useful feature for a few other purposes.


----------



## Whatisvalis (Dec 29, 2015)

How would you select a particular track from Lemur then, if you don't specify a track and corresponding midi message? I should probably look into this again.


----------



## afterlight82 (Dec 29, 2015)

You make a generic remote that sends the _same_ midi message to lemur whenever any track is selected, then edit the lemur project to send the "recall" message it has anyhow in composer tools on receipt of that midi message. Essentially, when you select a track, it sends the same message to the lemur, which sends a message back to that track triggering the midi send you already set up on each track for each page (per Composer Tools manual). It's like an auto trigger of the "recall" button, rather than pressing it. If you select a track without the midi send set up, it doesn't switch as cubase doesn't "answer" the auto-recall.

The only snag is that if you open a midi part on a different track to the one. You are on to edit, and then play/record into that track, it won't switch (because it is on track select). Also you can't switch tracks whilst recording or it will write in the page switch midi message to that part, unless you filter your inputs somehow (maybe?). Minor stuff until (if) cubase add a feature...


----------



## afterlight82 (Dec 29, 2015)

Do back up composer tools before messing with the lemur project file, obviously...I had a few misses before I hit...


----------



## rgames (Dec 29, 2015)

afterlight82 said:


> It's like an auto trigger of the "recall" button, rather than pressing it.


Yep - that's how I coded it in my Lemur project (I'm not using the MIDI Kinetics product). Send a track change message from Cubase to Lemur, then Lemur requests the new keyswitch ID from Cubase, then Cubase sends the keyswitch ID back to Lemur via a combo of MIDI insert and send. It's a bit of back-and-forth but it works.

I think you can do that by adding one script to the MIDI Kinetics product (though I think afterlight82 directly modified one of the existing scripts). Mine has three scripts attached to the Synch button - one that waits for the track change message from the generic remote and two others that are, I think, basically what Composer Tools uses. You do need to think about the "on expression" settings to make sure the behavior is correct. In my project it's a total of only four lines of code for all three scripts. 

Another major difference in the way I coded it vs. what the MIDI Kinetics video shows is that I did the transform on the insert, not the send. Then, on the send, I deleted all MIDI data that was not the keyswitch ID. If you don't do that then you're sending a LOT of data back to the Lemur project that it doesn't need. Depending on the size of your template, that could bog the Lemur project down. Admittedly, I've not used Lemur enough to know if that's a practical concern. But it is cleaner to do it that way.

It's a really handy capability.

rgames


----------



## afterlight82 (Dec 29, 2015)

Edit - dumb question. Never mind!


----------



## afterlight82 (Dec 29, 2015)

I find the best thing is it actually reminds me what articulations are available when scrolling through tracks. It's the first way that key switching became palatable to me, particularly as you can then export much cleaner midi to Sibelius without dozens of "violin 1" tracks, for example, but with a friendly way of dealing with the switching.


----------



## rgames (Dec 29, 2015)

I used some monitors in Lemur to watch the return data and it appeared to send ALL data on the track. It transforms part of it per instruction but sends all the rest in unaltered form. In any one instance of transformer you can either delete or transform but not both. And there's only one slot on the send, so you can only do one or the other on the send. That's why I put the change on the insert and the delete on the send.

There's a thread on it between me and vic_france over at the Cubase forum.

Again, I don't know enough about Lemur to know if it's really a problem. But my experience to date includes a fair number of missed transmissions to/from Lemur so it sure seems like a good idea to me.


----------



## afterlight82 (Dec 29, 2015)

Just realized the same (I had actually deleted my question, which was kind of silly in retrospect!)
Incorporating that! Superb way of setting it up, much cleaner. I had a few lemur crashes on occasion so that might be it.


----------



## Whatisvalis (Dec 29, 2015)

Looks like i need to start from the beginning and check a few of the mentioned templates out.


----------



## dgburns (Dec 30, 2015)

rgames said:


> Yep - that's how I coded it in my Lemur project (I'm not using the MIDI Kinetics product). Send a track change message from Cubase to Lemur, then Lemur requests the new keyswitch ID from Cubase, then Cubase sends the keyswitch ID back to Lemur via a combo of MIDI insert and send. It's a bit of back-and-forth but it works.
> 
> rgames



Sure wish Cubase supported OSC messages natively.That way we could actually send out a message like this to lemur directly from cubase 

"select_keyswitch/specified_instr" ie "select_keyswitch/vsl/string/vln1"

and on lemur same message as the script name would suffice so

"on osc" as the condition (with same name as above)

selectinterface(x);selecttab(y);

where the osc message specifies the exact instrument in question and lemur selects the interface and tab,if needed to show our articts for that instrument,upon recieving the osc message.OSC messages are like folder locations,so very easy to organize and create to be specific if you have huge numbers of instr needed.Of course you can do this now using Osculator as a go between,so you could send out a simple midi note on message to osculator,which upon recieving,sends out the appropriate osc message to lemur.This is how I work at the moment,but of course we are limited to how many midi messages we can send out,given one port of 16 channels and 88 odd notes each.

Sure wish Cubase supported OSC messages.....


----------

