To run the attached files you will need to install my RedGA library from the /code/sc/#classes page.
First, is a little exploration tool called growing_sounds10. It makes a single SynthDef from the settings of a multi slider. Draw something and press space to generate and play the SynthDef. If you like what you hear you can copy the code from the post window and refine it manually.
Also, try the preset functions. They will either generate, modify or set a fixed setting/drawing in the multi-slider.
the SynthDef generated in the screenshot above was this one...
Another file is called growing_soundsBreed and it gives you control over 6 parent genomes that can be transformed into SynthDefs and listened to by clicking the play buttons. Mark good sounding parents and breed a new generation. The genomes should now have been mixed and mutated and there are 6 new children as a result of the operation. It is likely that they sound similar to their parents and the longer you repeat the process, the more similar the genomes and in turn, the SynthDefs (phenomes) will be.
Yet another piece of code is growing_soundsBreedFitness and it works the same way as the previous except that you here give a rating i.e. fitness to each parent (blue sliders = fitness amount). So instead of marking which parents you give ratings. The system will use these ratings as a guideline of importance when choosing which parents' genes to use for the new generation.
And last is a file called growing_soundsBreedPattern in which you can not only breed SynthDefs but also the amplitude pattern they play in a simple sequencer.
As always, all code published under GNU GPL v2 license.
Updates:
180101: changed file format from rtf to scd and confirmed it working under SC 3.9
This birdcall synthesis tutorial by Andy Farnell I found very good when it was published. And as I wanted to learn more by synthetic bird songs I ported the Pure Data patches. So here is a version of hansm-bird-control.pd for SuperCollider.
Here is a file from a short introduction to / demonstration of SuperCollider given at the Hochschule für Musik und Theater Hamburg, July 2009. It was all live-coded from scratch during my talk, but in the video above I just run through the lines one by one found in the file (attached).
I recorded this screencast and published the code to serve as an example for people new to and curious of SuperCollider. Pardon the silly music.
hamburg, 02:47, 7.2MB
The \asdf synth definition is a phase modulation synth with some random panning. \hh and \sn are both built by filtering noise and the \bd is a simple oscillator. All three definitions use a percussive envelope.
All Pdefs (the sequencers sort of) is set to use a quantise of 4. That means that any change I do in the sequencing code waits to kick in until the next bar (4/4, 60 BPM).
At 01:35 I start live-coding some changes to the \bd bass drum. First changing the duration from a static 0.5 to a stream of numbers using the Pseq. Then I change the release time (hard to hear) and last I play with the frequencies. That might give an idea of how one can interact with code in SuperCollider and change the system as it is running.
This is a demonstration of a simple sequencer using the RedGA library - a library for genetic algorithms. See the story /f0blog/work-with-mark-genetics/ for more info and get the classes here: /code/sc/#classes.
The whole program consists of six voices. For each voice, there are individual genomes for the SynthDef as well as for the amplitude pattern (the step-sequencer) and for the envelope shape. The genomes are all randomised at startup or when the 'restart' button is clicked. One can monitor the complete result of one voice (SynthDef+pattern+envelope) with the 'play' button and edit the detailed multi-slider views manually if desired. As the play button is clicked, the SynthDef genome is translated to a phenome (a real working SynthDef) and sent to the server as well as posted to the post window.
With the 'mark' buttons one select which voices that will be parents in the next generation. One can mark from zero up to all six voices, but a more sensible number is two or three. There is the choice of keeping the parent voices alive to the next generation or to overwrite them with new children.
In any case, this program is not meant to be taken completely serious. It is more of a fun toy using a genetic algorithm to create some chaotic and glitchy little sounds.
Below is the printout of the genomes (arrays) and phenomes (SynthDefs) that were produced in the video demonstration.
This is a live patch for 4-channel sound written for a friend some time ago. To fully function it expects that you have an external soundcard with 4 inputs (mics) and 4 outputs (speakers) connected. The idea is to be able to route the sound from any of the inputs to any of the outputs and do all kinds of crossfades and mixes in between.
There are two areas with sliders that are used to do the 4x4 routing. One can also record the resulting quad output to disk and play it back, or use previously recorded quad files. There is also a sampler with 28 voices that can be triggered with the computer keyboard (keys A-Z). Additional features include MIDI learn (controllers) plus a preset system that can read and write to disk. Keys '0-9' with and without capslock recall presets while shift-clicking one of the preset buttons in the GUI stores the current setting. With the lag time, one can make all the changes smooth - it interpolates over x seconds.
Attached is the complete code for the program. Sorry for the ugly interface.
It has been tested on SC 3.4 on a OSX with both Cocoa and SwingOSC and should run cross-platform.
Updates:
110315: added MIDI mappings load and save (version09)
111114: increased from 4 to 6 outputs and made the number of inputs/outputs flexible (version10)
180101: changed file form rtf to scd and confirmed it working under SC 3.9
As a continuation of the n-bit computer story, here are three snippets of SuperCollider code that sonifies all possible programs of a little 2-bit computer emulator. They all map the sound differently. Note that here I let load and stor instructions increase the program counter one extra step.
Rendered MP3s for corresponding code is attached below.
//2-bit computer
//sonification #1 - all possible programs 0-255 in order, 16 ticks each
(
s.waitForBoot{
var mem;
var pc= 0; //program counter
var reg= 0; //register
var format= {|x| x.collect{|x| x.asBinaryString(2)}};
var rd= {|x| mem@@x};
var wr= {|x, y| mem.put(x%mem.size, y)};
var snd;
SynthDef(\snd, {|amp= 0, freq= 400, width= 0.5, pan= 0|
var src= LFPulse.ar(freq, 0, width, amp.lag(0, 0.1));
Out.ar(0, Pan2.ar(FreeVerb.ar(src, 0.2, 0.3), pan));
}).add;
s.sync;
snd= Synth(\snd);
Routine.run{
4.do{|m0|
4.do{|m1|
4.do{|m2|
4.do{|m3|
var op, running= true;
mem= [m3, m2, m1, m0]; //reordering here makes slightly different pieces
pc= 0;
reg= 0;
"".postln;
16.do{
if(running, {
op= mem[pc];
snd.set(\amp, 0.7, \freq, op.linexp(0, 3, 120, 1200), \pan, pc/3*2-1, \width, reg/3*0.8+0.1);
switch(op,
2r00, {running= false}, //halt
2r01, {reg= rd.(pc+1); pc= pc+1}, //load next addy into reg
2r10, {reg= reg+1%4}, //incr reg
2r11, {wr.(rd.(pc+1), reg); pc= pc+1} //stor at addy in next byte
);
pc= pc+1%mem.size;
[\pc, pc, \reg, reg, \mem, format.value(mem)].postln;
});
0.01.wait;
snd.set(\amp, 0);
0.001.wait;
};
};};};};
1.wait;
snd.free;
};
};
)