SuperSonic - SuperCollider's synth engine in the browser

Hi everyone,

I thought you might be interested to see what I’ve been working on recently.

As part of my work on Tau5 (and possibly a future version of Sonic Pi) I’ve been working really hard on a port of SuperCollider’s scsynth (synthesis engine) for the web - specifically an AudioWorklet port (which provides access to a dedicated high-priority audio thread).

I’ve been working on it for a few months now and it’s finally working pretty nicely and ready to start integrating with Tau5.

I’ve built a demo site to let you play which include a lot of Sonic Pi synths and samples that you’ll likely find very familiar.

I’d love to know what you think: SuperSonic - SuperCollider's Synthes Engine in the Browser

11 Likes

That’s amazing. I’ve seen requests for Sonic Pi in the browser here on the forum and thought it would never happen as it would mean porting SuperCollider to the web. And here you are. Fantastic.

2 Likes

Awesome. I’m really looking forward to this.

I’ve always wanted to use sonic Pi on my mobile phone even just on a browser.

2 Likes

Really impressive work! Installation was always a bit of a barrier to running Sonic Pi in schools, this should make it so much easier to run anywhere and really help bringing Sonic Pi / Tau5 to a much wider audience.

3 Likes

Love it! I played around with it for a while the other evening and was very impressed. I echo emlyn in it being a huge step forward for environments where installation can be a challenge.

3 Likes

Just saw this and had a play in the sandpit… I’m not a professional programmer but I’ve enjoyed Sonic Pi and the community through access as a music and digital literacies teacher in primary schools. Now with the evolution in Tau5 and web based interaction I am so impressed. I don’t know the back-end tech involved in development but would imagine it takes a serious amount engineering to make it work in a web-based context using the scsynth and… now …. it will work on portable devices with touch screens… Yeah :slight_smile: . Amazing. My students always ask if Sonic Pi will work on their iPads… can’t wait for the vers 1 and a variation for good old Sonic. Thanks Sam.

3 Likes

HOW THE BPM ARE SET AND MODIFIED ?

I LIKE THE UX AND THE LATENCY IS VIRTUALLY ZERO…

IS IT POSSIBLE TO LOOP IN ENDLESS RANDOM PATTERNS ?

THANK YOU VERY MUCH FOR THIS NEW WAY TO ENHOY YOUR MUSIC MAKING APPs….

This is purely a tech demo. It’s not meant to be configurable. It just demonstrates multiple synths, FX, samples and all the internal mechanisms, pre-schedulers, schedulers, etc.

Tau5 will be the tool I build that will allow you to compose your own music with this.

However, I’m already starting to see people use SuperSonic for their own web-based music apps - so I’m really excited about the future in this area!

1 Like

OK, I couldn’t resist - the demo now features a BPM slider :slight_smile:

Hi @samaaron , this is amazing!

I will play with it, thinking of turning a sonic pi .rb script that I have into an interactive web app. However I have seen no examples of that in the docs. How can I send a chunk of code to supersonic? For example, can I use it to play a classic example like this?

# Coded by Sam Aaron

live_loop :haunted do
  sample :perc_bell, rate: rrand(-1.5, 1.5)
  sleep rrand(0.1, 2)
end

1 Like

Oh SuperSonic is not a web version of Sonic Pi. It’s a web port of the powerful synthesis engine scsynth - the same synthesis engine that powers Sonic Pi.

SuperSonic does not have a programming language interface of any kind - just a network based API.

You could build programming language interfaces on top of it and that’s definitely my plan - and the project I’m exploring that with is called Tau5.

hi,

i guess the next step will be to integrate the same syntax used by sonicpi. right now the osc api is a bit hard to use without autocompletion to help us :slight_smile:

Hi, thanks for the quick answer! Now I see it very clear, I’m not sure why I guessed it was full sonic-pi in the browser thing. I guess we should not expect something like our .rb scripts working in the browser right? So I guess Tau5 will feature a different language than that of sonic-pi.

I’m really interested in porting my .rb sonic-pi script to the browser though. I suspect because the audio backend is supercollider, I should now somehow be able to port it and get very similar sound output. Is there a way I could somehow see the supercollider code that sonic-pi generates from my .rb script? I am asking something that does not make sense at all?

Thanks again!

Well I guess that also depends on the script itself. In my case my sonic-pi code mainly consists of a number of live_loop(s). If the timming of these live loops was handled by ruby in sonic-pi, then I guess my question makes no sense as scsynth would be receiving messages and playing sounds “upon request”, but if live_loop(s) program some sort of scheduler in scsynth then maybe it could be possible…

?

There are no plans to do this within the scope of SuperSonic - it’s purely a port of SuperCollide’s synth engine scsynth. It aims to be a downstream compatible fork - so I have minified the differences to maintain compatibility.

I think there’s some confusion: scsynth is just the audio engine. Sonic Pi uses the same audio engine and adds all the language and UI on top.

The demo page is just a simple fun UI on top of SuperSonic - just to show that it works. It’s nothing more than that.

The OSC API is the official OSC API of SuperCollider’s scsynth and aims to maintain compatibility where possible. You can see the original API spec here: Server Command Reference | SuperCollider 3.14.0 Help

Hi, thanks again for your answers and sorry for the confusion. I was just wandering how feasible it would be for me to re-implement my current sonic-pi script as a “pure supercollider” thing so it can run in the browser. I don’t know how sonic-pi and supercollider communicate (well, via the OSC api), but I thought that there might be a way to “capture” the messages that sonic-pi sends to scsynth so that I can replicate that somehow in the browser. Does this sound like something I should not even try?