I am trying to emulate the concept of bellows in the instrument. For example on a pump organ, you pump a pedal which fills a bag of air and then slowly releases it through the reeds, quickly at first and then more slowly as the air runs out. This makes the volume instrument pulse with the pumping of the footpedal.

You could model this as a simple dynamical system.

Say for example we denote "

x" as the input (rate of pumping) and "

P" as the bag pressure. Then we could model the rate of change of P as increasing in proportion to "x", but also decreasing in proportion to "P" (assuming the rate at which air escapes is proportional to the pressure). This gives an equation like:

Change_in_P = a*x - b*P, where "a" and "b" are some constants.

So the final difference equation is just

P(k+1) = P(k) + Change_in_P(k). Where P(k) denotes the pressure at some sample point, and P(k+1) the value at the next.

The overall equation is then:

P(k+1) = (1-b)*P(k) + a*x(k).

That equation btw is just the common exponential low pass filter. The parameter "b" controls the rate of decay and the parameter "a" controls the gain. The rate at which this system decays is

(1-b)**k (where ** denotes exponentiation). So parameter "b" should be between 0 and 1, with values larger values giving faster decay, and values near zero giving slower decay.

Normally as a filter we make a=b so that it's unity gain, but in your case you could adjust "a" depending on the relative values of "x" and "P" that you want. I'm not even sure what your input is, it could be x=1 when pumping and x=0 when not pumping for example. But there are other alternatives there.