Quantcast
Channel: will schrimshaw » Environmental Data
Viewing all articles
Browse latest Browse all 10

Background Noise

$
0
0

Noise and airs are often generally subtle enough in their fluctuations to become imperceptible, defining the background of an environment due their persistence. By virtue of their existence as part of the background of the day to day experience of an environment, they constitute that which a sound or smell must set itself apart from in becoming perceptible or moving to the fore. Both often fall beneath the thresholds of conscious perception, temporarily slipping into imperceptibility, while at the same time defining these thresholds.

Below are some experiments combining background noise and data derived from the quantaties of diverse airs populating the background of our respiratory and olfactory experience.

NormalCloud.mp3
PlagueCloud.aiff (large file).

These are experiments and don’t need to go on for long, so duplicate lines were removed from the log files using the following emacs commands:

C-x h C-u M-x shell-command-on-region RET uniq RET

The SuperCollider code responsible for the sounds above:

 
s=Server.local.boot;
 
s.doWhenBooted({
 
	var average, length, int, subav, duration, value;
 
	f = File("/Users/cl-user/PlagueCloudReduction.txt", "r");
 
	// put the contents of the file into an array, as long as it is not nil:
 
	a = Array.new(f.length);
	f.length.do({ |i|
	v = f.getLine;
	if (v != nil, {
	a.add(v.asInteger); });
	});
 
	// calculate average value of the file (background noise):
 
	average = a.sum/a.size;
	"average : ".post; average.postln;
	f.close; // dispose of exhausted file.
 
	// open anew:
 
	f = File("/Users/cl-user/PlagueCloudReduction.txt", "r");
 
	// get server ready for recording:
 
	s.recSampleFormat_("int16");	// lame has issues with whatever the default settings are
								// so int16 set for easy mp3 encoding.
	s.prepareForRecord;
 
	// buses:
 
	s.sendMsg(c_set, 100, 20);		// frequency bus
	s.sendMsg(c_set, 200, 0.01);	// q bus
	s.sendMsg(c_set, 300, 0.4);	// vol bus
 
	// White Noise through a bandpass filter:
	SynthDef(bpass, {
		|freq, rq, vol|
		var noise;
		noise = BPF.ar(WhiteNoise.ar(1), freq, rq, vol);
		Out.ar([0,1], GVerb.ar(noise*Formlet.ar(noise, freq, 0.1, 0.2, mul: 0.05),
			100, 1.2, 0.75, drylevel: 0.5));
	}).send(s);
 
 
	// a line generator to control the freq, q and volume of the above synth:
	SynthDef(line, {
		|outbus, end, dur|
		Out.kr(outbus, XLine.kr(In.kr(outbus), end, dur, doneAction:2));
	}).send(s);
 
	// Start the synth:
	s.sendBundle(nil, [s_new, bpass, x = s.nextNodeID, 0, 1],[n_map, x, freq, 100, rq, 200, 	vol, 300]);
 
	// start recording:
 
	s.record;
 
// send values derived from log file to synths:
 
Routine.new ({
 
// use the length of the array that the log values are stored in to determine length of the loop:
 
	a.size.do({
 
		int = f.getLine.asInteger;
		duration = int / 100;
		value = ((int)**((int)/int));
 
		s.sendBundle(0.3,
 
			[s_new, line, s.nextNodeID, 0,1, outbus, 100, end, value, dur, duration],
			[s_new, line, s.nextNodeID, 0,1, outbus, 200, end, int/120000, dur, duration],
			[s_new, line, s.nextNodeID, 0,1, outbus, 300, end, int/30, dur, duration]
 
		);
 
		duration.wait;
 
	}); // end loop
 
	f.close; 			// close the log file
	5.wait;			// wait five seconds
	s.stopRecording;	// stop recording
	//s.quit;			// kill server
 
}).play; // end routine
 
}); // end when booted..

Viewing all articles
Browse latest Browse all 10

Trending Articles