tomara-x / quartz

visual programming and dsp playground
https://codeberg.org/tomara-x/quartz
Apache License 2.0
36 stars 2 forks source link

osc #156

Closed tomara-x closed 1 month ago

tomara-x commented 1 month ago

of the data types supported by osc, the csound opcodes only send/receive floats, vectors, or strings. i think that's doable here

study: https://github.com/funatsufumiya/bevy_mod_osc

what have you unleashed!

plan b:

one singular sensation, every little step she takes (bararararara) one thrilling combination, every move that she makes (papappa papappapa)

https://github.com/CNMAT/OpenSoundControl.org/blob/master/spec-1_0.md

tomara-x commented 1 month ago

3a0a33c fuck. doing it with async tasks kinda works but i notice a lag sometimes and it's driving me bananas. there's also the issue when listening on a port but then changing it, then it doesn't work. i might have to do it with threads?

found this: https://github.com/DrLuke/bevy_rosc which isn't updated, and i think it works in a funny way, need to dig more tho (it doesn't send? i think it also needs to hardcode the ip:port in the add_plugin call?)

tomara-x commented 1 month ago

scratch all that, bevy_mod_osc is epic! put it in thread mode and have an osc port op that sets the port in the resource (hopefully that works), and then any number of osc r {address} ops can receive from different addresses.. i think that's good enough. send should be much easier

tomara-x commented 1 month ago

hard coded port it is! fuck it!

edit: :sob:

tomara-x commented 1 month ago

753166e op string osc r {osc address} will receive vectors of floats sent over port 1729, the floats are written to this circle's array

edit: actually i don't think that's a vector (to osc) it's a bunch of floats? the types are f, ff, ...

tomara-x commented 1 month ago

7388b3a osc_s {osc address} sends to address, osc_ip and osc_port will set the host and port for the sender (default to 127.0.0.1:1729)

tomara-x commented 1 month ago

fuck! now running multiple instances is gonna panic

a) figure out a way to avoid this (talk to mod_osc dev)

you might wanna make a module for that and customize it a bit (cause i feel it's too big of a change for mod_osc) (or at least try this idea out) so an op sets a resource and spawns a thread (give it a channel so it can be terminated) so you can change port from process (and you only actually start the thread once the op is given input) and no conflict with other instances, and if there is, you just give it another input.. hope that makes sense tomorrow :p

see https://github.com/DrLuke/bevy_rosc

okay, non-blocking is cute stuff, but that will make it not work in realtime. happy with the init op tho, now just need to figure out the thread stuff :3 i wanna try this more

:green_circle:

tomara-x commented 1 month ago

i can't shake the thought of "why not receive (with a socket in non-blocking mode) on the audio thread?).. someone is rolling in their grave rn probably >:3c

tomara-x commented 1 month ago

needs cleaning 6def158

tomara-x commented 1 month ago

i think we're good a146be3

even better 96ce9ff

tomara-x commented 1 month ago

look at em go! communicating with each other :smiling_face_with_three_hearts:

https://github.com/tomara-x/quartz/assets/86204514/e67a1370-f6fa-4a82-a95e-954486b80d8e

tomara-x commented 1 month ago

aand sensors are a must

https://www.youtube.com/watch?v=MOicQRViGxE