select some data contained within a UDP packet received on MAX

Luca Apolito's icon

I received these packages in them contain data of various kinds from the sensors and separated by semicolons, I would just take some information from these data, there is a way to select which characters or otherwise take what information and discard the rest?
the format of the received packet is done this way:
DeviceID;ActorName;BoneName;QuaternionW;QuaternionX;QuaternionY;QuaternionZ;AccX;AccY;AccZ;GyroX;GyroY;GyroZ;MagnX;MagnY;MagnZ
Many thanks in advance for your help

Rick's icon

You could use [regexp ; @substitute " "] to remove the semicolons and then use zl.nth or zl.lookup to select the info you want to process.

Luca Apolito's icon

Thanks a lot of rapid response . I have read the help of the command regexp but being still impractical program I need a hand . These packages udp I receive are streaming ( I get one per second ) and have that size that I posted . Someone I can give an example of pacth ? Thanks a lot of patience . For now I used the command MXJ net.udp.recv to get packages udp ... then ? What do I send the output of the object ?

Luca Apolito's icon

Here it is. Thank you.

Luca Apolito's icon

sorry

Cattura-di-schermata-14.png
png
Rick's icon
Max Patch
Copy patch and select New From Clipboard in Max.
Luca Apolito's icon

Where i have to copy this text in max? I use max 6.1. Thanks

Luca Apolito's icon

Ok I did it ! I am viewing the patch and everything works perfectly ! Thank you very much. There is only a small detail . The output is an object " message " . I I need a real-time format because UDP packets arrive in time ... there is a way ? Now if I choose ACC as a field in the message shows me the actual value ... Thanks again

Luca Apolito's icon

I solved this too ! ( I think I'm getting good ) ... How LAST request wanted to know if there was a way to select ACC in individual fields as ACCX ; ACCY ; ACCZ and not all together as happens now ... thanks a lot

Rick's icon
Max Patch
Copy patch and select New From Clipboard in Max.
Luca Apolito's icon

Ok the real time is correct . Now I need is to be able to separate the field ACCX and ACCY and ACCZ ... I wish it were possible to read the 3 values ​​separately .
Thank you very much

Luca Apolito's icon

I wish that a zl.mth just give me the value acc x and another zl.mth give me instead acc y so it can be processed separately

Rick's icon

[regexp - @substitute " "]

Luca Apolito's icon

I wish that a zl.mth just give me the value acc x and another zl.mth give me instead acc y in two different text boxes so it can be processed separately

Cattura-di-schermata-15.png
png
Luca Apolito's icon

The value in the box of the message is the union of the three axes of acceleration. I would like to read them separately . Everyone in an object ( such as "send x " or "send AccX " ) because I have to use this data in another patch

Cattura-di-schermata-151.png
png
Rick's icon
Max Patch
Copy patch and select New From Clipboard in Max.
Luca Apolito's icon

eii RICK everything works perfectly now !!
I want to thank you with all my heart for helping me with this problem, you saved me.
If I need more help with MAX will not hesitate to contact you, you were great!
thank you very much
@RICK

Luca Apolito's icon

hello guys
I have a patch that receives UDP packets through the object RECEIVE UDP but she receives packets too slowly for the application for which I need. And 'possible to set the speed of receiving the packages of MAX? Or as this object uses Java is possible that he has a setting that I should change?

Thanks in advance for your help !!
regards Luca
@RICK

Luca Apolito's icon

i use the object MJX.UDP.RECV