TouchOSC and Feedback

136 views
Skip to first unread message

im4...@gmail.com

unread,
Mar 27, 2021, 2:22:57 PM3/27/21
to Lightjams
Hi Guys,
       So far have been enjoying the functionality of lightjams. Need to control it through touchosc but with feedback now. I have different grids that sets different moods and am activating them with a source and using touchosc buttons to activate the grids which is working just fine. But, here is what I need to do and need some help:
  • Only one grid activated at a time. If grid 1 is activated and now need to activate grid 2, it will de-activate other active grid 2. I know this can be done with formula but need some help
  • TouchOSC does not know which grid is active so I need to provide feedback so that the use would know which grid active.
  • Currently using push button on touchosc to activate the grids
Thanks,
Regards
Jatin.

Mathieu

unread,
Mar 27, 2021, 7:43:07 PM3/27/21
to Lightjams
Hi,

>> Only one grid activated at a time. 

You can use the same principle as the sequencer like this: https://groups.google.com/g/lightjams/c/kgO_7qgDPyc/m/77wl-_SrAgAJ. Basically, one source activates one grid at a time and you move the source based on the trigger/input you want.

>> TouchOSC does not know which grid is active so I need to provide feedback so that the use would know which grid active.

Lightjams can send OSC the (almost) same way it sends DMX. It should be possible to put the logic in the sequencer grid and send the index of the currently activate grid via OSC to TouchOSC. 

Jatin V

unread,
Mar 31, 2021, 12:02:01 AM3/31/21
to ligh...@googlegroups.com

Thanks, Mathieu!

I understand the first part and seems like I can implement it. Will need to figure out the second part. Would it be the use of Osc.send command?

 

Regards,

-Jatin.

 

Sent from Mail for Windows 10

--
You received this message because you are subscribed to a topic in the Google Groups "Lightjams" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/lightjams/vFOHZxpzCkA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to lightjams+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lightjams/bebc4da9-6378-4760-943f-c695b70a0318n%40googlegroups.com.

 

Mathieu

unread,
Mar 31, 2021, 6:35:53 PM3/31/21
to Lightjams
Hi,

