wip - work on arp in progress

This commit is contained in:
Emanuel Rodriguez 2023-10-01 23:44:37 -07:00
parent bf35d04f7f
commit c469d51403
2 changed files with 13 additions and 0 deletions

View File

@ -76,6 +76,7 @@
<div style="padding: 15px">
<button id="start">Start</button>
<button id="stop">Stop</button>
<button id="arp">Arp</button>
<div style="padding: 10px;">
<label for="gain">Volume</label>
<input id="gain" type="range" min="0" max=".1" value=".05" step=".001"/>

View File

@ -130,4 +130,16 @@ window.onload = function () {
osc.stop();
osc = null;
});
document.getElementById("arp").addEventListener("click", () => {
const notes = ["C", "D", "E", "F", "G", "A", "B"];
for (let i = 0; i < notes.length; i++) {
setTimeout(2000);
console.log(notes[i]);
osc.frequency.setValueAtTime(
noteToHz(notes[i]),
audioContext.currentTime
);
}
});
};