S C O T T P E T E R S E N ∞ E L M U C O ∞ S C A C I N T O . C O M

homepage for scott eric petersen, el muco, and all things electronic

Simple Semi-Stochastic Music Language Examples

An article in the June 1979 issue of Computer Music Journal (Vol.3, No.2, Jun., 1979) inspired me to see how easy it would be to impliment “very simple” examples of semi-stochastic music in SuperCollider.  The algorithmic function is the focus of the following examples, which took about 10 minutes to code.  The code uses two different interval sets, a whole-tone set (a) and a simple scale (c) in order to make the algorithm audibly clear.  You can cut and paste the following code into SuperCollider and run it your self to hear the results.  Select and run the .plot code afterwards to see the envelope of pitch choice.  I will upload screen-shots of the plots and audio soon.

// Simple Semi-Stochastic Music Language (SSMLT) #1: the logorithmic curve

(
s.waitForBoot;

///////////////SYNTHDEFS//////////////////////////

SynthDef(“plunk”, {|freq|

var env = EnvGen.kr(Env.perc, 1, doneAction:2);
var sound = SinOsc.ar(freq);
Out.ar([0,1], sound * env * 0.5);

}).send(s);

//////////////////////////////////////////////////

///////////////VARIBLES///////////////////////////

a = [0,-10,-8,-6,-4,-2,0,2,4,6,8,10,0];
b = [0.5,1];
c = [0,1,3,5,7,9,11];

//////////////////////////////////////////////////

//////////Routines////////////////////////////////

(
~plot = List[];
~notes = List[];

r = Routine({

var num = 50;

num.do({|i|

var array = [num-(i+ (i/ (0.5*num))), (i/ (0.5*num))].normalizeSum.postln;
var notes = [a.choose,c.choose].wchoose(array).postln;

~plot.add(array.at(0));
~plot.add(array.at(1));
~notes.add(notes);

Synth(“plunk”, [\freq, (70 + notes).midicps]);

0.25.wait;
}); // outer ‘do’

});
)
)

//////////////////////////////////////////////////

/////////////CONTROL–GO TIME/////////////////////

r.reset.play;

//////////////////////////////////////////////////

///////////////PLOT IT////////////////////////////

(
~plot.asArray.plot(“turd plot terror attack”, numChannels:2);
~notes.asArray.plot(“turd plorp poopy attack”, discrete: true);
)

//////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////////////
/***********************************NEXT************************************/
/////////////////////////////////////////////////////////////////////////////

// Simple Semi-Stochastic Music Language (SSMLT) #2: the linear curve

(
s.waitForBoot;

///////////////SYNTHDEFS//////////////////////////

SynthDef(“plunk”, {|freq|

var env = EnvGen.kr(Env.perc, 1, doneAction:2);
var sound = SinOsc.ar(freq);
Out.ar([0,1], sound * env * 0.5);

}).send(s);

//////////////////////////////////////////////////

///////////////VARIBLES///////////////////////////

a = [0,-10,-8,-6,-4,-2,0];
b = [0.5,1];
c = [0,1,3,5,7,9,11,12];

//////////////////////////////////////////////////

//////////Routines////////////////////////////////

(
~plot = List[];
~notes = List[];

r = Routine({

var num = 50;

num.do({|i|

var array = [num-i, i].normalizeSum.postln;
var notes = [a.choose,c.choose].wchoose(array).postln;

~plot.add(array.at(0));
~plot.add(array.at(1));
~notes.add(notes);

Synth(“plunk”, [\freq, (70 + notes).midicps]);

0.25.wait;
}); // outer ‘do’

});
)

)

//////////////////////////////////////////////////

/////////////CONTROL–GO TIME/////////////////////

r.reset.play;

//////////////////////////////////////////////////

///////////////PLOT IT////////////////////////////

(
~plot.asArray.plot(“Weighted Choice”, numChannels:2);
~notes.asArray.plot(“Resulting Pitches”, discrete: true);
)

//////////////////////////////////////////////////

Advertisements

Filed under: Code, , , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

My Other Awesome Sites [•_•]

Assault! 375 Aural Assaults!
About me! About me!
MySpace! MySpace!
Google+! Google+!
My (soon-to-be) Company! My (soon-to-be) Company!

Enter your email address to subscribe to this awesome blog and receive notifications of new posts by email!

Join 76 other followers

-

P O S T E R S !

Artspace

-

Artspace

-

Artspace

Featured

INI new haven

Handmade instruments by Scott Petersen and Brian Kane at Artspace New Haven

%d bloggers like this: