OSC Receiver and Sender

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

Moderators: valis, garyb

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

Re: OSC Receiver

Post by DragonSF » Wed Dec 20, 2017 3:07 pm

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: 1384
Joined: Wed Nov 01, 2006 3:12 am
Location: israel
Contact:

Re: OSC Receiver

Post by faxinadu » Thu Dec 21, 2017 12:05 am

thats a good idea clause,i second that, good setup.
Scope 3rd Party Developer
http://www.oceanswift.net
Scope, Android and PC Developer
https://www.facebook.com/purechordsrecords/
Music
https://faxinadu.bandcamp.com/

w_ellis
Posts: 524
Joined: Wed Nov 07, 2001 4:00 pm
Location: London, U.K.

Re: OSC Receiver

Post by w_ellis » Thu Dec 21, 2017 1:53 am

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: 378
Joined: Sun Nov 08, 2015 4:28 pm

Re: OSC Receiver

Post by DragonSF » Thu Dec 21, 2017 3:20 am

For good reasons, I avoided strings as parameters so far. If possible, stay away from that.

User avatar
faxinadu
Posts: 1384
Joined: Wed Nov 01, 2006 3:12 am
Location: israel
Contact:

Re: OSC Receiver

Post by faxinadu » Thu Dec 21, 2017 4:19 am

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 3rd Party Developer
http://www.oceanswift.net
Scope, Android and PC Developer
https://www.facebook.com/purechordsrecords/
Music
https://faxinadu.bandcamp.com/

User avatar
faxinadu
Posts: 1384
Joined: Wed Nov 01, 2006 3:12 am
Location: israel
Contact:

Re: OSC Receiver

Post by faxinadu » Thu Dec 21, 2017 4:21 am

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 3rd Party Developer
http://www.oceanswift.net
Scope, Android and PC Developer
https://www.facebook.com/purechordsrecords/
Music
https://faxinadu.bandcamp.com/

w_ellis
Posts: 524
Joined: Wed Nov 07, 2001 4:00 pm
Location: London, U.K.

Re: OSC Receiver

Post by w_ellis » Thu Dec 21, 2017 4:39 am

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: 1384
Joined: Wed Nov 01, 2006 3:12 am
Location: israel
Contact:

Re: OSC Receiver

Post by faxinadu » Thu Dec 21, 2017 4:41 am

maybe i missed something, can't you make the message a variable?
Scope 3rd Party Developer
http://www.oceanswift.net
Scope, Android and PC Developer
https://www.facebook.com/purechordsrecords/
Music
https://faxinadu.bandcamp.com/

User avatar
faxinadu
Posts: 1384
Joined: Wed Nov 01, 2006 3:12 am
Location: israel
Contact:

Re: OSC Receiver

Post by faxinadu » Thu Dec 21, 2017 4:42 am

each slot from 16 has a value pad and a message to listen to pad
Scope 3rd Party Developer
http://www.oceanswift.net
Scope, Android and PC Developer
https://www.facebook.com/purechordsrecords/
Music
https://faxinadu.bandcamp.com/

w_ellis
Posts: 524
Joined: Wed Nov 07, 2001 4:00 pm
Location: London, U.K.

Re: OSC Receiver

Post by w_ellis » Thu Dec 21, 2017 4:43 am

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: 524
Joined: Wed Nov 07, 2001 4:00 pm
Location: London, U.K.

Re: OSC Receiver

Post by w_ellis » Thu Dec 21, 2017 4:44 am

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: 1384
Joined: Wed Nov 01, 2006 3:12 am
Location: israel
Contact:

Re: OSC Receiver

Post by faxinadu » Thu Dec 21, 2017 4:48 am

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 3rd Party Developer
http://www.oceanswift.net
Scope, Android and PC Developer
https://www.facebook.com/purechordsrecords/
Music
https://faxinadu.bandcamp.com/

User avatar
faxinadu
Posts: 1384
Joined: Wed Nov 01, 2006 3:12 am
Location: israel
Contact:

Re: OSC Receiver

Post by faxinadu » 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 restarted from scratch on my little app. better code. now i have text fields on the front panel for ip and port, works :)
Scope 3rd Party Developer
http://www.oceanswift.net
Scope, Android and PC Developer
https://www.facebook.com/purechordsrecords/
Music
https://faxinadu.bandcamp.com/

User avatar
faxinadu
Posts: 1384
Joined: Wed Nov 01, 2006 3:12 am
Location: israel
Contact:

Re: OSC Receiver

Post by faxinadu » Thu Dec 21, 2017 6:54 am

will can u please send me that module you mentioned that lets you see the array update in realtime? would make testing faster
Scope 3rd Party Developer
http://www.oceanswift.net
Scope, Android and PC Developer
https://www.facebook.com/purechordsrecords/
Music
https://faxinadu.bandcamp.com/

w_ellis
Posts: 524
Joined: Wed Nov 07, 2001 4:00 pm
Location: London, U.K.

Re: OSC Receiver

Post by w_ellis » Thu Dec 21, 2017 7:10 am

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: 524
Joined: Wed Nov 07, 2001 4:00 pm
Location: London, U.K.

Re: OSC Receiver

Post by w_ellis » Thu Dec 21, 2017 7:14 am

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: 1384
Joined: Wed Nov 01, 2006 3:12 am
Location: israel
Contact:

Re: OSC Receiver

Post by faxinadu » Thu Dec 21, 2017 7:14 am

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 1187 times
Scope 3rd Party Developer
http://www.oceanswift.net
Scope, Android and PC Developer
https://www.facebook.com/purechordsrecords/
Music
https://faxinadu.bandcamp.com/

User avatar
faxinadu
Posts: 1384
Joined: Wed Nov 01, 2006 3:12 am
Location: israel
Contact:

Re: OSC Receiver

Post by faxinadu » Thu Dec 21, 2017 7:26 am

cool works amazing the one with pads <3 nice nice :D
Scope 3rd Party Developer
http://www.oceanswift.net
Scope, Android and PC Developer
https://www.facebook.com/purechordsrecords/
Music
https://faxinadu.bandcamp.com/

w_ellis
Posts: 524
Joined: Wed Nov 07, 2001 4:00 pm
Location: London, U.K.

Re: OSC Receiver

Post by w_ellis » Thu Dec 21, 2017 7:37 am

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: 524
Joined: Wed Nov 07, 2001 4:00 pm
Location: London, U.K.

Re: OSC Receiver

Post by w_ellis » Thu Dec 21, 2017 7:37 am

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

Post Reply