shift + play = mute channel
This commit is contained in:
@ -9,7 +9,7 @@
|
||||
#include "config.h"
|
||||
#include "fonts.h"
|
||||
|
||||
#define VERSION "V:1.2A"
|
||||
#define VERSION "V:1.2A2"
|
||||
|
||||
byte memCode = 'd'; //Change to different letter if you changed the data structure
|
||||
|
||||
@ -33,15 +33,16 @@ struct channel {
|
||||
uint8_t swing : 3;
|
||||
uint8_t offset : 7; //mv: 128
|
||||
uint8_t gate : 6; //mv: 64
|
||||
bool isMute : 1;
|
||||
};
|
||||
|
||||
channel channels[6] = { //array of channel settings
|
||||
{ 0, 7, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 7, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 7, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 7, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 7, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 7, 0, 0, 0, 0, 0, 0, 0 }
|
||||
{ 0, 7, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 7, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 7, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 7, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 7, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 7, 0, 0, 0, 0, 0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
bool seqA1[16] = {1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1}; //switch to struct seqs { uint32_t sequence; uint8_t length : 5 ; uint8_t currentStep : 5}. test with lengthOf
|
||||
@ -415,19 +416,20 @@ void sendTriggers() { //rename to onPulse or something
|
||||
digitalWrite(outsPins[i], LOW);
|
||||
}
|
||||
}
|
||||
if (!channels[i].isMute) {
|
||||
if ((channels[i].mode == 3 && channelPulseCount[i] == 0 && stepIsOdd == 0)
|
||||
|| (channels[i].mode == 3 && channelPulseCount[i] == channels[i].swing && stepIsOdd == 1) //swing
|
||||
) {
|
||||
digitalWrite(outsPins[i], HIGH);
|
||||
}
|
||||
|
||||
if ((channels[i].mode == 3 && channelPulseCount[i] == 0 && stepIsOdd == 0)
|
||||
|| (channels[i].mode == 3 && channelPulseCount[i] == channels[i].swing && stepIsOdd == 1) //swing
|
||||
) {
|
||||
digitalWrite(outsPins[i], HIGH);
|
||||
}
|
||||
|
||||
if ((channels[i].mode == 0 && channelPulseCount[i] == channels[i].offset) //CLK with offset
|
||||
|| (channels[i].mode == 1 && channelPulseCount[i] == 0 && (random(10) + 1) > randAmount) //RND
|
||||
|| (channels[i].mode == 4 && channelPulseCount[i] == 0) //Gate
|
||||
) {
|
||||
digitalWrite(outsPins[i], HIGH);
|
||||
gatePulseCount[i] = 0; //reset gate here to avoid length "countdown" effect
|
||||
if ((channels[i].mode == 0 && channelPulseCount[i] == channels[i].offset) //CLK with offset
|
||||
|| (channels[i].mode == 1 && channelPulseCount[i] == 0 && (random(10) + 1) > randAmount) //RND
|
||||
|| (channels[i].mode == 4 && channelPulseCount[i] == 0) //Gate
|
||||
) {
|
||||
digitalWrite(outsPins[i], HIGH);
|
||||
gatePulseCount[i] = 0; //reset gate here to avoid length "countdown" effect
|
||||
}
|
||||
}
|
||||
if (channelPulseCount[i] < channelPulsesPerCycle[i]) {
|
||||
channelPulseCount[i]++;
|
||||
|
||||
@ -392,7 +392,7 @@ void checkInputs() {
|
||||
}
|
||||
|
||||
//play button
|
||||
if (!digitalRead(START_STOP_BTN_PIN) && !playBtnPushed) {
|
||||
if (!digitalRead(START_STOP_BTN_PIN) && !playBtnPushed && !shiftBtnPushed) {
|
||||
if (masterClockMode == 0) {
|
||||
calculateBPMTiming();
|
||||
if (!isPlaying) {
|
||||
@ -411,6 +411,15 @@ void checkInputs() {
|
||||
playBtnPushed = false;
|
||||
}
|
||||
|
||||
//shift + play = mute channel
|
||||
if (!digitalRead(START_STOP_BTN_PIN) && !playBtnPushed && shiftBtnPushed) {
|
||||
channels[displayTab - 1].isMute = !channels[displayTab - 1].isMute;
|
||||
playBtnPushed = true;
|
||||
updateScreen(); //to wake up the screen if turned off
|
||||
} else if (digitalRead(START_STOP_BTN_PIN) && playBtnPushed) {
|
||||
playBtnPushed = false;
|
||||
}
|
||||
|
||||
//shift button
|
||||
if (!digitalRead(SHIFT_BTN_PIN) && !shiftBtnPushed) {
|
||||
shiftBtnPushed = true;
|
||||
|
||||
Reference in New Issue
Block a user