Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3.  
  4. <head>
  5. <title>Note & Pitch</title>
  6. </head>
  7.  
  8. <body>
  9. <script>
  10. var note = prompt("Find Pitch Class for note: ", "");
  11.  
  12. switch (note) {
  13. case "C":
  14. document.write("Pitch of " + note + " is 0.");
  15. break;
  16.  
  17. case "B#":
  18. document.write("Pitch of " + note + " is 0.");
  19. break;
  20.  
  21. case "C#":
  22. document.write("Pitch of " + note + " is 1.");
  23. break;
  24.  
  25. case "Db":
  26. document.write("Pitch of " + note + " is 1.");
  27. break;
  28.  
  29. case "D":
  30. document.write("Pitch of " + note + " is 2.");
  31. break;
  32.  
  33. case "D#":
  34. document.write("Pitch of " + note + " is 3.");
  35. break;
  36. case "Eb":
  37. document.write("Pitch of " + note + " is 3.");
  38. break;
  39. case "E":
  40. document.write("Pitch of " + note + " is 4.");
  41. break;
  42. case "E#":
  43. document.write("Pitch of " + note + " is 5.");
  44. break;
  45. case "Fb":
  46. document.write("Pitch of " + note + " is 4.");
  47. break;
  48. case "F":
  49. document.write("Pitch of " + note + " is 5.");
  50. break;
  51. case "F#":
  52. document.write("Pitch of " + note + " is 6.");
  53. break;
  54. case "Gb":
  55. document.write("Pitch of " + note + " is 6.");
  56. break;
  57. case "G":
  58. document.write("Pitch of " + note + " is 7.");
  59. break;
  60. case "G#":
  61. document.write("Pitch of " + note + " is 8.");
  62. break;
  63. case "Ab":
  64. document.write("Pitch of " + note + " is 8.");
  65. break;
  66. case "A":
  67. document.write("Pitch of " + note + " is 9.");
  68. break;
  69. case "A#":
  70. document.write("Pitch of " + note + " is 10.");
  71. break;
  72. case "Bb":
  73. document.write("Pitch of " + note + " is 10.");
  74. break;
  75. case "B":
  76. document.write("Pitch of " + note + " is 11.");
  77. break;
  78. default:
  79. document.write("Please enter a valid note.");
  80. break;
  81. }
  82.  
  83. document.write("<br />Just completed finding pitch class of a musical note!");
  84. </script>
  85.  
  86. </body>
  87.  
  88. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement