kunark on Nostr: Créditos: Kowalski ...
Créditos: Kowalski (nprofile…l4p6)
//nome do buzzer
#define soprano 7
//frequência das notas de c3 a b5
int c3 = 130;
int c3s = 138;
int d3b = 138;
int d3 = 146;
int d3s = 155;
int e3b = 155;
int e3 = 164;
int f3 = 174;
int f3s = 185;
int g3b = 185;
int g3 = 196;
int g3s = 207;
int a3b = 207;
int a3 = 220;
int a3s = 233;
int b3b = 233;
int b3 = 246;
int c4 = 261;
int c4s = 277;
int d4b = 277;
int d4 = 293;
int d4s = 311;
int e4b = 311;
int e4 = 329;
int f4 = 349;
int f4s = 369;
int g4b = 369;
int g4 = 392;
int g4s = 415;
int a4b = 415;
int a4 = 440;
int a4s = 466;
int b4b = 466;
int b4 = 493;
int c5 = 523;
int c5s = 554;
int d5b = 554;
int d5 = 587;
int d5s = 622;
int e5b = 622;
int e5 = 659;
int f5 = 698;
int f5s = 739;
int g5b = 739;
int g5 = 783;
int g5s = 830;
int a5b = 830;
int a5 = 880;
int a5s = 932;
int b5b = 932;
int b5 = 987;
//Formula: ms = 60 * (t / bpm)
//ms = segundos*1000; bmp = batidas por minuto; t = tempo da nota
int bpm;
// valores de tempo
int f_tmp = 500;
int tmp = 10;
int sb = 4000;
int sbp = 6000;
int m = 2000;
int mp = 3000;
int sm = 1000;
int smp = 1500;
int c = 500;
int cp = 750;
int sc = 250;
int scp = 375;
void setup() {
Serial.begin(9600);
pinMode(soprano, OUTPUT);
noTone(soprano);
}
void n(int nota, int tempo) {
//função que determina a nota e seu respectivo tempo a ser tocado
tone(soprano, nota);
delay(60 * (tempo / bpm));
noTone(soprano);
delay(tmp);
}
void p(int tempo) {
//pausa: intervalo do som
delay(tempo / 2);
}
void f(int nota, int tempo) {
//fermata: prolongamento do som
tone(soprano, nota);
delay(60 * (tempo / bpm));
noTone(soprano);
delay(f_tmp);
}
void t(int nota1, int nota2, int nota3, int tempo) {
//tercina: três notas executadas onde caberiam duas
tone(soprano, nota1);
delay(((60 * (tempo / bpm)) * 2) / 3);
noTone(soprano);
tone(soprano, nota2);
delay(((60 * (tempo / bpm)) * 2) / 3);
noTone(soprano);
tone(soprano, nota3);
delay(((60 * (tempo / bpm)) * 2) / 3);
noTone(soprano);
delay(10);
}
void loop() {
//toca a musica ao inserir o nome da música
if (Serial.available() > 0) {
String music = Serial.readStringUntil('\n');
if(music == "RULE") {
bpm = 125;
RULE();
}
}
}
void RULE() {
//[Ado] RuLe - TONALIDADE RÉ BEMOL MAIOR - QUATERNÁRIO SIMPLES
//01
n(b4, c);
n(a4b, c);
n(b4, c);
n(a4b, c);
n(b4, c);
n(a4b, c);
n(e5b, c);
n(d5, (c + c));
//02
n(b4, c);
n(d5, c);
n(e5b, c);
n(d5b, c);
n(b4b, c);
n(b4, c);
t(b4b, b4b, b4b, sc);
//03
n(b4, c);
n(a4b, c);
n(b4, c);
n(a4b, c);
n(b4, c);
n(a4b, c);
n(e5b, c);
n(d5, (c + c));
//04
n(d5, c);
n(d5, c);
n(d5, c);
n(d5b, sm);
p(sm);
//05
n(b4, sm);
n(a4b, sm);
n(g4b, c);
n(a4b, sm);
n(d5, (c + c));
//06
n(d5, c);
n(d5, c);
n(d5, c);
n(d5b, sm);
p(c);
n(a4b, c);
//07
n(b4, sm);
n(a4b, sm);
n(g4b, c);
n(a4b, sm);
n(d4, (c + c));
//08
n(d4, c);
n(d4, c);
n(d4, c);
n(d4b, sm);
p(c);
n(a4b, c);
//09
n(b4, sm);
n(a4b, sm);
n(g4b, c);
n(a4b, sm);
n(d5, (c + c));
//10
n(d5, c);
n(d5, c);
n(d5, c);
n(d5b, sm);
p(c);
n(a4b, c);
//11
n(b4, sm);
n(a4b, sm);
n(g4b, c);
n(a4b, sm);
n(d4, (c + c));
//12
n(d4, c);
n(d4, c);
n(d4, c);
n(d4b, c);
p(sm);
n(e4b, c);
//13
n(b4, c);
n(a4b, sm);
n(e4b, c);
n(b4, c);
n(a4b, sm);
n(d4, c);
//14
n(e4b, c);
n(e4b, c);
n(d4, c);
n(e4b, c);
n(b4, c);
n(a4b, sm);
n(e4b, c);
//15
n(a4b, c);
n(a4b, c);
n(g4b, c);
n(g4b, c);
n(d4b, c);
n(b4, c);
n(d4b, c);
n(d4b, c);
//16 legato
n(b4, mp);
p(c);
n(e4b, c);
//17
n(b4, c);
n(a4b, sm);
n(e4b, c);
n(b4, c);
n(a4b, sm);
n(d4, c);
//18
n(e4b, c);
n(e4b, c);
n(d4, c);
n(e4b, c);
n(b4, c);
n(a4b, sm);
n(b4, c);
//19
n(d5b, c);
n(d5b, c);
n(d5b, c);
n(d5b, c);
n(d5b, c);
n(b4, c);
n(e5b, c);
n(d5b, c);
//20 legato
n(a4b, mp);
p(c);
n(e4b, c);
//21
n(b4, c);
n(a4b, sm);
n(e4b, c);
n(b4, c);
n(a4b, sm);
n(d4, c);
//22
n(e4b, c);
n(e4b, c);
n(d4, c);
n(e4b, c);
n(b4, c);
n(a4b, sm);
n(e4b, c);
//23
n(a4b, c);
n(a4b, c);
n(g4b, c);
n(g4b, c);
n(d4b, c);
n(b4, c);
n(d4b, c);
n(d4b, c);
//24 legato
n(b4, mp);
p(c);
n(e4b, c);
//25
n(b4, c);
n(a4b, sm);
n(e4b, c);
n(b4, c);
n(a4b, sm);
n(d4, c);
//26
n(e4b, c);
n(e4b, c);
n(d4, c);
n(e4b, c);
n(b4, c);
n(a4b, sm);
n(b4, c);
//27
n(d5b, c);
n(d5b, c);
n(d5b, c);
n(d5b, c);
n(d5b, c);
n(b4, c);
n(e5b, c);
n(d5b, (c + c));
//28
n(a4b, sm);
p(sm);
p(sc);
n(a4b, cp);
n(a4b, c);
//29
n(b4, c);
n(b4b, sc);
n(b4, c);
n(b4, c);
n(b4, sc);
t(b4, b4, b4b, scp);
n(b4, c);
n(b4, sc);
n(b4, c);
//30
n(b4, c);
n(b4, sc);
n(b4, c);
n(d5b, sc);
n(b4, c);
n(e5b, sm);
p(c);
n(b4b, sc);
n(b4b, sc);
//31
n(b4, cp);
n(b4, sc);
n(b4, sc);
n(b4, sc);
n(b4, c);
n(b4, sc);
n(b4, c);
n(b4, cp);
n(a4b, sc);
n(a4b, sc);
//32
t(b4, b4, b4b, scp);
n(b4, c);
n(b4, sc);
n(b4, c);
n(a4b, sm);
p(c);
n(a4b, sc);
n(a4b, sc);
//33
n(b4, sc);
n(b4, sc);
n(b4, sc);
n(b4, sc);
n(d5b, sc);
n(b4, c);
n(b4, sc);
t(b4, b4, b4, scp);
n(b4, c);
n(b4, sc);
n(b4, sc);
n(b4, sc);
//34
n(b4, sc);
n(b4, sc);
n(b4, sc);
n(b4, sc);
n(b4, sc);
n(b4, sc);
n(b4, c);
n(e5b, sm);
p(c);
n(a4b, sc);
n(a4b, sc);
//35
n(b4, sc);
n(b4, c);
n(b4, sc);
n(b4, sc);
n(b4, sc);
n(b4, c);
n(e5b, c);
n(b4, sc);
n(b4, c);
n(b4, c);
n(b4b, sc);
//36
n(b4, c);
n(b4b, sc);
n(b4, c);
n(b4, sc);
n(a4b, sm);
//*
n(e4b, c);
n(a4b, c);
n(b4b, c);
//37
n(b4, smp);
n(e4b, c);
n(a4b, c);
n(b4b, c);
n(b4, sm);
//38
n(g4, c);
n(a4b, c);
n(b4b, c);
n(b4, sm);
n(a4b, c);
n(a4b, c);
n(a4b, c);
//39
n(e5b, sm);
n(d5b, c);
n(e5b, sm);
n(d5b, c);
n(e5b, sm);
//40
n(b4, m);
p(c);
n(e4b, c);
n(a4b, c);
n(b4b, c);
//41
n(b4, smp);
n(e4b, c);
n(a4b, c);
n(b4b, c);
n(b4, sm);
//42
n(g4, c);
n(a4b, c);
n(b4b, c);
n(b4, sm);
n(a4b, c);
n(a4b, c);
n(a4b, c);
//43
n(e5b, sm);
n(d5b, c);
n(e5b, sm);
n(d5b, c);
n(e5b, sm);
//44
n(b4, sm);
p(sm);
p(sm);
p(sm);
//45
n(b4, c);
n(b4, c);
n(b4, c);
n(b4, c);
n(b4, c);
n(b4, c);
n(b4, c);
n(b4, c);
//46
n(b4b, c);
n(b4b, c);
n(b4b, c);
n(b4b, c);
n(a4, c);
n(a4, c);
n(a4, c);
n(a4, c);
//47
n(a4b, m);
p(sm);
p(sm);
//48
n(b4, sm);
n(a4b, sm);
n(g4b, c);
n(a4b, sm);
n(d5, (c + c));
//49
n(d5, c);
n(d5, c);
n(d5, c);
n(d5b, sm);
p(c);
n(a4b, c);
//50
n(b4, sm);
n(a4b, sm);
n(g4b, c);
n(a4b, sm);
n(d4, (c + c));
//51
n(d4, c);
n(d4, c);
n(d4, c);
n(d4b, sm);
p(c);
n(a3b, c);
//52
n(b3, sm);
n(a3b, sm);
n(g3b, c);
n(a3b, sm);
n(d4, (c + c));
//53
n(d4, c);
n(d4, c);
n(d4, c);
n(d4b, sm);
p(c);
n(a3b, c);
//54
n(b3, sm);
n(a3b, sm);
n(g3b, c);
n(a3b, sm);
n(d3, (c + c));
//55
n(d3, c);
n(d3, c);
n(d3, c);
n(d3b, c);
p(sm);
n(a4b, c);
//56
n(b4, sm);
n(a4b, sm);
n(g4b, c);
n(a4b, c);
}
//nome do buzzer
#define soprano 7
//frequência das notas de c3 a b5
int c3 = 130;
int c3s = 138;
int d3b = 138;
int d3 = 146;
int d3s = 155;
int e3b = 155;
int e3 = 164;
int f3 = 174;
int f3s = 185;
int g3b = 185;
int g3 = 196;
int g3s = 207;
int a3b = 207;
int a3 = 220;
int a3s = 233;
int b3b = 233;
int b3 = 246;
int c4 = 261;
int c4s = 277;
int d4b = 277;
int d4 = 293;
int d4s = 311;
int e4b = 311;
int e4 = 329;
int f4 = 349;
int f4s = 369;
int g4b = 369;
int g4 = 392;
int g4s = 415;
int a4b = 415;
int a4 = 440;
int a4s = 466;
int b4b = 466;
int b4 = 493;
int c5 = 523;
int c5s = 554;
int d5b = 554;
int d5 = 587;
int d5s = 622;
int e5b = 622;
int e5 = 659;
int f5 = 698;
int f5s = 739;
int g5b = 739;
int g5 = 783;
int g5s = 830;
int a5b = 830;
int a5 = 880;
int a5s = 932;
int b5b = 932;
int b5 = 987;
//Formula: ms = 60 * (t / bpm)
//ms = segundos*1000; bmp = batidas por minuto; t = tempo da nota
int bpm;
// valores de tempo
int f_tmp = 500;
int tmp = 10;
int sb = 4000;
int sbp = 6000;
int m = 2000;
int mp = 3000;
int sm = 1000;
int smp = 1500;
int c = 500;
int cp = 750;
int sc = 250;
int scp = 375;
void setup() {
Serial.begin(9600);
pinMode(soprano, OUTPUT);
noTone(soprano);
}
void n(int nota, int tempo) {
//função que determina a nota e seu respectivo tempo a ser tocado
tone(soprano, nota);
delay(60 * (tempo / bpm));
noTone(soprano);
delay(tmp);
}
void p(int tempo) {
//pausa: intervalo do som
delay(tempo / 2);
}
void f(int nota, int tempo) {
//fermata: prolongamento do som
tone(soprano, nota);
delay(60 * (tempo / bpm));
noTone(soprano);
delay(f_tmp);
}
void t(int nota1, int nota2, int nota3, int tempo) {
//tercina: três notas executadas onde caberiam duas
tone(soprano, nota1);
delay(((60 * (tempo / bpm)) * 2) / 3);
noTone(soprano);
tone(soprano, nota2);
delay(((60 * (tempo / bpm)) * 2) / 3);
noTone(soprano);
tone(soprano, nota3);
delay(((60 * (tempo / bpm)) * 2) / 3);
noTone(soprano);
delay(10);
}
void loop() {
//toca a musica ao inserir o nome da música
if (Serial.available() > 0) {
String music = Serial.readStringUntil('\n');
if(music == "RULE") {
bpm = 125;
RULE();
}
}
}
void RULE() {
//[Ado] RuLe - TONALIDADE RÉ BEMOL MAIOR - QUATERNÁRIO SIMPLES
//01
n(b4, c);
n(a4b, c);
n(b4, c);
n(a4b, c);
n(b4, c);
n(a4b, c);
n(e5b, c);
n(d5, (c + c));
//02
n(b4, c);
n(d5, c);
n(e5b, c);
n(d5b, c);
n(b4b, c);
n(b4, c);
t(b4b, b4b, b4b, sc);
//03
n(b4, c);
n(a4b, c);
n(b4, c);
n(a4b, c);
n(b4, c);
n(a4b, c);
n(e5b, c);
n(d5, (c + c));
//04
n(d5, c);
n(d5, c);
n(d5, c);
n(d5b, sm);
p(sm);
//05
n(b4, sm);
n(a4b, sm);
n(g4b, c);
n(a4b, sm);
n(d5, (c + c));
//06
n(d5, c);
n(d5, c);
n(d5, c);
n(d5b, sm);
p(c);
n(a4b, c);
//07
n(b4, sm);
n(a4b, sm);
n(g4b, c);
n(a4b, sm);
n(d4, (c + c));
//08
n(d4, c);
n(d4, c);
n(d4, c);
n(d4b, sm);
p(c);
n(a4b, c);
//09
n(b4, sm);
n(a4b, sm);
n(g4b, c);
n(a4b, sm);
n(d5, (c + c));
//10
n(d5, c);
n(d5, c);
n(d5, c);
n(d5b, sm);
p(c);
n(a4b, c);
//11
n(b4, sm);
n(a4b, sm);
n(g4b, c);
n(a4b, sm);
n(d4, (c + c));
//12
n(d4, c);
n(d4, c);
n(d4, c);
n(d4b, c);
p(sm);
n(e4b, c);
//13
n(b4, c);
n(a4b, sm);
n(e4b, c);
n(b4, c);
n(a4b, sm);
n(d4, c);
//14
n(e4b, c);
n(e4b, c);
n(d4, c);
n(e4b, c);
n(b4, c);
n(a4b, sm);
n(e4b, c);
//15
n(a4b, c);
n(a4b, c);
n(g4b, c);
n(g4b, c);
n(d4b, c);
n(b4, c);
n(d4b, c);
n(d4b, c);
//16 legato
n(b4, mp);
p(c);
n(e4b, c);
//17
n(b4, c);
n(a4b, sm);
n(e4b, c);
n(b4, c);
n(a4b, sm);
n(d4, c);
//18
n(e4b, c);
n(e4b, c);
n(d4, c);
n(e4b, c);
n(b4, c);
n(a4b, sm);
n(b4, c);
//19
n(d5b, c);
n(d5b, c);
n(d5b, c);
n(d5b, c);
n(d5b, c);
n(b4, c);
n(e5b, c);
n(d5b, c);
//20 legato
n(a4b, mp);
p(c);
n(e4b, c);
//21
n(b4, c);
n(a4b, sm);
n(e4b, c);
n(b4, c);
n(a4b, sm);
n(d4, c);
//22
n(e4b, c);
n(e4b, c);
n(d4, c);
n(e4b, c);
n(b4, c);
n(a4b, sm);
n(e4b, c);
//23
n(a4b, c);
n(a4b, c);
n(g4b, c);
n(g4b, c);
n(d4b, c);
n(b4, c);
n(d4b, c);
n(d4b, c);
//24 legato
n(b4, mp);
p(c);
n(e4b, c);
//25
n(b4, c);
n(a4b, sm);
n(e4b, c);
n(b4, c);
n(a4b, sm);
n(d4, c);
//26
n(e4b, c);
n(e4b, c);
n(d4, c);
n(e4b, c);
n(b4, c);
n(a4b, sm);
n(b4, c);
//27
n(d5b, c);
n(d5b, c);
n(d5b, c);
n(d5b, c);
n(d5b, c);
n(b4, c);
n(e5b, c);
n(d5b, (c + c));
//28
n(a4b, sm);
p(sm);
p(sc);
n(a4b, cp);
n(a4b, c);
//29
n(b4, c);
n(b4b, sc);
n(b4, c);
n(b4, c);
n(b4, sc);
t(b4, b4, b4b, scp);
n(b4, c);
n(b4, sc);
n(b4, c);
//30
n(b4, c);
n(b4, sc);
n(b4, c);
n(d5b, sc);
n(b4, c);
n(e5b, sm);
p(c);
n(b4b, sc);
n(b4b, sc);
//31
n(b4, cp);
n(b4, sc);
n(b4, sc);
n(b4, sc);
n(b4, c);
n(b4, sc);
n(b4, c);
n(b4, cp);
n(a4b, sc);
n(a4b, sc);
//32
t(b4, b4, b4b, scp);
n(b4, c);
n(b4, sc);
n(b4, c);
n(a4b, sm);
p(c);
n(a4b, sc);
n(a4b, sc);
//33
n(b4, sc);
n(b4, sc);
n(b4, sc);
n(b4, sc);
n(d5b, sc);
n(b4, c);
n(b4, sc);
t(b4, b4, b4, scp);
n(b4, c);
n(b4, sc);
n(b4, sc);
n(b4, sc);
//34
n(b4, sc);
n(b4, sc);
n(b4, sc);
n(b4, sc);
n(b4, sc);
n(b4, sc);
n(b4, c);
n(e5b, sm);
p(c);
n(a4b, sc);
n(a4b, sc);
//35
n(b4, sc);
n(b4, c);
n(b4, sc);
n(b4, sc);
n(b4, sc);
n(b4, c);
n(e5b, c);
n(b4, sc);
n(b4, c);
n(b4, c);
n(b4b, sc);
//36
n(b4, c);
n(b4b, sc);
n(b4, c);
n(b4, sc);
n(a4b, sm);
//*
n(e4b, c);
n(a4b, c);
n(b4b, c);
//37
n(b4, smp);
n(e4b, c);
n(a4b, c);
n(b4b, c);
n(b4, sm);
//38
n(g4, c);
n(a4b, c);
n(b4b, c);
n(b4, sm);
n(a4b, c);
n(a4b, c);
n(a4b, c);
//39
n(e5b, sm);
n(d5b, c);
n(e5b, sm);
n(d5b, c);
n(e5b, sm);
//40
n(b4, m);
p(c);
n(e4b, c);
n(a4b, c);
n(b4b, c);
//41
n(b4, smp);
n(e4b, c);
n(a4b, c);
n(b4b, c);
n(b4, sm);
//42
n(g4, c);
n(a4b, c);
n(b4b, c);
n(b4, sm);
n(a4b, c);
n(a4b, c);
n(a4b, c);
//43
n(e5b, sm);
n(d5b, c);
n(e5b, sm);
n(d5b, c);
n(e5b, sm);
//44
n(b4, sm);
p(sm);
p(sm);
p(sm);
//45
n(b4, c);
n(b4, c);
n(b4, c);
n(b4, c);
n(b4, c);
n(b4, c);
n(b4, c);
n(b4, c);
//46
n(b4b, c);
n(b4b, c);
n(b4b, c);
n(b4b, c);
n(a4, c);
n(a4, c);
n(a4, c);
n(a4, c);
//47
n(a4b, m);
p(sm);
p(sm);
//48
n(b4, sm);
n(a4b, sm);
n(g4b, c);
n(a4b, sm);
n(d5, (c + c));
//49
n(d5, c);
n(d5, c);
n(d5, c);
n(d5b, sm);
p(c);
n(a4b, c);
//50
n(b4, sm);
n(a4b, sm);
n(g4b, c);
n(a4b, sm);
n(d4, (c + c));
//51
n(d4, c);
n(d4, c);
n(d4, c);
n(d4b, sm);
p(c);
n(a3b, c);
//52
n(b3, sm);
n(a3b, sm);
n(g3b, c);
n(a3b, sm);
n(d4, (c + c));
//53
n(d4, c);
n(d4, c);
n(d4, c);
n(d4b, sm);
p(c);
n(a3b, c);
//54
n(b3, sm);
n(a3b, sm);
n(g3b, c);
n(a3b, sm);
n(d3, (c + c));
//55
n(d3, c);
n(d3, c);
n(d3, c);
n(d3b, c);
p(sm);
n(a4b, c);
//56
n(b4, sm);
n(a4b, sm);
n(g4b, c);
n(a4b, c);
}