Pd++
0.01
A pure C++ implementation of Pure Data objects
|
A sinewave oscillator. More...
#include <Oscillator.h>
Public Member Functions | |
Oscillator (double) | |
double | perform (double frequency) |
void | setPhase (double phase) |
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 = "osc~" |
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 |
A sinewave oscillator.
This is Pd's sinewave oscillator, though technically a cosine. It basically wraps the phasor into the cosine function. It also uses a cosine lookup table.
You can set the phase using the setPhase(double) function. It should be a number from 0-1. Just make sure to update the phase outside of the runAlgorithm() routine.