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

Don't see any way to pass sclang options #120

Open
ivxvm opened this issue Oct 8, 2022 · 5 comments
Open

Don't see any way to pass sclang options #120

ivxvm opened this issue Oct 8, 2022 · 5 comments
Assignees

Comments

@ivxvm
Copy link

ivxvm commented Oct 8, 2022

I found a way to specify scsynth executable path, but I don't see a similar way to specify sclang path.
Get the following error when trying to run the very first example from docs:

Error: spawn C:\Program Files (x86)\SuperCollider\sclang.exe ENOENT
    at Process.ChildProcess._handle.onexit (node:internal/child_process:283:19)
    at onErrorNT (node:internal/child_process:478:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawn C:\\Program Files (x86)\\SuperCollider\\sclang.exe',
  path: 'C:\\Program Files (x86)\\SuperCollider\\sclang.exe',
  spawnargs: [
    '-i',
...

PS: Sure I have SC installed, but I have x64 version and it's located in different folder, so I need a way to provide executable path

@dskill
Copy link

dskill commented Feb 6, 2023

running into this as well

@crucialfelix
Copy link
Owner

Hello, really sorry everyone for the late response.

The documentation does have broken links and I didn't manage to get it to link all the options arguments correctly.

Language interpreter

https://crucialfelix.github.io/supercolliderjs/#/packages/lang/SCLang

The options are:

export interface SCLangOptions {
debug: boolean;
echo: boolean;
log?: Console;
// path to sclang executable
sclang: string;
// To start sclang and immediately execute one file
executeFile?: string;
// path to existing conf file
sclang_conf?: string;
stdin: boolean;
failIfSclangConfIsMissing: boolean;
conf: SCLangConf;
}

sclang option is the path to the sclang executable.

default options are:

function defaultOptions(): SCLangOptions {
const opts: SCLangOptions = {
debug: false,
echo: true,
stdin: false,
sclang: "sclang",
failIfSclangConfIsMissing: false,
conf: {
includePaths: [],
excludePaths: [],
postInlineWarnings: false,
},
};
switch (os.platform()) {
case "win32": {
const defaultRoot = "C:\\Program Files (x86)\\SuperCollider";
opts.sclang = path.join(defaultRoot, "sclang.exe");
// eslint-disable-next-line @typescript-eslint/camelcase
opts.sclang_conf = path.join(defaultRoot, "sclang_conf.yaml");
break;
}
case "darwin": {
opts.sclang = "/Applications/SuperCollider/SuperCollider.app/Contents/MacOS/sclang";
// eslint-disable-next-line @typescript-eslint/camelcase
opts.sclang_conf = `${os.homedir()}/Library/Application Support/SuperCollider/sclang_conf.yaml`;
break;
}
default: {
const defaultRoot = "/usr/local/bin";
opts.sclang = path.join(defaultRoot, "sclang");
// eslint-disable-next-line @typescript-eslint/camelcase
opts.sclang_conf = "/usr/local/share/SuperCollider/sclang_conf.yaml";
}
}
return opts;
}

audio Server

https://crucialfelix.github.io/supercolliderjs/#/packages/server/Server

The scsynth option in the path to scsynth executable:

https://github.com/crucialfelix/supercolliderjs/blob/develop/packages/server/src/options.ts#L90-L136

@crucialfelix
Copy link
Owner

You pass the options in

new SCLang(options: SCLangArgs)

// or I think:
sc.lang.boot({ sclang: 'path/to/sclang' }).then(async function(lang) {

});

@dskill
Copy link

dskill commented Feb 9, 2023

thx! Got it working.

@crucialfelix crucialfelix self-assigned this Feb 9, 2023
@Mouradif
Copy link

Mouradif commented Nov 5, 2023

The option seems to be ignored. I boot with:

const sc = require("supercolliderjs");

sc.server.boot({
  scsynth: '/Applications/SuperCollider.app/Contents/Resources/scsynth',
  sclang: '/Applications/SuperCollider.app/Contents/MacOS/sclang'
}).then(async server => {

but it still fails with the error:

Error: spawn /Applications/SuperCollider/SuperCollider.app/Contents/MacOS/sclang ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:283:19)
    at onErrorNT (node:internal/child_process:476:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

Notice that it tries to open /Application**/SuperCollider/**SuperCollider.app/ despite me explicitly passing the correct path in the boot options.

By the way, the path I'm passing (without the nested SuperCollider folder inside /Applications) seems to be the default when installing SuperCollider now

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

4 participants