apuntes_Arduino/buzzer/midi_to_ino/midi_to_ino.ino
jp.av.dev 85bf8bb429 proyectos renombrados, reestructuracion
pendientes crear, indexar y linkear readmes
2022-04-04 01:11:04 -04:00

342 lines
10 KiB
C++
Executable File

// Credit:
// Midi to Arduino Converter
// - Andy Tran (extramaster), 2015
// https://www.extramaster.net/tools/midiToArduino/
//
// Process:
// Midi -> Midi tracks -> Note mappings -> Frequency
//
// CC0
// Set this to be the pin that your buzzer resides in. (Note that you can only have one buzzer actively using the PWM signal at a time).
int tonePin = 11;
void setup() {
}
void midi() {
tone(tonePin, 146, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 369, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 220, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 277, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 164, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 391, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 293, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 246, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 146, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 369, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 220, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 277, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 164, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 391, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 293, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 246, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 146, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 369, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 220, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 277, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 164, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 391, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 293, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 233, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 184, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 440, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 277, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 329, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 246, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 369, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 587, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 440, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 220, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 329, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 554, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 391, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 195, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 293, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 493, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 369, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 146, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 369, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 220, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 277, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 164, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 391, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 293, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 246, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 146, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 369, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 220, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 277, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 164, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 391, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 293, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 246, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 146, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 369, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 220, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 277, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 164, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 391, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 293, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 233, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 184, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 440, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 277, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 329, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 246, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 369, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 587, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 440, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 220, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 329, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 554, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 391, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 195, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 293, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 493, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 369, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 146, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 369, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 220, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 277, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 164, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 391, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 293, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 246, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 146, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 369, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 220, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 277, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 164, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 391, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 293, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 246, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 146, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 369, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 220, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 277, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 164, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 391, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 293, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 233, 97.977354375);
delay(108.863727083);
delay(0.227272916667);
tone(tonePin, 146, 392.523054375);
delay(436.136727083);
}
void loop() {
// Play midi
midi();
delay(2000);
}