7 void oscillator_bank_neon(
int numAudioFrames,
float *audioOut,
8 int activePartialNum,
int lookupTableSize,
9 float *phases,
float *frequencies,
float *amplitudes,
10 float *freqDerivatives,
float *ampDerivatives,
54 int setup(
float newSampleRate,
unsigned int newWavetableLength,
unsigned int newNumOscillators){
55 wavetableLength = newWavetableLength;
56 numOscillators = newNumOscillators;
57 sampleRate = newSampleRate;
59 if(posix_memalign((
void **)&wavetable, 16, (wavetableLength + 1) *
sizeof(
float))) {
60 fprintf(stderr,
"Error allocating wavetable\n");
65 if(posix_memalign((
void **)&phases, 16, numOscillators *
sizeof(
float))) {
66 fprintf(stderr,
"Error allocating phase buffer\n");
69 if(posix_memalign((
void **)&frequencies, 16, numOscillators *
sizeof(
float))) {
70 fprintf(stderr,
"Error allocating frequency buffer\n");
73 if(posix_memalign((
void **)&litudes, 16, numOscillators *
sizeof(
float))) {
74 fprintf(stderr,
"Error allocating amplitude buffer\n");
77 if(posix_memalign((
void **)&dFrequencies, 16, numOscillators *
sizeof(
float))) {
78 fprintf(stderr,
"Error allocating frequency derivative buffer\n");
81 if(posix_memalign((
void **)&dAmplitudes, 16, numOscillators *
sizeof(
float))) {
82 fprintf(stderr,
"Error allocating amplitude derivative buffer\n");
108 return wavetableLength;
117 return numOscillators;
147 amplitudes[n] = amplitude;
158 frequencies[n] = frequency * (float)wavetableLength / sampleRate;
166 memset(phases, 0,
sizeof(
float)*numOscillators);
167 memset(dFrequencies, 0,
sizeof(
float)*numOscillators);
168 memset(dAmplitudes, 0,
sizeof(
float)*numOscillators);
178 void process(
unsigned int frames,
float* output){
180 memset(output, 0, frames *
sizeof(
float));
181 oscillator_bank_neon(frames, output,
182 numOscillators, wavetableLength,
183 phases, frequencies, amplitudes,
184 dFrequencies, dAmplitudes,
void setFrequency(int n, float frequency)
Definition: OscillatorBank.h:156
float * getAmplitudes()
Definition: OscillatorBank.h:126
float * getWavetable()
Definition: OscillatorBank.h:97
float * getPhases()
Definition: OscillatorBank.h:136
void setAmplitude(int n, float amplitude)
Definition: OscillatorBank.h:146
void process(unsigned int frames, float *output)
Definition: OscillatorBank.h:178
int setup(float newSampleRate, unsigned int newWavetableLength, unsigned int newNumOscillators)
Definition: OscillatorBank.h:54
int getNumOscillators()
Definition: OscillatorBank.h:116
void clearArrays()
Definition: OscillatorBank.h:165
Definition: OscillatorBank.h:20
int getWavetableLength()
Definition: OscillatorBank.h:107