Lord help me I am passing variables by reference
parent
e5728416f0
commit
9ce26424a9
|
@ -72,13 +72,12 @@ void setup(void) {
|
||||||
void loop() {
|
void loop() {
|
||||||
long now = millis();
|
long now = millis();
|
||||||
runSequencer(seq1, now);
|
runSequencer(seq1, now);
|
||||||
Serial.println(seq1.noteOn);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void runSequencer(sequencer seq, long now) {
|
void runSequencer(sequencer& seq, long now) {
|
||||||
if( seq.noteOn ) {
|
if( seq.noteOn ) {
|
||||||
if( now - seq.last > seq.rel ) {
|
if( now - seq.last > seq.rel ) {
|
||||||
Serial.println("off");
|
Serial.println("noteOff");
|
||||||
noteOff(seq);
|
noteOff(seq);
|
||||||
seq.last = now;
|
seq.last = now;
|
||||||
seq.play = round(beat_m * seq.duration[seq.s] * (1.0 - gate));
|
seq.play = round(beat_m * seq.duration[seq.s] * (1.0 - gate));
|
||||||
|
@ -90,9 +89,11 @@ void runSequencer(sequencer seq, long now) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if( now - seq.last > seq.play ) {
|
if( now - seq.last > seq.play ) {
|
||||||
|
Serial.println("noteOn");
|
||||||
noteOn(seq, seq.melody[seq.s]);
|
noteOn(seq, seq.melody[seq.s]);
|
||||||
seq.last = now;
|
seq.last = now;
|
||||||
seq.rel = round(beat_m * seq.duration[seq.s] * gate);
|
seq.rel = round(beat_m * seq.duration[seq.s] * gate);
|
||||||
|
Serial.println(seq.rel);
|
||||||
seq.noteOn = true;
|
seq.noteOn = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue