Author Topic: Volume ramping questions  (Read 1001 times)

Offline bass

  • Active artist
  • *
  • Posts: 14
Volume ramping questions
« on: June 11, 2019, 21:50:09 »
I have some questions regarding volume ramping and sound quality.

1. Is there a minimum time (i.e. 10 ms) where I should do the volume ramping? I wonder if there are side effects when the ramping time is too low (still pops, clicks).

2. I do volume rampings on every tick and always with the same time value. So ramping from 63 to 0 has the same duration like ramping from 49 to 42. Is this the right way to do it or should I calculate the ramping length depending on the delta value (lastvol - newvol)?

3. Should I do volume ramping on a new note (same or different instrument)?

Example:
C-2 06 v60
--- --  --
--- --  --
E-2 06 v04

In this case I would do a volume ramping from 60 to 4, but I think this would be wrong and would produce clicks, because the last played sample value of C-2 is completely different than the first sample value of E-2 because it´s a new note and the sample is played from the beginning. Does volume ramping make sense in this case?

Thanks!!

Offline Saga Musix

  • OpenMPT Developers
  • *****
  • Posts: 6,727
  • aka Jojo
    • Download music, samples, VST plugins: Saga Musix Website
  • Operating System: Windows 10 x64
Re: Volume ramping questions
« Reply #1 on: June 12, 2019, 21:24:04 »
Quote
1. Is there a minimum time (i.e. 10 ms) where I should do the volume ramping? I wonder if there are side effects when the ramping time is too low (still pops, clicks).
Obviously there is a minimum but what it is very much depends on more than just a single factor (e.g. the ramping curve being one of them). 10ms is a lot, if you look at OpenMPT's defaults they are way below 1ms.

Quote
2. I do volume rampings on every tick and always with the same time value. So ramping from 63 to 0 has the same duration like ramping from 49 to 42. Is this the right way to do it or should I calculate the ramping length depending on the delta value (lastvol - newvol)?
I don't think there is a right or wrong, try what sounds better to you. But be careful, if you want to vary the time it shouldn't be too long for large volume jumps. Sometimes they are being used for gating effects, which would be completely washed out if your ramp takes too long.

Quote
3. Should I do volume ramping on a new note (same or different instrument)?
No, never. There is no relation between two independent notes that would justify a shared volume ramp. What you can do, however, is smoothly ramping the last sample value of the note that was just cut off to 0. OpenMPT does that. This ramp can (and should) be longer than your regular volume ramp. OpenMPT also applies a volume ramp at the start of the sample, but it may make sense to only do this conditionally (e.g. when a sample has a high DC offset or when using offset effects). XMPlay does something like that in its sensitive ramping mode.
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

Offline bass

  • Active artist
  • *
  • Posts: 14
Re: Volume ramping questions
« Reply #2 on: June 13, 2019, 14:27:50 »
Thanks, Saga! Yes, I have to experiment a little bit to find a good sounding result. If a new note is played, I set the oldVolumeLeft and Right to 0 to do a volume ramp. I also have a Decklick flag to fade out the last sample values (left and right) of the old note when a new note is played.
I also thought about putting each new note to a virtual channel (like IT NNAs) and fading the current channel out, but perhaps this is too much... On the other hand, if I want to support IT-files I have to implement the NNAs anyway.
Does OpenMPT use some kind of deckling when the end of a sample is reached and the sample is looped? You have to jump to the Loopstart-Position in this case, which also can produce clicks.

Offline Saga Musix

  • OpenMPT Developers
  • *****
  • Posts: 6,727
  • aka Jojo
    • Download music, samples, VST plugins: Saga Musix Website
  • Operating System: Windows 10 x64
Re: Volume ramping questions
« Reply #3 on: June 14, 2019, 18:37:08 »
Yes, as described above there is a slow fadeout when the sample is stopped, and if I remember it only happens on notes that stop "naturally" (i.e. not cut off by another note or Note Cut). It can indeed make sense to move notes stopped in other ways to NNA channels and ramp them down quickly.
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.