W3C home > Mailing lists > Public > public-audio@w3.org > July to September 2012

Re: How to write a sequencer?

From: Chris Rogers <crogers@google.com>
Date: Mon, 6 Aug 2012 12:04:13 -0700
Message-ID: <CA+EzO0mff5pWJM7z=2iws_NqJgHdw8Nk7nz9yDXmtw1H1jMPwg@mail.gmail.com>
To: Peter van der Noord <peterdunord@gmail.com>
Cc: "public-audio@w3.org" <public-audio@w3.org>
On Mon, Aug 6, 2012 at 8:51 AM, Peter van der Noord
<peterdunord@gmail.com>wrote:

> In the light of all the discussion about the limitations of the jsnode(at
> least for writing audio) i was curious about any ideas how i should write
> myself a sequencer using the native nodes.
>
> I need both a notesequencer (sends out frequencies mapped to the -1,1
> scale) and a triggersequencer (that can send out a single value of 1). I
> thought about having a jsnode scheduling a gainnode which has a
> buffersourceconnected to it that's playing a looped buffer containing just
> one value (a 1).
>

Hi Peter, I've actually done something like this although it's very much
unfinished and was written before we had an Oscillator  node.  Please don't
use it as a definitive guide, and I know there are bugs there, but still it
might give you some information:
http://chromium.googlecode.com/svn/trunk/samples/audio/wavetable-synth.html

I have a simple UI for it, but others could be written letting you draw
custom curves, etc.

For a monophonic subtractive synth you can create a single Oscillator node,
turn it on (with noteOn()) and just let it run forever, add an
AudioGainNode for the amplitude envelope, add a BiquadFilterNode (or two or
three...) for the filter.  You can control the monophonic note events by
"gating" the amplitude and filter parameters appropriately (something like
my example above).

Hope that helps,
Chris




> - are there better ways to do this?
> - i read about the dezippering of the gainnode. It's unspecified, but i
> assume it filters out fast changes. Woulnd't it be a good idea to be able
> to turn that off? If you want to do AM with it, you're not really looking
> for a node that interferes with your controlsignal.
>
> Peter
>
Received on Monday, 6 August 2012 19:04:41 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 6 August 2012 19:04:42 GMT