shift + play = mute channel

This commit is contained in:
Oleksiy
2025-03-04 20:42:51 +02:00
parent 3552cfd2f5
commit d04e7b0dbb
2 changed files with 31 additions and 20 deletions

View File

@ -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]++;