mirror of
https://github.com/AquaMorph/Droplets.git
synced 2025-04-30 01:35:34 +00:00
Moved outputs size adjustments to droplets
This commit is contained in:
parent
e691e12646
commit
c334aaa6bb
7
Makefile
7
Makefile
@ -1,7 +1,10 @@
|
|||||||
TARGET = cascade
|
TARGET = cascade
|
||||||
|
|
||||||
CPP_SOURCES = src/main.cpp src/util.cpp src/menu.cpp \
|
CPP_SOURCES = src/main.cpp \
|
||||||
src/droplets/droplet.cpp src/droplets/noise_droplet.cpp
|
src/util.cpp \
|
||||||
|
src/menu.cpp \
|
||||||
|
src/droplets/droplet.cpp \
|
||||||
|
src/droplets/noise_droplet.cpp
|
||||||
|
|
||||||
LIBDAISY_DIR = ./lib/libDaisy
|
LIBDAISY_DIR = ./lib/libDaisy
|
||||||
DAISYSP_DIR = ./lib/daisySP
|
DAISYSP_DIR = ./lib/daisySP
|
||||||
|
@ -10,8 +10,10 @@ void Droplet::UpdateState(DropletState m_state) {
|
|||||||
screen_min = 0;
|
screen_min = 0;
|
||||||
screen_max = SSD1309_WIDTH;
|
screen_max = SSD1309_WIDTH;
|
||||||
if (state == DropletState::kLeft) {
|
if (state == DropletState::kLeft) {
|
||||||
|
chn_max = 2;
|
||||||
screen_max = SSD1309_WIDTH / 2;
|
screen_max = SSD1309_WIDTH / 2;
|
||||||
} else if (state == DropletState::kRight) {
|
} else if (state == DropletState::kRight) {
|
||||||
|
chn_min = 2;
|
||||||
screen_min = SSD1309_WIDTH / 2;
|
screen_min = SSD1309_WIDTH / 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,8 @@ class Droplet {
|
|||||||
const int kTitleHeight = 8;
|
const int kTitleHeight = 8;
|
||||||
int screen_min;
|
int screen_min;
|
||||||
int screen_max;
|
int screen_max;
|
||||||
|
size_t chn_min = 0;
|
||||||
|
size_t chn_max = 4;
|
||||||
void DrawName(daisy::DaisyPatch*,
|
void DrawName(daisy::DaisyPatch*,
|
||||||
std::string);
|
std::string);
|
||||||
void UpdateState(DropletState);
|
void UpdateState(DropletState);
|
||||||
|
@ -5,7 +5,6 @@ NoiseDroplet::NoiseDroplet(DaisyPatch* m_patch,
|
|||||||
DropletState m_state) {
|
DropletState m_state) {
|
||||||
noise.Init();
|
noise.Init();
|
||||||
filter.Init();
|
filter.Init();
|
||||||
patch = m_patch;
|
|
||||||
UpdateState(m_state);
|
UpdateState(m_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -14,13 +13,6 @@ 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();
|
||||||
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++) {
|
for (size_t chn = chn_min; chn < chn_max; chn++) {
|
||||||
out[chn][i] = sig;
|
out[chn][i] = sig;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user