Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ossia-max] ossia.router bug with numbers as addresses #802

Open
navid opened this issue Oct 28, 2022 · 12 comments
Open

[ossia-max] ossia.router bug with numbers as addresses #802

navid opened this issue Oct 28, 2022 · 12 comments

Comments

@navid
Copy link
Collaborator

navid commented Oct 28, 2022

Funny behaviour happens when trying to route the following message: servos/y2/3 11.5

If i route servo/y2
then ossia.router returns:
"3" 11.5
whereas it should return:
3 11.5

however I can still route servos/y2/3
in which case the router behaves correctly and returns:
11.5

Screen Shot 2022-10-24 at 7 29 49 PM

@petervanhaaften petervanhaaften changed the title ossia.router bug with numbers as addresses [ossia-max] ossia.router bug with numbers as addresses Dec 13, 2022
@petervanhaaften
Copy link
Collaborator

i have tested and confirmed this bug on the Ossia "2022-1-25-38" build.
The issue appears to be, when a list is sent, the first value is routed as a symbol. With lists with more values than two, the first value still returns as a symbol, the following values still return as a list.
An examples patch based on Navid's screenshot is attached.

router-bug.maxpat.zip

@jcelerier
Copy link
Member

Capture d’écran 2023-01-10 à 13 57 50

is that the expected behaviour ?

@jcelerier
Copy link
Member

jcelerier commented Jan 10, 2023

hm there's still something that I don't understand: surely in servos/y2/3, "3" is supposed to be a symbol and not converted to a number, right? (the only way tomake it show up without the quotes in max).
I checked and j.oscrout definitely does the same:

joscroute

(and I don't see any other way to do it sanely: for instance imagine that you have an OSC address such as:

/audio/5.1/volume

that you want to route: if we convert it from floating point to string (or conversely) for instance it could end up as "5.100000000000001" or something like this due to the way FP works, so we really have to stay with symbols all the time

@jcelerier
Copy link
Member

(and even if Max displays "5" in the message box, the actual data we receive in the object is the string 5 so everything is fine)

@jcelerier
Copy link
Member

ossia-max-2023-01-10-15-55.zip

here's a test version @navid @petervanhaaften

@jcelerier
Copy link
Member

router.maxpat.zip

@jcelerier
Copy link
Member

@navid @petervanhaaften tell me when you have tested that I close the issue :)

@navid
Copy link
Collaborator Author

navid commented Jan 12, 2023 via email

@jcelerier
Copy link
Member

what about ossia.router staying like this to not break compat with existing patch, and introducing an ossia.oscrouter which would add the /

@navid
Copy link
Collaborator Author

navid commented Jan 13, 2023 via email

@jcelerier
Copy link
Member

ossia-max-2023-01-20-17-39.zip

latest version with the test patch:


----------begin_max5_patcher----------
1700.3oc0a0sTaqCD95vSgGeMMHsRxxtuJG5zwD7o0cH1Yhc5gNc569wVqMn
.DGUsRLjafYcLnuuc09qT98UqRuq8wptzjOm7OIqV86qVsx7nwGrZRdU51xG
27PYm40R2V00U9spzqwOq4v15lGp5MeH77CaOzO+T9zSqu27On8te7IY17eO
9d8+ZWEBhzzjuL8Q6J62785lu808Ua5wOMSkslccBmKF+khM9S.VyR9x3exe
t5pwebseLou5QypjdyufaDCqwZ07G8PcS0l1CM8ufj9vbleLWIJdEyEp.y7t
p8+rsaj+pDNHnYiyD9wzB.IWtd7WEhnXieIECnENC7j2Yl81JddDsv16p8jd
b+nWdAxKdV3cc8jId5JlyYgiIMU+2.Vdkc5Gqa61re.WUIiQi9KHJ7ZhpJNM
Qu9rdil3NxbCMQexf6Mdap51T5QbTdlUQqf2WCJQyoveyoNWXYN0wwb9bZji
Si5YFSomVUjpy4QxhrUEIMMKqL.VVI2P2hnXYe7FpFSOSNxYbXMnFnj.cOKV
qh.+T27HQ9w8M4O5JFD1chMq8sc+Z6csO7lLj6JCEE9VVmYiInwfrwIxCwcm
hbZbKp6MI66Ij9V4FVKJmGwltrZ83lGu4eaaSJnwVOMkBU9n0iqTl1sXEwls
IRfFQ4JZLkqiXkcOSTYBjSinflDQyydW3oHQnIxSZackEuK7b1MEnVeG3YU6
.1F1rmJONdpgvA0yLlpLSGyRlLlC6J.7yS+RPphO+rizBLp6U4BZ6UwXsEww
2jZ7UtmyCgmqLwchpc71T43HB3rnLUVvyx103HC3X6VeXmYG3YWWJswjx0p3
MXj1tt5x0ldn2GfYcADZgVUf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aTjiy1En55bZogEKBcpGlocJYL4SRgthYPRt6KqFtBY2WfS41VbP
DyJNzKLi+rDUrwBkKFZgmBB7BovGYHPnd95hndNHbzvLWEpfvxiB6JiaPXtH
T6PjGsmPF2cHlJ3NaqUEK6zka0+hsTHv1YafIeIrovChbBa1Rg.am0buXQdy
Cbd59uZIQEatTPMr3LS0pLq.o1RTwl6SXa4RimNe0oSFQnCelRt6kJuT8D3A
aUta2Oq12M8WaVyzsk+n0754WaDqaPQyksIce0Oqmee7Ik627859pM8G1Wge
+ZyvKgS511gEt4P8zZOv1gkzbtgMkaq51UhDyb7hW8mq9ebjkA9O
-----------end_max5_patcher-----------

@jcelerier
Copy link
Member

ossia-max-24-04-2023-ossia-router-optim.zip

with some optimizations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants