Skip to content

Commit

Permalink
V1 (#13)
Browse files Browse the repository at this point in the history
* Made all played notes react to ui changes

* Added an actual keyboard and mobile compatibility

* fix deployed code

* messed it up again

* why

* better start and ui

* made fully editable envelopes

* bugfixing and real const nodes

* added export and prepared import

* Imported nodes, modulations missing

* import export DONE!!!!

* oops

* fixed importing
  • Loading branch information
HyperLan-git committed May 25, 2024
1 parent 9421283 commit 50242dc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion scripts/FX.js
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,12 @@ function deserializeFX(AC, json, updateUILabels = true) {
res.node[k].value = val.value;
} else if(json.type == "constant" && k == "data" && json.params["type"]["value"] === "ENVELOPE") {
res.node[k] = new Envelope(val.value.attack, val.value.decay, val.value.sustain, val.value.release);
} else if(json.type == "distortion" && k == "curve") {
const arr = new Float32Array(Object.keys(val.value).length);
for(let k2 in val.value) {
arr[k2] = val.value[k2];
}
res.node[k] = arr;
} else {
res.node[k] = val.value;
}
Expand Down Expand Up @@ -535,7 +541,7 @@ class FXGraph {
}
for(let k in this.nodes) {
if(this.nodes[k].gid === e) {
this.deleteNode(this.nodes[k]);
this.deleteNode(k);
return;
}
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/synth.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ function addFx(type) {
if(node === undefined) return;

const audioNode = new node(AC);
if(type === "constant") audioNode.node.type = "CONSTANT";
if(type === "constant") audioNode.type = "CONSTANT";
fx.addNode(audioNode);
updateModUI(fx.getAllNodes());
}
Expand Down

0 comments on commit 50242dc

Please sign in to comment.