Musical scale: Difference between revisions
→{{header|JavaScript}}: Music playing on page load doesn't work anymore
(→{{header|Vlang}}: Rename "Vlang" in "V (Vlang)") |
Simple9371 (talk | contribs) (→{{header|JavaScript}}: Music playing on page load doesn't work anymore) |
||
Line 628:
<meta charset="utf-8">
<title>Sample Page</title>
<
<body>▼
function musicalScale(freqArr){
// create web audio api context
Line 656 ⟶ 653:
oscillator.stop(audioCtx.currentTime + freqArr.length * duration);
}
musicalScale([261.63, 293.66, 329.63, 349.23, 392.00, 440.00, 493.88, 523.25]);▼
</script>
</head>
▲<body>
▲<button onclick="musicalScale([261.63, 293.66, 329.63, 349.23, 392.00, 440.00, 493.88, 523.25]);">Play scale</button>
</body>
</html></syntaxhighlight>
|