Posts tagged supercollider

Posted 3 weeks ago

FM in SuperCollider

Tinkering with the TX81Z led me to building some simple FM in SuperCollider to experiment with. Next I will need to add some LFOS or complex envelopes to these simple FM sounds.

//FM Synthesis 

// 2 Oscillators

SynthDef(\FM, { |car_freq, mod_ratio, mod_index, amp |
    var fm = SinOsc.ar(car_freq + (SinOsc.ar(car_freq*mod_ratio) * mod_index));
    var env = EnvGen.kr(Env.linen, doneAction: 2);
    Out.ar(0, fm*env);
}).add;

x = Synth.new(\FM, [\car_freq, 200, \mod_ratio, 2, \mod_index, 500]); 

// 3 Oscillators

SynthDef(\FM3OP, { |car_freq, mod_ratio1, mod_ratio2, mod_index1, mod_index2, amp |
    var fm = SinOsc.ar(car_freq + 
        (SinOsc.ar(car_freq*mod_ratio1 +
            (SinOsc.ar(car_freq*mod_ratio2) * mod_index2)) * mod_index1));
    var env = EnvGen.kr(Env.linen, doneAction: 2);
    Out.ar(0, fm*env);
}).add;

x = Synth.new(\FM3OP, [\car_freq, 200, 
                \mod_ratio1, 2, \mod_index1, 500,
                \mod_ratio2, 0.5, \mod_index2, 200]); 
                
// 4 Oscillators

SynthDef(\FM4OP, { |car_freq, mod_ratio1, mod_ratio2, mod_ratio3, mod_index1, mod_index2, mod_index3 amp |
    var fm = SinOsc.ar(car_freq + 
        (SinOsc.ar(car_freq*mod_ratio1 +
            (SinOsc.ar(car_freq*mod_ratio2 +
                (SinOsc.ar(car_freq*mod_ratio3) * mod_index3)) * mod_index2)) * mod_index1));
    var env = EnvGen.kr(Env.linen, doneAction: 2);
    Out.ar(0, fm*env);
}).add;

x = Synth.new(\FM4OP, [\car_freq, 200, 
                \mod_ratio1, 2, \mod_index1, 500,
                \mod_ratio2, 0.5, \mod_index2, 200,
                \mod_ratio3, 3, \mod_index3, 700]);
                    
                
Posted 3 weeks ago

A Quick Introduction to SuperCollider : Designing Sound

Nice intro to SuperCollider tutorial. Even though I have been using SC for a while, it is always so useful to look at beginning tutorials because they remind you of the simple (and not so simple) ways of working with it. Plus, everyone has a different approach to starting out with SC

Posted 1 month ago

Quick demonstration of sending CV signals from SuperCollider using the multitouch pad. X position determines filter cutoff and y position is resonance. If I had more CV cables I could use multiple fingers to control more parameters.

Posted 3 months ago

Outputting Control Voltages (CV) with SuperCollider

image

image

image

So I recently decided to actually start building a modular synth in the eurorack format. Modular synths are expensive and I am really going to have to take my time saving up and selecting modules, etc. So in the meantime, I am looking for ways to get more functionality out of single modules (or very few modules). One way to save money on modules initially is to only purchase sound producing or processing modules (oscillators, filters, effects, etc) versus purchasing control based modules (envelopes, lfos, etc). I learned a while ago that certain audio interfaces that are DC-coupled are capable of outputting the same kinds of control voltages that modular synths can use. If you are interested in reading more about this I suggest checking out the Expert Sleepers site and especially reading about their Silent Way plug-ins. 

But I want to show you all how to output control voltage quickly and easily using everyone’s favorite audio programming language SuperCollider. Also this post by Andrea Valle on the SuperCollider Users list was very helpful in getting me started with this.

First a checklist of things you need:

- a synth module and power source (I have the Abstract Data ADE-20 Filter)
- DC-coupled audio interface, see list of supported interfaces here
- floating-ring 1/4” to 1/8” cables
- SuperCollider

The floating ring cables are important because if you attempt to send CV signals out from your audio interface with normal cables you could damage your interface. You can make these cables yourself or purchase them. I purchased mine from Control in Brooklyn, a really great modular synth store. I have a MOTU Traveler audio interface with 1/4” outputs on the back. I plugged channel 1 into the filter (using a 1/4” to 1/8” cable) and then plugged my two floating ring cables into outputs 3 and 4 on my interface and then into the frequency cutoff CV and resonance CV inputs on the filter.

First, I send some sound into the filter (a basic saw wave)

SynthDef(\saw, { | out=0, freq=100, amp=0.2 |
	Out.ar(out, Saw.ar(freq, amp));
}).add;

~saw = Synth(\saw, [\freq, 100, \amp, 1]);

Note I am sending this saw wave out with a lot of amplitude because I don’t have an audio input module for my synth yet that will amplify line level signals from the computer up to modular levels.

Next let’s create an LFO synth and start it running out of output 3

SynthDef(\lfo, { | out = 2, rate = 1, amp=1 |
			Out.ar(out, K2A.ar(SinOsc.ar(rate, amp)));
			}).add;
			
~lfo1 = Synth(\lfo, [\out, 2, \rate, 0.5]);

We can send another LFO out of output 4

