Noise changes output based on state

This commit is contained in:
Christian Colglazier 2020-09-13 09:39:04 -04:00
parent 2922aca05a
commit cb7fdcf50b
2 changed files with 8 additions and 2 deletions

View File

@ -14,7 +14,14 @@ void NoiseDroplet::Control() {}
void NoiseDroplet::Process(float** in, float** out, size_t size) { void NoiseDroplet::Process(float** in, float** out, size_t size) {
for (size_t i = 0; i < size; i += 2) { for (size_t i = 0; i < size; i += 2) {
float sig = noise.Process(); float sig = noise.Process();
for (size_t chn = 0; chn < 4; chn++) { size_t chn_min = 0;
size_t chn_max = 4;
if (state == DropletState::kLeft) {
chn_max = 2;
} else if (state == DropletState::kRight) {
chn_min = 2;
}
for (size_t chn = chn_min; chn < chn_max; chn++) {
out[chn][i] = sig; out[chn][i] = sig;
} }
} }

View File

@ -10,7 +10,6 @@
#include "droplets/noise_droplet.h" #include "droplets/noise_droplet.h"
using namespace daisy; using namespace daisy;
using namespace daisysp;
DaisyPatch patch; DaisyPatch patch;
Menu menu(&patch); Menu menu(&patch);