7 #ifndef PDSP_SAMPLERS_SAMPLER_H_INCLUDED 8 #define PDSP_SAMPLERS_SAMPLER_H_INCLUDED 10 #include "../pdspCore.h" 11 #include "SampleBuffer.h" 83 void prepareUnit(
int expectedBufferSize,
double sampleRate)
override;
84 void releaseResources ()
override {};
85 void process (
int bufferSize) noexcept
override;
87 template<
bool pitchModChange>
88 void process_once(
const float* pitchModBuffer)noexcept;
90 template<
bool pitchModAR,
bool triggerAR>
91 void process_audio(
const float* pitchModBuffer,
const float* triggerBuffer,
int bufferSize)noexcept;
93 void selectSample(
int n,
int bufferSize,
float trigger) noexcept;
109 std::vector<SampleBuffer*> samples;
114 std::atomic<float> positionMeter;
115 float positionDivider;
117 std::vector<int> channels;
119 const float* selectBuffer;
122 const float* startBuffer;
125 const float* startModBuffer;
135 #endif // PDSP_SAMPLERS_SAMPLER_H_INCLUDED plays SampleBuffer
Definition: Sampler.h:21
bool setSample(SampleBuffer *newSample, int index, int channel=0)
Sets the SampleBuffer pointer at the given index to a new pointer.
Definition: Sampler.cpp:76
Patchable & in_start()
Sets "start" as selected input and returns this Unit ready to be patched. This input change the start...
Definition: Sampler.cpp:51
Abstract class for implementing Units.
Definition: BasicNodes.h:223
Abstract class for implementing Units and Modules.
Definition: BasicNodes.h:82
float meter_position() const
returns a value from 0.0f to 1.0f that broadly rapresent the "playhead" of the current sample...
Definition: Sampler.cpp:35
Contains the data loaded from an audio file.
Definition: SampleBuffer.h:28
Patchable & out_signal()
Sets "signal" as selected output and returns this Unit ready to be patched. This is the default outpu...
Definition: Sampler.cpp:63
Thread-safe value control with smoothing.
Definition: SequencerBridge.h:11
void addSample(SampleBuffer *newSample, int channel=0)
adds a pointer to a SampleBuffer to an internal array of SampleBuffer pointers
Definition: Sampler.cpp:68
Patchable & in_pitch()
Sets "pitch" as selected input and returns this Unit ready to be patched. This input change the sampl...
Definition: Sampler.cpp:43
Output of a Unit, contains a buffer of rendered floats and has a variable state flag.
Definition: BasicNodes.h:354
Patchable & in_select()
Sets "select" as selected input and returns this Unit ready to be patched. This input change the samp...
Definition: Sampler.cpp:47
Patchable & in_direction()
Sets "direction" as selected input and returns this Unit ready to be patched. A positive value will s...
Definition: Sampler.cpp:59
Patchable & in_trig()
Sets "trig" as selected input and returns this Unit ready to be patched. This is the default input...
Definition: Sampler.cpp:39
Patchable & in_start_mod()
Sets "start_mod" as selected input and returns this Unit ready to be patched. This input change how m...
Definition: Sampler.cpp:55