[flocking-users] Fwd: using flocking

Colin Clark colin at colinclark.org
Thu Jan 23 12:36:51 EST 2014


Hi Laurens,

Wow, this is cool! The sound of network latency.

On Jan 23, 2014, at 12:29 PM, Laurens van der Wee <l.vanderwee at gmail.com> wrote:

> repeating ajax call with timer determining pitch of sine wave.
> is this the way to do it? -> schedule a change 'now', or is there also a way to do something like: synth.freq = newfreq ?

It’s probably simpler and more efficient not to use the scheduler if you are just making changes to a synth immediately. Instead, you can call .set() on the synth. Here’s a version of your code, updated to this:

http://pastie.org/8660985

Synth.set() will take either a single key/value pair as two arguments like this:

mySynth.set(“carrier.freq”, 440);

Or an object containing multiple key/value pairs, like this:

mySynth.set({
    “carrier.freq”: 440,
    “carrier.mul”: 0.5,
    “modulator.freq”: 123
});

I hope this helps,

Colin


More information about the flocking mailing list