As my first pd-extended project I'm putting together a sample player / looper where you can crop the sample by specifying a start and end point. I have a crown envelope to avoid clicking when the loop restarts. Is there any way to avoid clicking when the sample position (start or end changed) is changed?
Smoothly change start and end of looped sample
@Arnoson Hi, as a general rule whenever you send control values to [*~] and [+~] objects connected to an audio signal you are most likely to get clicks. Try smoothing the values you send to audio objects by using [pack] and [line~].
This way you avoid clicks, but the looper restarts from the beginning every time you change a parameter. To make it loop back only when it reaches the end of the sample you're probably going to need to use [vline~] instead of [phasor~] for the table readout.
Hope this helps.
@weightless Hey, thank you! It worked to get rid of the click, but the pitch changes when changing start or end. I guess its because I recalculate the speed of the phasor when the loop changed (in the subpatch [pd compensateSpeed]) and this recalculation happens instantly. I tried to also put a [line~] object in between but still get the pitch-changes / wrong speed when cropping the sample
@Arnoson I think that that is a problem of using [phasor~] to do the sample readout, since whichever way you do it you still need to scale the phase in real time and that causes the change in pitch. Apparently there is a solution explained in the text portion of B12.sampler.transpose.pd in the browser, but I wasn't able to implement it.
For a sampler I did a while a go I used [vline~] instead, and with a little trick you can reduce the number of values spat out by the sliders. Maybe it could also be done by getting the mouse state and changing the value when you release the mouse button? Not sure which objects would do it.
Hope it helps.
This post is deleted!