Skip to content

Commit

Permalink
Updated code for better compatibility with all arduino boards
Browse files Browse the repository at this point in the history
  • Loading branch information
robsoncouto committed Feb 11, 2019
1 parent f0eca3e commit 7930281
Show file tree
Hide file tree
Showing 20 changed files with 20 additions and 21 deletions.
2 changes: 1 addition & 1 deletion bloodytears/bloodytears.ino
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ const PROGMEM int melody[] = {

// sizeof gives the number of bytes, each int value is composed of two bytes (16 bits)
// there are two values per note (pitch and duration), so for each note there are four bytes
int notes = sizeof(melody) / 2 / 2;
int notes = sizeof(melody) / sizeof(melody[0]) / 2;

// this calculates the duration of a whole note in ms (60s/tempo)*4 beats
int wholenote = (60000 * 4) / tempo;
Expand Down
2 changes: 1 addition & 1 deletion cannonind/cannonind.ino
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ int melody[] = {

// sizeof gives the number of bytes, each int value is composed of two bytes (16 bits)
// there are two values per note (pitch and duration), so for each note there are four bytes
int notes = sizeof(melody) / 2 / 2;
int notes = sizeof(melody) / sizeof(melody[0]) / 2;

// this calculates the duration of a whole note in ms
int wholenote = (60000 * 4) / tempo;
Expand Down
2 changes: 1 addition & 1 deletion cantinaband/cantinaband.ino
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ int melody[] = {

// sizeof gives the number of bytes, each int value is composed of two bytes (16 bits)
// there are two values per note (pitch and duration), so for each note there are four bytes
int notes = sizeof(melody) / 2 / 2;
int notes = sizeof(melody) / sizeof(melody[0]) / 2;

// this calculates the duration of a whole note in ms
int wholenote = (60000 * 2) / tempo;
Expand Down
2 changes: 1 addition & 1 deletion greenhill/greenhill.ino
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ int melody[] = {

// sizeof gives the number of bytes, each int value is composed of two bytes (16 bits)
// there are two values per note (pitch and duration), so for each note there are four bytes
int notes = sizeof(melody) / 2 / 2;
int notes = sizeof(melody) / sizeof(melody[0]) / 2;

// this calculates the duration of a whole note in ms
int wholenote = (60000 * 4) / tempo;
Expand Down
2 changes: 1 addition & 1 deletion greensleeves/greensleeves.ino
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ int melody[] = {

// sizeof gives the number of bytes, each int value is composed of two bytes (16 bits)
// there are two values per note (pitch and duration), so for each note there are four bytes
int notes = sizeof(melody) / 2 / 2;
int notes = sizeof(melody) / sizeof(melody[0]) / 2;

// this calculates the duration of a whole note in ms
int wholenote = (60000 * 4) / tempo;
Expand Down
2 changes: 1 addition & 1 deletion harrypotter/harrypotter.ino
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ int melody[] = {

// sizeof gives the number of bytes, each int value is composed of two bytes (16 bits)
// there are two values per note (pitch and duration), so for each note there are four bytes
int notes = sizeof(melody) / 2 / 2;
int notes = sizeof(melody) / sizeof(melody[0]) / 2;

// this calculates the duration of a whole note in ms (60s/tempo)*4 beats
int wholenote = (60000 * 4) / tempo;
Expand Down
2 changes: 1 addition & 1 deletion imperialmarch/imperialmarch.ino
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ int melody[] = {

// sizeof gives the number of bytes, each int value is composed of two bytes (16 bits)
// there are two values per note (pitch and duration), so for each note there are four bytes
int notes = sizeof(melody) / 2 / 2;
int notes = sizeof(melody) / sizeof(melody[0]) / 2;

// this calculates the duration of a whole note in ms
int wholenote = (60000 * 4) / tempo;
Expand Down
2 changes: 1 addition & 1 deletion miichannel/miichannel.ino
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ int melody[] = {

// sizeof gives the number of bytes, each int value is composed of two bytes (16 bits)
// there are two values per note (pitch and duration), so for each note there are four bytes
int notes = sizeof(melody) / 2 / 2;
int notes = sizeof(melody) / sizeof(melody[0]) / 2;

// this calculates the duration of a whole note in ms
int wholenote = (60000 * 4) / tempo;
Expand Down
2 changes: 1 addition & 1 deletion odetojoy/odetojoy.ino
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ int melody[] = {

// sizeof gives the number of bytes, each int value is composed of two bytes (16 bits)
// there are two values per note (pitch and duration), so for each note there are four bytes
int notes=sizeof(melody)/2/2;
int notes=sizeof(melody)/sizeof(melody[0])/2;

// this calculates the duration of a whole note in ms (60s/tempo)*4 beats
int wholenote = (60000 * 4) / tempo;
Expand Down
2 changes: 1 addition & 1 deletion princeigor/princeigor.ino
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ int melody[] = {

// sizeof gives the number of bytes, each int value is composed of two bytes (16 bits)
// there are two values per note (pitch and duration), so for each note there are four bytes
int notes = sizeof(melody) / 2 / 2;
int notes = sizeof(melody) / sizeof(melody[0]) / 2;

// this calculates the duration of a whole note in ms (60s/tempo)*4 beats
int wholenote = (60000 * 4) / tempo;
Expand Down
2 changes: 1 addition & 1 deletion professorlayton/professorlayton.ino
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ int melody[] = {

// sizeof gives the number of bytes, each int value is composed of two bytes (16 bits)
// there are two values per note (pitch and duration), so for each note there are four bytes
int notes = sizeof(melody) / 2 / 2;
int notes = sizeof(melody) / sizeof(melody[0]) / 2;

// this calculates the duration of a whole note in ms
int wholenote = (60000 * 2) / tempo;
Expand Down
2 changes: 1 addition & 1 deletion pulodagaita/pulodagaita.ino
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ int melody[] = {

// sizeof gives the number of bytes, each int value is composed of two bytes (16 bits)
// there are two values per note (pitch and duration), so for each note there are four bytes
int notes = sizeof(melody) / 2 / 2;
int notes = sizeof(melody) / sizeof(melody[0]) / 2;

// this calculates the duration of a whole note in ms
int wholenote = (60000 * 4) / tempo;
Expand Down
2 changes: 1 addition & 1 deletion songofstorms/songofstorms.ino
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ int melody[] = {

// sizeof gives the number of bytes, each int value is composed of two bytes (16 bits)
// there are two values per note (pitch and duration), so for each note there are four bytes
int notes = sizeof(melody) / 2 / 2;
int notes = sizeof(melody) / sizeof(melody[0]) / 2;

// this calculates the duration of a whole note in ms
int wholenote = (60000 * 4) / tempo;
Expand Down
2 changes: 1 addition & 1 deletion starwars/starwars.ino
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ int melody[] = {

// sizeof gives the number of bytes, each int value is composed of two bytes (16 bits)
// there are two values per note (pitch and duration), so for each note there are four bytes
int notes = sizeof(melody) / 2 / 2;
int notes = sizeof(melody) / sizeof(melody[0]) / 2;

// this calculates the duration of a whole note in ms
int wholenote = (60000 * 4) / tempo;
Expand Down
2 changes: 1 addition & 1 deletion supermariobros/supermariobros.ino
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ int melody[] = {

// sizeof gives the number of bytes, each int value is composed of two bytes (16 bits)
// there are two values per note (pitch and duration), so for each note there are four bytes
int notes = sizeof(melody) / 2 / 2;
int notes = sizeof(melody) / sizeof(melody[0]) / 2;

// this calculates the duration of a whole note in ms
int wholenote = (60000 * 4) / tempo;
Expand Down
2 changes: 1 addition & 1 deletion tetris/tetris.ino
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ int melody[] = {

// sizeof gives the number of bytes, each int value is composed of two bytes (16 bits)
// there are two values per note (pitch and duration), so for each note there are four bytes
int notes=sizeof(melody)/2/2;
int notes=sizeof(melody)/sizeof(melody[0])/2;

// this calculates the duration of a whole note in ms (60s/tempo)*4 beats
int wholenote = (60000 * 4) / tempo;
Expand Down
2 changes: 1 addition & 1 deletion thelick/thelick.ino
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ int melody[] = {

// sizeof gives the number of bytes, each int value is composed of two bytes (16 bits)
// there are two values per note (pitch and duration), so for each note there are four bytes
int notes = sizeof(melody) / 2 / 2;
int notes = sizeof(melody) / sizeof(melody[0]) / 2;

// this calculates the duration of a whole note in ms
int wholenote = (60000 * 4) / tempo;
Expand Down
3 changes: 1 addition & 2 deletions thelionsleepstonight/thelionsleepstonight.ino
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
Robson Couto, 2019
*/


#define NOTE_B0 31
#define NOTE_C1 33
#define NOTE_CS1 35
Expand Down Expand Up @@ -205,7 +204,7 @@ int melody[] = {

// sizeof gives the number of bytes, each int value is composed of two bytes (16 bits)
// there are two values per note (pitch and duration), so for each note there are four bytes
int notes = sizeof(melody) / 2 / 2;
int notes = sizeof(melody) / sizeof(melody[0]) / 2;

// this calculates the duration of a whole note in ms
int wholenote = (60000 * 4) / tempo;
Expand Down
2 changes: 1 addition & 1 deletion zeldaslullaby/zeldaslullaby.ino
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ int melody[] = {

// sizeof gives the number of bytes, each int value is composed of two bytes (16 bits)
// there are two values per note (pitch and duration), so for each note there are four bytes
int notes = sizeof(melody) / 2 / 2;
int notes = sizeof(melody) / sizeof(melody[0]) / 2;

// this calculates the duration of a whole note in ms
int wholenote = (60000 * 4) / tempo;
Expand Down
2 changes: 1 addition & 1 deletion zeldatheme/zeldatheme.ino
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ int melody[] = {

// sizeof gives the number of bytes, each int value is composed of two bytes (16 bits)
// there are two values per note (pitch and duration), so for each note there are four bytes
int notes=sizeof(melody)/2/2;
int notes=sizeof(melody)/sizeof(melody[0])/2;

// this calculates the duration of a whole note in ms (60s/tempo)*4 beats
int wholenote = (60000 * 4) / tempo;
Expand Down

0 comments on commit 7930281

Please sign in to comment.