[HN Gopher] Sonic Pi - The Live Coding Music Synth for Everyone
       ___________________________________________________________________
        
       Sonic Pi - The Live Coding Music Synth for Everyone
        
       Author : graderjs
       Score  : 279 points
       Date   : 2022-11-08 06:18 UTC (16 hours ago)
        
 (HTM) web link (sonic-pi.net)
 (TXT) w3m dump (sonic-pi.net)
        
       | yboris wrote:
       | Somewhat/very related: https://glicol.org/
       | 
       | https://github.com/chaosprint/glicol
       | 
       | > Graph-oriented live coding language and music DSP library
       | written in Rust
        
       | pvinis wrote:
       | I recently was trying this again, also searching online for
       | people using it, and I could only find club music made with it,
       | which made me just give up on trying further. I wish there were
       | some YouTube channel what made nice music with sonicpi or
       | similar.
        
         | xavriley wrote:
         | I've got a few pieces here which aren't all dance (e.g. live
         | coded sampling of bass guitar)
         | https://www.xavierriley.co.uk/talks/
         | 
         | @rbnpi has also done some lovey work with classical music
         | that's worth checking out
        
         | djaychela wrote:
         | Can you give a better definition than nice music?
         | 
         | 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!
        
           | pvinis wrote:
           | "nice music" I mean music that is not repeating with a period
           | of less that 8 seconds. I don't care for a 3-loop made using
           | code. I know it can be done, and I know it's easy to do
           | compared to other ways. I wanna see if it's possible to use
           | code as an real instrument.
           | 
           | 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.
        
             | severak_cz wrote:
             | Look into Alda music programming language - it's possible
             | to write classical music with it. It's more like MIDI or
             | classical notation - you don't care about sound but you
             | specify notes.
             | 
             | https://alda.io/
        
             | monetus wrote:
             | Sonic pi totally can be used for that - I've made some
             | classical compositions with it, however not live. I've
             | really needed pre-built abstractions to get to the point
             | where I can improvise akin to when I play a guitar or
             | saxaphone.
        
             | luqtas wrote:
             | yes, tho, verbose... you may have a better time using
             | Csound and its score paradigm!
             | http://www.csounds.com/manual/html/ScoreTop.html
        
           | ilyt wrote:
           | You'd most likely just treat is as another synth - write
           | "code" to make the sounds then "data" to just feed it notes.
           | 
           | And making traditional song wouldn't be as interesting demo
           | for it I'd imagine
        
         | acarabott wrote:
         | You might like (Extrmpore author) Andrew Sorensen's piano live
         | coding:
         | 
         | https://youtu.be/bq-260NUw5o
        
       | squarefoot wrote:
       | Note that Sonic Pi is also available on other Linux distributions
       | (Debian and Manjaro have it, didn't check others), presumably
       | built and packaged by the community since it appears from the
       | homepage they support only the ports linked from there. This is
       | important especially now that used mini-pcs are so easily
       | available and cost a fraction of a mostly unobtanium Raspberry
       | PI.
        
       | cies wrote:
       | This project is like magic, though really hard to install on it's
       | own. Hence the approach that is advised is to run it on a
       | Rasberry Pi (something like a physical docker container). This
       | project duct-tapes so many cool technologies together that the
       | whole setup become quite brittle: you need the exact versions of
       | all dependencies + patches + wiring/configs and only then it
       | works.
       | 
       | 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.
        
         | monetus wrote:
         | they break the install in official repos too.
        
         | xavriley wrote:
         | I agree that the install is hard on linux but there are
         | prebuilt packages for Windows and MacOS. There's no requirement
         | to use a Raspberry Pi.
         | 
         | 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
        
           | cies wrote:
           | > There's no requirement to use a Raspberry Pi.
           | 
           | 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.
        
       | crocktucker wrote:
       | See also: https://100r.co/site/orca.html
       | 
       | 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.
        
       | d--b wrote:
       | Live coding music is nice, but the interface is awful.
       | 
       | 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
        
         | MivLives wrote:
         | I used to have this complaint until I saw someone do it well.
         | The key is that can't be all their doing. One guy I saw was
         | doing it at audience level while also being in the pit and
         | moshing. Not sure I'll ever see anything like that again.
        
         | opminion wrote:
         | The interface is designed so that a 10-12 year old can write
         | music-making code with little guidance. I have anecdotal
         | evidence that it's quite good for that purpose.
        
         | troutwine wrote:
         | You might be interested in the approach Author & Punisher has
         | taken.
        
         | smrq wrote:
         | Perhaps ORCA [1] might pique your interest. I've mostly bounced
         | off of live coding because of the interface issue, but
         | something about the ORCA interface tickles my eyeballs and gets
         | the creative juices flowing.
         | 
         | Shameless self-promo example of the language in action [2]
         | 
         | [1] https://100r.co/site/orca.html [2]
         | https://youtu.be/fhYi958qqac
        
           | crocktucker wrote:
           | I thought the same. And thanks for sharing your compositions
           | -- I particularly enjoyed "killed in the light of a crescent
           | moon".
        
         | cubano wrote:
         | Hmmmm why my first instinct is to agree with you
         | wholeheartedly, after a few moments of reflection I start
         | thinking "well isn't that the actual point here?"
         | 
         | 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?
        
         | karmakaze wrote:
         | If you continue the live coding (thought) experiment, you would
         | naturally code a better interface. At that point you would be
         | reinventing something like Ableton Live, but completely
         | different. Similar to how using Lisp for a project develops its
         | own DSL for the application different from other DSLs for other
         | applications.
         | 
         | 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.
        
           | d--b wrote:
           | Right, good point.
           | 
           | 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.
        
         | jhbadger wrote:
         | I don't think "live coding" music means that musicians would
         | actually write code in front of an audience live -- it's not
         | like musicians compose music in real time even without
         | computers. In either case there is a lot of trial and error in
         | getting things right that you wouldn't want an audience to see
         | (or hear). I think "live coding" is just a fancy way of saying
         | a programming experience with immediate feedback -- like a REPL
         | but even more so.
        
           | ThomasMidgley wrote:
           | There are many musicians who "build" music in live concerts
           | with modular synthesizers (in newer times mostly with
           | Eurorack modules). Since many decades! Without computers.
           | With some experience they know how to handle their tools. And
           | with some experience a good live coder can do the same with
           | his computer too.
        
             | MivLives wrote:
             | I've seen performances where the live coding is just them
             | building those same modular synths just digital. They start
             | with a patch, and know what patch they need to end in.
             | Everything between is up to them. Wish I had a better look
             | at what they were doing.
        
       | dm319 wrote:
       | Anyone know how this compares/fits with pure data?
        
       | taink wrote:
       | First learned of Sonic Pi in Dylan Beattie's "The Art of Code"
       | NDC London conference[1]. Overall a very interesting watch; the
       | particular segment mentioning Sonic Pi had really piqued my
       | interest towards this wonderful piece of software.
       | 
       | [1] https://yewtu.be/watch?v=6avJHaC3C2U
        
         | q-base wrote:
         | Thanks for sharing. It is by no means new and I have seen it
         | before. But that is such an incredible presentation!
        
       | keepquestioning wrote:
       | I want to learn synthesis, but want to make pop songs as good as
       | "Closer" by The Chainsmokers, any idea where to start?
        
       | jameal wrote:
       | I downloaded Sonic Pi years ago but haven't given it a proper
       | try. I'm really looking forward to playing around with it again.
       | Playing around with music can be such a fun creative outlet!
       | 
       | 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
        
       | overthemoon wrote:
       | I just lost 30 minutes down this rabbit hole. I am so excited to
       | get into this.
        
       | lpil wrote:
       | Sonic Pi is a wonderful project! Sam the creator is consistently
       | friendly and helpful, if you get the chance to chat with him or
       | to book him for a conference or a party you should on that
       | opportunity.
        
         | ntoll wrote:
         | Thirded... our world is a better place because of Sam and his
         | contributions.
        
         | andycroll wrote:
         | Seconded. Watching a live performance by Sam really is
         | something else.
        
       | BuboBubo wrote:
       | Everything live coding related is worth taking a look:
       | https://github.com/toplap/awesome-livecoding
       | 
       | 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!
        
         | soulofmischief wrote:
         | What are your thoughts / experience with Extempore?
         | https://extemporelang.github.io/
        
           | BuboBubo wrote:
           | I am using some of the concepts that were described by Andrew
           | Sorensen such as temporal recursion in my own project. Such a
           | cool concept. Extempore is very interesting, especially all
           | the low-level bits that are a bit hard to grasp without a
           | solid background in engineering.
        
       | MrGilbert wrote:
       | I was today years old to learn that something like this exists.
       | I'm a coder, and I love music. I know how to spend the next
       | couple evenings. That's awesome!
        
       | lawik wrote:
       | I adore this project. Just fun, creative and powerful stuff.
       | 
       | 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_am_proteus wrote:
       | See also: https://supercollider.github.io/
       | 
       | Supercollider is another real time audio synthesis tool.
        
         | Argorak wrote:
         | Sonic Pi is essentially a frontend to Supercollider:
         | https://github.com/sonic-pi-net/sonic-pi/blob/dev/SYNTH_DESI...
        
         | rvieira wrote:
         | Sonic Pi is a Ruby DSL for SuperCollider.
         | 
         | Sonic Pi is awesome, but ike all DSLs, while making simple
         | things easy it has its limitations.
        
       | pugio wrote:
       | For those looking to start understanding the fundamentals of
       | synths and sound, check out
       | https://learningsynths.ableton.com/en/get-started (and the
       | recently posted https://ciechanow.ski/sound/ ). A great little
       | explorable on the basics.
        
       | williamdclt wrote:
       | I don't know the alternatives but I'm a big fan of
       | https://tidalcycles.org/. People really do crazy things, check
       | out the videos on the front page.
       | 
       | 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.
        
       | bodge5000 wrote:
       | Have been trying to get into live coding, mostly with
       | Supercollider but Sonic-Pi looks nice as well (certainly less
       | verbose). On the composition side of things it seems to be
       | fantastic, I've used a lot of Renoise and this way of doing
       | things just feels like a more direct way of what I was trying to
       | do there, really nice.
       | 
       | 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.
        
         | otikik wrote:
         | Didn't Renoise have some sort of Lua interface? In theory it
         | should allow doing what this is doing, and more.
        
           | bodge5000 wrote:
           | It does, but it ends up working a little bit like using a
           | regular live-coding language with a DAW in that your
           | switching between the two tools. Plus, from what I can
           | remember in Renoise its largely about populating the tracker
           | interface itself rather than values, which makes the whole
           | live portion of it a bit more challenging
        
         | lpil wrote:
         | I think it's not really intended for synth design and complex
         | sound design, it's more akin to an instrument than a DAW. If
         | you read the source code for Sonic Pi you'll see that most the
         | synths are implemented in SuperCollider language or Clojure
         | using the Overtone library, not Ruby/Sonic Pi.
        
       | djaychela wrote:
       | I've spent some time trying to work with Sonic Pi, but I've
       | really struggled with the syntax, finding it difficult to work
       | with. I'm fluent in Python but find the use of colons is the real
       | sticking point.
       | 
       | 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!
        
         | depingus wrote:
         | FoxDot is probably what you're looking for.
         | 
         | https://foxdot.org/
        
           | nvrspyx wrote:
           | They actually mentioned FoxDot in their comment, so they're
           | already familiar. Plus, FoxDot is no longer being actively
           | developed.
        
         | intrepidhero wrote:
         | For what it's worth, I have a python background and Sonic Pi
         | was my introduction to Ruby too. It does feel a bit weird but
         | the built in tutorials are really quite good. You can get
         | pretty far just copying and pasting samples. Play around until
         | bits of it start to make sense.
         | 
         | 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.
        
         | simongray wrote:
         | > I'm fluent in Python but find the use of colons is the real
         | sticking point.
         | 
         | 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
        
           | 0atman wrote:
           | Agreed! OP: Do you think Ruby is the last language you'll
           | have to learn? ;-) Stick with it, sonic-pi is worth it!
        
       | xavriley wrote:
       | For anyone wondering, a lot of work on Sonic Pi recently has gone
       | into integrating an Elixir backend to handle distributed jamming.
       | It has Ableton Link support so it can easily be synced with a DAW
       | and other apps. It can also control external devices via MIDI and
       | OSC protocols more reliably as a result.
        
       ___________________________________________________________________
       (page generated 2022-11-08 23:01 UTC)