OpenSoundControl (OSC) in Rev?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
OpenSoundControl (OSC) in Rev?
Hi,
Is there a way to create a server application in revolution that will handle network packets that come in on a certain port?
For example, if one wants to create an application that responds to OSC messages?
http://opensoundcontrol.org/
see also http://www.audiomulch.com/~rossb/code/oscpack/
Thanks,
B
Is there a way to create a server application in revolution that will handle network packets that come in on a certain port?
For example, if one wants to create an application that responds to OSC messages?
http://opensoundcontrol.org/
see also http://www.audiomulch.com/~rossb/code/oscpack/
Thanks,
B
Re: OpenSoundControl (OSC) in Rev?
Hello B,
I don't know anything about OBC, but RunRev can communicate through sockets. Just read the manual. You can also search the dictionary for "socket".
Best regards,
Mark
I don't know anything about OBC, but RunRev can communicate through sockets. Just read the manual. You can also search the dictionary for "socket".
Best regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: OpenSoundControl (OSC) in Rev?
I would also like to know if there is a library or something for easy OSC (open sound control ) messaging in LiveCode.
If not does anyone have experience doing this via the socket support?
If not does anyone have experience doing this via the socket support?
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: OpenSoundControl (OSC) in Rev?
I did an OSC library some years ago. I'll see if I can dig it up for you.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
Re: OpenSoundControl (OSC) in Rev?
That would be awesome.. OSC is the primary reason I want to work in LiveCode..
I really want to use live code to create custom UI's for my OSC enabled visual performance packages.
I really want to use live code to create custom UI's for my OSC enabled visual performance packages.
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: OpenSoundControl (OSC) in Rev?
Whew-
Took a while to dig this up, and it's dated 2008, so the code may not be pretty, but maybe it'll give you something to start with.
This is a substack for a controller I wrote for a general-purpose I/O board that's no longer being made.
Some of it will be very specific to the MakeBoard: toggling the I/O controls, reading the DACs, etc, but the basic OSC drivers should work fine.
Strip out what you don't need and add what you do.
It works (or at least worked in 2008) on Windows and OSX. No linux support because I never built the usb handlers (linux versions of ioreg, etc).
Good luck.
Took a while to dig this up, and it's dated 2008, so the code may not be pretty, but maybe it'll give you something to start with.
This is a substack for a controller I wrote for a general-purpose I/O board that's no longer being made.
Some of it will be very specific to the MakeBoard: toggling the I/O controls, reading the DACs, etc, but the basic OSC drivers should work fine.
Strip out what you don't need and add what you do.
It works (or at least worked in 2008) on Windows and OSX. No linux support because I never built the usb handlers (linux versions of ioreg, etc).
Good luck.
- Attachments
-
- libOSC.zip
- LiveCode library to use OSC
- (28.57 KiB) Downloaded 518 times
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
Re: OpenSoundControl (OSC) in Rev?
This is great.. thank-you!
I think it might take me sometime before I have the know how to use this, but now I am motivated
I think it might take me sometime before I have the know how to use this, but now I am motivated
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: OpenSoundControl (OSC) in Rev?
Cool. Lemme know if you have problems. Looking it over, there's a lot I could have stripped out that's specific to the MakeBoard, but the basic protocols should work and you can build out from there.
Have fun.
Have fun.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
Re: OpenSoundControl (OSC) in Rev?
Just curious how livecode would send OSC commands. I'm looking to bridge livecode and casparCG client using OSC commands which casparCG client can receive. Id assume i need to open socket to the localhost:port number then would i just write to that socket? apparently the command thats supposed to be sent to casparCG is "/control/layername/play 1"
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: OpenSoundControl (OSC) in Rev?
Yeah, either a socket or a serial port. I provided for both approaches in the library.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
Re: OpenSoundControl (OSC) in Rev?
the library looks really good. im trying to communicate with another software. currently im using PD to send the osc messages but would like to bypass that and go direct from livecode. this is my setup in PD. Still trying to figure out exactly how i use the library to reproduce this.
im guessing its not as easy as thisCode: Select all
on mouseUp
OSC.Open
OSC.Send "/control/mark1/play 1"
OSC.Close
end mouseUp
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: OpenSoundControl (OSC) in Rev?
That's pretty close. Here's what I do (after adding the "libOSC" stack as a substack and making any appropriate changes to the constants that define the environment)
In the card script:
and then in a button script you'll want something like
In the card script:
Code: Select all
on openStack
insert the script of stack "libOSC" into back
-- now the handlers in the stack script are available to all scripts
OSC.SetUDPMode true
OSC.Open
end openStack
on closeStack
OSC.Close
remove the script of stack "libOSC" from back
end closeStack
Code: Select all
on mouseUp
OSC.Send "/control/mark1/play 1"
end mouseUp
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
Re: OpenSoundControl (OSC) in Rev?
wow, it works. perfect
if the only commands im going to be using are those listed there with the message sent changed would i need all of those items in the library our could i start going through it and slimming it down. Im unsure if having all of those lines of code there would slow down the program
if the only commands im going to be using are those listed there with the message sent changed would i need all of those items in the library our could i start going through it and slimming it down. Im unsure if having all of those lines of code there would slow down the program
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: OpenSoundControl (OSC) in Rev?
Yay!
You could trim things down if you choose, but the script gets compiled down to a pretty compact intermediate code by the engine when it's loaded, so that long names and comments and unused code, etc, don't slow things down.
You could trim things down if you choose, but the script gets compiled down to a pretty compact intermediate code by the engine when it's loaded, so that long names and comments and unused code, etc, don't slow things down.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
Re: OpenSoundControl (OSC) in Rev?
cool. Thanks. for a 6 year old code its still pretty useful