Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
momentollogy committed Apr 15, 2023
1 parent ed941e8 commit c192ae3
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -489,16 +489,16 @@ <h1>Arduino Piano Buzzer Song Creator V1 <br> <small>by momentollogy</small><br>

console.log('Playing note:', note); // Debug: log the current note

if (note.rest) {
console.log(`Waiting (rest) for ${note.duration}ms`); // Debug: log the rest duration
await new Promise(resolve => setTimeout(resolve, note.duration + timeBetweenNotesMs));
} else {
const keyElement = document.querySelector(`.key[data-note="${getKeyCodeForFrequency(note.frequency)}"]`);

if (!keyElement) {
console.error('Could not find key element for note:', note);
continue;
}
// if (note.rest) {
// console.log(`Waiting (rest) for ${note.duration}ms`); // Debug: log the rest duration
// await new Promise(resolve => setTimeout(resolve, note.duration + timeBetweenNotesMs));
// } else {
// const keyElement = document.querySelector(`.key[data-note="${getKeyCodeForFrequency(note.frequency)}"]`);
//
// if (!keyElement) {
// console.error('Could not find key element for note:', note);
// continue;
// }

const oscillator = playNote(note.frequency, keyElement);

Expand Down

0 comments on commit c192ae3

Please sign in to comment.