Skip to content

Commit

Permalink
Fixed issue #11
Browse files Browse the repository at this point in the history
  • Loading branch information
twboom committed Mar 16, 2021
1 parent 2f7313f commit 8758ddb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/js/interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ document.querySelectorAll('input.control').forEach(item => {

// Toggle button
document.querySelector('button#toggle.controls').addEventListener('click', _ => {
synthquencer.interface = new AudioContext();
const button = document.querySelector('button#toggle.controls')
if (synthquencer.state.active) { button.innerHTML = 'Start' }
else { button.innerHTML = 'Stop' }
Expand Down
2 changes: 1 addition & 1 deletion src/js/play.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const interface = new AudioContext();
synthquencer.sound = function(note, wave) {
const interface = synthquencer.interface;
const oscillator = interface.createOscillator();
oscillator.type = wave;
oscillator.frequency.value = synthquencer.utility.getFrequency(note);
Expand Down

0 comments on commit 8758ddb

Please sign in to comment.