added random chance, some progress on pcb
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
#define SCREEN_ADDRESS 0x3C
|
||||
|
||||
#define PPQN 24
|
||||
#define PULSE_LENGTH 5 //ms
|
||||
#define PULSE_LENGTH 15 //ms
|
||||
#define MAXBPM 250 //250 at 24ppqn with 5ms pulse will be 50/50 square wave
|
||||
#define MINBPM 20
|
||||
|
||||
@ -28,7 +28,7 @@ unsigned int bpm = 130;
|
||||
|
||||
struct channel {
|
||||
unsigned int mode;
|
||||
int random;
|
||||
unsigned int random;
|
||||
bool modulationChannel; //0 - A1, 1 - A2
|
||||
int modulationRange;
|
||||
};
|
||||
@ -76,6 +76,7 @@ RotaryEncoder encoder(ENC_D1_PIN, ENC_D2_PIN, RotaryEncoder::LatchMode::TWO03);
|
||||
void setup() {
|
||||
Serial.begin(9600);
|
||||
|
||||
//saveState(); //for cases when structure is updated in the code
|
||||
EEPROM.get(0, bpm);
|
||||
EEPROM.get(sizeof(int), channels);
|
||||
|
||||
@ -126,7 +127,7 @@ void internalClock() {
|
||||
playingModes[i] = clockModes[channels[i].mode]; //updated here to prevent sync problems for multipliers
|
||||
if (playingModes[i] > 0) {
|
||||
if (outsClocksCounts[i] == 0) { //Pulse on 0
|
||||
if (channels[i].random == 0 || (channels[i].random == 1 && random(2))) { //random
|
||||
if (channels[i].random == 0 || random(channels[i].random) == 0) { //random
|
||||
digitalWrite(outsPins[i], HIGH);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user