/osc-ruby-ng

Open Sound Control Library for Ruby

Primary LanguageRubyMIT LicenseMIT

An OSC client for Ruby

opensoundcontrol.org

osc.justthebestparts.com

Original Description

This OSC gem originally created by Tadayoshi Funaba has been updated for ruby 1.9 compatibility. I’ve made a point to make this code as expressive as possible and provide a test suite for confident hacking. It also should be flexible enough to support most crazy ideas.

Compatible with ruby 1.9, 2.0 and jruby

Neurogami fork stuff

Added basic support for two more OSC types: T (True) and F (False)

Install

To install the Neurogami fork you should get the source from gitub and build it yourself, then install the gem locally

sudo gem i osc-ruby-ng

Or you can try this:

sudo gem i osc-ruby-ng --source http://gems.neurogami.com

for the EMServer, you will need EventMachine

sudo gem i eventmachine

Event Machine Basic example

# compatible with ruby 1.9, 2.0 and jruby
require 'osc-ruby-ng'
require 'osc-ruby/em_server'

@server = OSC::EMServer.new 3333 
@client = OSC::Client.new 'localhost', 3333 

@server.add_method '/greeting' do | message |
  puts "#{message.ip_address}:#{message.ip_port} -- #{message.address} -- #{message.to_a}"
end

Thread.new do
  @server.run
end

@client.send OSC::Message.new( "/greeting" , "hullo!" )

sleep 3

Credits

Originally created by…

Tadayoshi Funaba

www.funaba.org/en/

thx also to Toby Tripp, Brian McClain, Andreas Haller, and James Hughes