|
|
@ -20,7 +20,9 @@ class AudioSynthNoiseWhite_F32 : public AudioStream_F32 |
|
|
|
//GUI: shortName:whitenoise //this line used for automatic generation of GUI node
|
|
|
|
//GUI: shortName:whitenoise //this line used for automatic generation of GUI node
|
|
|
|
public: |
|
|
|
public: |
|
|
|
AudioSynthNoiseWhite_F32() : AudioStream_F32(0, NULL) { |
|
|
|
AudioSynthNoiseWhite_F32() : AudioStream_F32(0, NULL) { |
|
|
|
output_queue.begin(); |
|
|
|
noise.disconnectFromUpdateAll(); |
|
|
|
|
|
|
|
i16_to_f32.disconnectFromUpdateAll(); |
|
|
|
|
|
|
|
output_queue.disconnectFromUpdateAll(); |
|
|
|
|
|
|
|
|
|
|
|
patchCord100 = new AudioConnection(noise, 0, i16_to_f32, 0); //noise is an Int16 audio object. So, convert it!
|
|
|
|
patchCord100 = new AudioConnection(noise, 0, i16_to_f32, 0); //noise is an Int16 audio object. So, convert it!
|
|
|
|
patchCord101 = new AudioConnection_F32(i16_to_f32, 0, output_queue, 0); |
|
|
|
patchCord101 = new AudioConnection_F32(i16_to_f32, 0, output_queue, 0); |
|
|
@ -34,7 +36,9 @@ public: |
|
|
|
AudioConnection_F32 *patchCord101; |
|
|
|
AudioConnection_F32 *patchCord101; |
|
|
|
|
|
|
|
|
|
|
|
void update(void) { |
|
|
|
void update(void) { |
|
|
|
output_queue.clear(); |
|
|
|
//Serial.println("AudioSynthNoiseWhite_F32: update().");
|
|
|
|
|
|
|
|
output_queue.begin(); |
|
|
|
|
|
|
|
//output_queue.clear();
|
|
|
|
|
|
|
|
|
|
|
|
//manually update audio blocks in the desired order
|
|
|
|
//manually update audio blocks in the desired order
|
|
|
|
noise.update(); //the output should be routed directly via the AudioConnection
|
|
|
|
noise.update(); //the output should be routed directly via the AudioConnection
|
|
|
@ -48,6 +52,7 @@ public: |
|
|
|
//transmit the block, and release memory
|
|
|
|
//transmit the block, and release memory
|
|
|
|
AudioStream_F32::transmit(block); |
|
|
|
AudioStream_F32::transmit(block); |
|
|
|
output_queue.freeAudioBlock(); |
|
|
|
output_queue.freeAudioBlock(); |
|
|
|
|
|
|
|
output_queue.end(); |
|
|
|
} |
|
|
|
} |
|
|
|
void amplitude(float n) { |
|
|
|
void amplitude(float n) { |
|
|
|
noise.amplitude(n); |
|
|
|
noise.amplitude(n); |