next up previous contents index
Next: Polyphony Up: Continuous and discontinuous control Previous: Muting   Contents   Index

Switch-and-ramp

The switch-and-ramp technique also seeks to remove discontinuities resulting from discontinuous control changes, but does so in a different way: by synthesizing an opposing discontinuity which cancels the original one out. Figure 4.6 shows an example in which a synthetic percussive sound, an enveloped sinusoid, starts a note in the middle of a previous one. The attack of the sound derives not from the amplitude envelope but on the initial phase of the sinusoid, as is often appropriate for percussive sounds. The lower graph in the figure shows a compensating audio signal with an opposing discontinuity, which can be added to the upper one to remove the discontinuity. The advantages of this technique over muting are, first, that there need be no delay between the decision to make an attack and the sound of the attack; and second, that any artifacts arising from this technique are more likely to be hidden by the new sound's onset.

Figure 4.6: The switch-and-ramp technique for canceling out discontinuous changes. A discontinuity (upper graph) is measured and canceled out with a signal having the opposite discontinuity (lower graph), which then decays smoothly.
\begin{figure}\psfig{file=figs/fig04.06.ps}\end{figure}

Figure 4.7 shows how the switch-and-ramp technique can be realized in a block diagram. The box marked with ellipsis ("...") may hold any synthesis algorithm, which we wish to interrupt discontinuously so that it restarts from zero (as the example of the previous figure did). At the same time we trigger whatever control changes are necessary (exemplified by the top ADSR generator), we also reset and trigger another ADSR generator (middle right) to cancel out the discontinuity.

Figure 4.7: Block diagram for the switch-and-ramp technique.
\begin{figure}\psfig{file=figs/fig04.07.ps}\end{figure}

To do this we measure the level the ADSR generator must now jump to. This is its own current level (which may not be zero) minus the current output of the synthesis algorithm. We subtract the two and send the difference to a snapshot object, triggered at the same time as the discontinuity is expected. Finally, we use the snapshot output as a parameter to the ADSR generator, which must be reset (to the level given by the snapshot) and ramped toward zero.


next up previous contents index
Next: Polyphony Up: Continuous and discontinuous control Previous: Muting   Contents   Index
msp 2003-08-09