I couldn't find a way to use my text editor and javascript to do live coding without a ton of setup. I found some projects like Hydra, Strudel, I found them cool but not exactly what I wanted since they easily run in the browser. Rather than going through the setup, I built a way you can get all the conveniences of your text editor.
- clone the repo locally
git clone https://github.com/codingMustache/live-coding-js-template.git- install dependencies
npm i-
In Chromium browser you have to turn of the setting to play audio without interactions, if you want to use saving HMR and your browser to play automatically without having to interact with the browser first.
-
Run the app
npm run dev-
Open your browser and go to http://localhost:5173/
-
Open
music.tsin your editor and go off. -
Read docs for Tone.js for reference.