Sonic Pi – The Live Coding Music Synth for Everyone
sonic-pi.net
sonic-pi.net
Live coding is how I learned to program and I am so glad that this type of computer music performance exists. I am currently doing my PhD on the topic! Programming as a performative act, with its own culture and music sub-genres. For those interested in helping / taking a look, I am currently trying to hack my own live coding environment based on Python asyncio mechanisms: https://github.com/Bubobubobubobubo/sardine I am a bit shy about it because I am light years behind the level of the projects that are posted on HN and that keep me inspired. I've taught myself how to do this basically by live coding ... a lot, with friends in France! Learning a bit of CS because of music.
EDIT: Sonic Pi is the environment that I used to learn the basics of programming!
I worked with Sam to put together a special demo of it. Super fun :)
Music by DJ_Dave.
Short video, 6 minutes: https://www.youtube.com/watch?v=suH_goWVBeA
I love when 2 DJs live-code together (on the same document! Editing each other's loops) or when a VJ live-codes some visuals in reaction to the DJ live-coding the music.
Supercollider is another real time audio synthesis tool.
Sonic Pi is awesome, but ike all DSLs, while making simple things easy it has its limitations.
Having someone type at a laptop is so boring to watch, it totally kills the mood.
I'd rather have them manipulate lego like bricks on a physical screen or even write on a chalkboard...
Something has to be better than this
So we'd be watching someone simultaneously live code/play music and live code their interface.
Personally, I'd rather let them code the interface off stage and watch the live performance. After all, using the interface is live coding, but using the pre-built DSL.
In some ways, sonic Pi is already a higher order interface than whatever language it's written in.
I am mostly talking about the way of inputting the code though. Having someone bent over a laptop is fairly disgraceful.. Maybe people said the same when knob-turning DJs appeared.
Perhaps the program designer wants people to see actual coding as an artistic expression, which of course all real programmers know is very true, and not as some nerdy boring thing that lets-face-it…many non-programmers think of it.
That’s why personally I love the idea of the real time collaboration additions that are coming online these days. Like what could be better to promote coding then seeing a couple of people go fucking off sitting behind keyboards making interesting music together?
Shameless self-promo example of the language in action [2]
[1] https://100r.co/site/orca.html [2] https://youtu.be/fhYi958qqac
From the site:
ORCA is an ... esoteric programming language ... capable of sending MIDI, OSC & UDP to your audio interface, like Ableton, Renoise, VCV Rack or SuperCollider.
If anyone's got any suggestions, or can point to a python version of the same (I spent a fair bit of time working with FoxDot which does use python so it made more sense to me) it'd be appreciated - this is something I'd really like to get into, but have found the hurdles a bit too tall!
The you'd probably have hated its predecessor which was all about the parentheses: https://overtone.github.io/
It's too bad that superficial stuff like which characters you need to type is holding you back. Getting used to Ruby when you're familiar with Python is no big deal. I would just stick with it
If you just don't want to mess with Ruby, there are python libraries for supercollider (the same backend that Sonic Pi is using). The only gotcha is I think a lot of the value of Sonic Pi comes from the built in samples and synths.
It's very complete: the "language" (Ruby with some libs), IDE, sound generation... It truly comes with batteries included.
I tried to put this project in a docker container (before snap and flatpak were all the rage; I've a bit of experience with snap and sure it did cause rage): that is a docker container that should be able to draw an X11 window in the host OSes X11 server. This to allow the project to be run with all its dependencies included. Sadly I failed.
A long time ago (2017) I did successfully get Sonic Pi running in Docker but it wasn't straightforward https://github.com/xavriley/sonic-pi-docker If anyone wants to pick this back up I'd be happy to help
I know! But trying install it on Linux I did understand that the RPi route effectively "containerizes" the app :) That's what I meant to say by my comment.
> I did successfully get Sonic Pi running in Docker but it wasn't straightforward
You succeeded! Nice work.
I compiled it myself on Fedora and it works great. It wasn't too hard. Perhaps I should just document the steps somewhere.
What I tried and failed was to run it on OpenBSD. I spent all my free time in the evenings for about 2 weeks before I eventually gave up and moved to Linux. I agree with parent post that Sonic Pi is essentially a bunch of stuff duct taped to each other. Which is nice because it can do many things, but it is definitely not a very clean architecture and not easy to port.
Glicol has a much much nicer architecture. It is written in Rust and doesn't even depend on SuperCollider! It is so portable that it even compiles to WASM and runs in the browser. But I find Ruby easier to understand than Glicol's own language, plus ... I like Sonic Pi's feature completeness. It comes with plenty of pre-defined synths (not just sine/square/sawtooth, but some actually very complex stuff). It comes with many filters and sample manipulation tools. You can connect MIDI inputs with just a couple of lines of code... So yeah, I hate it and I love it at the same time!
No idea about the performance on RPI, do you guys find it acceptable? I am actually just thinking to use an older laptop as a "physical container" for Sonic Pi. Essentially a laptop that is only meant as a musical instrument, and it always just works (after the initial setup).
I got some Guitar pieces from freesound.org and built an electric guitar synth. I then mixed it with some Tibetan Fire Priest chants and built this:
https://soundcloud.com/user-408150882-831970789/rhythm-of-ka...
As some of the comments here specify, the UI isn't exactly conducive to building 'heavy' music.
For instance, something that I built this morning using Kontakt (https://soundcloud.com/amal-krishnan-103125344/megatherion-p...) is painful to develop on SonicPi. Of course, SonicPi can be extended to perform some of the functionalities you'd expect a professional synthesizer to do. {DOS->Win 3.1}
There are some other issues as well centered around 'coding for developing music' and 'live coding'. Everything you build in the code --when I last checked-- goes into one stream. You really have to visualize time flow outside of the software. This makes editing chunks hard. A UI based synthesizer is a lot easier to work with: turn a few knobs and push a few keys as opposed to coding. Live Coding never really works in practice, and I'm talking about performing at the professional DJ level. It's easier to use a 'GUI' (a synth front end with its knobs etc) as opposed to code. Music tends not to flow 'rationally; inspiration tends to externalize in a kinetic fashion.
All that said, Sonic Pi is a rich platform to build synthesizers and pieces to go with the other tools in your music building deck.
The big drawback for me so far has been sound design. Actually building your own synths can be difficult to even get the basics down, working with samples is predictably a bit of a pain (to the point where I intended to just use synths for everything, drums included), and it doesn't look like many of these tools provide an easy way to reuse synths you've made before in different files.
I know that a lot of the time you can plug these tools into a traditional DAW, which obviously fixes the sound design issue, but this is the kind of thing I'd only really want to use standalone. Maybe its just a part of the learning curve, and eventually sound design gets more intuative.
https://github.com/chaosprint/glicol
> Graph-oriented live coding language and music DSP library written in Rust
I think one reason why tools like this lead to creation of dance music is that the structures are readily created using them, and in addition they tend to make synth and sample sounds which are often heard in dance... It's pretty quick to code a 4 on the floor dance beat, but programming Gene Krupa will be much more challenging!
And making traditional song wouldn't be as interesting demo for it I'd imagine
Yes, a keyboard and a looper can be used for club music. Same for sonicpi. But a keyboard can be used to play/compose classical, or even "The Office" intro. Can sonicpi be used for that? That's what I wanna see.
@rbnpi has also done some lovey work with classical music that’s worth checking out
This is only slightly related but since others are sharing their live coding resources, I've had a lot of fun playing around with this one in the past: https://livecodingyoutube.github.io