From 53ad1c95041e24d647bf8b5d3489220c03a73d30 Mon Sep 17 00:00:00 2001 From: Dooho Yi Date: Sat, 21 May 2022 05:51:32 +0900 Subject: [PATCH] add individual volume control for teensy --- @sampler/src/main.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/@sampler/src/main.cpp b/@sampler/src/main.cpp index 66850d7..63bfbad 100644 --- a/@sampler/src/main.cpp +++ b/@sampler/src/main.cpp @@ -244,14 +244,17 @@ void receiveEvent(int numBytes) { // sample_now = key; // int velocity = str_velocity.toInt(); // 0 ~ 127 - float amp_gain = (float)velocity / 127.0; - // - amp_gain = amp_gain * GAIN_FACTOR; - // - amp1.gain(amp_gain); - amp2.gain(amp_gain); - // int gate = str_gate.toInt(); + // + if (velocity != 0 || gate == 2) { + float amp_gain = (float)velocity / 127.0; + // + amp_gain = amp_gain * GAIN_FACTOR; + // + amp1.gain(amp_gain); + amp2.gain(amp_gain); + } + // if (gate == 1) { //on 'start' // filter out re-triggering same note while it is playing. if (!playSdWav1.isPlaying() || sample_now != key) {