2: Polynome Flasher App

Posted on Monday the 8th of February, 2010

To continue along yesterday’s theme, I did some more work plumbing work with Polynome. This time I added some operations which affected all the lights: all on, all off and perhaps more interesting: toggle all. I then added some nice ways of adding OSC listeners and senders to a client app. Hooking this all together with a simple SCLang script allowed me to make a Polynome flasher app which is driven by ticks from SCLang. Perhaps for another entry, I’ll draw some diagrams about how it all currently works.

For those interested, the Polynome client code needed to describe this app is as follows:

class SCFlasher < Polynome::Client
  def init
    listen(5706, "/tick") {toggle_all}
  end
end

The SCLang code required to send the flash ticks is also similarly simple. The various tempos listed at the end were some of the values I evaluate live during the video in order to change the flash rate. I really appreciate the fact that SCLang supports live-coding out of the box.

~outAddr = NetAddr("localhost", 5706);
t = TempoClock(1);
t.schedAbs(t.beats.ceil, { ~outAddr.sendMsg("/tick"); 1});

t.tempo = 10;
t.tempo = 4;
t.tempo = 0.5;
t.tempo = 1;
blog comments powered by Disqus

Recent Posts