1
$\begingroup$

What's that effect called? Is that one of the reasons for having attack and release parameters when implementing synths? And is there a generic method to avoid such sound artifacts?

Example: I have implemented a simple synth that uses a midi control channel to adjust loudness by applying the 128 discrete MIDI values directly to the generated audio signal. Whenever one touches the MIDI controller wheel, pretty nasty, scratch-like sounds get produced.

$\endgroup$

4 Answers 4

1
$\begingroup$

You are changing the volume in discrete steps, applied at random points in the audio signal.

If the signal happens to be close to zero, you won't hear much of anything.

If the signal is close to a peak, then you will get a "step" change in the signal. This audible.

When you roll the volume up and down that way, you get a kind of "zipper" sounding noise.

What you want to do is to apply volume changes only when the signal is close to zero. The "zippers" still occur, but are much less annoying - and may be completely inaudible if you change volume only at times when the signal is at zero.


Looking at the code you referred to in a comment, it appears you aren't changing volume when the amplitude is close to zero.

You are changing volume when the signal is less than zero. What you want to do is to change volume when the absolute value of the signal is less than some small value.

Start with like 0.1, then try 0.01. You should notice far less "zipper noise" that way.

Sort of like this:

if (abs(amplitude) < 0.1d) {
   currentVolume = targetVolume;
}
$\endgroup$
3
  • $\begingroup$ Well, that's what I thought at first, too. But it's more complicated. Having a discontinuous waveform is not the (only?) problem. Here is an example where there is a popping effect even though volume is adjusted suddenly only on 0 amplitude traversal: github.com/jjYBdx4IL/java-evaluation/blob/master/src/test/java/… $\endgroup$ Commented Aug 24, 2019 at 17:31
  • $\begingroup$ @user1050755: Added to the answer in response to comment. $\endgroup$
    – JRE
    Commented Aug 24, 2019 at 18:35
  • $\begingroup$ what I do is to detect 0-crossings, ie. when the sign of the amplitude changes. $\endgroup$ Commented Aug 24, 2019 at 18:56
1
$\begingroup$

It is not only noise. It is noise and distortion because this scenario modulates the signal as well.

Abruptly changing amplitude of a signal is equivalent to multiplying the signal with a rectangular pulse. A pulse has a wide Fourier representation extending to higher frequencies. The multiplication means convolutional of Fourier of the pulse with Fourier of your signal. Hence, lots of unwanted components from the pulse and lots of dislocation of signal frequency components from modulation will end up in your signal.

$\endgroup$
0
$\begingroup$

Changing the volume abruptly always causes a click in the audio. Most DAC chips change volume on next zero crossing (or after a timeout if it takes too long). In this situation it would be best to use the MIDI volume as the target volume, and slide from current volume to target volume over many samples, either with linear or exponential ramp.

$\endgroup$
1
  • $\begingroup$ Adjusting the volume over a few samples isn't enough, it seems that it has to be changed over mulitple signal oscillations. $\endgroup$ Commented Aug 24, 2019 at 18:58
0
$\begingroup$

I always thought that they called this "zipper noise".

The effect of quantization of the volume level and then rapidly changing the volume level with that quantization effect.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.