screen-shot

ScalaCollider

ScalaCollider is a sound-synthesis programming language, a dialect of SuperCollider based on the Scala language. It is provided in multiple layers, from a plain library that can be incorporated into other projects, to a desktop standalone-application (ScalaCollider-Swing) that can be used for experimentation, live coding, seminars etc.

The Scala programming language has been around since 2003 now, and has become one of the most interesting new languages around: It combines object-orientation and functional programming, runs on the Java Virtual Machine (i.e. can be combined with other Java libraries and is operation system independent), has a strong type system, but its smart type inference results in a comparably compact syntax. It comes with powerful constructs such as pattern matching, implicit classes and trait mixins, all which allow for elegant Domain Specific Language extensions within the language itself.

ScalaCollider has been created as a client for SuperCollider server in the Scala language. It can encapsulate much of the expressiveness of SC-Lang, adding new unique expressiveness, type-safety, performance, and doing away with the split-up of SC-Lang (compiled classes, interpreted code, C primitives, GUI server), by allowing all those inside the same language.

// ScalaCollider
play {
   val o = LFSaw.kr(Seq(8, 7.23)).madd(3, 80)
   val f = LFSaw.kr(0.4).madd(24, o)
   val s = SinOsc.ar(f.midicps) * 0.04
   CombN.ar(s, 0.2, 0.2, 4)
}
// sclang
play {
   var o = LFSaw.kr([8, 7.23], 0, 3, 80);
   var f = LFSaw.kr(0.4, 0, 24, o);
   var s = SinOsc.ar(f.midicps) * 0.04;
   CombN.ar(s, 0.2, 0.2, 4)
}

ScalaCollider also starts fresh, leaving behind much of the bulk that has been growing in the SC-Lang class library over the years. It is an experimentation field of how things could be done differently, and it forms the base layer in a modular system:

Further experiments have shown that ScalaCollider can run on Android and might be integrated into the IntelliJ IDEA platform.

Further Resources

Much of the reasoning for the initial version has been described in the paper 'Rethinking the SuperCollider Client…' for the 2010 SuperCollider Symposium. The ScalaCollider GitHub page has links to a mailing list and a wiki which has a few articles on getting started with ScalaCollider, setting up projects in IDEA and so forth. Finally, there is a short screencast (a bit older, but still mostly up-to-date) introducing ScalaCollider via its Swing front-end: