Re: How to write a sequencer?

On Mon, Aug 6, 2012 at 12:28 PM, Peter van der Noord
<peterdunord@gmail.com>wrote:

> I'm not sure your example is what i am looking; i need something that
> outputs that sequence as a signal (in patchwork, i use 0.2 "Volt" per
> octave, so the lowest frequency would be a signal of -1, and the highest,
> 10 octaves higher, at 1), so i can control other things with it (my
> notesequencer doens't directly control other modules itself, other modules
> are controlled because they interpret that signal).
>
> But i guess that should be done in the same manner as a triggersequencer
> (have a module that outputs a continous signal of 1, connect it to a
> gain-control, and set the gain-control accordingly)
>
> Hmm...
>

Peter, the way I would think about it is how to achieve the desired
behavior for the application (what the user hears, sees, and interacts with
on the page).  In other words, I think you should be able to present a
"signal" representation of events in your UI without actually using an
actual audio signal in the underlying JS code.  Instead, you can use the
scheduling primitives available in the API (such as note event and
fine-grained AudioParam control) as the actual implementation.  What the
user sees on the screen can be whatever you want.  It feels like you're
trying to create an exact 1:1 mapping between your UI and the underlying
API calls.  From the user's perspective they won't care how you achieve
your result as long as it works.

In other words, there needs to be an appropriate level of MVC (Model View
Controller) abstraction:
http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller

Chris



>
> Peter
>
>
> 2012/8/6 Chris Rogers <crogers@google.com>
>
>>
>>
>> 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:50:29 UTC