UDP to triggers (Unreal)

 Okay, so UDP is working and I'm receiving a bunch of information on a string. What now?

So the objective here is to connect this variables as triggers and connect them to the Unreal set up we had made before but transform the binary values that come in, into triggers.

First things first, the incoming values are a string on a comma separated value array and I need to separate every character into only numbers. On Received Bytes (The event that registers when new info comes in) outputs byte values that so far I have only transformed into Strings, trying to process the bytes as themselves doesn't really work since the result are a bunch of byte values of different magnitudes that represent the message, but not the message itself, so first I transform the Bytes array into String and use the Split function to remove both square brackets.


Then I use the Parse Into Array function to separate the values through the ", " comma and space separation, leaving a string array with only the numbers. This allows me to use a For Each Loop to send the information into an int array, Additionally I also had to create an empty array with all possible inputs available to be filled when the UDP sends a new message.


Fantastic, so now we have a very useful array configuration that is constantly updated everytime there is a value change. Now I created a macro and made a small comparator that checks if the value in any particular position is 1. If it is it generates a trigger, if it isn't it doesn't. I made it into a macro to be able to access all touch sensors separately since each of them need to be able to trigger their own timeline. Paul made the recommendation of changing how uncomfortable some of the sensors where depending on where they are placed so leaving each timeline and sensor independent give us more flexibility.



What's left is connecting this Macro to each timeline which in turn is already connected to the MIDI message out system. 

To facilitate further changes I also created an additional Macro that contained that system so that the only incoming necessary information is the Discomfort level calculated by the timeline and the MIDI Out port that is created.


Here's a small video showcase of the whole system together being played by the UDP communication.


Comments

Popular Posts