rncbc / samplv1

samplv1 - an old-school polyphonic sampler
https://samplv1.sourceforge.io
GNU General Public License v2.0
38 stars 9 forks source link

Clicking even when looping between zero crossings #12

Closed xnakos closed 6 years ago

xnakos commented 6 years ago

Greetings, Rui and lurkers!

Investigating samplv1, I am not able to produce a click-less looping sound, based on a simple sample. I created the sample using qtractor and a simple amsynth patch. Using audacity I selected a nice region at zero crossings, which I believed should yield a click-less sound when looping over (please tell me in case I have totally misunderstood something, since I have just started playing with sampling). I then loaded the sample to samplv1, using the at-zero-crossings sample numbers as start and end, and recorded a single note using qtractor. I finally exported the audio. The input sample and exported audio are here: sample-and-export.zip. Clicks are audible in the exported audio.

This is the waveform of the input sample and the selected at-zero-crossings region (I selected ten periods):

sample-c4-stereo

This is the configuration of samplv1:

samplv1

These are parts of the exported audio (normalized). I have marked what I believe are anomalies:

export-anomaly

export-anomaly-period

Is there an error on my part or is this a bug?

rncbc commented 6 years ago

yes, probably it's a more like a feature turned into a bug :)

fact is that samplv1 searches for its own zero-crossings too, on its own at the loop start/end points.

however, it also applies a forced micro-fade-in and -out at the loop-start and -end resp. over a fixed number of frames (32 samples) independently of current sample-rate.

it is this micro-fade-in/out that you see as anomalies on the waveform graphics above.

i'll see whether this micro-fade-io-shtty-artifacts may be axed tout-couer* as it nowadays seems like just an overzealous and naive design and engineering mistake. ;)

cheers && thanks

rncbc commented 6 years ago

good news are micro-fade-in/outs on loop points are now gone ( https://github.com/rncbc/samplv1/commit/c2265628f6ad7f84c702708c1f9c5dde82047d3d ) bad news are that other, more atonal but looped samples may now click harder than before :( cheers

xnakos commented 6 years ago

Thank you, Rui, for the fast response! I cannot test it right now, but your choice seems excellent. Easy loops should loop easily, I guess. I will test it as soon as possible. In case you have already tried the attached or a similar sample and found it fine, you could close the current issue. If not, I will do so after testing it.

Keep on rocking in the free and open-source world!

xnakos commented 6 years ago

Clicking is gone. Closing. Thank you!