You can use the osc.send function (see some examples https://groups.google.com/u/1/g/lightjams/search?q=osc.send). Or depending on the messages expected by TouchOSC, you could also path a generic dimmer in the OSC universe and control this dimmer like a normal fixture.

Alex Sinclair

unread,
Feb 15, 2024, 5:36:20 PMFeb 15
to Lightjams
Hi Mathieu,
I'm still persisting with my slow learning journey - being teased by the vision of building what I imagine to be possible with this wonderful, powerful tool.

However, I'm struggling getting osc.send to work for me.
I've read many of the examples in your search query linked above and specifically been tryng to get 2 simple cases working with TouchOSC. These are:

I have a simple prototype for Hue/fx grid selection via TouchOSC momentary buttons.
I want the active grid to be reflected back to TouchOSC so the user can see what is active.
Simple right?

So in grid MasterHueGridSelect I: 
Move emitter in x with osc.latest(0,5)
This selects the relevant hue grid from osc0 to osc5

How to send state back to TouchOSC?
Tried
osc.send(0, if(grid.powerat(0,10), 1, 0))
but get feedback loop

So I tried
using osc.send(0, grid.onactivated)

but watching the OSC out messages in the monitor window , only the following message seems to be sent:
/1/button103 0 when the Red grid is activated
never 
/1/button103 1

I do see an impulse in the scope when I have the "osc.send(0, grid.onactivated)" emitter selected.



Secondly,
In the HazerControl grid:
I've tried a couple of approaches to send the state of the Hazer "state machine" to the TouchOSC controls, but I just don't see any changes on TouchOSC
I have independently checked the mapping to TouchOSC and I can turn buttons on and off with e.g. osc.send(57,1) and osc.send(57,0) respectively, but as you have explained elsewhere, these flood the OSC Out with an endless stream of the repeat messages.

Two failed approaches:

matching the powerlevel of the hazer control attribute using:
osc.send(59,if(grid.attributeValueAt(0,7)==0.00,1,0)) "/1/button111"
osc.send(57,if(grid.attributeValueAt(0,7)==0.05,1,0)) "/1/button110"
osc.send(58,if(grid.attributeValueAt(0,7)==0.15,1,0)) "/1/button109"


I also tried:
selectcondition(
grid.attributeValueAt(0,7)==0.05,osc.send(57,1),
grid.attributeValueAt(0,7)==0.15,osc.send(58,1),
grid.attributeValueAt(0,7)==0,osc.send(59,1))

Note: this emitter is null in the attached because I can only test one approach or the other, of course.


Attached is an extract of my project including the relevant grids, patch & OSC in/out mappings.

Any help getting me to the point where I can do a show using LightJams (and therefore buy it) would be much apprecated.
Thanks
Alex

TouchOSC_feedback_issue_help.ljp

Mathieu

unread,
Feb 16, 2024, 8:37:34 AMFeb 16
to Lightjams
Hi,

To send back to TouchOSC the index of the active fx grid, it looks like the formula would be:

osc.send(0, osc.latest(0,5))

You can also try to enable the feedback option in Lightjams by going in the view/Configuration and under OSC, there's a 'feedback' option. This will send back the received values to TouchOSC as a reception confirmation. 

Alex Sinclair

unread,
Feb 18, 2024, 2:15:33 PMFeb 18
to Lightjams
Hi Mattieu,
thank you for you answer.

I have attempted to implement your suggestions but am now very confused.

With regard your suggestion
"You can also try to enable the feedback option in Lightjams by going in the view/Configuration and under OSC, there's a 'feedback' option. This will send back the received values to TouchOSC as a reception confirmation. "

This simply echoes the received OSC back out the TouchOSC - as per your description elsewhere.
This is not the functionality I need since the buttons are momentary (by choice) their states are all sent back to touchOSC
e.g.
18:59:52.397 | SEND       | ENDPOINT(127.0.0.1:9001) ADDRESS(/1/button103) FLOAT(1)
18:59:52.398 | RECEIVE    | ENDPOINT([::ffff:127.0.0.1]:61637) ADDRESS(/1/button103) FLOAT(1)
18:59:52.531 | SEND       | ENDPOINT(127.0.0.1:9001) ADDRESS(/1/button103) FLOAT(0)
18:59:52.531 | RECEIVE    | ENDPOINT([::ffff:127.0.0.1]:61637) ADDRESS(/1/button103) FLOAT(0)
 

With regard to "osc.send(0, osc.latest(0,5))" this seems to send the channel value of the latest button pressed in the mapped range 0 to 5. LJ sends the value to TouchOSC  Ch0.
Do I understand correctly that: In order to send anything to OSC from LJ we must configure the "Extra Outs" channel to string mapping?
In the project file I posted, I had the following ExtraOuts mapped:

Ch to Address
0 to /1/button103
1 to /1/button104
2 to /1/button105
3 to /1/button106
4 to /1/button107
5 to /1/button108

As you can see from the capture in TouchOSC

19:06:32.080 | SEND       | ENDPOINT(127.0.0.1:9001) ADDRESS(/1/button103) FLOAT(1)
19:06:32.120 | RECEIVE    | ENDPOINT([::ffff:192.168.0.225]:58977) ADDRESS(/1/button103) FLOAT(0)
19:06:32.130 | SEND       | ENDPOINT(127.0.0.1:9001) ADDRESS(/1/button103) FLOAT(0)
19:06:32.233 | SEND       | ENDPOINT(127.0.0.1:9001) ADDRESS(/1/button106) FLOAT(0)
19:06:32.865 | SEND       | ENDPOINT(127.0.0.1:9001) ADDRESS(/1/button107) FLOAT(1)
19:06:32.869 | RECEIVE    | ENDPOINT([::ffff:192.168.0.225]:58977) ADDRESS(/1/button103) FLOAT(4)
19:06:32.881 | SEND       | ENDPOINT(127.0.0.1:9001) ADDRESS(/1/button103) FLOAT(1)
19:06:32.920 | RECEIVE    | ENDPOINT([::ffff:192.168.0.225]:58977) ADDRESS(/1/button103) FLOAT(0)
19:06:32.931 | SEND       | ENDPOINT(127.0.0.1:9001) ADDRESS(/1/button103) FLOAT(0)
19:06:33.015 | SEND       | ENDPOINT(127.0.0.1:9001) ADDRESS(/1/button107) FLOAT(0)
19:06:33.847 | SEND       | ENDPOINT(127.0.0.1:9001) ADDRESS(/1/button108) FLOAT(1)
19:06:33.869 | RECEIVE    | ENDPOINT([::ffff:192.168.0.225]:58977) ADDRESS(/1/button103) FLOAT(5)
19:06:33.880 | SEND       | ENDPOINT(127.0.0.1:9001) ADDRESS(/1/button103) FLOAT(1)
19:06:33.919 | RECEIVE    | ENDPOINT([::ffff:192.168.0.225]:58977) ADDRESS(/1/button103) FLOAT(0)
19:06:33.931 | SEND       | ENDPOINT(127.0.0.1:9001) ADDRESS(/1/button103) FLOAT(0)
19:06:34.065 | SEND       | ENDPOINT(127.0.0.1:9001) ADDRESS(/1/button108) FLOAT(0)

and the
 Lightjams Monitor Outgoing OSC Messages
 Lightjams Monitor Incoming OSC Messages

your proposed function sends the OSC latest received channel (number) to OSC channel /1/0 
This is the behaviour I expect from my understanding of the commandline reference:

osc.send(channel, value1, value2, value3...)

Send OSC values (max 16) to the specified extra output channel. Configure your extra output messages in the OSC config panel. This allows you to send float values to a custom OSC address.

channel: The extra output channel from 0 to 63.

values: Float numbers to be sent.


Screenshot 2024-02-18 190906.png

Alex Sinclair

unread,
Feb 18, 2024, 2:24:05 PMFeb 18
to Lightjams
I see 2 potential solutions to my requirement:
1) Use ExtraOuts mappings for every TouchOSC indicator/control I need to send status to
2) Write some script in TouchOSC to decode the received values at ch0 if I use osc.send(0,  osc.latest(0,5))

