Skip to content

Commit

Permalink
GameLAN and Smartfaust regenerated.
Browse files Browse the repository at this point in the history
  • Loading branch information
sletz committed Jul 30, 2024
1 parent a6f36ef commit a884e83
Show file tree
Hide file tree
Showing 308 changed files with 10,673 additions and 6,695 deletions.
37 changes: 35 additions & 2 deletions docs/gamelan/atomicro/create-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const createFaustNode = async (audioContext, dspName = "template", voices = 0, s
faustDsp.effectModule = await WebAssembly.compileStreaming(await fetch("./effect-module.wasm"));
}

// Create a polyphonic Faust audio node
const generator = new FaustPolyDspGenerator();
faustNode = await generator.createNode(
audioContext,
Expand All @@ -62,6 +63,7 @@ const createFaustNode = async (audioContext, dspName = "template", voices = 0, s
sp
);
} else {
// Create a standard Faust audio node
const generator = new FaustMonoDspGenerator();
faustNode = await generator.createNode(
audioContext,
Expand All @@ -81,10 +83,11 @@ const createFaustNode = async (audioContext, dspName = "template", voices = 0, s
* @param {AudioContext} audioContext - The Web Audio API AudioContext to which the Faust audio node is connected.
* @param {string} id - The ID of the audio input device to connect.
* @param {FaustNode} faustNode - The Faust audio node to which the audio input stream will be connected.
* @param {MediaStreamAudioSourceNode} inputStreamNode - The audio input stream node to be connected to the Faust audio node.
* @param {MediaStreamAudioSourceNode} inputStreamNode - The audio input stream node to be disconnected from the Faust audio node.
* @returns {Promise<MediaStreamAudioSourceNode>} - The audio input stream node connected to the Faust audio node.
*/
async function connectToAudioInput(audioContext, id, faustNode, inputStreamNode) {
// Create an audio input stream node
const constraints = {
audio: {
echoCancellation: false,
Expand All @@ -93,6 +96,7 @@ async function connectToAudioInput(audioContext, id, faustNode, inputStreamNode)
deviceId: id ? { exact: id } : undefined,
},
};
// Get the audio input stream
const stream = await navigator.mediaDevices.getUserMedia(constraints);
if (stream) {
if (inputStreamNode) inputStreamNode.disconnect();
Expand All @@ -102,4 +106,33 @@ async function connectToAudioInput(audioContext, id, faustNode, inputStreamNode)
return inputStreamNode;
};

export { createFaustNode, connectToAudioInput };
/**
* @param {FaustAudioWorkletNode} faustNode
*/
async function createFaustUI(divFaustUI, faustNode) {
const { FaustUI } = await import("./faust-ui/index.js");
const $container = document.createElement("div");
$container.style.margin = "0";
$container.style.position = "absolute";
$container.style.overflow = "auto";
$container.style.display = "flex";
$container.style.flexDirection = "column";
$container.style.width = "100%";
$container.style.height = "100%";
divFaustUI.appendChild($container);
const faustUI = new FaustUI({
ui: faustNode.getUI(),
root: $container,
listenWindowMessage: false,
listenWindowResize: true,
});
faustUI.paramChangeByUI = (path, value) => faustNode.setParamValue(path, value);
faustNode.setOutputParamHandler((path, value) => faustUI.paramChangeByDSP(path, value));
$container.style.minWidth = `${faustUI.minWidth}px`;
$container.style.minHeight = `${faustUI.minHeight}px`;
faustUI.resize();
};

// Export the functions
export { createFaustNode, createFaustUI, connectToAudioInput };

10 changes: 5 additions & 5 deletions docs/gamelan/atomicro/dsp-meta.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "atomicro",
"filename": "atomicro.dsp",
"version": "2.74.8",
"version": "2.75.2",
"compile_options": "-lang wasm-i -ct 1 -es 1 -mcd 16 -mdd 1024 -mdy 33 -single -ftz 2",
"include_pathnames": [
"/share/faust",
Expand All @@ -10,7 +10,7 @@
"."
],
"size": 5041144,
"code": "iGG+",
"code": "MIe+",
"inputs": 1,
"outputs": 1,
"meta": [
Expand All @@ -24,7 +24,7 @@
"basics_lib_tabulateNd": "Copyright (C) 2023 Bart Brouns <[email protected]>"
},
{
"basics_lib_version": "1.18.0"
"basics_lib_version": "1.19.1"
},
{
"compile_options": "-single -scal -e ../atomicro.dsp -o atomicro.dsp"
Expand Down Expand Up @@ -84,10 +84,10 @@
"signals_lib_name": "Faust Signal Routing Library"
},
{
"signals_lib_version": "1.5.0"
"signals_lib_version": "1.6.0"
},
{
"version": "2.74.9"
"version": "2.75.2"
}
],
"ui": [
Expand Down
Binary file modified docs/gamelan/atomicro/dsp-module.wasm
Binary file not shown.
3 changes: 2 additions & 1 deletion docs/gamelan/atomicro/faust-ui/index.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/gamelan/atomicro/faust-ui/index.css.map

Large diffs are not rendered by default.

Loading

0 comments on commit a884e83

Please sign in to comment.