wip - work on arp in progress
This commit is contained in:
parent
bf35d04f7f
commit
c469d51403
|
@ -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"/>
|
||||
|
|
12
basic.js
12
basic.js
|
@ -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
|
||||
);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue