Volume ramping questions

Started by bass, June 11, 2019, 21:50:09

Previous topic - Next topic

bass

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!!

Saga Musix

Quote1. 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.

Quote2. 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.

Quote3. 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.

bass

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.

Saga Musix

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.