// first (one-liner) sound examples

// 1. step: boot the server  (scsynth)
// on OSX: click on the [Boot] button in the (internal) server window
// elsewhere: do the following

s = Server.local;		// evaluate this line

s.boot;				// and then this

// watch the post window until "SuperCollider 3 server ready.." appears

// 2. step: evaluate each of the following lines
// stop the noise by [CMD-.] (OSX) or [ALT-.] (Win)

{ SinOsc.ar(440, 0, 0.1) }.play

{ SinOsc.ar(60.midicps, 0, 0.1) }.play

{ Saw.ar(36.midicps, 0.3) }.play

{ Pulse.ar(50, 0.1, 0.3) }.play

// modulation of the frequency:
{ SinOsc.ar(440 + SinOsc.kr(2).range(-50, 50), 0, 0.1) }.play

{ Saw.ar( XLine.kr(36, 60, 10).midicps, 0.1) }.play

{ Saw.ar( LFPulse.kr(1).range(55, 60).midicps, 0.1) }.play

{ Pulse.ar(50, LFTri.kr(0.3).range(0.01, 0.5), 0.1) }.play

{ Saw.ar( MouseY.kr(3, 300, \exponential), 0.5) }.play

// modulation of both frequency and pulse width:
{ Pulse.ar( MouseY.kr(5, 500, \exponential), MouseX.kr(0.0, 0.5), 0.5) }.play

// random modulation of the amplitude:
{ SinOsc.ar(440, 0, LFNoise2.kr(5).exprange(0.01, 0.9)) }.play

// do you have a microphone connected to your computer?
{ CombN.ar(AudioIn.ar(1), 1, 0.5, 3.0) }.play

// subtractive synthesis with a resonance filter:
{ Resonz.ar(Saw.ar(100), LFNoise1.kr(1).range(300, 1200), 0.1) }.play

// subtractive synthesis with a resonant lowpass filter
// and two detuned sawtooths in stereo:
{ RLPF.ar(Saw.ar([100, 101], 0.5), LFNoise1.kr(1).range(300, 1200), 0.1) }.play

// independant random generators for resonance frequencies:
{ RLPF.ar(Saw.ar([100, 101], 0.3), LFNoise1.kr([1,1]).range(300, 1200), 0.03) }.play

// one can start a couple of synth at the same time:
{ SinOsc.ar(440, 0, 0.1) }.play;  { SinOsc.ar(577, 0, 0.1) }.play; 

// additive synthesis (boring ...)
20.do { arg i;  { SinOsc.ar((i+1) * 300, 0, (i+1).reciprocal * 0.1) }.play }

// additive synthesis (... more interesting)
20.do { arg i;  { SinOsc.ar((i+1) * 300, 0, LFNoise2.kr((i+1)*0.5).exprange(0.001, (i+1).reciprocal) * 0.3) }.play }

// additive synthesis (... deterministic version)
20.do { arg i;  { SinOsc.ar((i+1) * 300, 0, SinOsc.kr((i+1)*0.5).exprange(0.001, (i+1).reciprocal) * 0.3) }.play }

// additive synthesis, inharmonic
20.do { arg i;  { SinOsc.ar(exprand(200.0, 1800.0), 0, LFNoise2.kr(rrand(0.3, 1.0)).exprange(0.001,0.2)) }.play }

// additive synthesis, inharmonic and stereo
30.do { arg i;  { Pan2.ar(SinOsc.ar(exprand(200.0, 1800.0), 0, LFNoise2.kr(rrand(0.3, 1.0)).exprange(0.001,0.2)), 1.0.rand2) }.play }