/* Class 1 - SuperCollider */
/*
SuperCollider 3 (or SuperCollider Server) is actually the combination of two programs, scsynth, a synthesis engine (server) and sclang, or a language side client. Other client programs and structures exist, but in many ways, the language developed by James McCartney for use with his synthesis engine is probably the strongest.
This is a block comment. It will colorize red when you ask SuperCollider to colorize your document (apple-')
*/
// This is a single line comment
// Strings colorize grey. Colons end a line of code
"I am a string";
\symbol; // colorize green
Class; // colorize blue - starts with an uppercase letter
/*
SuperCollider is an interpreted language.
*/
3 + 3;
3 + 3;
6 * pi;
a = "The var 'a' is assigned this string"; // '=' is the assignment operator
a; // a is now the above string.
// code can be blocked with parens
(
b = 3 + 3;
c = 6 * pi;
a = "The var 'a' is assigned this string";
)
[a, b, c].postln;
/* SuperCollider's help system */
Class
/*
Class definitions - apple-y
*/
Class
Date
// Create a new instance of Date, and assign it to the
// variable 'a'. We send the getDate creation
// method to the Date Class
a = Date.getDate;
a; // a is always that intial value...
// message that instance of the Class 'Date'
a.dayStamp;
a.secStamp;
// getters...
a.year;
// and setters.
a.year = 2003;
a; // a now has a new year
a.year_(2006); // alternate setter notation
/*
The Server - where synthesis happens
*/
s; // -> localhost (a Server)
s.class; // -> Server
s.name; // ->localhost
s.serverRunning; // ->false
s.boot; // all sorts of info
s.serverRunning; // ->true
s.quit; // it quits
/*
The main function of the Server is to run synthesis processes. These are described as a set of Unit Generators (Ugens) with a specific control flow (a UGen graph). It is up to you to describe these processes ahead of time, using the SynthDef object.
UGens are the basic building blocks of synthesis... in simplest terms, they generate values that can be interpreted in time as a signal.
*/
s = Server.internal.boot;
s.scope;
// as a quick test, we will define a function that will
// play a UGen. Functions are indicated by curly
// brackets
a = {SinOsc.ar(440, 0, 0.2)}.play(s);
a.free;
a = {SinOsc.ar(660, mul: 0.2)}.play(s);
// apple-. kills all synthesis (a kind of panic button)
/* For tonight:
Become familiar with the Help system. And look specifically at the following topics.
[More-On-Getting-Help]
[How-to-Use-the-Interpreter]
[Server-Architecture]
[Server-Command-Reference]
[Tour_of_UGens]
[UGens-and-Synths]
[ClientVsServer]
[NodeMessaging]
[Order-of-execution]
[ServerTiming]
*/