How to get Skeleton data (XYZ) to fall within a range


#1

Hi,

I’m working with the Ballet in town here to do a generative music/movement piece. I am using Ni Mate to send OSC to ableton and have had some success with controller mode + using the triggers (which are a great idea btw) but it doesn’t have the flexibility I’m looking for. I’m now using a set of OSC max patches to translate the OSC data to midi data (erasermice OSC pack).
Hit a few problems as I’m totally new to OSC

  1. I’ve read the documentation for OSC tags that you allow but not sure how to implement them to force the range to fall within 0-1. I was expecting this to be the case by default but I seem to be getting negative values and values up to 2. Even if I change the scale at the bottom to .5 to change the scale globally I still get negative values

  2. How can I get my receiving input to only look at the {X} or {Y} value yet still send out all (XYZ) data? when I type Left_Hand {X} into the reciever it gets data but totally bezerk data that definitely isnt the X value.

  3. Where is a good place to read more about OSC? the OSC foundations webpage doesn’t have many noob friendly materials on learning about using OSC. Any good resources out there?

Also any ways to use this setup more simply or tools to connect NImate with ableton?

thanks
Peter


#2

how to implement them to force the range to fall within 0-1

We don’t have an inbuilt system for this. You can achieve this effect by measuring what type of values you’re getting at the extremes, then normalize the values. For example, if you’re mapping some hand’s y coordinate (height) to a controller, move the hand as high as possible and note the value, then as low as possible and write down that value as well. You can then normalize all values between these two into the range [0, 1] as follows:

  • Solve the range by calculating: max_point - min_point. If your max value is 5000 and min -1500, then the range is: 5000 - (-1500) = 6500
  • Scale values so the minimum point is at 0: /left_hand {y + 1500.0}
  • Map it between [0, 1]: /left_hand { (y + 1500.0) / 6500.0 }

Another way is to use the Controller Tracker which doesn’t map values between 0 and 1, but you can do something such as 0 and 100 and perhaps handle that in the receiving software.

How can I get my receiving input to only look at the {X} or {Y} value yet still send out all (XYZ) data?

I think this requires you to look into how the receiving software handles the arriving OSC messages. If you need to have some data in all fields but want it to be ignored, can you do something like: /left_hand {x} {y} {z*0}

Where is a good place to read more about OSC?

Apart from reading the formal specification I’m not sure if there’s much to read about it. If you don’t need to involve yourself with the details of the protocol’s implementation all your needed knowledge is essentially that there are addresses and values like NI mate is outputting them.


#3

Thanks so much for the detailed reply! I plugged in my data

MAX -.41
MIN .066


RANGE -0.476

this is exactly what I typed into the empty field

Left_Hand { (x - .066) / (-0.476)}

and got a totally bizarre result, however it did map me to a range of about 40-1000 which was interesting and I counted it as a semi success… this also shut off Y and Z data coming into ableton…
I realized that you probably meant the numbers not in OSC but in millimeters (or whatever I should be inputting - your examples like 6500 etc were very different than my numbers!). How do I view this data? Also, do you have a generic set of numbers I could use for this purpose for legs and arms?

As far as using the controller fields, this would probably be much easier as I am translating all these osc messages back into midi (0-127), however I also had trouble with the range here and kept running into problems when I adjusted the scale and also got bizarre outcomes. Any advice?

Thanks again for the super detailed reply, hope to get this figured out soon!

Peter


#4

Also as a test I did { (x + 1500) / 6500.0 } { (y + 1500) / 6500.0 } { (z + 1500) / 6500.0 } as I will have to map all 3 (or probably at least x+y) into a range but that seemed to stop all messages being sent on OSC on the left hand. Is there a way to do this --map to the same range (0,1) for XY and Z on the same hand/foot?


#5

this also shut off Y and Z data coming into ableton…

Change the field to include the other components by adding {y} {z} in it.

How do I view this data?

Earlier I used Blender to get an idea on what kind of values were outputted as you can simply see the 3D world coordinates for the joints as they arrive in Blender. These should probably be a way to print the outputted values in NI mate in the log window or something. I’ll add a future TODO for this, as well as the normalization.

How do I view this data? Also, do you have a generic set of numbers I could use for this purpose for legs and arms?

I don’t have any numbers to give as these values depend largely on the positioning of your sensor device and your relative position to it.

I also had trouble with the range here and kept running into problems when I adjusted the scale and also got bizarre outcomes. Any advice?

Which fields on the Controller Tracker are you using, and what kind of ranges do you have specified?

Is there a way to do this --map to the same range (0,1) for XY and Z on the same hand/foot?

Your modification should work, although the ranges are probably different for each axis. You could enable OSC logging on the log page and see if the values are in fact being outputted, but the received software ignores them (maybe they’re 0 due to the divisor being relatively large at 6500?)