@grame/faustwasm 0.6.3 → 0.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -69,6 +69,9 @@ audioContext.suspend();
69
69
  }
70
70
  }
71
71
 
72
+ let sensorHandlersBound = false;
73
+ let midiHandlersBound = false;
74
+
72
75
  // Function to resume AudioContext, activate MIDI and Sensors on user interaction
73
76
  function activateAudioMIDISensors() {
74
77
 
@@ -78,11 +81,15 @@ audioContext.suspend();
78
81
  }
79
82
 
80
83
  // Activate sensor listeners
81
- faustNode.listenSensors();
84
+ if (!sensorHandlersBound) {
85
+ faustNode.listenSensors();
86
+ sensorHandlersBound = true;
87
+ }
82
88
 
83
89
  // Initialize the MIDI setup
84
- if (FAUST_DSP_VOICES > 0) {
90
+ if (!midiHandlersBound && FAUST_DSP_VOICES > 0) {
85
91
  initMIDI();
92
+ midiHandlersBound = true;
86
93
  }
87
94
  }
88
95
 
@@ -133,12 +133,12 @@ const buildMidiDeviceMenu = async (faustNode) => {
133
133
  // Set the title and enable the DSP button
134
134
  $buttonDsp.disabled = false;
135
135
  document.title = name;
136
- let motionHandlersBound = false;
136
+ let sensorHandlersBound = false;
137
137
  $buttonDsp.onclick = async () => {
138
138
  // Activate sensor listeners
139
- if (!motionHandlersBound) {
139
+ if (!sensorHandlersBound) {
140
140
  await faustNode.listenSensors();
141
- motionHandlersBound = true;
141
+ sensorHandlersBound = true;
142
142
  }
143
143
  if (audioContext.state === "running") {
144
144
  $buttonDsp.textContent = "Suspended";
package/dist/cjs/index.js CHANGED
@@ -813,8 +813,8 @@ export default ${(_b = jsCode.match(jsCodeHead)) == null ? void 0 : _b[1]};
813
813
  if (t[0] & 1)
814
814
  throw t[1];
815
815
  return t[1];
816
- }, trys: [], ops: [] }, f, y, t, g;
817
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
816
+ }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
817
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
818
818
  return this;
819
819
  }), g;
820
820
  function verb(n) {