SuperCollider

From MusiKiwi

Jump to: navigation, search

Contents

Starting & Stopping the Server

  s = Server.local;
  s.boot;
  s.quit;

Or simply

  Server.local.boot;


Random

  f = {3.0.rand;}; // kinda like: f = rand(3.0);

Functions

Function calls can specify the arguments by name without the need to list them in order:

  f = { arg a, b, c, d; (a + b) * c - d };
  f.value(2, c:3, b:4, d: 1); // 2 + 4 * 3 - 1

Arguments can also be enclosed in ||:

  f = { arg a, b; a + b; };
  g = { |a, b| a + b; };
  f.value(2, 2);
  g.value(2, 2);

Default variables

  • All variables must start with lowercase letter.
  • By default, 's' refers to the localhost server.
  • Variables a-z are "interpreter variables" and have global scope.
Personal tools