Custom OSC input Values
Posted: Fri Apr 12, 2013 22:27
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/
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/