osc events in supercollider
supercollider uses osc to controll the synthisizers internally, but i wanted a supercollider synth to react to my osc events instead of having to send supercollider-osc events from my app
after some research in the help files i found out that OSCresponderNode does the trick.
the code example shows how to register for an osc event and trigger a synth. now i can use a supercollidersynt with my ruby osc sequencer
(
SynthDef( "guru2", { arg mfreq=40;
var env, amp;
env = Env.perc( 0, 0.2 );
amp = EnvGen.kr(env, 1, doneAction:2);
Out.ar([0,1], SinOsc.ar( mfreq.midicps ) * amp * 0.5);
}).send(s);
)
n = NetAddr("127.0.0.1", 57120)
o = OSCresponderNode(nil, '/melody', { |t, r, msg| Synth( "guru2", [\mfreq, msg[1]]); }).add;
o.remove
read more ...using the BlenderGameEngine as OSC client
i just managed to use the GameEngine of blender as a client for OSC events :-)
now i can change the color of a cube by sending osc events from my pd-patch or the ruby-script i wrote for my openframeworks-demo

the blend file can be downloaded here
the blend file needs OSC.py by Daniel W. Holth to be in the python searchpath, so either copy it to location you start blender form or copy it to your site-package folder (obviously i'm not the only one who had the idea of using this lib with the blender game engine :-] )
read more ...oscdispatch 0.1
I finished the first version of my OSCDispatch server in erlang.
The program defines a generic server and uses a callback function for the dispaching rules.
the oscdispatch.erl looks like this and uses a parameter in the module definition
-module(oscdispatch, [Dispatch]).
-export([start_server/0]).
-include("server_config.hrl").
start_server() ->
spawn( fun() -> server(?server_port) end ).
server(Port) ->
{ok, Socket} = gen_udp:open( Port, [binary] ),
io:format( "socked opened ~p~n ", [Socket]),
loop(Socket).
loop(Socket) ->
receive
{udp, Socket, Host, Port, Bin} ->
Adr = binary_to_list(util:getadr(Bin)),
io:format( "got: ~p~n", [{Host, Port, Adr}]),
Dispatch:dispatch( Adr, Bin ),
loop(Socket)
end.
read more ...Osc events in PD
i have written an pd-patch to controll the simple openframeworks osc demo i wrote ealier today.

the hardest part in using osc with pd was getting a pd-version that supports osc. the deb packages for pd-extended don't work on unbuntu 8.10.
so i had to compile my own package using this instructions
read more ...very simple OSC debug tool
when playing with OSC and i'm not quite sure what osc messages get send by an application i use a little python script which uses the simple OSC api
import osc
osc.init()
osc.listen( "127.0.0.1", 1234 )
in fact it misuses the library ;-)
every time a message is received that isn't bound by a callback function (which is all messages, since we dont bind anything here ), the listener prints a waring containing the address, the format and the value of the message
read more ...osc app using openframeworks
I have written a little demo app in openframeworks that shows how to react to osc events. Openframeworks uses ofxOsc as OSC library, which comes preinstalled in the FAT distribution.
the programm shows a square on a black background. the gray level of the square can be adjusted by sending osc messages to port 1234.
the following little ruby program sets the color to #808080
require 'osc'
msg = OSC::Message.new("/color", "i", 128 )
c = OSC::UDPSocket.new
c.send( msg, 0, "localhost", 1234 )
in the 'setup' method a osc receiver is initalized, and in the 'update' method, the messages are fetched from a queue and parsed.
I didn't generate any real complex osc messages for now, but as far as i can tell it is a very nice osc framework.
read more ...Handassembled java bytecode
motivated by my hand written x86 machinecode, i decided that i had to take it to the next level.
i worte some handassembled java bytecode. run the file below as
./dump.sh > HelloAsm
and run the programm with
java HelloAsm
read more ...

