# How to make Lemur layout change with track selection?



## AlexRuger (Oct 2, 2017)

I'm looking to revisit controlling soft-synths with Lemur. One thing I hated about it was that I'd have to switch between each template for each synth. I'd love it to look like this:

-Create instrument track.
-Load up, say, Arturia CS-80
-Lemur template changes to CS-80 controller.
-Nah, never mind, let's change the instrument to Massive (on the same track).
-Lemur changes to Massive controller.
-Select another synth track, say Arturia Mini Moog.
-Lemur changes to Mini Moog controller.

Anyone pull this off?


----------



## dgburns (Oct 2, 2017)

Remotely change lemur page/container by selectng a track in Cubase (even Logic )....yes.

But for what you're asking for, you'd need to be able to send out a midi message that is somehow tied to a vsti by it's own unique identifer. Set by you. 

beyond me.


----------



## pmcrockett (Oct 2, 2017)

I've not actually attempted it, but I think Reaper could do it. The API appears to let you address plugins by name (reaper.TrackFX_GetFXName and reaper.TrackFX_GetByName), which should allow you to define messages to Lemur based on what plugins are present on a track.


----------



## AlexRuger (Oct 2, 2017)

Hmm. I'm in Cubase so unfortunately whatever Reaper can do is irrelevant to me.

I've seen a Python script interact with DP before. Maybe it can do the same with Cubase, always run in the background and communicate between the two.


----------



## dgburns (Oct 3, 2017)

I'm wondering if a touchscreen is the better way.


----------



## AlexRuger (Oct 3, 2017)

Nah, I already use one but the CPU bundle. Most of these synths have GUI's that are too small to handle with a touch-screen.


----------



## dgburns (Oct 3, 2017)

see, there are a few hurdles with Lemur as far as my experiences go-

I seem to hit the limit with memory. For example, even though the memory indicator in the lemur editor shows more then half memory available, I've found that I can't add any more scripts at the top level. No idea why. Maybe my lemur scripting is inefficient, but to date I can't find a conditional script syntax that allows me to recieve many values and use one script for many input messages. Especially with OSC messages that tend to be unique by definition. 

I hate creating lemur synth controller pages. Why in hell isn't there some commercial version of many synths available as lemur controller templates?

I think there is a hole in the market for a kick ass ipad/tablet controller for many synths out there. One that had the gui of the synth emulated and the layout with touch control in mind. I wouldn't mind if I had to switch to the right page, but it would be nice if the faders/controllers would 'bang' to the new settings as we rolled through presets. So two way communication.

we can dream right?


----------



## dgburns (Oct 3, 2017)

AlexRuger said:


> Nah, I already use one but the CPU bundle. Most of these synths have GUI's that are too small to handle with a touch-screen.



just remembered this guy. he helped me out on some esoteric lemur programming. Maybe he can offer some insight. seem to recall he does bespoke programming- maybe he can help you out. He's quite inventive with his coding. And helpfull.

http://www.antonioblanca.com/


----------



## pmcrockett (Oct 3, 2017)

dgburns said:


> I seem to hit the limit with memory. For example, even though the memory indicator in the lemur editor shows more then half memory available, I've found that I can't add any more scripts at the top level. No idea why. Maybe my lemur scripting is inefficient, but to date I can't find a conditional script syntax that allows me to recieve many values and use one script for many input messages. Especially with OSC messages that tend to be unique by definition.


I've run into these problems as well, and I think your best bet -- assuming your DAW can be set up to output OSC messages in an appropriate way -- is to write your own basic communications protocol to handle incoming OSC messages. You'd have one OSC address in Lemur that handles routing info, one or more addresses that handle data, and one address that handles a terminating signal. For each OSC message to Lemur, you have the DAW first send a routing code to the routing address that tells Lemur how to use the incoming data, then send the data to the data address(es), then send a terminating signal to the terminating address that tells Lemur to go ahead and use the data it just received. On the Lemur end, the routing info would get stored in a variable when received, the data would get stored in the next available element of an array, and the terminating signal would cause a script to run that would check the routing info, execute the appropriate script using the data in the array as its argument, then clear the array. This gives you a general-purpose framework for receiving OSC messages at a single set of addresses, sending that data anywhere in Lemur that you want, and receiving as much data as you want before operating on the data.

