Hi Friends,
I am streaming fov, pitch, yaw, roll, position and other parameters in the form of ascii strings, from the GoProVr Video Player. I am parsing the strings using a series of [route] which then get fed into [float2ascii] and [json-decode]. This works reasonably well until I run into situations where a string changes from let's say 2 characters to 3 or more. When this happens I need to use [unpack] for the max number of characters. The independent characters are combined to a single number using various [expr], while [spigot] and [switch] allow me to choose a different [expr] and number atom, based on the number of characters being generated.
The problem comes when I try to move on from one parameter (fov) to let's say (pitch), because I can no longer serialize using [route], as the values can not be known in advance. I wouldn't mind being able to truncate the pitch and yaw values, as well.
Here's an some example data using [bytes2any]:
print: "fov":90
print: "id":"ked"
print: "pitch":0.036522697657346725
print: "position":45600
print: "roll":0
print: "state":2
print: "url":"file:///Users/laptopolist/Desktop/UltraFlight.mp4"
print: "yaw":-0.09542924165725708
I've also included an abstraction that demonstrates what I'm doing.
fov-example.pd
Thanks, Matt