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