Supercollider: Difference between revisions

From Noisebridge
Jump to navigation Jump to search
(what sc does)
No edit summary
Line 1: Line 1:
== Introduction ==
== Introduction ==
Supercollider (SC) operates in the same vein as the [[bytebeat]] project but at a higher level. The [[computer music workstation]] has SC installed.
Supercollider (SC) operates in the same vein as the [[bytebeat]] project but at a higher level. The [[computer music workstation]] has SC installed.
== Supercollider Class ==
Starting the first week in Feburary 2018, there will be a weekly class on Supercollider, lasting for 12 weeks. Details on the [[Supercollider Class]] page.


== Example code ==
== Example code ==

Revision as of 15:45, 17 January 2018

Introduction

Supercollider (SC) operates in the same vein as the bytebeat project but at a higher level. The computer music workstation has SC installed.

Supercollider Class

Starting the first week in Feburary 2018, there will be a weekly class on Supercollider, lasting for 12 weeks. Details on the Supercollider Class page.

Example code

The following is an algorithmic composition in the SC language by Fredrik Olofsson, published on Twitter. It must be executed in the SC virtual machine.

play{a=LFCub;Splay.ar(a.ar(b=2/(2..9))%a.ar(b/5)*a.ar(2**a.ar(b/8)>0+1*2*(b*[300,303]-(a.ar(b/9)>0*50).lag2))*a.ar(b/6,b))}

This is not a limitation of the language though. It can be written in a much more expressive way, and lends itself to livecoding as a performative activity.

For example, the following creates a synth definition, followed by four instances of that synth with different parameters. Each code block can be executed as a piece, and the engine runs the code blocks in realtime.

// Define a single synth that takes parameters
SynthDef.new("impulse-sinefunc", { |
	impulseLFO = 0.49,
	panPos = 0.5,
	lfoRange = 833,
	sinFreq = 435 |

	Out.ar(0,
		Pan2.ar(
		Decay2.ar(
			Impulse.ar(
				LFCub.kr(1,0.33,1,impulseLFO),
				0
			),0.09,0.4,SinOsc.ar(sinFreq,0,0.25,0)
		),panPos)
	)}
).add;

// mess around with these four starting at different times
x = Synth.new("impulse-sinefunc",[\impulseLFO,5.5,\panPos, 0.2, \sinFreq, 457]);
x.free;
y = Synth.new("impulse-sinefunc", [\impulseLFO,5, \panPos, 0.7]);
y.free;
z = Synth.new("impulse-sinefunc", [\impulseLFO,4, \panPos, 0.3,\sinFreq, 488]);
z.free;
a = Synth.new("impulse-sinefunc", [\impulseLFO,4.2, \panPos, 0.8,\sinFreq, 444]);
a.free;

Facts