@grame/faustwasm 0.10.0 → 0.10.2

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.
@@ -40,19 +40,20 @@ $buttonDsp.onclick = async () => {
40
40
  }
41
41
  }
42
42
 
43
+ // Play some notes using the Faust node
44
+ const play = (node) => {
45
+ node.keyOn(0, 60, 100);
46
+ setTimeout(() => node.keyOn(0, 64, 100), 1000);
47
+ setTimeout(() => node.keyOn(0, 67, 100), 2000);
48
+ setTimeout(() => node.allNotesOff(), 5000);
49
+ setTimeout(() => play(node), 7000);
50
+ }
51
+
43
52
  // Called at load time
44
53
  (async () => {
45
54
 
46
55
  const { createFaustNode, connectToAudioInput } = await import("./create-node.js");
47
56
 
48
- const play = (node) => {
49
- node.keyOn(0, 60, 100);
50
- setTimeout(() => node.keyOn(0, 64, 100), 1000);
51
- setTimeout(() => node.keyOn(0, 67, 100), 2000);
52
- setTimeout(() => node.allNotesOff(), 5000);
53
- setTimeout(() => play(node), 7000);
54
- }
55
-
56
57
  // Create Faust node
57
58
  const result = await createFaustNode(audioContext, "FAUST_DSP_NAME", FAUST_DSP_VOICES);
58
59
  faustNode = result.faustNode; // Assign to the global variable