Pd++
0.01
A pure C++ implementation of Pure Data objects
|
This class is where you put all your audio routines, etc. More...
#include <PdAlgorithm.h>
Public Member Functions | |
Buffer | runAlgorithm (double input1, double input2) |
Public Member Functions inherited from PdMaster | |
void * | getbytes (size_t nbytes) |
void * | resizebytes (void *old, size_t oldsize, size_t newsize) |
void | freebytes (void *fatso, size_t nbytes) |
std::string | getPath () |
void | setSampleRate (unsigned long) |
unsigned long | getSampleRate () |
void | setBlockSize (int) |
int | getBlockSize () |
double | getTimeInSampleTicks () |
long | getTimeInMilliSeconds (double time) |
int | pdBigOrSmall (double f) |
void | cos_maketable () |
int | PD_BIGORSMALL (float f) |
void | setFFTWindow (int) |
int | getFFTWindow () |
double | mtof (double) |
double | ftom (double) |
double | powtodb (double) |
double | dbtopow (double) |
double | rmstodb (double) |
double | dbtorms (double) |
Public Attributes | |
std::vector< double > | test |
Public Attributes inherited from PdMaster | |
int | cosTableSize = COSTABSIZE |
float * | cos_table |
Additional Inherited Members | |
Public Types inherited from PdMaster | |
typedef union PdMaster::_sampleint_union | t_sampleint_union |
This class is where you put all your audio routines, etc.
This class emulates a Pd Patch. Your algorithm or patch code would be simulated in the runAlgorithm(double, double) function. Subpatches and abstractions could be member functions. Abstractions and externals could be separate classes. The runAlgorithm receives audio input and writes the output to the Buffer data type. Buffer is defined in the superclass PdMaster. The audio I/O class paRender only calls the runAlgorithm function, so all your audio output data must end up in this function via objects or member functions.
NOTE: It's best not to write to the stdout (e.g std::cout, or printf()) in your runAlgorithm function, unless you are using mainNoAudio.cpp. It could cause audio interruptions.
Created by Robert Esler on 9/17/14. Copyright (c) 2014 Robert Esler. All rights reserved.
Buffer PdAlgorithm::runAlgorithm | ( | double | input1, |
double | input2 | ||
) |
This is where the actual algorithm gets called by paRender you can use other non-static functions of your class but paRender only cares about the Buffer that is returned from this function. Put any functions here that need to be updated. Be wary of using locking or wait routines, allocating or deallocating memory.
write an audio file, see deconstructor for write method