[music-dsp] Release Problems

Olli Niemitalo oniemita at mail.student.oulu.fi
Fri Jul 28 09:00:51 EDT 2000


On Fri, 28 Jul 2000, Jason Field wrote:

> I need some advice on sample transitions. Given a sample that is triggered 
> by MIDI and which has a long release, how should I mix the sample when a
> NoteOff  is received before the end of the release? Is this worth doing,
> or should I implement a higher polyphony system so that both notes can
> play at once?

Quickly fade out the noteoff'ed sample. If the new note starts instantly
then you need a little polyphony to allow the old one die in peace.

> On a similar note (excuse the poor pun...), what strategies should I adopt 
> for mixing panned audio? I am using a linear panning algorithm at the
> moment, but if  the pan is changed rapidly, the audio exhibits clicks
> (due, I assume, to the waveform changing too fast).

Panning changes are basicly volume changes.

A "scientific" explanation for the clicks follows: Applying a volume envelope
over a signal is same as multiplying it by the envelope. Time domain
multiplication is frequency domain convolution. If the envelope is
changing slowly, there are mainly low frequencies in it, and the
convolution doesn't smear the spectrum very much. If there's a sudden
change (discontinuity, edge) in the envelope, then all frequencies are
present, and the convolution results in totally smeared, ruined spectrum.

One way to avoid this problem is to lowpass filter the
brick-wall envelope. Check out 'the archive', there's a filter designed
for this purpose! Even a single-pole lowpass "out(t) = in(t) +
c*(out(t)-in(t))" helps. Another solution is to form the envelope from
ramps, avoiding discontinuities.

-olli


dupswapdrop -- the music-dsp mailing list and website: subscription info,
FAQ, source code archive, list archive, book reviews, dsp links
http://shoko.calarts.edu/musicdsp/




More information about the music-dsp mailing list