The WASM build of the sampler is hosted @ https://charsampler.netlify.app/ for demo purposes.
It is also used in the Brain Keyboard — a program I developed for Brainvolts Auditory Neuroscience Lab at Northwestern University. In this instance it is used as the core of a more fully fledged sampler instrument with midi capabilities etc.
I developed the DSP/sampling logic here based on Ableton Sampler's 'sustain looping' function, where it plays the sample forwards then backwards, crossfading between the two directions. This is useful for creating sustained sound from short samples.
I also included a 'Loop Length Variation' control, which lets each pass — forward or backward — have a proportionally shorter duration. When looping a short sound, we often hear the rhythm of the loop itself. This parameter breaks up that rhythm by making each loop a different length.