Primer On Building Layouts For Touchosc/Duplex

Initial apologies if there is already a post like this. I searched but could not find the info I was looking for.

I’m hoping someone can shoot me in the right direction in a concise way on how to begin building layouts for touchosc to be used in duplex.
I was able to use OSCulator and change the osc messages to midi, then map away to my hearts content, but I think duplex has greater possibilities…and I hate midi mapping.

So I have the touchosc editor and have made some layouts. Where I’m a little lost is how to have those osc messages coincide with the duplex messages.
I’ve gotten touchosc to work with duplex with the simple layout but I want more faders, encoders etc…

any help/tips is greatly appreciated.

Thanks so much!

I’m not a TouchOSC user, so maybe I’m wrong something though…

I think that you should make new layout XML file in Duplex as well as the TouchOSC Editor.
I temporary tried to make “TouchOSC_2.xml” here.

1539 TouchOSC_2.xml

So put this xml into the folder below:
Macintosh HD\Users\YourName\Library\Preferences\Renoise\V2.6.1\Scripts\Tools\com.renoise.Duplex.xrnx\Duplex\Controllers\TouchOSC

And open the “TouchOSC.lua” file on the same folder by using Renoise’s Scripting Editor,
and add (paste) this config code to the bottom of it.

  
--==============================================================================  
  
-- custom configurations for the TouchOSC  
  
--------------------------------------------------------------------------------  
  
duplex_configurations:insert {  
  
 -- configuration properties  
 name = "Mixer",  
 pinned = true,  
  
 -- device properties  
 device = {  
 class_name = "TouchOSC",  
 display_name = "TouchOSC",  
 device_prefix = nil,  
 device_address = "10.0.0.2",  
 device_port_in = "8001",  
 device_port_out = "8081",  
 control_map = "Controllers/TouchOSC/TouchOSC_2.xml",  
 thumbnail = "TouchOSC.bmp",  
 protocol = DEVICE_OSC_PROTOCOL,  
 },  
  
 applications = {  
 Mixer = {  
 mappings = {  
 levels = {  
 group_name = "1_Faders",  
 },  
 mute = {  
 group_name = "1_Buttons",  
 },  
 master = {  
 group_name = "1_Fader",  
 }  
 },  
 },  
 }  
}  
  
  

Then save the file and click Renoise’s menu: [Tools] >> [Reload all Tools]
After that, you can find new TouchOSC config in the Duplex’s device list.

But this is just a example, so you should do trial & error by editing these files manually.
Also please refer the Duplex manual well. :)

And about the question in your image above,
see the in the TouchOSC_2.xml.

cool, thank you!
I will test shortly.
cheers :)

It’s important to note that Duplex has a single limitation when it comes to OSC communication: OSC is capable of sending multiple messages at the same time, but Duplex currently only support single-value messages. In practice, this means that using the TouchOSC X/Y pad and accelerometers are limited to a single value. This is of course something that should be taken care of in an upcoming version

PS: Do you mind me asking what device you are targeting? From the screenshot, it looks like it could be an iPad, but of course I could be mistaken

yes! I got danoise in my topic…
you seem to be a legend around these parts. these forums rules.

Yes I am using an ipad, but may also use an ipod touch at some point.
Reading other posts I get that the x/y controller won’t work through duplex quite right yet, that fine. I don’t go crazy for x/y pads anyway (burnt out on the kaoss pad).

I want to be able to have a mixer screen (with like 8+ tracks)
some encoders for plugin parameters/sends
and some transport/loop controls
that’d be pretty dope.

so yeah I want to build a layout like that. its easy to do in touchosc, but connecting the messages is the hard part.
is there a doc that has all the assignable parameter code in duplex listed? I saw a few parameters in the duplex manual, but I would imagine it would be more configurable than that. I would think that everything midi-mappable would be duplex-able…lol

thanks so much in advance, love the community vibe here!

@alec: the only person I believe would deserve the “legend” moniker around here is Taktik. But thanks anyway

I guess you’re lucky then, because Duplex has these things covered pretty good. You could run easily build a setup which could run the Mixer, Effects and Transport apps next to each other. Check out how they’re put to use with other controllers, then bring out a piece of paper maybe and sketch what you want, and finally build the TouchOSC layout. Unfortunately, you also need to do the same for Duplex (provide a control-map) but you can “cheat” as you don’t have to make it look exactly like TouchOSC - unless you really want to.

The most important thing to understand is how the messages are received, and what mappings you can use. The PDF manual pretty much has the message part covered, but you might still need to get your hands dirty and open the actual application files to learn what mappings are available. For example, the code listed by satobox is for the configuring the Mixer application, but he only listed the three most common mappings - there is in fact a total of 7 different mappings.

As for “Duplex makes all mappings in Renoise available” - no, this is not how it works. Renoise has one-to-one mappings, Duplex has applications which are as complex as we would like them to be. However, you can combine Duplex and Renoise OSC mappings in a single TouchOSC interface if you want - the Mixer/Effect/Transport combination might have you covered to begin with, but eventually you might want to add functionality that isn’t covered by the Duplex applications (this is another topic that involves GlobalOSCActions, but I just thought that I’d mention it).

@danoise thanks!

so I’d have to edit the touchosc.lua to add more mixer tracks etc?

I think I’m still just a little confused between the files. In the applications folder there is a mixer.lua file. That is what the touchosc.lua file is referencing in order to make the visual mixer in duplex, right?

I’m starting to get it thanks for your help. I’ll dig in.

a quick explanation on how the files are connected would be awesome though!!

cheers :)

@alec: hopefully this clarifies things a bit:

Super quick introduction to how applications, devices and control-maps are connected

To begin with, you have the applications. For example, Mixer.lua is an application (you can easily tell, as it’s placed in the Duplex/Applications folder). The application has a number of public properties, some you can change in real-time via the UI (options), and some you still need to edit manually in a text-editor (mappings). The Duplex Mixer application is fundamentally different from having MIDI-mapped each track level in Renoise to a slider, as communication in Duplex is both bi-directional (changing stuff in Renoise updates the controller) and you can “scroll” through tracks (mappings are dynamic).

Then, you have the TouchOSC.lua file - this is the device class + configurations. The first part of a device file may consist of code - technical stuff you don’t really have to mess with (they specify how the device should be updated). Underneath this part, each of the configurations are specified (look for “duplex_configurations”). This is where the mappings are specified (as well as a multitude of other default settings which can be overridden using the “settings” dialog). The mappings themselves are simple - not actual code, but rather a lua table you can edit using any text editor. Check out how the various devices have assigned their mappings…

Finally, you have the control-map which describe your device (in your case, a particular TouchOSC layout)*. Any mappings that we just specified in the device configuration should point to a group name that is present in the control-map. For the Mixer application, you might have a number of sliders located in a control-map group called “Levels”. If the name of the group is then specified in the device configuration (like satobox’ example) you have just assigned all the sliders automatically**.

  • I’m sure building a control-map for each TouchOSC layout could be avoided if someone clever wrote an automatic TouchOSC template -> Duplex control-map converter.
    ** Note that you basically have two types of mappings: “normal” and “greedy” mappings. Check out the Duplex manual for more info about this…

word!
building a layout in duples, then will duplicate it in touchosc.
programming is so much fun! this is my first time getting my feet wet.
thanks for the help, I’m sure I’ll be back with more questions.