Spring Break 2010 – Synthesizer Work!

This past week was my Spring Break – classes are going reasonably well, and I’m really enjoying my Electronics I course; it has rejuvenated my desire to work on my modular synthesizer! So much so, in fact, that I furiously worked on the project which I hadn’t touched for about 2 years (and hadn’t touched for about a year prior to that, either!), and have made a large amount of progress. My Modular Synthesizer is really only semi-modular, in that it it built into a (1′H)x(2′W)x(4″D) rectangular case that I built from 1/8″ thick, florescent green acrylic that I bought from US Plastic about three years ago. I lined the back of the front panel with foil tape to help contrast the plugs and jacks from the innards; being able to see the insides is kind of distracting, as I found out when I first mocked up some pieces of equipment several years ago (plus, it provides a convenient grounding plane).

I chose my first modules and purchased some ready-made PCBs from Ray Wilson about three years ago: a VC-LFO, a VCO, a VCF, and a State-Variable VCF (which he sent to me for free because he somehow lost track of my order and didn’t send it for over a month). I started populating one of the boards back then, but then school got in my way, and I pretty much hadn’t touched them until this past Monday.

This past week, I finished all four modules and have them mounted to the front panel and working! Here is a view of the front panel, upside down and displaying all of its delicious insides:

At this point, I need to get access to an oscilloscope so that I can calibrate the waveforms and get an idea of what voltage ranges I am working with and how steady they are across frequency ranges. I also have to get to work on the sequencer (which all of the components on the right side of the above picture are for), which I have built (for the most part) on a breadboard. I have already started soldering it on a protoboard. I also just remembered that this still exists! I think I made that page during my Junior year of High School.

In other news, I’ve got only about 2 feet of solder left in the one-pound spool that I bought almost 10 years ago; I probably used ~1/4 of the thing over the past week. >.<

Collatzian ChucKathon

Intrigued by a recent XKCD comic regarding the Collatz Sequence, I whipped up a fairly simple ChucK program that runs through the Collatz sequences of increasing odd starting points and assigns the raw number in each sequence as the frequency of an oscillator. I few spatial effects are there as well, to make it a bit more listenable than just a simple oscillator running. I limited the output to (20,1000) Hz because anything else drops straight to one Hz or begins to create undesireably high pitched frequencies that don’t provide much of anything interesting.

I think I’ve heard this familiar-sounding sequence of tones before, but I can’t imagine where. If it has been in something I’ve heard before, I’m sure it was coincidental because there are only so many whole number frequency sequences to be made! :P

ChucK code follows:

21 => int fo;
fo => int f;
fo => int fmax;
0 => int loopcount;
0 => int looplength_timer;
0 => int looplength;

SawOsc osc1 => LPF lp => PRCRev r;
0.1 => r.mix;
f => osc1.freq;
0.4 => osc1.gain;

SinOsc bg => r;
0.025 => bg.gain;
fmax => bg.freq;

SinOsc lpm => blackhole;
0.183 => lpm.freq;
50 => lpm.gain;

r => dac;

//Loop until process is terminated
while(1)
{
//Print values to terminal
<<< “f=”,f, “ttfo=”,fo,”ttfmax=”,fmax,”ttlooplength_timer=”,looplength_timer,”ttlooplength=”,looplength,”ttloopcount=”,loopcount >>>;

183::ms => now;

f => osc1.freq;
if(looplength > 0) { (((looplength $ float) / (looplength_timer $ float)) / (looplength $ float)) * 0.05 => bg.gain; }
else { 0.01 => bg.gain; }
lpm.last() + f + 60 => lp.freq;

if(f%2 != 0) { f*3 + 1 => f; }
else { f / 2 => f; }

if(f < 20) { fo => f; }
if(f > 1000) { fo => f; }

if(f == fo) { looplength_timer => looplength; 0 => looplength_timer; loopcount++; }
if(f > fmax) { f => fmax; fmax => bg.freq; }

if(loopcount == 4) { fo + 2 => fo; fo => f => fmax => bg.freq; 0 => looplength_timer => looplength => loopcount;}

looplength_timer++;

}

ChucK – Differential Equation System Solver

For several weeks, I have been playing around with ChucK: a Strongly-timed, Concurrent, and On-the-fly Audio Programming Language. I have actually been using the software, off and on, for over two years, but only recently started to really use it in the ways I had always wanted to: algorithmically-produced music.

My real dip into the code occured when I jumped on an extra credit assignment for my Differential Equations class, where I was tasked with programming a numerical solver for first-order DEs using the three major introductory algorithms for doing so: Euler’s, Improved Euler’s, and 4th-Order Runge-Kutta (the best of all). It was intended for me to use Mathematica or Matlab, but my program was able to solve the given problems, so it was still acceptable.

The next day, I modified my program for a more general use and to be capable of solving systems of differential equations. I did some research on Lorenz Attractors, and decided that they might be interesting to listen to. Here’s my resulting code and an audio snippet of what it can produce:

ChucK code follows:

3 => int a;
SinOsc osc1[a];
for(0 => int j; j < a; j++)
{
osc1[j] => dac;
(1.0 / a) => osc1[j].gain;
}

float k[a][4];
float x[a];

10.0 => x[0];
20.0 => x[1];
30.0 => x[2];
0.0 => float tt;
0.0001 => float h;

while(1)
{
//Print values to terminal
if( (tt % 0.01) < 0.0001){ <<< “tt=”,tt,”tx0=”,x[0],”tx1=”,x[1],”tx2=”,x[2] >>>; }

for(0 => int j; j < a; j++)
{ ((Std.fabs(x[j]) + 1) * j*20) + 20 => osc1[j].freq; }

h +=> tt;

for(0 => int j; j < a; j++){ h * f(j,tt,x[0],x[1],x[2]) => k[j][0]; }
for(0 => int j; j < a; j++){ h * f(j,tt + (0.5*h),x[0] + (0.5*k[0][0]),x[1] + (0.5*k[1][0]),x[2] + (0.5*k[2][0])) => k[j][1]; }
for(0 => int j; j < a; j++){ h * f(j,tt + (0.5*h),x[0] + (0.5*k[0][1]),x[1] + (0.5*k[1][1]),x[2] + (0.5*k[2][1])) => k[j][2]; }
for(0 => int j; j < a; j++){ h * f(j,tt,x[0] + k[0][2],x[1] + k[1][2],x[2] + k[2][2]) => k[j][3]; }
for(0 => int j; j < a; j++){ x[j] + (1.0 / 6.0) * (k[j][0] + (2.0*k[j][1]) + (2.0*k[j][2]) + k[j][3]) => x[j]; }

.1::ms => now;
}

 

fun float f(int sub, float t, float x, float y, float z)
{
if(sub == 0){ return 10.3*(y-x); }
if(sub == 1){ return x*(28.4-z)-y; }
if(sub == 2){ return x*y-(7.0/3.2)*z; }
}

My work continued quite a bit past that, and I’m debating whether to post the results here, or to keep it quiet until I have enough music to release my first album. That could be this Summer sometime, if ever.

I can only hope.

In The Beginning…

There was LiveJournal; I used that for a while, and got tired of it.

What’s this, then? WordPress? Two simple words: “I’m lazy.”

This place will be where I post my music and music-related thoughts; a centralized location to help ensure that I know what I’m doing.

How will it work? Just wait, and we’ll see where this goes…