Solution 1 seems "clunky" and I'll run out of OutputChannelMappings after channel 63
Solution 2 seems more extensible, but I need to understand how to configure (script?) TouchOSC to decode the values.

Do you agree with these statements? (i.e. do I understand now?)

Many thanks for you help and patience,
Alex

Alex Sinclair

unread,
Feb 18, 2024, 3:45:34 PMFeb 18
to Lightjams
Hi Mathieu,
I'm trying one of your other suggestions 
placing an emitter in the newly activated Hue grid to trigger the Ch0 message when the grid is activated AND not keep spamming OSC with endless repeat messages.
osc.send(0, grid.onactivated) 

Unfortunately, only the zero value seems to get generated on this event.
The rest of the behaviour seems correct.
How do I amend the formula such that:
when grid.onactivated, osc.send sends "1" on Ch0?
  
See screenshot attached

Thanks
again
Screenshot 2024-02-18 203720.png

Mathieu

unread,
Feb 19, 2024, 8:55:02 AMFeb 19
to Lightjams
Hi,

To send the value of a grid activation back to TouchOSC for the /1/button103, /1/button104, etc see the new grid I've added to your project.

Basically, you can get the value of the attribute in a grid with the grid.attributevalueat function. This allows you to put this TouchOSC control grid anywhere without having to modify your existing grids. Then you send the activation value to TouchOSC with the osc.send function. I've used the shader mode to use only one source. 

The formula is osc.send(x, grid.attributevalueat(x,0)). X is the horizontal position. Without the shader mode, I could have used one source per attribute and used a formula like osc.send(0, grid.attributevalueat(0,0)) for the 1st one, osc.send(1, grid.attributevalueat(1,0)) for the 2nd one, etc. 

If you have more buttons, add the corresponding grid activation attribute at the bottom of the grid.

By the way, I've removed the source with the formula  osc.send(0, grid.onactivated). This formula sends a pulse (only one value at 100% and then 0%) when the grid has just been activated. This doesn't seem to be what you needed.

TouchOSC_feedback_issue_help-2.ljp

Bernardo Piranio

unread,
Feb 29, 2024, 11:31:33 AMFeb 29
to Lightjams
hello Mathieu I am also looking for this solution but I soon end up extra outs. You could increase them to 2 universes at least, and the same to OSC inputs. There are never enough OSC.

Mathieu

unread,
Feb 29, 2024, 12:50:19 PMFeb 29
to Lightjams
Hi,

Can you give more details about what is taking so many osc values? Maybe post your project file?

Reply all
Reply to author
Forward
0 new messages