Problem with every sampler.

same goes for Ahornberg modules

1 Like

In short, they adjust for playback speed when the samples are at a different rate than VCV.

float step_amount = sample.sample_rate / rack_sample_rate;
playback_position = playback_position + step_amount;

I’m sure that this is truly terrifying. :see_no_evil: When I have a bit of time, I’ll dig in and make improvements.

nothing is terrifying! if it were me (and it isn’t) I would say in the manual “to play back the wave files completely pristine, make sure they are at the same sample rate as VCV, and make sure that none of the options are engaged that change the pitch. If Wav Bank does shift the pitch due to any of those reasons, then a drop/repeat re-sampler will kick in and the quality may be degraded.”

But, yeah, given that resampling is built in and encouraged, that form of resampling isn’t so good. At least on paper.

2 Likes

I was thinking the other day of making a “stem player”… where multiple wavs would be played back in sync. Would be useful when using vcv rack as a mixing and effects playground of already recorded/sequenced material…

4 Likes

Forever thank you, for sharing them with us! And continuously allowing us to drop ideas that enhance your modules even further.


On a side note, whatever happened to the OP of this thread?

Actually my Tape Recorder does pretty much the same, on Tape Recoder you can grab a reel with the mouse for doing weird scratch effects. I don’t think resampling based on interpolation would make a big difference here.

could be. on the other hand, the wierd inharmonic tones generated by low quality interpolation are pretty easy to hear, even to my old ears which are pretty shot. So, sure you grab the reel and speed it up, maybe you don’t hear those tones going down in pitch when everything else it going up. Just for the comfort of knowing I’m not getting those funny noises, I’d probably pick a sampler with a better interpolator, but that’s just me. Here’s the output of a sampler with a pure sine wave file, speed changed, played from a sampler with a drop/repeat interpolator, fwiw:

2 Likes

I’ll check it out. Even if it can’t resample it’s good if it can just play back the audio file as recorded, at the same samplerate.

That would be awesome!. Hope you’ll do it…

2 Likes

Just a couple of thoughts… If one were to make a sampler / player that works much better when the sample rates match and no shifting is applied, then I think a great feature would be an LED on the panel that told you if this were happening.

FWIW, I have found (in the 90’s?) that no interpolation (what I call drop/repeat) usually adds a lot of weird tones and noises that are pretty easy to hear. But even simple linear interpolation is much, much closer to “the truth”. DSP ppl consider linear interpolation “a joke”, but as long as your wave doesn’t have a ton of super high frequency energy is works pretty well. I always use a cubic polynomial for the reasons a lot of ppl do: it’s no harder than linear interpolation and it measures better.

Of course a “real” audio player, like whatever you use for listening to music, will usually have a “very good” interpolator in it - often a polyphase FIR filter.

I really like the 7 Seas approach where you can control the quality to make your own trade-off for CPU usage vs quality.

2 Likes

doesn’t appear to have been back yet

A long time ago I had an Ensoniq Mirage sampler, very charming machine, but that uses drop/repeat samples (at 32kHz) and it sounds very very rough…

I grew up with the Amiga, and its sound chip also does repeat samples but it does it at Mhz-rate (with a single pole low-pass-filter after), so it has a special sound (still rough though) (https://bel.fi/alankila/modguide/interpolate.txt)

Most hardware-samplers (still today) use linear interpolation,at their native sample-rate (often 44 or 48kHz) since it’s a great bang-for-the-buck, but you will definitely hear a low-pass (tiny boxcar style) filter effect of the playback.

1 Like

As well as some interpolation noise. But totally acceptable in many cases. Btw, hardware samplers still exist?

In addition to having had an Ensoniq Mirage sampler, I also still have a Kurzweil K2000RS rack mounted sampler. But…, it is not embedded in my studio any longer.

1 Like

Btw, hardware samplers still exist?

I actually had the electribe 2 sampler for a short while… but sold it after being put off by the obvious low pass effect… (of just sampling and playing back)

My first sampler was an Ensoniq EPS. If you wiggled the sample start and end positions just right, you could get it to freak out. :man_dancing:

1 Like

An easter-egg feature for one of your samplers, perhaps?

Yes, you’re right. Even just linear interpolation makes a huge audible differenz, at least on pure sine waves.

Implementing linear interpolation is quite simple. Just call rack::math::crossfade() or rack::simd::crossfade() for multitrack samples.

It’s simple as long as you always have the right two samples in memory. That’s why I say cubic is just was easy. The hard part is having the right 4 samples in memory.

1 Like

Influenced by this thread, I’m starting to add linear interpolation to all of my modules. I think that it’s working? I’m starting with the looper module. I’ve added an option to select which interpolation to use, and I hope to add more options as I learn more about them.

My question is: I can’t really hear the difference. Is there some easy way that I can tell if it’s working?

Thanks!

Just for fun, here’s my code:

  void readLI(double position, float *left_audio_ptr, float *right_audio_ptr)
  {
    unsigned int index = std::floor(position); // convert float to int

    // If out of bounds, return zeros
    if((index >= (left_buffer.size() - 1)) || ((index >= right_buffer.size() - 1)))
    {
      *left_audio_ptr = 0;
      *right_audio_ptr = 0;
    }
    // Else, compute and return the interpolated values
    else
    {
      float distance = position - (float) index;
      *left_audio_ptr = left_buffer[index] + ((left_buffer[index + 1] - left_buffer[index]) * distance);
      *right_audio_ptr = right_buffer[index] + ((right_buffer[index + 1] - right_buffer[index]) * distance);
    }
  }

If you look up higher in this thread you can see a plot where I did this. Take a wave file of a pure sine at a reasonably high pitch, then transpose it a little until you see all the tones that aren’t supposed to be there pop in.

btw, It seem a couple of ppl were influenced by this thread. It would be great to be credited by name for contributing good ideas.

1 Like