This project, is a transpiler converting TypeScript to SuperCollider's own language, SCLang.
Currently, this project is still not stable, may contains unexpected bug, and the result might not be reliable.
Use npm
or your favourite Node package manager (such as pnpm
) to install them.
You need NodeJS to be installed before install tstosc
.
npm install -g tstosc
After installing that, you can use tstosc
in console for transpilation.
Notice that class in your file will be written to SuperCollider's User Extension folder.
tstosc ./file_to_convert.ts # Will convert `./file_to_convert.ts` to `./file_to_convert.sc`.
If you are developing this project, or you simply want a quicker update of tstosc
,
it might be good for you to build it by yourself.
After cloning/downloading this project, at the root of this project, run this command to get the necessary package and environment for the project (if you are using other Node package manager, use them instead):
npm i
pnpm i # if using `pnpm`
After that, run:
npm run build
pnpm run build
This will build the JavaScript file. Finally to make tstosc
available in CLI, run:
npm link
pnpm link -g
Finally, check if tstosc
works by tstosc -v
, or run it directly.
By now, you can develop/run it based on local project.
If you changed something, just need to run npm run build
to reflect your changes.