20100914

day 14 an actual thing

Presenting a HTML5 <audio> <canvas> moz API processingjs interactive sound thing:

http://sdfphd.net/creativepact2010/day14c.html

that's right folks, a thing!

you know?
something that's something, not just a test for a thing, an actual thing!

Ok, so it's still pretty much a hack, but I'm still happy with it.
The processing.js side of it owes a lot to Lee Freeman's Creative Pact post from yesterday

I actually hacked this together last night (post midnight) which means I now have a few hours left of today with which to look over what Scott McLaughlin did for CreativePact today as he has been html5ing with my post from yesterday adding in his envelopes, which I remember him talking about not working all those months ago : )

In terms of building on day14c.html, my next move would have been to implement a crude form of polyphony by instantiating multiple Audio() objects...


as it goes, who knows what's next, who ever knows?


mouse controlling audio visual synth toy thing created with html and javascript for Firefox 4



a few more techy details:

significant edits to Lee's Processing script:

  • the mouse position over the canvas affects the speed of the balls ±x ±y about the centre

    • i.e. they should stop if you hover at the middlest pixel

  • added a conditional to the bounce() function using a frameCount to prevent rapid firing of the audio beep()

    • this is important because the current implementation of writing samples to the audio API can create a backlog of commands (i.e it will play all the samples it has been asked to play, even if you ask it to stop before you've heard them all)

  • a mouse click will reseed the position and speed of the balls 

    • (but not their colour so that you can get used to which colour has which pitch)
    • this function also help getting out of the situation where a ball is stuck to the edge and thus beep()ing non stop - although that can sound good at times!

1 comment:

  1. Glad to see you using our stuff (processing.js + audio api). We hang out on irc.mozilla.org/audio and irc.mozilla.org/processing.js if you need any help.

    Dave

    ReplyDelete