Some force of will was involved in practising today as I was busy arranging things in the afternoon, then had to help a friend move in the evening. However, I practiced and tried to study the rapid resetting of the RNG seed some more. The factors that are involved are fairly delicate. There is only one RNG yet multiple processes may be writing different numbers to it at various rates, leading to a sort of chord. Furthermore, the sound of any given UGens that makes use of it will be affected by the total number of such UGens being currently processed.
The issue as I experienced it tonight in this setup is that for patterns to remain interesting the sub-patterns should be prime in length, relative to each other, however numbers that are prime relative to each other tend not to make good chords. I struggled with this for a while before deciding sleep would be a better plan now with hopefully fresh perspectives later.
Below is the code, first my clock;
==================
public class clk
{
//beats per minute
static float BPM;
//beats per bar
static int bpb;
static dur period;
//what beat we are at
static int beatnr;
//what bar we are at
static int barnr;
//broadcasts every bar
static Event @ bar;
//broadcasts every beat
static Event @ beat;
//sets the bpm
fun static void bpm(float value)
{
if (value > 0)
{
value => BPM;
minute / BPM => period;
}
else <<<”BPM should be greater than 0″>>>;
}
}
//bget around instantiation issue
new Event @=> clk.beat;
new Event @=> clk.bar;
//set defaults
130 => clk.bpm;
8 => clk.bpb;
while(1)
{
if(!clk.beatnr)
{
clk.barnr++;
clk.bar.broadcast();
}
clk.beat.broadcast();
clk.period => now;
clk.beatnr++;
clk.bpb %=> clk.beatnr;
}
=================
Here is the first sound;
==============
SubNoise s;
10::ms => dur period;
2::ms => dur fund;
fun void mod()
{
while(1)
{
period => now;
1 => Std.srand;
}
}
spork ~ mod();
while (clk.beat => now)
{
(1+ ((clk.beatnr + clk.barnr) % 5)) * 4 => s.rate;
(2+ (clk.beatnr % 4))::fund => period;
if (clk.beatnr % 2) s =< dac;
else s => dac;
}
============
Which I contrasted against this variation (note these interact and aren’t really independant at all for the above reasons)
============
SubNoise s;
10::ms => dur period;
3::ms => dur fund;
fun void mod()
{
while(1)
{
period => now;
0 => Std.srand;
}
}
spork ~ mod();
while (clk.beat => now)
{
(1+ ((clk.beatnr + clk.barnr) % 13)) * 5 => s.rate;
(2+ (clk.barnr % 4))::fund => period;
if (clk.beatnr % 3) s =< dac;
else s => dac;
}
================
The result isn’t all that spectacular, but I’m not yet ready to give up on this principle. It’s clearly hard to use effectively but the challenge is interesting; so many factors interact in texture and perceived pitch. I’ll let the idea stew for a while and try something different tomorrow, I think.
Kassen_hackpact-day2
It’s a challenging listen, I suppose, but then it’s a rather conceptual study trying to challenge myself.