Tue Jan 10 11:13:08 EST 2012

Upsampling : Constant Array / Discrete Events?

One of the nuisances of writing audio DSP code is the upsampling of
control-rate signals: rate conversion and associated filtering.  You
really want to do this 1. automatically and 2. using in-line
calculations, avoiding the use of intermediate memory.

Can it be solved with current approaches?  Yes.  It seems the only
component that's necessary is a "constant" array, and a way to get at
the oversampling factor.

The input of an SM loop is ((i,o),n) where i and o are structures of
array pointers.  It could be made such that these pointerse are simply
floats/ints.  The problem is to get the 'n' next to that float, or to
compute some update coefficients at the start of the loop.

This should go somewhere in the SM <-> update path.  The main question
is: does this need extra state?  The answer should probably be yes.

It seems straightforward to do.  This is mostly a transformation of
the update method itself using serial composition.  The problem then
is to find a simple way to tag this in the type signature.
I.e. something like:

  liftUpdate :: LiftUpdate ((A,C),C)

Where A is audio rate (array) and C is control rate (constant float
over current audio frame).

This should be made part of SSM because it's not just the update
method that needs to be lifted, but of course also the state.

Thinking about it a bit it's probably best to work bottom up: write
some manual cases, then abstract the pattern that turns up as a class.