Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <title>Note & Pitch</title>
- </head>
- <body>
- <script>
- var note = prompt("Find Pitch Class for note: ", "");
- switch (note) {
- case "C":
- document.write("Pitch of " + note + " is 0.");
- break;
- case "B#":
- document.write("Pitch of " + note + " is 0.");
- break;
- case "C#":
- document.write("Pitch of " + note + " is 1.");
- break;
- case "Db":
- document.write("Pitch of " + note + " is 1.");
- break;
- case "D":
- document.write("Pitch of " + note + " is 2.");
- break;
- case "D#":
- document.write("Pitch of " + note + " is 3.");
- break;
- case "Eb":
- document.write("Pitch of " + note + " is 3.");
- break;
- case "E":
- document.write("Pitch of " + note + " is 4.");
- break;
- case "E#":
- document.write("Pitch of " + note + " is 5.");
- break;
- case "Fb":
- document.write("Pitch of " + note + " is 4.");
- break;
- case "F":
- document.write("Pitch of " + note + " is 5.");
- break;
- case "F#":
- document.write("Pitch of " + note + " is 6.");
- break;
- case "Gb":
- document.write("Pitch of " + note + " is 6.");
- break;
- case "G":
- document.write("Pitch of " + note + " is 7.");
- break;
- case "G#":
- document.write("Pitch of " + note + " is 8.");
- break;
- case "Ab":
- document.write("Pitch of " + note + " is 8.");
- break;
- case "A":
- document.write("Pitch of " + note + " is 9.");
- break;
- case "A#":
- document.write("Pitch of " + note + " is 10.");
- break;
- case "Bb":
- document.write("Pitch of " + note + " is 10.");
- break;
- case "B":
- document.write("Pitch of " + note + " is 11.");
- break;
- default:
- document.write("Please enter a valid note.");
- break;
- }
- document.write("<br />Just completed finding pitch class of a musical note!");
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement