diff --git a/Makefile b/Makefile index ae0649c..51b923e 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,10 @@ TARGET = cascade -CPP_SOURCES = src/main.cpp src/util.cpp src/menu.cpp \ - src/droplets/droplet.cpp src/droplets/noise_droplet.cpp +CPP_SOURCES = src/main.cpp \ + src/util.cpp \ + src/menu.cpp \ + src/droplets/droplet.cpp \ + src/droplets/noise_droplet.cpp LIBDAISY_DIR = ./lib/libDaisy DAISYSP_DIR = ./lib/daisySP diff --git a/src/droplets/droplet.cpp b/src/droplets/droplet.cpp index 6908a69..36820ba 100644 --- a/src/droplets/droplet.cpp +++ b/src/droplets/droplet.cpp @@ -10,8 +10,10 @@ void Droplet::UpdateState(DropletState m_state) { screen_min = 0; screen_max = SSD1309_WIDTH; if (state == DropletState::kLeft) { + chn_max = 2; screen_max = SSD1309_WIDTH / 2; } else if (state == DropletState::kRight) { + chn_min = 2; screen_min = SSD1309_WIDTH / 2; } } diff --git a/src/droplets/droplet.h b/src/droplets/droplet.h index e8536ad..68f42da 100644 --- a/src/droplets/droplet.h +++ b/src/droplets/droplet.h @@ -23,6 +23,8 @@ class Droplet { const int kTitleHeight = 8; int screen_min; int screen_max; + size_t chn_min = 0; + size_t chn_max = 4; void DrawName(daisy::DaisyPatch*, std::string); void UpdateState(DropletState); diff --git a/src/droplets/noise_droplet.cpp b/src/droplets/noise_droplet.cpp index 0cc86f2..a5be79d 100644 --- a/src/droplets/noise_droplet.cpp +++ b/src/droplets/noise_droplet.cpp @@ -5,7 +5,6 @@ NoiseDroplet::NoiseDroplet(DaisyPatch* m_patch, DropletState m_state) { noise.Init(); filter.Init(); - patch = m_patch; UpdateState(m_state); } @@ -14,13 +13,6 @@ void NoiseDroplet::Control() {} void NoiseDroplet::Process(float** in, float** out, size_t size) { for (size_t i = 0; i < size; i += 2) { float sig = noise.Process(); - 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; }