Filling in the start of the connecticut halftime
brute force style.
This commit is contained in:
parent
390f83a65a
commit
06abc7febd
@ -1,15 +1,63 @@
|
||||
const unsigned int LED_PIN = 13;
|
||||
const unsigned int PAUSE = 700;
|
||||
const unsigned int NOTE_MULTIPLIER = 100;
|
||||
|
||||
const unsigned int QUARTER_NOTE = 8;
|
||||
const unsigned int EIGHTH_NOTE = 4;
|
||||
const unsigned int SIXTEENTH_NOTE = 2;
|
||||
const unsigned int THIRTYSECOND_NOTE = 1;
|
||||
|
||||
int measure0[] = {-8, -8, -8, 2, 2, 2, 2, 0};
|
||||
int measure1[] = {4, 2, 2, 4, 4, 4, -4, 2, 2, 2, 2, 0};
|
||||
int measure2[] = {4, 2, 2, 4, 4, 4, -4, 2, 2, 2, 2, 0};
|
||||
int measure3[] = {4, 4, 4, 4, 4, 4, 4, 4, 0};
|
||||
int measure4[] = {4, 2, 2, 4, 4, 4, -4, 2, 2, 2, 2, 0};
|
||||
int measure5[] = {4, 2, 2, 4, 4, 4, -4, 2, 2, 2, 2, 0};
|
||||
int measure6[] = {4, 2, 2, 4, 4, 4, -4, 2, 2, 2, 2, 0};
|
||||
int measure7[] = {4, 4, 4, 4, 4, 4, 4, 4, 0};
|
||||
int measure8[] = {4, 2, 2, 4, 4, 4, -4, 2, 2, 2, 2, 0};
|
||||
|
||||
int measurePop[] = {4, -4, -8, -8, -8, 0};
|
||||
|
||||
void playNote(int note) {
|
||||
if (note > 0) {
|
||||
digitalWrite(LED_PIN, HIGH);
|
||||
delay((NOTE_MULTIPLIER * note) / 2);
|
||||
digitalWrite(LED_PIN, LOW);
|
||||
delay((NOTE_MULTIPLIER * note) / 2);
|
||||
} else if (note < 0) {
|
||||
digitalWrite(LED_PIN, LOW);
|
||||
delay(NOTE_MULTIPLIER * (-1 * note));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void playMeasure(int measure[]) {
|
||||
for (int i = 0;;i++) {
|
||||
int note = measure[i];
|
||||
if (note == 0) {
|
||||
return;
|
||||
}
|
||||
playNote(note);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void setup() {
|
||||
pinMode(LED_PIN, OUTPUT);
|
||||
pinMode(LED_PIN, OUTPUT);
|
||||
}
|
||||
|
||||
|
||||
void loop() {
|
||||
digitalWrite(LED_PIN, HIGH);
|
||||
delay(PAUSE);
|
||||
digitalWrite(LED_PIN, LOW);
|
||||
delay(PAUSE);
|
||||
// int testMeasure[] = {2, 2, 2, 2, 2, -2, -2, -2, 0};
|
||||
// playMeasure(testMeasure);
|
||||
playMeasure(measure0);
|
||||
playMeasure(measure1);
|
||||
playMeasure(measure2);
|
||||
playMeasure(measure3);
|
||||
playMeasure(measure4);
|
||||
playMeasure(measure5);
|
||||
playMeasure(measure6);
|
||||
playMeasure(measure7);
|
||||
playMeasure(measure8);
|
||||
playMeasure(measurePop);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user