ofxPDSP
pdsp::TriggeredGrain Class Reference

A stream of really short sampled segments, use many of this to create a "graincloud". More...

#include <TriggeredGrain.h>

Inheritance diagram for pdsp::TriggeredGrain:
pdsp::Patchable

Public Member Functions

 TriggeredGrain (const TriggeredGrain &other)
 
TriggeredGrainoperator= (const TriggeredGrain &other)
 
float meter_env () const
 returns the last processed envelope amplitude value. This method is thread-safe.
 
float meter_position () const
 returns a value from 0.0f to 1.0f that broadly rapresent the "playhead" of the current sample. This method is thread-safe.
 
float meter_jitter () const
 returns a value from -1.0f to 1.0f that rapresent the jitter of the grain. This method is thread-safe.
 
Patchablein_trig ()
 Sets "trig" as selected input and returns this module ready to be patched. This is the default input. Each time a trigger is received a grain is triggered.
 
Patchablein_position ()
 Sets "position" as selected input and returns this module ready to be patched. This is the default input. Send a value between 0.0f and 1.0f to control the position of the grains inside the sample.
 
Patchablein_length ()
 Sets "length" as selected input and returns this module ready to be patched. Controls the grain length in milliseconds.
 
Patchablein_pitch ()
 Sets "pitch" as selected input and returns this module ready to be patched. Controls the grain pitch in semitones.
 
Patchablein_select ()
 Sets "select" as selected input and returns this module ready to be patched. Select the sample to stream from the ones previously added.
 
Patchablein_position_jitter ()
 Sets "position_jitter" as selected input and returns this module ready to be patched. Grain position jitter control relative to the sample length. 0.0f = no jitter, 1.0f = position jitter as long as the entire sample lenght.
 
Patchablein_pitch_jitter ()
 Sets "pitch_jitter" as selected input and returns this module ready to be patched. Grain pitch jitter in semitones.
 
Patchablein_direction ()
 Sets "direction" as selected input and returns this module ready to be patched. A positive value makes the grains play forward, a negative in reverse.
 
Patchableout_signal ()
 Sets "signal" as selected output and returns this Unit ready to be patched. This is the default output. This is the stream output.
 
Patchableout_jitter ()
 Sets "jitter" as selected output and returns this Unit ready to be patched. This output produce a random value between -1.0f and 1.0f that changes each time a grain is retriggered.
 
void addSample (SampleBuffer *newSample)
 adds a pointer to a SampleBuffer to an internal array of SampleBuffer pointers More...
 
void setSample (SampleBuffer *samplePointer, int index=0)
 Sets the SampleBuffer pointer at the given index to a new pointer. More...
 
void setWindowType (Window_t type, int window_length=1024)
 sets the envelope window shape, optionally the resolution of the table. More...
 
- Public Member Functions inherited from pdsp::Patchable
void resetInputToDefault ()
 resets the selected input to the default.
 
void resetOutputToDefault ()
 resets the selected output to the default.
 
Patchablein (const char *tag)
 sets the selected input to the one tagged with "tag", if tag is a valid string, and returns this Patchable ready to be patched. More...
 
Patchableout (const char *tag)
 sets the selected output to the one tagged with "tag", if tag is a valid string, and returns this Patchable ready to be patched. More...
 
void disconnectIn ()
 disconnects all the outputs connected to the selected input, then resets the selected input to the default.
 
void disconnectOut ()
 disconnects all the inputs connected to the selected output, then resets the selected output to the default.
 
void disconnectAll ()
 disconnects all the inputs and outputs to their connected outputs and inputs. Also resets the selected input and output to the default.
 
InputNodegetSelectedInput ()
 returns the selected input, you can patch a Patchable or OutputNode to it with the >> operator.
 
OutputNodegetSelectedOutput ()
 returns the selected output, you can patch it to another Patchable or InputNode with the >> operator.
 
std::vector< std::string > getInputsList ()
 returns a vector of the valid input tags
 
std::vector< std::string > getOutputsList ()
 returns a vector of the valid input tags
 

Additional Inherited Members

- Protected Member Functions inherited from pdsp::Patchable
void addOutput (const char *tag, OutputNode &output)
 method to add outputs when constructing a Unit More...
 
void addInput (const char *tag, InputNode &input)
 method to add inputs when constructing a Unit More...
 
void addModuleOutput (const char *tag, Patchable &unit)
 method to add outputs when constructing a module More...
 
void addModuleInput (const char *tag, Patchable &unit)
 method to add outputs when constructing a module More...
 

Detailed Description

A stream of really short sampled segments, use many of this to create a "graincloud".

Member Function Documentation

◆ addSample()

void pdsp::TriggeredGrain::addSample ( pdsp::SampleBuffer newSample)

adds a pointer to a SampleBuffer to an internal array of SampleBuffer pointers

Parameters
[in]newSamplepointer to a SampleBuffer

◆ setSample()

void pdsp::TriggeredGrain::setSample ( SampleBuffer samplePointer,
int  index = 0 
)

Sets the SampleBuffer pointer at the given index to a new pointer.

Parameters
[in]samplePointerpointer to a sample buffer with a loaded file inside
[in]indexindex of the position of the sample to set inside the sample pointers table

◆ setWindowType()

void pdsp::TriggeredGrain::setWindowType ( Window_t  type,
int  window_length = 1024 
)

sets the envelope window shape, optionally the resolution of the table.

Parameters
[in]typewindow type
[in]window_lengthwindow length, if not specified 1024

The documentation for this class was generated from the following files: