I was finally able to get my data into TouchDesigner (Yay!)
Now, the issue I have been having is that I am trying to just extract the bpm value so I can focus on the live heartbeat data coming in. Does anyone have any advice, tips, suggestions on how I can just get the bpm value out of the whole row of data coming in? Please let me know, any help is greatly appreciated!!
Example of data coming in:
great to hear you were able to connect - can you post the solution to your previous question? Other’s will greatly benefit from that.
Regarding your question here. The MQTT Client DAT has a callbacks DAT attached where you can deal with the data as it is coming in. Specifically the onMessage callback is of interest.
First have a look here to see how you can retrieve values:
In your specific case it looks like you are being served a json which you would want to parse using python’s json module.
For a general introduction to TouchDesigner and Python, have a look at our curriculum, especially the section on “DATs: Scripting and Python”. It has a short Chapter on JSON parsing as well: