38 sourceSampleRate (source.sampleRate),
49 source.
read (data.get(), 0, length + 4, 0,
true,
true);
86 sourceSamplePosition = 0.0;
123 const float*
const inL = data.getReadPointer (0);
124 const float*
const inR = data.getNumChannels() > 1 ? data.getReadPointer (1) :
nullptr;
129 while (--numSamples >= 0)
131 auto pos = (
int) sourceSamplePosition;
132 auto alpha = (
float) (sourceSamplePosition - pos);
152 *
outL++ += (
l + r) * 0.5f;
155 sourceSamplePosition += pitchRatio;
void setSampleRate(double sampleRate)
void setParameters(const Parameters &newParameters)
ElementType * data() noexcept
bool appliesToChannel(int midiChannel) override
SamplerSound(const String &name, AudioFormatReader &source, const BigInteger &midiNotes, int midiNoteForNormalPitch, double attackTimeSecs, double releaseTimeSecs, double maxSampleLengthSeconds)
bool appliesToNote(int midiNoteNumber) override
void startNote(int midiNoteNumber, float velocity, SynthesiserSound *, int pitchWheel) override
void controllerMoved(int controllerNumber, int newValue) override
bool canPlaySound(SynthesiserSound *) override
void renderNextBlock(AudioBuffer< float > &, int startSample, int numSamples) override
void pitchWheelMoved(int newValue) override
void stopNote(float velocity, bool allowTailOff) override
double getSampleRate() const noexcept
SynthesiserSound::Ptr getCurrentlyPlayingSound() const noexcept