Tag Archives: osc

Speaking at OneShotLondon NodeConf

“Just turn it into a node module,” and other mantras Edna taught me

The story of leaving behind a random mix of Python + php + bash + makefile + Scons scripts to totally embrace using Node, modules, standard callbacks, browserify, and friends to build toys that bleep and bloop with MIDI, WebGL and Web Audio.

As you can maybe deduct, this might not be your average super expert node.js talk, but a story of learning with a non-appointed mentor and an spontaneous community, and improving and making the most out of node.js—and how it informed and shaped the rest of my coding philosophy, both inside and outside of Mozilla.

I must confess that I’m really humbled and flattered to be amongst this amazing line up of true node experts.

UUUUUUUHHH THE EXPECTATIONS!—feeling a bit like an impostor now.

Next next Saturday 19th of July. See you there? :-)

QuNeo + node.js + node-osc

That is the result of this code:

var osc = require('node-osc');

var client = new osc.Client('0.0.0.0', 9999);

var value = 0;
setInterval(function() {
    client.send('/quneo/leds/hSliders/0/' + value, 0);
    value = ++value % 7;
    client.send('/quneo/leds/hSliders/0/' + value, 1);
}, 500);

var bpmFlash = 0;
var bpmInterval = 60 * 1000.0 / 125;
console.log('bpm interval', bpmInterval);
setInterval(function() {
    client.send('/quneo/leds/transportButtons/2', bpmFlash);
    bpmFlash = bpmFlash > 0 ? 0 : 1;
}, bpmInterval);

which I think is AWESOME!

Also, the official docs on the OSC bridge are wrong. To turn pad lights on you have to use the SW/SE/NW/NE names too…, or use ‘*’ in place of the direction, to turn the entire pad on. Otherwise I couldn’t get anything to light up. I.e.

// works, turns on the red led on the bottom right corner
client.send('/quneo/leds/pads/0/SE/red', 1);

// works, turns on all the red leds on the first pad
client.send('/quneo/leds/pads/0/*/red', 1);

// doesn't work
client.send('/quneo/leds/pads/0/red', 1);

Another error I fell for was using slash-terminated input addresses. These (silently) do not work. I.e.

// won't work, address ends in '/'
client.send('/quneo/leds/pads/0/SE/red/', 1);

// works, address doesn't end in '/'
client.send('/quneo/leds/pads/0/SE/red', 1);

I have very little else to report as I just got this thingie today and I’m super excited that I got it communicating with node.js this early. Yay for OSC!