

Sonic Pi – A Music Live Coding Environment for Schools - samaaron
http://sonic-pi.net

======
gracenotes
There was a talk at Strange Loop 2014, "Our Shared Joy of Programming", which
was just recently put on YouTube:

[https://www.youtube.com/watch?v=3_zW63dcZB0](https://www.youtube.com/watch?v=3_zW63dcZB0)

The whole talk is stimulating, but the parts relevant to Sonic Pi are its
Overtone ([http://overtone.github.io/](http://overtone.github.io/)) lineage at
about 9:05, a demo at about 17:36, and the experience using it in schools
([http://www.raspberrypi.org/sonic-pi-live-summer-
school/](http://www.raspberrypi.org/sonic-pi-live-summer-school/)) at about
26:48.

What I got out of it was that it's a language which is meant to be both fully
featured and easy for kids to pick up, to get interested in music,
programming, or both. Maybe not so much programming as just "computational
thinking". It has less incidental complexity than EDSLs (like Overtone) or
traditional tools which expose more of the synthesis pipeline. Compared to
most video game/graphics frameworks, which are also used in education, you can
get to more polished content faster.

------
catshirt
really cool.

nested with_synth and with_fx calls seem less intuitive than an object
oriented approach, which mirror traditional circuits. (synth.connect(fx1)
fx1.connect(output)). what was the reasoning behind this? i only ask because i
could see it making a difference in terms of education. and, what makes this
more suitable for schools than ChucK, Supercollider, etc.?

that aside, i really wish someone would make a language agnostic livecoding
VST so we can start incorporating stuff like Sonic Pi into our real workflows.
i sense an integration like that would also gain some attention from people
who previously ignored livecoding. i'm sure a lot of students screw around
with Fruity Loops or Ableton and would find livecoding much more accessible if
it tapped into the tooling they already understood.

~~~
TheOtherHobbes
There's a basic problem with live coding, which is defining the problem
domain.

Live coding systems are only really good for building teeny tiny little toy
automata, which usually do simple stuff with note lists, and maybe apply a bit
of randomness or some simple repeating functions to a parameter or five.

Weapons-grade commercial music is _much_ more complicated. The sounds are
richer, the arrangements and mixes are immensely complex (even for simple
songs), and generally there's a ridiculous amount of care and detail.

But... if you start building in machine learning, database searches, and
super-complex DSP patches, and the stuff you really need to make non-trivial
music, you're not really live coding any more - you're plugging pre-existing
modules and data together by typing.

Also, watching people typing is kind of dull.

I think there are solutions to both problems, but REPL-music systems are only
ever going to be a step on the way to them.

I'd be surprised if live coding ever makes it into the mainstream in the way
that (say) eSports almost have.

~~~
yaxu
I disagree for a few reasons - language is very good at describing complicated
things, minimal music is great, and there's nothing at all stopping live
coders from using rich sounds.

~~~
TheOtherHobbes
Then why don't live coders use rich sounds, or make complicated things?

As for 'minimal music' \- most of it isn't really all that minimal, and it
certainly can't be reduced to trivial algos.

And if your only option is to be minimal, maybe that's not so great.

Point is that only a tiny subset of the population has ever been interested in
listening to music defined and created exclusively by writing code. Live
coding caters very nicely to them.

No one else seems to be listening.

Over the same period, CGI has moved from basic wireframes to epic
photorealism-with-AI. You can see this stuff in games and movies, and it's
awesome.

Why aren't code musicians interested in pushing the boundaries of code music
by aiming for something with similar complexity?

Here's a thing: after nearly sixty years of code music, exactly zero code
music composers have troubled the public imagination.

Over the same period we've had literally hundreds of new electronic genres and
styles, and even people who don't much like electronica can name at least a
couple of people who make it.

We've also had game music coders writing complex AIs for arranging and
generating music on the fly in game contexts.

But live coders don't seem interested in any of this, because typing.

Honestly, this completely baffles me.

~~~
catshirt
>> "Then why don't live coders use rich sounds, or make complicated things?"

because there is no reason, because livecoding hasn't matured at the same rate
as other production software. at the risk of painting a broad stroke, the
people who care about livecoding don't really care about rich sounds.

do you recall how EDM sounded in the 90s and early 2000s compared to now? and
they were using the same exact tools as they use today. but i'm pretty sure a
lot of techno producers were literally limited to like 6 tracks or something.
and the sounds they used were god awful. not because they preferred it, but
because they were technically limited by these parameters.

but people still made music, people still danced, and the genre progressed
along with it's tooling over the next 20 years.

the music is still evolving side by side with the software we build to produce
it. livecoding is just another instrument that hasn't been exploited to it's
fullest advantage (as a "live" coding or a production tool).

i've played in touring bands, and i produce electronic music for fun now. i've
been a software engineer about my whole life. i would love more programming
language options in my production. the same way tweaking a VST can result in
more interesting melodies than you originally intended, programming languages
can be a great tool to help explore audio in unique ways.

------
zalmoxes
Not bad. Reminds me of Hackety Hack.

Bret Victor's criticism of KhanAcademy is just as relevant here
[http://worrydream.com/LearnableProgramming/](http://worrydream.com/LearnableProgramming/)

~~~
yaxu
I think Bret Victor underplays the importance of liveness ("almost worthless",
eh?), and doesn't touch on the possibilities of making programming a shared
experience, that is itself culturally meaningful, inclusive activity, e.g.
musical. This is what Sam Aaron and other live coders have been working on for
the past decade. It's a totally different approach really, through making
music together, nonstop for years.. Sonic Pi is impressive and successful
because it's grounded in actual arts practice, not extrapolations from rigged
demos.

------
ThomPete
For a long long time I have wanted to do a language for programming music. I
like how easy this is to get started with it almost feels like the old tracker
days.

~~~
keithpeter
How is your conception of what is involved in 'do[ing] a language for
programming music' different to super-colider or ChucK or puredata? Not being
aggressive just interested in how you see the problem.

~~~
ThomPete
Getting started to begin with :)

It feels like the PHP of music programming environments.

I am a former musician so approach music more like Sonic Pi

I mean it's this

Sonic Pi

with_fx :reverb, mix: 0.2 do loop do play scale(:Eb2, :major_pentatonic,
num_octaves: 3).choose, release: 0.1, amp: rand sleep 0.1 end end

vs. super collider

// Simple synth definition using the Atari2600 UGen: ( SynthDef(\atari2600,
{|out= 0, gate= 1, tone0= 5, tone1= 8, freq0= 10, freq1= 20, amp= 1, pan= 0|
var e, z; e= EnvGen.kr(Env.asr(0.01, amp, 0.05), gate, doneAction:2); z=
Atari2600.ar(tone0, tone1, freq0, freq1, 15, 15); Out.ar(out, Pan2.ar(z*e,
pan)); }).store )

// And a pattern to play it: ( Pbind( \instrument, \atari2600, \dur,
Pseq([0.25, 0.25, 0.25, 0.45], inf), \amp, 0.8, \tone0, Pseq([Pseq([2, 5],
32), Pseq([3, 5], 32)], inf), \tone1, 14, \freq0, Pseq([Pbrown(28, 31, 1, 32),
Pbrown(23, 26, 3, 32)], inf), \freq1, Pseq([Pn(10, 16), Pn(11, 16)], inf)
).play )

When playing music the ability to quickly get up and running is more important
than the flexibility of the system. I.e. you wanna quickly get to the point
when you have fun and then you optimize later.

But don't get me wrong supercollider is a fantastic tool and was a real
innovation.

~~~
keithpeter
Fine, so still REPL but with built in stuff to get a performance going. I get
the picture.

------
dmoo
Also have a look at [http://earsketch.gatech.edu](http://earsketch.gatech.edu)

Python + music

~~~
zeitpolizei
I'm glad someone mentioned EarSketch. As it's more focused on teaching
programming and computing principles by making music, as opposed to a general
purpose computer music language/environment like Chuck, Pure Data, and
Supercollider. I was involved with the project during Grad school when it was
completely attached to a DAW (Reaper), but it can now run in a browser. I'm
usually not that excited about audio applications in a browser, but I think
this is a great use case.

------
glial
This is great. As someone who's tried to get into coded music, the biggest
hurdle for me has always been getting the pipeline set up properly (including
learning VIM commands). This handles all of that.

------
zapt02
Would it be possible to run this under Windows? :o

~~~
keithpeter
Also how about non-pi Debian linux?

I'll experiment with the .tgz file for that.

~~~
tripzilch
Hey if you figure this out, please report back--I'd love to try this program.

------
ArthurClemens
This seems related to Chuck
[http://chuck.cs.princeton.edu](http://chuck.cs.princeton.edu)

------
jimiwen
let's if some mainstream will use it e.g.
[https://www.facebook.com/imayday555?ref=br_tf](https://www.facebook.com/imayday555?ref=br_tf)

------
Ashuu
Is it possible to use sonic pi on windows?

