OSC Receiver and Sender

A place for developers to share ideas and assist each other in solving problems.

Moderators: valis, garyb

DragonSF
Posts: 405
Joined: Sun Nov 08, 2015 4:28 pm

Re: OSC Receiver

Post by DragonSF »

w_ellis wrote: Wed Dec 20, 2017 1:36 pm P.S. 16 parameters is just while we test it out. Once we have things up and running, e.g. with naming the addresses and having a prefix per instance, either we can make bigger versions, or just have multiple modules running together.
My suggestion: only the first instance will be the OSC receiver. All other will get trheir data from the 1st. As all the instance pointers are stored in a static array, there shouldn't be a problem. Data is pushed from instance 1 to the appropiate instance (i.e. event on device 1-16 goes to 1st instance, 17-32 to 2nd and so on). SO you can have as many events as you like, but you don't need one monster module.
User avatar
faxinadu
Posts: 1602
Joined: Wed Nov 01, 2006 3:12 am
Location: israel
Contact:

Re: OSC Receiver

Post by faxinadu »

thats a good idea clause,i second that, good setup.
Scope, Android, Web, PC Plugins and Sounds:
http://www.oceanswift.net
Music
https://faxinadu.bandcamp.com/
w_ellis
Posts: 554
Joined: Wed Nov 07, 2001 4:00 pm
Location: London, U.K.

Re: OSC Receiver

Post by w_ellis »

Yup, I've been thinking that through and it'll be pretty easy. I was thinking that the OSCReceiver module would have a "First Parameter Num" input and you set that to a number, so the first module would have 1 (parameters 1->16), second would be 17 (parameters 17->32) etc.

I was also thinking about a standard OSC address format that we could use that avoids strings*. Something like /<device_instance>/<device_uid>/<param_group>/<param_num>, where device_instance is unique per device loaded by user (at least for a given device), device_uid would be an identifier for the device that's unique on the platform. param_group could mean that we actually always refer to parameters as 1->16 and use the group to reference multiple receivers? The First Parameter Num mentioned above would then become Parameter Groups instead.

* DragonSF - I'd love to know if you had good experiences with passing strings into DLLs, as my memory is of them creating instability.
DragonSF
Posts: 405
Joined: Sun Nov 08, 2015 4:28 pm

Re: OSC Receiver

Post by DragonSF »

For good reasons, I avoided strings as parameters so far. If possible, stay away from that.
User avatar
faxinadu
Posts: 1602
Joined: Wed Nov 01, 2006 3:12 am
Location: israel
Contact:

Re: OSC Receiver

Post by faxinadu »

i would send all the incoming osc data direct to the master module in scope just with /x y like you have it now, so it is the easiest integration in just getting the signal into scope. do the splitting once the osc info has reached scope.
Scope, Android, Web, PC Plugins and Sounds:
http://www.oceanswift.net
Music
https://faxinadu.bandcamp.com/
User avatar
faxinadu
Posts: 1602
Joined: Wed Nov 01, 2006 3:12 am
Location: israel
Contact:

Re: OSC Receiver

Post by faxinadu »

or... if your module can have a parameter on each pad that states what incoming /x osc message that pad is listening to then that's it - in this case even 16 pads would be enough since each opened module in sdk can be configured to be unique. this would be imo the simplest, cleanest and most logical implementation.
I was also thinking about a standard OSC address format that we could use that avoids strings*. Something like /<device_instance>/<device_uid>/<param_group>/<param_num>, where device_instance is unique per device loaded by user (at least for a given device), device_uid would be an identifier for the device that's unique on the platform. param_group could mean that we actually always refer to parameters as 1->16 and use the group to reference multiple receivers? The First Parameter Num mentioned above would then become Parameter Groups instead.
imo this is way way over the top, keep it as simple and as functional as possible.
Scope, Android, Web, PC Plugins and Sounds:
http://www.oceanswift.net
Music
https://faxinadu.bandcamp.com/
w_ellis
Posts: 554
Joined: Wed Nov 07, 2001 4:00 pm
Location: London, U.K.

Re: OSC Receiver

Post by w_ellis »

It's important that you think of* each OSCReceiver module running in Scope, across any devices, receiving all messages and needing to decide which ones it is interested in. We'll need to tell it what to listen for. If we just use the /xx syntax, it will be impossible to disambiguate between loaded instances of one device or even between different devices.

Of the suggestion I gave above, we could simplify by losing the param_group, but for very complex devices (e.g. mixers), you could end up with very high numbers for parameters.

* From an implementation-perspective it doesn't actually work like that, as only one thing listens to all messages, on behalf of all of the module instances.
User avatar
faxinadu
Posts: 1602
Joined: Wed Nov 01, 2006 3:12 am
Location: israel
Contact:

Re: OSC Receiver

Post by faxinadu »

maybe i missed something, can't you make the message a variable?
Scope, Android, Web, PC Plugins and Sounds:
http://www.oceanswift.net
Music
https://faxinadu.bandcamp.com/
User avatar
faxinadu
Posts: 1602
Joined: Wed Nov 01, 2006 3:12 am
Location: israel
Contact:

Re: OSC Receiver

Post by faxinadu »

