Skip to content

Commit

Permalink
working on issue #246
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelpalumbo committed Jul 24, 2023
1 parent caad7e5 commit 21f6564
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 12 deletions.
2 changes: 0 additions & 2 deletions Components/Audio/Audio.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ function doc2operations(doc) {
// for any op that we used, add it to the chain:
if (memo[conn.src]) {
// if we have already generated this object, this must be a history connection
console.log("feedback loop", conn)

// // at this point, we need to add a history object
// // and replace this cable with two cables
Expand Down Expand Up @@ -309,7 +308,6 @@ module.exports = {
}
fs.writeFileSync('fb.json', JSON.stringify(doc, undefined, 2))
let operations = doc2operations(doc)
console.log(operations)
worker.postMessage({ cmd: "graph", operations })

} catch (e) {
Expand Down
2 changes: 1 addition & 1 deletion Components/Audio/fbCable.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ module.exports = class FeedbackCable{
"name": "value"
}
],
"name": "ssd",
"name": "history",
"outputs": [
{
"_props": {
Expand Down
6 changes: 5 additions & 1 deletion Components/Audio/genish.js
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,9 @@
history = require('./history.js'),
mul = require('./mul.js'),
sub = require('./sub.js');


const fs = require('fs')
// fs.writeFileSync('historyDef.txt', history)
module.exports = function () {
var decayTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 44100;

Expand Down Expand Up @@ -2162,6 +2164,8 @@
input = input.graph;
}
var code = input.gen();


//if( code.indexOf( 'Object' ) > -1 ) console.log( 'bad input:', input, code )

if (Array.isArray(code)) {
Expand Down
8 changes: 5 additions & 3 deletions Components/Audio/genish_worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ parentPort.on("message", (msg) => {

msg.operations.forEach(op => {

//console.log("op", op.name)
// console.log("op", op.name, op.inputs)

let inputs = op.inputs.map(name => typeof name == "number" ? name : values[name] != undefined ? values[name] : name)
if (op.name == "speaker") {
Expand All @@ -96,14 +96,16 @@ parentPort.on("message", (msg) => {
// } else if (op.name == "history") {
// console.log("history", op)

} else if (genish[op.name]) {
}

else if (genish[op.name]) {
makeUID(op.uuid)


let outputs = genish[op.name].apply(genish, inputs)


//if (op.name == "history") console.log("op", op.name, op, outputs)
// if (op.name == "history") console.log("op", op.name, op, outputs)

// store outputs:
if (Array.isArray(outputs)) {
Expand Down
2 changes: 1 addition & 1 deletion Components/Op/mischmaschOps.json
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@
"inputs": {},
"outputs": {}
},
"ssd": {
"history": {
"classification": "delay",
"inputs": {
"name": {
Expand Down
8 changes: 4 additions & 4 deletions fb.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"08b47f807ecb4c6da50f883ab9f05f22": {
"audio": "cable"
},
"27a0e69becb34799971d3770a575b899": {
"28650157b70e437a860a8d541a131a2b": {
"value": "cable"
}
},
Expand Down Expand Up @@ -172,7 +172,7 @@
],
"uuid": "4c39b8a07ad54b049f99a6820b0d013d"
},
"27a0e69becb34799971d3770a575b899": {
"28650157b70e437a860a8d541a131a2b": {
"category": "delay",
"inputs": [
{
Expand Down Expand Up @@ -210,7 +210,7 @@
"name": "value"
}
],
"name": "ssd",
"name": "history",
"outputs": [
{
"_props": {
Expand All @@ -237,6 +237,6 @@
0,
0.8314696123025452
],
"uuid": "27a0e69becb34799971d3770a575b899"
"uuid": "28650157b70e437a860a8d541a131a2b"
}
}

0 comments on commit 21f6564

Please sign in to comment.