|
|
@ -762,8 +762,13 @@ OSCdef(\transport, {arg msg, time, addr, port;
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
(
|
|
|
|
(
|
|
|
|
|
|
|
|
//synthdefs
|
|
|
|
~stringModelBusArray = 4.collect({Bus.audio(s, 1)});
|
|
|
|
~stringModelBusArray = 4.collect({Bus.audio(s, 1)});
|
|
|
|
~sineBusArray = 4.collect({Bus.audio(s, 1)});
|
|
|
|
~sineBusArray = 4.collect({Bus.audio(s, 1)});
|
|
|
|
|
|
|
|
~bassBusArray = 1.collect({Bus.audio(s, 1)});
|
|
|
|
|
|
|
|
~hdustBusArray = 1.collect({Bus.audio(s, 1)});
|
|
|
|
|
|
|
|
~samplerBusArray = 2.collect({Bus.audio(s, 1)});
|
|
|
|
|
|
|
|
~sBuf = Buffer.alloc(s, 10, 2);
|
|
|
|
SynthDef(\string_model, {arg freq, gate = 1, sustain, amp, dur, busIndex = 0;
|
|
|
|
SynthDef(\string_model, {arg freq, gate = 1, sustain, amp, dur, busIndex = 0;
|
|
|
|
var trig, exc, sig1, sig2, noHarms;
|
|
|
|
var trig, exc, sig1, sig2, noHarms;
|
|
|
|
noHarms = 30;
|
|
|
|
noHarms = 30;
|
|
|
@ -783,28 +788,74 @@ SynthDef(\sine, {arg freq, gate = 1, sustain, amp, dur, busIndex = 0;
|
|
|
|
}).add;
|
|
|
|
}).add;
|
|
|
|
|
|
|
|
|
|
|
|
SynthDef(\mixer, {arg freq, gate = 1, sustain, amp, dur, out;
|
|
|
|
SynthDef(\mixer, {arg freq, gate = 1, sustain, amp, dur, out;
|
|
|
|
var inputStringModel, inputSine, sig;
|
|
|
|
var nameSpaces, sigs;
|
|
|
|
inputStringModel = ~stringModelBusArray.collect({arg bus, c; In.ar(bus, 1) * NamedControl.kr(\string_volume_ ++ c, 1, 0.1)});
|
|
|
|
|
|
|
|
inputStringModel = inputStringModel.collect({arg channel, c; Pan2.ar(channel, NamedControl.kr(\string_pan_ ++ c, 1, 0.1) * 2 - 1)});
|
|
|
|
sigs = [~stringModelBusArray, ~sineBusArray, ~bassBusArray, ~hdustBusArray, ~samplerBusArray].collect({arg busArray, i;
|
|
|
|
inputStringModel = inputStringModel.collect({arg channel, c; channel * NamedControl.kr(\string_mute_ ++ c, 1, 0.1)});
|
|
|
|
var nameSpace, sig;
|
|
|
|
inputStringModel = Mix.ar(inputStringModel) * NamedControl.kr(\string_volume_master, 1, 0.1);
|
|
|
|
nameSpace = ['string', 'sine', 'bass', 'hdust', 'sampler'][i];
|
|
|
|
|
|
|
|
sig = busArray.collect({arg bus, c; In.ar(bus, 1) * NamedControl.kr(\ ++ nameSpace ++ '_volume_' ++ c, 1, 0.1)});
|
|
|
|
inputSine = ~sineBusArray.collect({arg bus, c; In.ar(bus, 1) * NamedControl.kr(\sine_volume_ ++ c, 1, 0.1)});
|
|
|
|
sig = sig.collect({arg channel, c; Pan2.ar(channel, NamedControl.kr(\ ++ nameSpace ++ '_pan_' ++ c, i / (busArray.size - 1), 0.1) * 2 - 1)});
|
|
|
|
inputSine = inputSine.collect({arg channel, c; Pan2.ar(channel, NamedControl.kr(\sine_pan_ ++ c, 1, 0.1) * 2 - 1)});
|
|
|
|
sig = sig.collect({arg channel, c; channel * NamedControl.kr(\ ++ nameSpace ++ '_mute_' ++ c, 1, 0.1)});
|
|
|
|
inputSine = inputSine.collect({arg channel, c; channel * NamedControl.kr(\sine_mute_ ++ c, 1, 0.1)});
|
|
|
|
sig = Mix.ar(sig) * NamedControl.kr(\ ++ nameSpace ++ '_volume_master', 1, 0.1);
|
|
|
|
inputSine = Mix.ar(inputSine) * NamedControl.kr(\sine_volume_master, 1, 0.1);
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
sig = Mix.ar([inputStringModel, inputSine] / 2);
|
|
|
|
sigs = Mix.ar(sigs / 4);
|
|
|
|
Out.ar(0, sig)
|
|
|
|
Out.ar(0, sigs)
|
|
|
|
|
|
|
|
}).add;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SynthDef(\bass, {
|
|
|
|
|
|
|
|
var switches, drone;
|
|
|
|
|
|
|
|
switches = {|i| Dust.kr(0.1)} ! 9;
|
|
|
|
|
|
|
|
drone = {|i| var harm = pow(2, 2 - (i / 3).trunc), amp = (1 / pow(harm, 2));
|
|
|
|
|
|
|
|
SinOsc.ar(60 * harm + TRand.kr(-3, 3, switches[i]), 0, amp)} ! 9;
|
|
|
|
|
|
|
|
Out.ar(~bassBusArray[0], Mix.new(drone) * 0.2);
|
|
|
|
}).add;
|
|
|
|
}).add;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SynthDef(\sampler, {
|
|
|
|
|
|
|
|
Out.ar(~samplerBusArray, PlayBuf.ar(2, ~sBuf, BufRateScale.kr(~sBuf), doneAction: 2))
|
|
|
|
|
|
|
|
}).add;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// main routine
|
|
|
|
|
|
|
|
SynthDef(\hdust, {
|
|
|
|
|
|
|
|
arg gate = 0;
|
|
|
|
|
|
|
|
var hierarchical_dust, low_sine, high_sine, brown_noise, white_noise;
|
|
|
|
|
|
|
|
// this triggers the combinations of sources
|
|
|
|
|
|
|
|
// it is similar to the Supercollider UGen called dust but with a hierarchical structure
|
|
|
|
|
|
|
|
hierarchical_dust = (
|
|
|
|
|
|
|
|
TIRand.kr(0, 1, Impulse.kr(100)) *
|
|
|
|
|
|
|
|
TIRand.kr(0, 1, Impulse.kr(10)) *
|
|
|
|
|
|
|
|
TIRand.kr(0, 1, Impulse.kr(1)) *
|
|
|
|
|
|
|
|
TIRand.kr(0, 1, Impulse.kr(0.1))
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
// adjust the multiplier at the end of each line for adjusting levels
|
|
|
|
|
|
|
|
// note with each trigger, each source has a 1 in 3 chance of sounding
|
|
|
|
|
|
|
|
low_sine = SinOsc.ar(76.midicps / 16) * (TIRand.kr(0, 2, hierarchical_dust) < 1) * 0.1;
|
|
|
|
|
|
|
|
high_sine = SinOsc.ar(76.midicps * 8) * (TIRand.kr(0, 2, hierarchical_dust) < 1) * 0.01;
|
|
|
|
|
|
|
|
brown_noise = BrownNoise.ar() * (TIRand.kr(0, 2, hierarchical_dust) < 1) * 0.025;
|
|
|
|
|
|
|
|
white_noise = WhiteNoise.ar() * (TIRand.kr(0, 2, hierarchical_dust) < 1) * 0.02;
|
|
|
|
|
|
|
|
Out.ar(~hdustBusArray[0],
|
|
|
|
|
|
|
|
((low_sine + high_sine + brown_noise + white_noise) )
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}).add;
|
|
|
|
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
(
|
|
|
|
(
|
|
|
|
var mixer;
|
|
|
|
var bass, hdust, sampler, mixer;
|
|
|
|
|
|
|
|
bass = Synth.tail(~group, \bass);
|
|
|
|
|
|
|
|
hdust = Synth.tail(~group, \hdust);
|
|
|
|
|
|
|
|
sampler = Synth.head(~group, \sampler);
|
|
|
|
mixer = Synth.tail(~group, \mixer);
|
|
|
|
mixer = Synth.tail(~group, \mixer);
|
|
|
|
OSCdef(\mixer, {arg msg, time, addr, port;
|
|
|
|
OSCdef(\mixer, {arg msg, time, addr, port;
|
|
|
|
mixer.set((msg[1] ++ '_' ++ msg[2] ++ '_' ++ msg[3]), msg[4])
|
|
|
|
mixer.set((msg[1] ++ '_' ++ msg[2] ++ '_' ++ msg[3]), msg[4])
|
|
|
|
}, \mixer);
|
|
|
|
}, \mixer);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
OSCdef(\sampler, {arg msg, time, addr, port;
|
|
|
|
|
|
|
|
msg.postln;
|
|
|
|
|
|
|
|
sampler.free;
|
|
|
|
|
|
|
|
~sBuf.free;
|
|
|
|
|
|
|
|
~sBuf = Buffer.read(s, msg[1].asString.postln, action: {sampler = Synth.head(~group, \sampler)});
|
|
|
|
|
|
|
|
}, \sampler);
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
/* old something
|
|
|
|
/* old something
|
|
|
|