ofxPDSP
|
Public Member Functions | |
void | setup (int sampleRate, int bufferSize, int nBuffers) |
prepares all the module and units, initializing their internal buffers, then setup up the audioStreams and start the audio engine. Check oF audio tutorials for more info on the parameters. More... | |
void | start () |
starts the audio streams again if they were stopped. | |
void | stop () |
stop the audio streams. | |
void | close () |
close everything. This is called automatically on exit and probably you should never use it. | |
void | setChannels (int inputChannels, int outputChannels) |
sets the number of inputs and output channels. If not called, the standard is 0 input channels and 2 output channels (L/R). More... | |
std::vector< ofSoundDevice > | listDevices () |
calls ofSoundStreamListDevices() for listing the available audio devices. | |
void | setApi (ofSoundDevice::Api api) |
sets the API to use for the engine soundstream, for the APIs see oF ofSoundBaseTypes.h file. More... | |
void | setDeviceID (int deviceID) |
sets the ID of the audio device to open. You can get the available ID with listDevices(). Sometimes you have to use different ID for input and output devices, for that use setInputDeviceID() and setOutputDeviceID(). More... | |
void | setInputDeviceID (int deviceID) |
sets the ID of the audio device to open for audio input. More... | |
void | setOutputDeviceID (int deviceID) |
sets the ID of the audio device to open for audio output. More... | |
void | addOscInput (pdsp::osc::Input &oscInput) |
void | addMidiController (pdsp::Controller &controller, pdsp::midi::Input &midiIn) |
adds a midi controller and a relative midi input to the engine, making them active. More... | |
void | addMidiOut (pdsp::midi::Output &midiOut) |
void | addSerialOut (pdsp::serial::Output &serialOut) |
void | addExternalOut (pdsp::ExtSequencer &externalOut) |
pdsp::Patchable & | audio_out (int channel) |
returns a Patchable object that represent the audio out of the system. Patch your module to this for connecting them to the selected device audio output. More... | |
pdsp::Patchable & | audio_in (int channel) |
returns a Patchable object that represent the audio input of the system. Patch this to your modules for processing the selected device audio input. More... | |
pdsp::Patchable & | blackhole () |
returns a Patchable object that continously process all output patched to it without outputting nothing. Patch your Units and modules to this channels if you need them to be always active for some reason; | |
pdsp::Patchable & | out_bar_ms () |
returns a module that outputs the time of a musical bar in milliseconds | |
void | test (bool testingActive, float testingDB=-12.0f) |
activate/deactivate a sine tone patched to the left output to testing that the engine is running. More... | |
void | setBackgroundAudio (bool active) |
activate/deactivate background audio on ios, this function has to be called before the setup. More... | |
Public Attributes | |
pdsp::SequencerProcessor | sequencer |
a SequencerProcessor class to manage the playhead and for sequencing. Look SequencerProcessor page for knowing more. | |
void pdsp::Engine::addMidiController | ( | pdsp::Controller & | controller, |
pdsp::midi::Input & | midiIn | ||
) |
adds a midi controller and a relative midi input to the engine, making them active.
[in] | controller | controller to add |
[in] | midiIn | midiIn for the controller. Adds a midi controller and a relative midi input to the engine, making them active. You can use the same pdsp::midi::Input for multiple controllers, that are parsing the midi data in different way, for example if you have a keyboard with some knob and faders you can use the same midiIn with a ofxPDSPMidiKeys for the key, pitch bend and pressure output and a ofxPDSPMidiControls for the knobs and faders. |
pdsp::Patchable & pdsp::Engine::audio_in | ( | int | channel | ) |
returns a Patchable object that represent the audio input of the system. Patch this to your modules for processing the selected device audio input.
[in] | channel | channel to connect |
pdsp::Patchable & pdsp::Engine::audio_out | ( | int | channel | ) |
returns a Patchable object that represent the audio out of the system. Patch your module to this for connecting them to the selected device audio output.
[in] | channel | channel to connect |
void pdsp::Engine::setApi | ( | ofSoundDevice::Api | api | ) |
sets the API to use for the engine soundstream, for the APIs see oF ofSoundBaseTypes.h
file.
[in] | api | name of the API to use |
void pdsp::Engine::setBackgroundAudio | ( | bool | active | ) |
activate/deactivate background audio on ios, this function has to be called before the setup.
mix | true to activate background audio, false to deactivate, false is default |
void pdsp::Engine::setChannels | ( | int | inputChannels, |
int | outputChannels | ||
) |
sets the number of inputs and output channels. If not called, the standard is 0 input channels and 2 output channels (L/R).
[in] | inputChannels | input channels number |
[in] | outputChannels | output channels number |
void pdsp::Engine::setDeviceID | ( | int | deviceID | ) |
sets the ID of the audio device to open. You can get the available ID with listDevices(). Sometimes you have to use different ID for input and output devices, for that use setInputDeviceID() and setOutputDeviceID().
[in] | deviceID | ID to set |
void pdsp::Engine::setInputDeviceID | ( | int | deviceID | ) |
sets the ID of the audio device to open for audio input.
[in] | deviceID | ID to set |
void pdsp::Engine::setOutputDeviceID | ( | int | deviceID | ) |
sets the ID of the audio device to open for audio output.
[in] | deviceID | ID to set |
void pdsp::Engine::setup | ( | int | sampleRate, |
int | bufferSize, | ||
int | nBuffers | ||
) |
prepares all the module and units, initializing their internal buffers, then setup up the audioStreams and start the audio engine. Check oF audio tutorials for more info on the parameters.
[in] | sampleRate | audio callbacks sample rate |
[in] | bufferSize | audio callbacks expected buffer size. |
[in] | nBuffers | number of buffers in the audioQueue |
void pdsp::Engine::test | ( | bool | testingActive, |
float | testingDB = -12.0f |
||
) |
activate/deactivate a sine tone patched to the left output to testing that the engine is running.
testingActive | pass true to activate testing, false to deactivate |
testingDB | optional volume of testing tone, -12dB if not given |