(NB: I've not done a lot of OSC coding in Lemur, but the above is based on a system I put together in Lemur with MIDI sysex messages that works pretty well but is unfortunately Reaper-specific.)


----------



## Gerhard Westphalen (Oct 3, 2017)

I'd look into the control surfaces that Cubase has the profiles for and then find one that lets you control instrument parameters. From there you just need to see what messages it sends to identify plugin parameters and remap that to control your Lemur (using something like Max). The only challenge might be if that control surface uses a call and response to stay active in which case you'd need to program whatever your using to translate to send those messages back to Cubase. 

I did a similar thing for "hacking" my Faderport in order to use it in both its native mode and as a CC control and it worked well.


----------



## igbro (Oct 17, 2017)

In this video, they show how to send midi data on track change to lemur within Cubase. This is transformed in PCG to suit composer tools witch is a big lemur script. I just can't figure out from where comes this CC127 with no data on the track... maybe an automated Cubase thing. Never found such parameter...


----------



## MLP Aarts (Oct 3, 2018)

I use Osculator to check what osc messages Logic is sending out, by listening to port 8000, and redirecting these to Lemur (osc.udp://'your computer name'.local.:7000)

If you insert let's say Alchemy on an empty instrument track, Logic sends out the osc message:

/logic/track/instrument/name "Alchemy Stereo"

You could then you this info to change the control tab in Lemur, by having a script reacting to this OSC message.


----------



## Olfirf (Oct 3, 2018)

I can tell you how to set it up in Cubase, but there is unfortunately no elegant and easy solution for it ... more on that later.
First, you need to make Lemur aware of Cubase changing, selecting or record enabling a track. This means you build a generic remote in Cubase that sends a specific midi command once a track is selected to a specific midi port, which is received by Lemur. You have to take care that this port - at least the midi command - is unique, so that there is no unwanted triggering possible. So, e.g., this generic remote might send CC 0 with a value of zero, as there usually is no midi command for instruments on CC 0.
Now, lemur is aware that a new track has been selected. In Lemur, you now need this action to trigger another CC 0 being sent to the recorded instrument. This means, you need to merge your hardware midi inputs like Keyboard and controllers with this virtual midi port sending the CC 0. You can do that by including the right ports in „all inputs“ in Cubase and use that input option on each track. Now, every midi track will receive CC 0 0, once it is selected.
To inform Lemur, what the selected instrument is, you need to activate one of the midi send effects with a transformer and a dedicated midi port. This midi port is again a virtual one, just there for sending a specific information to Lemur. You could for example use the transformer to transform CC 0 0 to CC 0 1, which stands for Arturia CS 80. CC 0 2 would mean OT Berlin Strings, etc.
Now, what are the drawbacks:
1) You can use this method only for Midi tracks, as instrument tracks haven’t got a midi send.
2) You have to be careful not to use any triggering midi command, that is used on any of the VIs! It is not possible to filter out the CC 0 from the midi being sent to your VSTi.
3) You have to program the midi send and transformer every time, you create a new instrument. You may not disable the instrument track, cause midi send options do not get saved. For the same reason, track presets will not save it either.
4) Record enabling multiple tracks will mostly not lead to the wanted results.

It is somewhat cumbersome to get it to work and will certainly lead to frustrations in the beginning. Yet, in my template, every track for orchestral instruments is set up so that it generated unique labels keyswitches and controllers on my iPad and I can even read the current settings, as I made midi feedback possible. The only thing that bugs me, is how complicated and limiting it is to send some basic information out to another midi/OSC device, like ... ‚Sample modelling Trumpet 1‘ has just been selected. If that was a feature built into Cubase , which would be rather simple to program for them, this would be way more simple! Actually, some features of generic remote seem to be exactly that, but unfortunately, those are dead options and generic remote has not been touched by a Steinberg upgrade for many years ...
You can look at patchboard app, which makes it possible, but within the limitations of what it is made for and pretty pricy ... for now, I will stay with my homebrewn method.


----------



## Olfirf (Oct 3, 2018)

Reading your initial post again, you probably want Lemur to notice a change of VSTi on the instrument track you selected. That is impossible, as far as I know. What I wrote is more about setting up a template where Lemur changes its layout based on the track you selected. With the features of patchboard app it should be possible to make that happen based on changing the track name, though. But it is not going to inform Lemur, as patchboard app is a closed system.


----------



## Olfirf (Oct 3, 2018)

MLP Aarts said:


> I use Osculator to check what osc messages Logic is sending out, by listening to port 8000, and redirecting these to Lemur (osc.udp://'your computer name'.local.:7000)
> 
> If you insert let's say Alchemy on an empty instrument track, Logic sends out the osc message:
> 
> ...


I would love to have that kind of feature in Cubase as well! This would probably solve all the problems ...


----------



## Olfirf (Oct 3, 2018)

igbro said:


> I just can't figure out from where comes this CC127 with no data on the track... maybe an automated Cubase thing. Never found such parameter...



Cubase generic remote ...


----------



## stigc56 (Oct 3, 2018)

Take a look at this:
https://www.youtube.com/channel/UCCaIUVcF_bBKGlgdEV8R_eQ , especially 8 and 9
Mihkel Zilmer is a member here and very helpfull.


----------



## mrmiller (Oct 14, 2018)

Olfirf said:


> Reading your initial post again, you probably want Lemur to notice a change of VSTi on the instrument track you selected. That is impossible, as far as I know. What I wrote is more about setting up a template where Lemur changes its layout based on the track you selected. With the features of patchboard app it should be possible to make that happen based on changing the track name, though. But it is not going to inform Lemur, as patchboard app is a closed system.



Heya! Creator of Patchboard here. Yeah, you could definitely do it by naming the track something specific (and Patchboard can do fuzzy matching on the name so you could match all things like "CS-80*"). Patchboard could then pull up some generic controls you wrote for that synth.

While Patchboard is closed in the sense that it's not open source, it's core design goal is to interoperate with whatever tools you use in your setup. That's your DAW, your tablet, your keyboard, macro software, whatever. It's got a small OSC and command line API already, for integrating with tools like Keyboard Maestro. I've had a couple requests to relay Patchboard's updates about which track is selected, record armed, etc. via OSC. It's absolutely doable and a fairly small feature, but I haven't had the time yet or strong enough demand to prioritize it ahead of other features. And that way you'd be able to tie it into a custom Lemur setup as well. (Though my personal goal would be to make Patchboard itself feature-rich enough for the vast majority of users.)


----------

