Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error running example code in readme #66

Closed
vectorsize opened this issue Nov 22, 2019 · 7 comments
Closed

Error running example code in readme #66

vectorsize opened this issue Nov 22, 2019 · 7 comments
Assignees

Comments

@vectorsize
Copy link

Hello, I installed supercolliderjs and tried some of the examples in a js file but when calling it with node I got the following error: SynthDef not in store: 1075206181

Looking a bit into the code, there seems to be a mismatch when saving the synthdef with a readable name and trying to recall it using the assigned server name, I tried hacking around but didn't manage to get it working, I wonder if this is related to some version mismatch (lodash perhaps?).

I ran the examples with node version v12.8.0 and [email protected], also [email protected] and the error seems to be present in both versions, either thrown as an error or ignored and failing later when trying to access the buffer data.

@crucialfelix
Copy link
Owner

Which examples are doing this ? I did check them just the other day. Could you post the full error with stack trace if you got one? That would be very helpful. Thanks!

@crucialfelix crucialfelix self-assigned this Nov 22, 2019
@vectorsize
Copy link
Author

hi! sure, this is what I get when pasting the first snippet in the readme file

(node:47499) UnhandledPromiseRejectionWarning: Error: SynthDef not in store: 1262960294
    at SynthDefCompiler.sendCommand (~/Dev/supercolliderjs/node_modules/@supercollider/lang/lib/SynthDefCompiler.js:67:19)
    at ~/supercolliderjs/node_modules/@supercollider/lang/lib/SynthDefCompiler.js:46:80
    at ~/supercolliderjs/node_modules/lodash/lodash.js:3543:27
    at ~/supercolliderjs/node_modules/lodash/lodash.js:4905:15
    at baseForOwn (~/Dev/supercolliderjs/node_modules/lodash/lodash.js:2990:24)
    at ~/supercolliderjs/node_modules/lodash/lodash.js:4874:18
    at baseMap (~/Dev/supercolliderjs/node_modules/lodash/lodash.js:3542:7)
    at Function.map (~/Dev/supercolliderjs/node_modules/lodash/lodash.js:9554:14)
    at SynthDefCompiler.compileAndSend (~/Dev/supercolliderjs/node_modules/@supercollider/lang/lib/SynthDefCompiler.js:46:43)
    at processTicksAndRejections (internal/process/task_queues.js:85:5)
    at async ServerPlus._compileSynthDef (~/Dev/supercolliderjs/node_modules/@supercollider/server-plus/lib/ServerPlus.js:215:22)

Thats running [email protected] with [email protected]

@vectorsize
Copy link
Author

when I try ./examples/sine-wave.js the error is the following:

const s = d.Synth(
            ^
TypeError: Class constructor Synth cannot be invoked without 'new'
    at Object.<anonymous> (~/supercolliderjs/projects/index.js:3:13)
    at Module._compile (internal/modules/cjs/loader.js:868:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:879:10)
    at Module.load (internal/modules/cjs/loader.js:731:32)
    at Function.Module._load (internal/modules/cjs/loader.js:644:12)
    at Function.Module.runMain (internal/modules/cjs/loader.js:931:10)
    at internal/main/run_main_module.js:17:11

Ther's a chance Im messing something up with versions 🤔

@crucialfelix
Copy link
Owner

Ack! You are right: the js side defName and what sclang gives it were why it wouldn't load. I have a fix posted and will do a new release shortly.

The sine-wave.js example should not have been included : I was sketching out an idea of how it could/should look. I will clean and test all the examples. That was all done in a hurry last week.

Sorry for the

@crucialfelix
Copy link
Owner

There will be a new dryadic soon that will dramatically improve how you work with it. I was hoping to get that completed for the 1.0 release

@vectorsize
Copy link
Author

Nice! I tried changing the code here and there before creating the issue, but it would break other places...
Thanks for the fix, looking forward to playing with it 👍

crucialfelix added a commit that referenced this issue Nov 24, 2019
… of the synth def and the generated compiled name that sclang gives it
@crucialfelix
Copy link
Owner

There is a new release out. I had unit tested that stuff but no integration tests. I should set up a test that can run all the examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants