Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 6 of 6

Thread: How to avoid zipping noise for volume change?

  1. #1

    How to avoid zipping noise for volume change?

    Hi,

    perhaps a simple question: what is the best/easiest way to avoid zipping noise when changing the volume. I can try to create my own class for this or perhaps there is something which can be used? Is a simple LP filter enough for this?

    Thanks, Holger
    Last edited by C0d3man; 02-15-2019 at 12:37 PM.

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,299
    I know not of this zipping noise.

    Generally we expect you to show a program, so anyone can reproduce the problem. But even just being able to see (hear) the problem is a bare minimum.

    But to try to answer your question, I can point you to Part 1-5 of the audio library tutorial, which is pages 6 & 7 in the PDF. That part of the tutorial shows how to change the volume with a pot, while the audio library plays a song from the SD card. The full source for all the tutorials is available in Arduino by clicking File > Examples > Audio > Tutorial.

    In the walkthrough video, you can hear the volume change smoothly, no "zipping noise" (still have no idea what you mean by this). Skip to 6:17 in the video, where you can see Alysia turn the pot and you can hear the volume change. This is how you can change the volume without any problems.



    If this didn't answer your question or solve the problem, please try to follow our "Forum Rule" where you give a complete program and enough info so anyone can reproduce the same problem. We can help you much more when we're able to actually reproduce your problem.

  3. #3
    Senior Member oddson's Avatar
    Join Date
    Feb 2013
    Location
    Isle in the Salish Sea
    Posts
    1,138
    'Zipper' is used as shorthand for audible quantization when sweeping thru a parameter - usually MIDI because of its limited resolution.

    In soft-synth authoring tools a 'dezipper' is code/module that adds a lowpass or slew limit to provide a smooth data stream before multiplying with audio data. The audio library should have one.

  4. #4
    Hi Paul,

    thanks for your fast reply and sorry for beeing imprecisely...
    My problem is not caused by the Teensy audio code, but by changing the volume at control-rate.

    Quote Originally Posted by PaulStoffregen View Post
    I know not of this zipping noise.

    Generally we expect you to show a program, so anyone can reproduce the problem. But even just being able to see (hear) the problem is a bare minimum.
    It's a little bit complicated to extract this code from my project and I thought this is a common problem. That's why I asked my problem in only two sentences.

    But to try to answer your question, I can point you to Part 1-5 of the audio library tutorial, which is pages 6 & 7 in the PDF. That part of the tutorial shows how to change the volume with a pot, while the audio library plays a song from the SD card. The full source for all the tutorials is available in Arduino by clicking File > Examples > Audio > Tutorial.

    In the walkthrough video, you can hear the volume change smoothly, no "zipping noise" (still have no idea what you mean by this). Skip to 6:17 in the video, where you can see Alysia turn the pot and you can hear the volume change. This is how you can change the volume without any problems.

    Oh, I didn't know this document yet...

    If this didn't answer your question or solve the problem, please try to follow our "Forum Rule" where you give a complete program and enough info so anyone can reproduce the same problem. We can help you much more when we're able to actually reproduce your problem.
    It's more a question of best-practice, which I didn't seem to formulate well - sorry. I'll try it again:

    I have to implement a volume control with encoders and only get a certain number of new volume values that are definitely well below the sample-reate. This leads to - let's say 10 - value changes per second. If the encoder is turned sufficiently fast, the volume changes are very strongly graded and this simply sounds bad. This is what I meant by "zipping noise".

    So my questions are:
    - Has anyone ever built a solution for this?
    - Can the Teensy Audio Library do this?
    - Is a more generic way (e.g. with a low pass filter) useful or do you write your own functions/classes that make the change softer (by calculating a increment value and change the volume at s-rate with this value)?

    Thanks a lot,

    Holger

  5. #5
    Ah, thanks @oddson for exactly describing I tried to formulate.

  6. #6
    Senior Member oddson's Avatar
    Join Date
    Feb 2013
    Location
    Isle in the Salish Sea
    Posts
    1,138
    Yeah its common with soft synth tools because GUI (screen) knobs update too slowly.

    The 'filter' object should work with a very low corner frequency but I would think an object that uses less processing and is simpler use would be possible.

    ResponsiveAnalogRead() might be able to work somehow but I've not thought it through sufficiently to say.

    Or you could code a very simple lowpass

    y = a*x + (1-a)*y

    Which you could probably update well below audio rate and still be smooth enough.

    Or you could implement a slew rate limiter by restricting updated values to move towards the goal by a set step size but that might not be responsive enough if you are sweeping the parameter across the full scale.
    Last edited by oddson; 02-16-2019 at 05:07 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •