I’m using a Kinect chop and connecting it to a Select chop which passes through two channels into an OSCOut. I want to combine the two channels into a single channel in the form of an array. Is there a way I can achieve this without using scripting?
Thank you.
Edit:
Thanks to the replies below, I was able to create a version which works to my requirements. Using a Script CHOP and OSCOut DAT will help in sending out the array of values while retaining single channels. Both the OSCOut CHOP and DAT need to be set to the same port.
Try changing the data format on OSC Out CHOP to “Transpose”. That sends the first sample from every channel going into the OSC Out in a multi value OSC message.
I’m not sure if I have understood you incorrectly, but I can access the multiple channels from OSCOut. I wanted to modify them into a single channel using an existing operator and instead of sending across a float, send an array of floats.
I ended up using an external library (numpy) to get convert the values received from the channels into an array. I’m able to convert it into an array and it does result in the data I’m expecting to see but I’m not able to see the values being sent out. I have confirmed that the OSC connection is active, so it doesn’t seem to be the OSC’s issue. Is /array not the right channel that is being sent out?
Secondly, I would also like to retain the original channels and sent /array out through OSC, could you please point me in the direction I will have to proceed?
In regards to why your Script CHOP isn’t outputting data, it’s because you’re still missing the code to create CHOP channels ( appendChan) and then fill that channel with samples.
See examples for the Script CHOP in Help-> Operator Snippets
Hi, thank you for your response. As suggested, I used the appendChan() method to create a new channel and assign data to it. I’m still not able to transfer the data in the form I want to, while I’ve been able to create the array using array([val1, val2]), I’ve not been successful in copying it to the created channel.
Also see the Shuffle CHOP to convert channels to samples, easier&faster than using Python scripting. See examples in operator snippets
To confirm, do you suggest using Shuffle operator instead of the process I’m intending to follow?
(Also, thank you for directing me to operator snippets section.)
Wanted to give you an example of the Transpose technique. You’ll notice in the textport that the ‘args’ argument in the callback is literally an array of the 3 values. transposeOSC.tox (1.3 KB)
Thank you! I tried it out with UE and it works as expected. I do have an additional issue though, if I want to pass the transposed channels through the same port at as individual channels, along with the array value (xyz which is the array, channel 1/2/3 respectively), it seems I can’t. I can send them out through another port but that would require additional changes in my UE project which I’m hoping to avoid.
Edit: Cleaned up script section of the file. From the print statements, I see that the data is copied, however, the new channel that’s been created receives only the last index value? Is it receiving only a single sample?
Yeah if you want to send both transposed and non-transposed data, you probably just have to format it in Python and send using the OSC Out DAT sendOSC Python function.
All right, thank you. Would you know why the OSCOut chop is sending out only a single value/sample when an array has been copied to the appended channel?