https://github.com/arirusso/micro-osc
A Ruby DSL for OSC
https://github.com/arirusso/micro-osc
Last synced: over 1 year ago
JSON representation
A Ruby DSL for OSC
- Host: GitHub
- URL: https://github.com/arirusso/micro-osc
- Owner: arirusso
- License: other
- Created: 2011-10-24T04:17:29.000Z (almost 15 years ago)
- Default Branch: master
- Last Pushed: 2012-03-25T22:42:16.000Z (over 14 years ago)
- Last Synced: 2024-04-24T00:39:22.403Z (over 2 years ago)
- Language: Ruby
- Homepage:
- Size: 106 KB
- Stars: 8
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.rdoc
- License: LICENSE
Awesome Lists containing this project
README
= MicroOSC
A Ruby DSL for OSC
== Features
* Works with MRI and JRuby
* Network resources are invisible to the user even when shared or multiplexed
* Includes shortcuts for common tasks associated with OSC such as translating numeric values from one range to another
* Network discoverable using {Zeroconf}[http://en.wikipedia.org/wiki/Zero_configuration_networking]
== Requirements
Ruby (MRI) 1.9.2+ or JRuby (in 1.9 mode)
{eventmachine}[http://github.com/eventmachine/eventmachine] (version 0.12.8 recommended for MRI)
{osc-access}[http://github.com/arirusso/osc-access]
{osc-ruby}[http://github.com/aberant/osc-ruby]
(These should install automatically with the gem)
For Zeroconf support, {dnssd}[http://github.com/tenderlove/dnssd] is required.
== Installation
gem install micro-osc
== Usage
The following are two MicroOSC programs; the first will receive OSC messages and the second will send one. Run them in two separate windows and they will talk to each other.
Here's the receiver...
require "osc"
OSC.using(:input_port => 8000) do
receive("/greeting") { |val| p "received #{val}" }
p "Ready to receive OSC messages on port(s) #{input_ports.join(', ')}..."
wait_for_input
end
When you run this, You should see confirmation that the program is running "Ready to receive OSC..." in your Ruby console.
Next, in another window run this next client program.
require "osc"
o = OSC.using(:output => { :host => "localhost", :port => 8000 })
o.out "/greeting", "hullo!"
After running it, flip back to the first receiver program and see "received hullo!", confirming that these two programs could reach each other.
Notice that I didn't use a Ruby block in the second program. There's no particular reason for that other than to demonstrate both styles
A single MicroOSC block can act as a client and receiver, both sending and receiving OSC ({see here...}[http://github.com/arirusso/micro-osc/blob/master/examples/duplex.rb])
These examples and more are available {here}[http://github.com/arirusso/micro-osc/tree/master/examples]
== Other Documentation
* {rdoc}[http://rubydoc.info/github/arirusso/micro-osc]
== License
Licensed under Apache 2.0, See the file LICENSE
Copyright © 2011-2012 Ari Russo