lichen-community-systems / Flocking

Flocking - Creative audio synthesis for the Web
GNU General Public License v2.0
699 stars 60 forks source link

The graphical playground can't handle any array-typed inputs #103

Closed colinbdclark closed 8 years ago

colinbdclark commented 9 years ago

Any inputs that are specified as an array seem to cause the graphical playground to fail to render properly. This error is thrown:

[Error] TypeError: undefined is not an object (evaluating 'path.lastIndexOf')
    lastDotIndex (DataBinding.js, line 1389)
    getTailPath (DataBinding.js, line 1402)
    prepareStrings (visual-editor.js, line 249)
    refreshView (visual-editor.js, line 216)
    invokeInvoker (FluidIoC.js, line 1655)
    (anonymous function) (visual-editor.js, line 396)
    each (Fluid.js, line 464)
    renderGraph (visual-editor.js, line 395)
    render (visual-editor.js, line 459)
    refreshView (visual-editor.js, line 470)
    invokeInvoker (FluidIoC.js, line 1655)
    invokeListener (Fluid.js, line 1052)
    togo (DataBinding.js, line 835)
    notifyExternal (DataBinding.js, line 682)
    concludeTransaction (DataBinding.js, line 742)
    fireToListeners (Fluid.js, line 1103)
    fire (Fluid.js, line 1196)
    commit (DataBinding.js, line 1343)
    fireChangeRequest (DataBinding.js, line 1314)
    change (DataBinding.js, line 946)
    parseJSON (playground.js, line 198)
    evaluateSource (playground.js, line 187)
    invokeInvoker (FluidIoC.js, line 1655)
    invokeListener (Fluid.js, line 1052)
    togo (FluidIoC.js, line 1713)
    fireToListeners (Fluid.js, line 1103)
    fire (Fluid.js, line 1196)
    invokeListener (Fluid.js, line 1052)
    togo (FluidIoC.js, line 1713)
    fireToListeners (Fluid.js, line 1103)
    fire (Fluid.js, line 1196)
    (anonymous function) (ui.js, line 88)

Here's a synthDef that illustrates the issue:

{
    "description": "Two different channels: both are sine waves with slightly different frequencies.",
    "synthDef": [
        {
            "id": "leftSine",
            "ugen": "flock.ugen.sinOsc",
            "freq": 440,
            "mul": 0.25
        },
        {
            "id": "rightSine",
            "ugen": "flock.ugen.sinOsc",
            "freq": 444,
            "mul": 0.25
        }
    ]
}
colinbdclark commented 9 years ago

This issue was fixed, at least in a simple way, in c45fe5f5a9f18fedaf49743f14a8067a539ee3e1