each slot from 16 has a value pad and a message to listen to pad
Scope, Android, Web, PC Plugins and Sounds:
http://www.oceanswift.net
Music
https://faxinadu.bandcamp.com/
w_ellis
Posts: 554
Joined: Wed Nov 07, 2001 4:00 pm
Location: London, U.K.

Re: OSC Receiver

Post by w_ellis »

P.S. device_instance would need to be unique per loaded instance of a device, would probably need to be user-editable and would need to be stored in project configuration.

device_uid would be a value stored in a device and published so people could avoid using the same value. We could even agree a range of device_uids for each developer, so this wouldn't need to be negotiated very often.
w_ellis
Posts: 554
Joined: Wed Nov 07, 2001 4:00 pm
Location: London, U.K.

Re: OSC Receiver

Post by w_ellis »

faxinadu wrote: Thu Dec 21, 2017 4:41 am maybe i missed something, can't you make the message a variable?
We could definitely do that, but it significantly increases the patching effort inside the SDK and I'm not sure I see what value it adds (assuming we're not using human-readable strings - see DragonSF's comment above). I can imagine it becoming a nightmare to debug if a given parameter osc address was set wrong.
User avatar
faxinadu
Posts: 1602
Joined: Wed Nov 01, 2006 3:12 am
Location: israel
Contact:

Re: OSC Receiver

Post by faxinadu »

it adds value in the sense that i can just open the sdk module, lets say for ocean storm i would just assign the slots to listen to /storm1 to /storm16 and thats it. open another synth assign it whatever...

edit: ahhh ok i think i catch your drift... you don't wanna use strings in the message names thats the thing?
edit: ahhhhhhhhhh ok and yeah didn't take multiple instances into account hmmm.
Scope, Android, Web, PC Plugins and Sounds:
http://www.oceanswift.net
Music
https://faxinadu.bandcamp.com/
User avatar
faxinadu
Posts: 1602
Joined: Wed Nov 01, 2006 3:12 am
Location: israel
Contact:

Re: OSC Receiver

Post by faxinadu »

will thought more about it, your way is probably the best option. i kinda dislike the idea of really long message addresses but i can't think of anything better than your proposal.

i restarted from scratch on my little app. better code. now i have text fields on the front panel for ip and port, works :)
Scope, Android, Web, PC Plugins and Sounds:
http://www.oceanswift.net
Music
https://faxinadu.bandcamp.com/
User avatar
faxinadu
Posts: 1602
Joined: Wed Nov 01, 2006 3:12 am
Location: israel
Contact:

Re: OSC Receiver

Post by faxinadu »

will can u please send me that module you mentioned that lets you see the array update in realtime? would make testing faster
Scope, Android, Web, PC Plugins and Sounds:
http://www.oceanswift.net
Music
https://faxinadu.bandcamp.com/
w_ellis
Posts: 554
Joined: Wed Nov 07, 2001 4:00 pm
Location: London, U.K.

Re: OSC Receiver

Post by w_ellis »

The version I uploaded yesterday doesn't use arrays anymore. Are you using that yet?

With the previous version, I was using the Pipe module from BC Modular and hooking it up to a Range Text, which seemed to work well.
w_ellis
Posts: 554
Joined: Wed Nov 07, 2001 4:00 pm
Location: London, U.K.

Re: OSC Receiver

Post by w_ellis »

faxinadu wrote: Thu Dec 21, 2017 6:51 am will thought more about it, your way is probably the best option. i kinda dislike the idea of really long message addresses but i can't think of anything better than your proposal.
I don't anticipate them being very long. An example would be /3/10010/3/5 - Third loaded instance of device 10010, parameter group 3, parameter 5. Not so different to MIDI - port/channel/cc
faxinadu wrote: Thu Dec 21, 2017 6:51 am i restarted from scratch on my little app. better code. now i have text fields on the front panel for ip and port, works :)
Awesome!
User avatar
faxinadu
Posts: 1602
Joined: Wed Nov 01, 2006 3:12 am
Location: israel
Contact:

Re: OSC Receiver

Post by faxinadu »

oh i didnt notice damn! grabbing now man ty! do you wanna test my app? i just added also the ability to set the message for the knob :)
oscccc.png
oscccc.png (8.38 KiB) Viewed 336119 times
Scope, Android, Web, PC Plugins and Sounds:
http://www.oceanswift.net
Music
https://faxinadu.bandcamp.com/
User avatar
faxinadu
Posts: 1602
Joined: Wed Nov 01, 2006 3:12 am
Location: israel
Contact:

Re: OSC Receiver

Post by faxinadu »

cool works amazing the one with pads <3 nice nice :D
Scope, Android, Web, PC Plugins and Sounds:
http://www.oceanswift.net
Music
https://faxinadu.bandcamp.com/
w_ellis
Posts: 554
Joined: Wed Nov 07, 2001 4:00 pm
Location: London, U.K.

Re: OSC Receiver

Post by w_ellis »

Any thoughts on my earlier question about where to store the OSC port number? I could easily create a dedicated preferences file for it, which might be safest. I think it's misleading to have it as an input to the module, as it can only be one value across all devices.
w_ellis
Posts: 554
Joined: Wed Nov 07, 2001 4:00 pm
Location: London, U.K.

Re: OSC Receiver

Post by w_ellis »

I'm assuming that most people won't need to change it...
Post Reply