~lfo2 = Synth(\lfo, [\out, 3, \rate, 0.4]);

One thing that is really fun and interesting is modulating up into audio levels to get FM effects. 

~lfo1.set(\rate, 40);
~lfo2.set(\rate, 0.5);

Listen to this code being run through my filter below, or click here to listen on SoundCloud.

It is really quite simple, any signal that you could listen to, if you slow it down enough it can become a usable control voltage. You could build all sorts of modules in SuperCollider to create different kinds of interactions. 

Posted 7 months ago

OSCNotation and SuperCollider

So I found out about this new app for iPhone/iPod touch today on CreateDigitalMusic called OSCNotation. It allows you to send traditional western notation from a computer via Open Sound Control Messages to the application running on an iPhone/iPod touch. There are a lot of interesting applications to using this in live music. I imagine creating a front end that allows a composer to create orchestral arrangements on the fly (with lots of iPods) or at the very least create some interesting cellular compositions for a small ensemble that are dynamic and can respond to the moment.

Anyway, here is how you can set it up to work with SuperCollider.

Open up OSCNotation on your iOS device. You will see a blank page with an IP address at the top.

image

In SuperCollider, run the following code to set up the networking. Remember to use the IP address that the app says it is receiving on.

n = NetAddr.new("192.168.1.106", 9000);

Then run the following code and a treble clef will appear.

n.sendMsg("/stave", "treble");

image

Run the following two lines and music will appear!

n.sendMsg("/rhythm", 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25); 
n.sendMsg("/notes", 60, 1, 64, 65, 67, 1, 69, 71, 72); 

image

When you are done, enter

n.disconnect

to clean up after yourself.

Check out the User Guide here for an explanation on how to notate different kinds of rhythms and rests.

You could have multiple iPods running for each musician and send them each their own musical phrase. This doesn’t have to be a computer-controlling human situation either. This could serve as potential pitch based material for use in an improvisation with a computer musician. Lots of possibilities! Thanks to David for helping me with the OSC commands.

Posted 8 months ago

Music for Computer-Controlled Pipe Organ on September 27th

So last year I helped organize a concert of music for computer-controlled pipe organ and it was a musical success. We are doing it again and writing new pieces for the concert. The pipe organ is a very fascinating instrument. When you combine this massive instrument with a computer there is nothing quite like it in acoustic or electronic music. The results can be truly jaw-dropping and at times frightening. This thing can produce SO MUCH SOUND and when you program it to do things that a human player could never do you can’t help but be amazed at the thing. So obviously you should all go because it is FREE!

Posted 8 months ago

Schemawound: Hello World, I Am Lonely Too

schemawound:

In this post I break down the creation of my track “Hello World, I Am Lonely Too” from my album “They Want To Make Your Body Move. I Want To Hold You Perfectly Still.”. The track was made entirely in Supercollider, although the final mix actually contains sections from two different renders of…

Great post explaining one way to create a piece in SuperCollider.

Posted 9 months ago

Wavefolding in SC.

{ Fold.ar(SinOsc.ar(440, 0, 0.9), LFNoise0.ar(1,0.5,-0.5), LFNoise0.ar(0.9,0.5,0.5)) }.scope;
Posted 9 months ago

Some SuperCollider Code

Learning about modular synths is really helping me visualize what is happening with SuperCollider these days. The last paragraph of this interview where Tony Rolando of MakeNoise mentions an “Animated Mix Engine” got me thinking about how that would be created with SC. Here is a basic implementation of it.

//Mix animator
{
var mix = [
	SinOsc.ar(220, 0, -12.dbamp),
	LFTri.ar(220, 0, -12.dbamp),
	LFPulse.ar(220, 0, -12.dbamp),
	LFSaw.ar(220, 0, -12.dbamp)
	];	
	
SelectX.ar(LFNoise0.ar(20, 1).abs*mix.size, mix);
}.scope;

Here is another version that creates a similar sound, but puts it in a SynthDef so that you can alter the sound while it is playing.

SynthDef(\animator, { | outbus=0, rate=0.5, freq=220, amp=0.2 |
	var mix = [
	SinOsc.ar(freq, 0, amp),
	LFTri.ar(freq, 0, amp),
	LFPulse.ar(freq, 0, amp),
	LFSaw.ar(freq, 0, amp)
	];

	Out.ar(outbus, SelectX.ar(LFNoise2.ar(rate, 1).abs*mix.size, mix));
}).add;

//start the synth
x = Synth(\animator);

//change the rate while it's playing
x.set(\rate, 2);
x.set(\rate, 10);
x.set(\rate, 0.1);
x.set(\rate, 0.5);

//stop the synth
x.free;

This is pretty basic, but it is fun to think about how to implement things and reading about different hardware synths is giving me ideas about synthesis in general.

Posted 10 months ago

A very simple first demo of some of the basic sounds available using the GenMDM. This short, processy, phasey, thingy uses all three square waves and the noise channel of the SN76489 chip and one very simple FM sound from the YM2612 chip. The whole thing was coded in SuperCollider. I simply used SuperCollider to send all the midi messages using the Patterns library. I wanted to try some automation in SC like gradually changing the volume of the noise and gradually speeding up the tempo at the end. Much, MUCH more to learn.