Custom OSC input Values

"Where is Feature X? I need Feature X! How can you not have Feature X?"
Post Reply
User avatar
gradek
Hasn't felt like this about software in a long time
Posts: 238
Joined: Thu Oct 05, 2006 20:14

Custom OSC input Values

Post by gradek »

Dear Resolume,

I'd like to be able to change the input values/range instead of just the string. The main reason for this is because always using values from 0-1 can be very impractical with current OSC output software.

For example. The BPM slider goes from 2-300. Sending a value of 0 will get you 2bpm. Sending a value of 1 will result in 300bpm. However what if I want 108 bpm. This is where things get ugly since you need to send a very strange floating point value. Something like "0.36241610738255" Software like TouchOSC only allow for 3 decimale places. 0.362 is all that can be specified in the value range.

Another example is for X or Y Position of a layer or clip. I recently had to do this for a project that invovled palying pong wth peoples faces. We need a live video feed layer to move with the position of a ball using OSC coming from quartz composer.

Resolume allows for a very large range of position values. This is different on some computer perhaps depending on the graphics card. I have a range of -16384 to +16384 on my GTX670. That range is controlled by a value of 0-1 with the following string "/layer1/video/positionx/values"

So if I wanted to make a slider or control that would move a layer within a 640x480 comp I would have to use some crazy floating point values to get the range set. To figure out this range I had to calculate the range by using the following formula.

Output = (Input)/Range + 0.5

In our case the Range is (32,768) The difference between -16384 to +16384.
So the input values min/max we need for the X value to get  -320 to +320 is the following formula:

Xmin = (-320)/32768 + 0.5
Xmax = (+320)/32768 + 0.5

Do the math and you get these answers.

Xmin = 0.490234375
Xmax = 0.509765625


Then the same logic would have to be applied to the Y values. It would be much easier if I could just set the range of the OSC input string to -16384 to +16384 instead of 0-1. That way if I send a value of 320, the layer would move 320 pixels instead of having to send a value of 0.509765625.

Currently the only easy solution is to use OSCulator to translate the input/output range of all OSC traffic. This is frustrating and adds a layer of complexity to all OSC mapping. I'd rather communicate direct with Resolume and drop the middleman. All it would take is a custom min/max value box below the input string.

-Martin


If you want to see how we played pong with people faces check out the project here:
http://www.martin-thoburn.com/news_and_ ... fool-moon/
Attachments
Alas, no input value control!
Alas, no input value control!
Screen Shot 2013-04-12 at 5.27.46 PM.png (17.49 KiB) Viewed 7725 times
Want to map LED rings with Resolume? Then look no further: https://goo.gl/f2dPGu

Joris
Doesn't Know Jack about VJ'ing or Software Development and Mostly Just Gets Coffee for Everyone
Posts: 5185
Joined: Fri May 22, 2009 11:38

Re: Custom OSC input Values

Post by Joris »

The beauty about OSC is that it's open, and everyone can implement it the way they see fit. The bad thing about OSC is that it's open, and everyone can implement it they way they see fit.

We chose to go with normalized 0...1 values, so that there is some form of structure. Once certain values are 0...1, but others are -1...1, and others are -16384...16384, you lose the overview really quickly.

You can however change the limits of a parameters by setting it to timeline in pause, and changing the in and out points.

User avatar
beatfix
Is taking Resolume on a second date
Posts: 44
Joined: Fri Jan 13, 2012 07:05
Location: Boston, MA

Re: Custom OSC input Values

Post by beatfix »

Not complaining, but I just wanted to mention that I ran into this exact same problem, trying to implement the ability to resize / move layers in my TouchOSC templates.

I will try OSCulator as a workaround - also thinking about looking at PD for a cross-platform solution...

- j

User avatar
subpixel
Hasn't felt like this about software in a long time
Posts: 152
Joined: Thu Jun 05, 2014 09:32
Location: Sydney, AU

Re: Custom OSC input Values

Post by subpixel »

Joris wrote:We chose to go with normalized 0...1 values, so that there is some form of structure. Once certain values are 0...1, but others are -1...1, and others are -16384...16384, you lose the overview really quickly.
It seems to me that values are likely stored as floats (not normalised), and the UI allows clicking and typing a direct number, so it makes sense to me to allow a direct number to be sent via OSC. Perhaps there can be a normalised and a separate direct-value interface so users (/device mappers) can choose.
Joris wrote:You can however change the limits of a parameters by setting it to timeline in pause, and changing the in and out points.
Does this mean the input values get clipped to fall within the range, or does it change the meaning of 0 to 1 as being exactly the in-out range?

Post Reply