Open fpiesik opened 2 months ago
Thanks for filling this issue.
I've run into clicks while using some of the fx commands too, but I'm not sure about the best way to go about addressing this, for instance using PLOF for granular playback of very short samples, it often won't make sense to do any of those 3 possible solutions you listed.
I have two ideas in mind:
The second approach might be more technically straightforward to implement, as triggering a fade mechanism at the exact right time seems complicated, especially since everything else appears to be k-rate-timed, which isn't fast or precise enough. This is particularly true with fade-outs, as they need to occur before the sample position is changed. To achieve this, you'd need to introduce some kind of look-ahead mechanism to determine whether a PLOF command will be triggered in the next step.
The more I play with the tracker, the more I realize that it definitely needs a smoothing mechanism. For example, if I play a bass sample that is half a note long and want to trigger it every quarter note, it clicks almost every time. I think there is no way around to implement a detector that triggers the sample to fade out before its play position changes.
@fpiesik thats an interesting example, but in this case, it sounds more like what you want is to be able to set a ADSR volume envelope?
Envelopes would definitely help in some cases. There’s already the possibility to use the VOLM command to achieve something similar to envelopes, but that requires setting the VOLM speed fast enough to ensure the envelope is completely finished before the next note is triggered. That’s not very convenient. So I think there should be something at a lower level that always ensures at least a few milliseconds of fading between sudden sample amplitude value changes.
Yes I've noticed that myself too, tables aren't fast enough to implement ADSR envelopes properly so I have implementing dedicated ADSR vol envelopes on the to-do list.
I'm looking forward to envelopes, but I'm not convinced they will eliminate the problem of clicking sounds in many cases. For example, if you choose a long decay for sustained notes, you'd have to adjust the decay every time you want to mix shorter notes with the longer ones.
Whenever the sample player makes abrupt changes to the sample position (e.g., using PLOF, slice, or RTRG commands), an audible click sound can occur due to the instant change in amplitude.
Steps to Reproduce:
Expected Behavior:
Position hopping should work without any audible clicking sounds, by implementing smoother transitions or a mechanism to avoid abrupt waveform changes.
Possible Solutions:
Code Hints:
In the code, I found some indications that an anti-click mechanism may have been partially implemented by the original authors:
However, the
couldClick_
variable does not seem to be used elsewhere in the code. It appears this feature is still a work in progress.It would be fantastic if this work could be completed, as the presence of these clicks significantly detracts from the experience of sample mangling in LGPT.