Posted 6 months ago

Using the Scope to Visualize Multi-Channel Audio and Control Signals in SuperCollider

image

I was working tonight on some random multichannel expansion sound design in SuperCollider and I realized that I wanted to make sure that my synth was expanding correctly and I wanted a way to visualize it. I recently realized that it is possible to include multiple Out UGens in SynthDefs and decided to use this capability to first visualize the waveform audio signal and then the envelope control signal.

First, here is the synth that I have been working on:

SynthDef(\triBank, {
	|lo=20, hi=440, gate=1, timeScale=1, out=0, scopeOut=0|
	var sound, env, mix;
	sound = LFTri.ar({ExpRand(lo, hi)}!5, {Rand(0, 4)}!5, 0.2);
	env = EnvGen.kr(Env.asr({Rand(1, 4)}!5, 1, {Rand(1, 4)}!5, -4), gate, timeScale: timeScale, doneAction: 2);
	sound = sound * env;
	mix = Mix.new(sound);
	Out.ar(out, mix);
}).add;

SynthDef(\reverb, {
	|in=16, out=0, size=1, damp=0.1|
	var input = In.ar(in, 1);
	var reverb = FreeVerb.ar(input, 0.5, size, damp);
	Out.ar(out, Pan2.ar(reverb, 0));
}).add;

~reverb = Bus.audio(s, 1); //assign a reverb bus

~reverbSynth = Synth.new(\reverb, [\in, ~reverb, \out, 0, \size, 1], s, \addToTail); //start reverb synth

x = Synth(\triBank, [\out, ~reverb, \timeScale, 1, \lo, 60, \hi, 440]); //start drone

x.set(\gate, 0, \timeScale, 1); //free drone

It is a Triangle Oscillator synth modeled on the Snazzy FX Drone Bank Eurorack Synth Module. I also have a simple reverb synth to make everything sound a little better. Then there is just some code to start and stop the synths. Change the argument values and see what they sound like. You can change the timeScale to make shorter or longer attack and decays.

So in my debugging work, I wanted to make sure I was actually creating five different oscillators with five different envelope shapes. I decided to use the scope to make sure everything was working. First, let’s create a plotTree and a scope to visualize the audio server and the audio waveforms. 

s.plotTree;
s.scope(7, 0, rate: \audio);

Now let’s change the SynthDef so that in addition to outputing the Mixed audio, we output the 5 individual channels to a different audio bus.

SynthDef(\triBank, {
	|lo=20, hi=440, gate=1, timeScale=1, out=0, scopeOut=0|
	var sound, env, mix;
	sound = LFTri.ar({ExpRand(lo, hi)}!5, {Rand(0, 4)}!5, 0.2);
	env = EnvGen.kr(Env.asr({Rand(1, 4)}!5, 1, {Rand(1, 4)}!5, -4), gate, timeScale: timeScale, doneAction: 2);
	sound = sound * env;
	mix = Mix.new(sound);
	Out.ar(out, mix);
	Out.ar(scopeOut, sound);
}).add;

x = Synth(\triBank, [\out, ~reverb, \timeScale, 1, \lo, 60, \hi, 440, \scopeOut, 2]);

x.set(\gate, 0, \timeScale, 1);

Now when we run that code, we can see the Mixed audio on audio busses 0 and 1 and then the five individual triangle waves on busses 2 through 6.

I also wanted to visualize the envelope signals. To do this, I just have to change the SynthDef again. The second Out UGen needs to be set to Control rate and it needs to output the env signal. Also remember to change the Scope to control rate.

SynthDef(\triBank, {
	|lo=20, hi=440, gate=1, timeScale=1, out=0, scopeOut=0|
	var sound, env, mix;
	sound = LFTri.ar({ExpRand(lo, hi)}!5, {Rand(0, 4)}!5, 0.2);
	env = EnvGen.kr(Env.asr({Rand(1, 4)}!5, 1, {Rand(1, 4)}!5, -4), gate, timeScale: timeScale, doneAction: 2);
	sound = sound * env;
	mix = Mix.new(sound);
	Out.ar(out, mix);
	Out.kr(scopeOut, env);
}).add;

x = Synth(\triBank, [\out, ~reverb, \timeScale, 1, \lo, 60, \hi, 440, \scopeOut, 0]);

x.set(\gate, 0, \timeScale, 1);

Now we can watch the different envelopes rise and fall at different rates. 

This technique is primarily useful for troubleshooting and learning more about what is happening with your audio and control signals. I have found that it has been very useful to me when designing new sounds. Let me know if there are any questions or clarifications needed.

Posted 7 months ago

breathing-ripples:

peter speer at the mca

Looks great! But is he trying hide the fact that there is a laptop there?

Posted 8 months ago

The Story Of The Clavioline

I would like to have one :)

Posted 8 months ago

There is that eurorack module I noticed a few posts back. This looks awesome, voltage controlled granular synthesis. I think it is based off of CSound opcodes.

Posted 8 months ago
mikerugnetta:

good afternoon

mikerugnetta:

good afternoon

(Source: 1jps)

Posted 8 months ago

It's in my brain now: Morton Subotnick's use of control tracks

cray5656:

Reprinted from Buzzclick Music with permission by Peter Grenader.

The folowing is an outline on Morton Subotnick ‘s use of control tracks:

Through most of his analog works from Sidewinder on, Mort Subotnick relied heavily on the use of analog control tracks to pace, locate and…
Posted 8 months ago

daveseidel:

michaelgogins:

A few pictures I managed to take at the 2013 Csound Conference at the Berkelee College of Music, Boston. 

I’m in the audience shot (from one of the seven concerts). Thanks for the photos, Mike. It was a very good conference.

Is that the CSound Eurorack module in the third picture I heard rumors about? That would be interesting to hear.

Posted 9 months ago

Mary Halvorson: Pay for live music!!!

maryhalvorson:

I went to see a really amazing concert tonight. A trio of musicians of the highest caliber who played beautifully. It was a “pass the hat” concert with a suggested donation of $10. I watched the tip jar go around (clearly labeled ‘suggested donation $10’). A couple people put in nothing, another…

An important message from guitarist/composer Mary Halvorson. For real!

Posted 1 year ago

My new album IRIS is available today. You can buy it direct from the label LockStep Records, iTunes, Amazon or a bunch of other online stores. For up to date information about the album, please go to http://iris.carltesta.net Thanks for listening!

Posted 1 year ago

A new interview/performance/demonstration where I talk about my SuperCollider-based live sampling and granular synthesis setup and discuss my new album IRIS.