Send OSC message back to TouchOSC

348 views
Skip to first unread message

Mark Schreuder

unread,
Jan 21, 2014, 7:54:42 AM1/21/14
to ligh...@googlegroups.com
Just started using LightJams and I'm scrambling to get ready for a live show in less than a week.  Without getting too long-winded, here's what I'm trying to do:
I will have multiple controls on my Android tablet (running Touch OSC) to activate various effects, patterns, etc on LightJams - no problem there.  What I would like to do is to have a "Blackout" button on TouchOSC to kill everything with one click and not have to turn off all the effects individually.  Obviously I can use the 'Master Intensity' fader on LightJams, but as soon as I bring the Master Intensity back up, all of the effects  are still being called for by TouchOSC.    

What I would ideally like to have is a 'Blackout' button on TouchOSC that would turn all of the other TouchOSC controls to off.  I thought I could do that within TouchOSC by some sort of scripting, but I have not been able to find any information on that.  

My next thought was to send the 'Blackout' signal to LightJams to activate a OSC "fixture" that would generate an OSC message back to the TouchOSC.  I have my OSC fixture sending out an OSC message that I can see in the outgoing OSC monitor and on the red blinky indicator up the upper right corner of TouchOSC - but I have been unable to figure out how to format the LightJams outgoing OSC message into something that TouchOSC can act upon.

I'm sure that this can be done somehow - I'm just running out of time to noodle this out on my own.   Any information, samples, web links, etc. would be GREATLY appreciated!

Mathieu

unread,
Jan 21, 2014, 5:51:00 PM1/21/14
to ligh...@googlegroups.com
Hi Mark,

I've added a custom OSC message output format in the new Lightjams version. You should see a "extra outs" button in the OSC output section. There you can specify the address you want. Then use the osc.send function to actually send your message with the parameters you need. Lightjams send float numbers.

Mark Schreuder

unread,
Jan 21, 2014, 9:23:51 PM1/21/14
to ligh...@googlegroups.com
Downloaded this latest version tonight (didn't find it automatically for whatever reason).  Didn't have time to play with it, but at first glance it looks like it should do what I need.  Thanks!    I'll post some video and technical details of my setup next week - may be of help to some other noobie.

Mathieu

unread,
Jan 21, 2014, 9:28:21 PM1/21/14
to ligh...@googlegroups.com
The latest version isn't a "mandatory update" so it needs to be downloaded manually. Have fun!

Mark Schreuder

unread,
Jan 26, 2014, 7:29:29 PM1/26/14
to ligh...@googlegroups.com
So I have been beating my head against this all day - and I'm ready to admit defeat and ask for help...   I guess I just don't understand the basic concept of the scripting.    I have all of my OSC inputs mapped and working flawlessly, but I can not for the life of me figure out how to use an OSC input from a "Blackou" button to reset faders and toggle switches on my TouchOSC screen back to zer0.  

So my understanding is that I put a source on a grid, and then in the activation/intensity of this source I tie the activation to the input value of "osc(49)".  What I don't understand is where I put the "osc.send(1,0)" command.   On the OSC configuration page, I have used the "Extra Outs" button to define Channel 1 as "/Main/GridPattern/1 0" with the intent to set the TouchOSC multi fader control called "GridPattern", fader #1 of 4 to a value of zero.

Any additional help would be greatly appreciated!

I

Mathieu

unread,
Jan 27, 2014, 9:14:41 AM1/27/14
to ligh...@googlegroups.com
Hi Mark,

You put the osc.send function in any source actually. It just needs to be somewhere. So create a new grid, add a source and put your formula there. What I think is missing from your formula is the activation logic. If you only use osc.send(1 ,0), it will only be sent once, since the value always stays at 0. You need something like osc.send(1, if(condition for activation, 1, 0)). In this case, when the condition is true, the value 1 is sent, otherwise 0. 

For example, if you're using the osc value 49 coming from TouchOSC meaning "blackout" and you want to send it back to TouchOSC, then your formula should be: osc.send(1, if(osc(49), 1, 0))

Note that the osc.send function sends exactly the values you specify (no scaling). 

Cheers,
Mathieu

Jack

unread,
Jan 29, 2014, 5:18:56 PM1/29/14
to ligh...@googlegroups.com
In TouchOSC when messages go out from the mobile, I see a flashing green square. Incoming messages give a red square. A bad sign.

And the slider that I want LJ to change on my mobile doesn't move. So, I'm not sure I'm adressing it right.  I'm doing "something" wrong. That's for sure.


I'm sending from LJ to the mobile using: osc.send(0, if(recall(0)!=0, recall(0), 0))    (if mem(0) changes value, I want to adjust the fader1 on the mobile)

On OSC Extra out channel 0, I have put : /lj/1/fader1  (I used this adress because the mapped incoming adress was: /1/fader1)

But it's not working. Is the outgoing adress wrong ?
Message has been deleted

Mathieu

unread,
Jan 30, 2014, 5:28:50 PM1/30/14
to ligh...@googlegroups.com
Hi Jack!

Try using the same output address as the input one. TouchOSC works like that. If it sends you something at /1/fader1, then if you want to change the fader 1, you need to send something to /1/fader1 also.

Little tip about your formula:

osc.send(0, if(recall(0)!=0, recall(0), 0))

is the same as

osc.send(0, recall(0))

Since when recall(0) is 0, you send 0 anyway

Cheers,
Mathieu.
Reply all
Reply to author
Forward
0 new messages