Noise generators now out of date

feature_setBlockSize
Chip Audette 8 years ago
parent f9c8926efb
commit 783e492d49
  1. 7
      NotUsed/synth_pinknoise_f32.h
  2. 33
      NotUsed/synth_whitenoise_f32.h

@ -20,7 +20,9 @@ class AudioSynthNoisePink_F32 : public AudioStream_F32
//GUI: shortName:pinknoise //this line used for automatic generation of GUI node //GUI: shortName:pinknoise //this line used for automatic generation of GUI node
public: public:
AudioSynthNoisePink_F32() : AudioStream_F32(0, NULL) { AudioSynthNoisePink_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,7 @@ public:
AudioConnection_F32 *patchCord101; AudioConnection_F32 *patchCord101;
void update(void) { void update(void) {
output_queue.clear(); output_queue.begin();
//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 +50,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);

@ -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,20 +36,23 @@ public:
AudioConnection_F32 *patchCord101; AudioConnection_F32 *patchCord101;
void update(void) { void update(void) {
output_queue.clear(); //Serial.println("AudioSynthNoiseWhite_F32: update().");
output_queue.begin();
//manually update audio blocks in the desired order //output_queue.clear();
noise.update(); //the output should be routed directly via the AudioConnection
i16_to_f32.update(); // output is routed via the AudioConnection //manually update audio blocks in the desired order
output_queue.update(); noise.update(); //the output should be routed directly via the AudioConnection
i16_to_f32.update(); // output is routed via the AudioConnection
//get the output output_queue.update();
audio_block_f32_t *block = output_queue.getAudioBlock();
if (block == NULL) return; //get the output
audio_block_f32_t *block = output_queue.getAudioBlock();
if (block == NULL) return;
//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);
Loading…
Cancel
Save