Initial Thoughts

There are so many music programming DSLs out there that it’s incredibly difficult to choose which will best suit your purpose. My initial explorations centred around Pure Data (PD). Somewhat arse-from-elbow, this was the first programming language I learned. To me, the dataflow paradigm still makes perfect sense – things go in, stuff comes out (please excuse the analogy (and the pun)). Perhaps this is why some of the concepts of functional programming are appealing to me but I digress.

To me, SuperCollider (SC) seemed like a completely different creature to PD; intimidating in every way. It wasn’t until I learned that PD and SC both make use of something called ‘unit generators’, developed by Max Mathews and his colleagues at Bell Labs in the 1950s that this fear subsided.

Remember that notion of things going in and stuff coming out? Consider that a very crude summation of ‘unit generators’. Both languages make use of this concept but represent it in different ways. PD represents them visually and SC represents them with nested parathensis. After realising this, SC doesn’t seem so daunting after all.

SC “Hello World”

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// =====================================================================
// My SuperCollider "Hello World"
// =====================================================================

(
 {
   var m1, m2, voice1, voice2, combo;

   m1 = MouseX.kr(440,44,10.0);
   m2 = MouseY.kr(44,440,10.0);

   voice1 = Impulse.ar(m1);
   voice2 = Impulse.ar(m2);

   combo = voice1 + voice2;

   (CombN.ar(combo, 0.1, 0.1, 10))*0.05;
 }.play
)