Pd++
0.01
A pure C++ implementation of Pure Data objects
|
Voltage-controlled filter. More...
#include <VoltageControlFilter.h>
Public Member Functions | |
VoltageControlFilter (double q) | |
vcfOutput | perform (double input, double centerFrequency) |
void | setQ (double f) |
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::string | pdName = "vcf~" |
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 |
Voltage-controlled filter.
This is a voltage controlled filter which is basically a bandpass filter that can use a signal generator such as an oscillator or a phasor to control the center frequency. The Q can be set using the setQ() method. Since we are not using the same scheduling routine as Pd the Q can also technically use a signal as an input.
The other major difference between this and bandpass is that vcf uses the same cosine table lookup as the unit generators to calculate the real and imaginary coefficients.
Also, notice that the perform() function returns a struct which is a pair of doubles that correspond to the real and imaginary part. You'll have handle this in your run() function. Normally, I either sum the two or ignore the imaginary part (I don't really believe in imaginary numbers.)