MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / GetInterpolatedSample

Function GetInterpolatedSample

Source/SynthGlobals.cpp:428–440  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

426}
427
428float GetInterpolatedSample(double offset, const float* buffer, int bufferSize)
429{
430 offset = DoubleWrap(offset, bufferSize);
431 int pos = int(offset);
432 int posNext = int(offset + 1) % bufferSize;
433
434 float sample = buffer[pos];
435 float nextSample = buffer[posNext];
436 float a = offset - pos;
437 float output = (1 - a) * sample + a * nextSample; //interpolate
438
439 return output;
440}
441
442float GetInterpolatedSample(double offset, ChannelBuffer* buffer, int bufferSize, float channelBlend)
443{

Callers 13

ProcessMethod · 0.85
ConsumeDataMethod · 0.85
ProcessMethod · 0.85
ResampleForSpeedMethod · 0.85
SampleDroppedMethod · 0.85
ProcessMethod · 0.85
ProcessMethod · 0.85
ProcessMethod · 0.85
LoadStateMethod · 0.85
ProcessMethod · 0.85
GetCueSampleDataMethod · 0.85
ProcessMethod · 0.85

Calls 3

DoubleWrapFunction · 0.85
NumActiveChannelsMethod · 0.80
GetChannelMethod · 0.80

Tested by

no test coverage detected