2020_07_11_01

main
Michael Winter 4 years ago
parent ff0136caf9
commit d69884511b

@ -3,15 +3,15 @@
~generateGUI = {
var win, clockStringFunc, metronomeStringFunc, metronomeColorFunc, masterView, faderView, helpView, tabs;
var tabButtonReset, transportButton, mixerButton, helpButton, startPos = 0;
var partAbbr = ["guitar", "accompHigh", "accompLowLower", "accompLowUpper", "interlude"];
var trackNames = ["guitar", "high", "low 1", "low 2", "interlude"];
var partAbbr = ["guitar", "accompHigh", "accompLowLower", "accompLowUpper", "interlude", "click"];
var trackNames = ["guitar", "high", "low 1", "low 2", "interlude", "click"];
var partVols, partMutes, partPans;
var masterMute, masterVol;
// set initial mixer values
partVols = [1, 1, 1, 1, 1];
partMutes = [0, 1, 1, 1, 1];
partPans = [0, 0, 0, 0, 0];
partVols = [1, 1, 1, 1, 1, 1];
partMutes = [0, 1, 1, 1, 1, 0];
partPans = [0, 0, 0, 0, 0, 0];
masterMute = 1;
masterVol = 1;
@ -71,23 +71,41 @@
subSection = ((~sectionOrder[~currentSection] % 4) + 1).asInteger;
sectionDisplay.string = "section: " ++ section.asString ++ "." ++ subSection.asString;
if(~isPlaying, {
~play.set(\sel, ~currentSection % 2);
~patterns[~sectionOrder[~currentSection]].play(~tempoClock, quant: 0);
if(~interludes && ((~currentSection % 4) == 3) && (~currentSection != (~sectionOrder.size - 1)), {
var center, interval, freq1, freq2, tremRate;
center = 50 - 12.0.rand;
interval = 3.0.rand + 2;
freq1 = (center + (interval / 2)).midicps;
freq2 = (center - (interval / 2)).midicps;
tremRate = 50 + 4.0.rand2;
~interludeTremelo.set(\gate, 1, \amp, 1, \freq1, freq1, \freq2, freq2, \tremRate, tremRate);
});
if((~currentSection % 4) == 0, {
~interludeTremelo.set(\gate, 0);
});
if(((~currentSection % 4)) != 0 && ((~currentSection % 4) != 3), {
~interludeTremelo.set(\gate, 0, \amp, 0);
});
countOff = {
if(~interludes && ((~currentSection % 4) == 0), {
Pbind(
\instrument, \click ++ ~hash,
\beat, Pseq([1, 2, 1, 2]),
\dur, 1
).play(~tempoClock, quant: 0);
[1, 2, 1, 2].do({arg beat;
{
metronome.stringColor = metronomeColorFunc.value(beat);
metronome.string = metronomeStringFunc.value(beat);
}.defer;
0.75.wait;
{metronome.string = ""}.defer;
0.25.wait;
});
});
~play.set(\sel, ~currentSection % 2);
~patterns[~sectionOrder[~currentSection]].play(~tempoClock, quant: 0);
if(~interludes && ((~currentSection % 4) == 3) && (~currentSection != (~sectionOrder.size - 1)), {
var center, interval, freq1, freq2, tremRate;
center = 50 - 12.0.rand;
interval = 3.0.rand + 2;
freq1 = (center + (interval / 2)).midicps;
freq2 = (center - (interval / 2)).midicps;
tremRate = 50 + 4.0.rand2;
~interludeTremelo.set(\gate, 1, \amp, 1, \freq1, freq1, \freq2, freq2, \tremRate, tremRate);
});
if((~currentSection % 4) == 0, {
~interludeTremelo.set(\gate, 0);
});
if(((~currentSection % 4)) != 0 && ((~currentSection % 4) != 3), {
~interludeTremelo.set(\gate, 0, \amp, 0);
});
}.fork(~tempoClock, quant: 0);
}, {
var measure, beat;
measure = ~sectionStartMeasure[~sectionOrder[~currentSection]];
@ -140,6 +158,11 @@
~interludeTremelo.set(\gate, 0, \amp, 0);
},{
countOff = {
Pbind(
\instrument, \click ++ ~hash,
\beat, Pseq([1, 2, 1, 2]),
\dur, 1
).play(~tempoClock, quant: 0);
[1, 2, 1, 2].do({arg beat;
{
metronome.stringColor = metronomeColorFunc.value(beat);
@ -218,13 +241,13 @@
var view, masterIndicators, trackIndicators, master, tracks;
view = View(win);
masterIndicators = {LevelIndicator()} ! 2;
trackIndicators = {LevelIndicator()} ! 5;
trackIndicators = {LevelIndicator()} ! 6;
OSCFunc.new({arg msg; {
{arg i; masterIndicators[i].value = msg[3 + i].ampdb.linlin(-40, 0, 0, 1)} ! 2}.defer},
'/masterLevels' ++ ~hash, s.addr);
OSCFunc.new({arg msg; {
{arg i; trackIndicators[i].value = msg[3 + i].ampdb.linlin(-40, 0, 0, 1)} ! 5}.defer},
{arg i; trackIndicators[i].value = msg[3 + i].ampdb.linlin(-40, 0, 0, 1)} ! 6}.defer},
'/trackLevels' ++ ~hash, s.addr);
master = HLayout(
@ -247,17 +270,17 @@
trackIndicators[part]),
Button(view).states_([["mute", Color.black], ["mute", Color.black, Color.grey]]).action_(
{arg v; partMutes[part] = (1 - v.value).abs; ~play.set(partAbbr[part] ++ "Mute", partMutes[part])}.inEnvir).value_(
{if(part == 0, {1}, {0})}.value),
{if((part == 0) || (part == 5), {1}, {0})}.value),
StaticText(view).string_("pan").align_(\center),
Knob(view).value_(0.5).action_(
{arg v; partPans[part] = v.value * 2 - 1; ~play.set(partAbbr[part] ++ "Pan", partPans[part])}.inEnvir),
StaticText(view).string_(trackNames[part]).align_(\center)
),
nil)
} ! 5;
} ! 6;
view.layout_(HLayout(master, nil, *tracks))};
helpView = {
StaticText(win).string_(File.readAllString(~dir +/+ "cicc_readme.scd"));
TextView(win).string_(File.readAllString(~dir +/+ "cicc_readme.scd")).editable_(false);
};
tabButtonReset = {transportButton.value = 1; mixerButton.value = 1; helpButton.value = 1};
win.layout = VLayout(

@ -22,5 +22,5 @@ The default seed given in the application and reseeded when the "reset seed" but
~~~~mixer tab
This allow invidual control of each of the sonic elements. The synthesized guitar part is automatically muted is at should only be used for audition and practice. The low accompaniment has two separate tracks in case a performer cannot play both the notes.
This allow invidual control of each of the sonic elements. The synthesized guitar part is automatically muted is at should only be used for audition and practice. The low accompaniment has two separate tracks in case a performer cannot play both the notes. The sonification will go out outputs 1 and 2 while the click will go out outputs 3 and 4.
*/

@ -8,6 +8,7 @@
~accompLowLowerBusB = Bus.audio(s, 1);
~accompLowUpperBusB = Bus.audio(s, 1);
~interludeTremoloBus = Bus.audio(s, 1);
~clickBus = Bus.audio(s, 1);
SynthDef(\masterPlayerControl ++ ~hash, {
arg sel = 0,
@ -16,9 +17,10 @@ SynthDef(\masterPlayerControl ++ ~hash, {
accompHighVol = 1, accompHighPan = 0, accompHighMute = 1,
accompLowLowerVol = 1, accompLowLowerPan = 0, accompLowLowerMute = 1,
accompLowUpperVol = 1, accompLowUpperPan = 0, accompLowUpperMute = 1,
interludeVol = 1, interludePan = 0, interludeMute = 1;
var guitarSig, accompHighSig, accompLowLowerSig, accompLowUpperSig, interludeSig,
guitarSigPanned, accompHighSigPanned, accompLowLowerSigPanned, accompLowUpperSigPanned, interludeSigPanned,
interludeVol = 1, interludePan = 0, interludeMute = 1,
clickVol = 1, clickPan = 0, clickMute = 1;
var guitarSig, accompHighSig, accompLowLowerSig, accompLowUpperSig, interludeSig, clickSig,
guitarSigPanned, accompHighSigPanned, accompLowLowerSigPanned, accompLowUpperSigPanned, interludeSigPanned, clickSigPanned,
masterSig, imp;
guitarSig = In.ar(~guitarBus) * guitarVol;
@ -36,12 +38,15 @@ SynthDef(\masterPlayerControl ++ ~hash, {
]
) * accompLowUpperVol;
interludeSig = In.ar(~interludeTremoloBus) * interludeVol;
clickSig = In.ar(~clickBus) * clickVol;
guitarSigPanned = Pan2.ar(guitarSig * guitarMute, guitarPan);
accompHighSigPanned = Pan2.ar(accompHighSig * accompHighMute, accompHighPan);
accompLowLowerSigPanned = Pan2.ar(accompLowLowerSig * accompLowLowerMute, accompLowLowerPan);
accompLowUpperSigPanned = Pan2.ar(accompLowUpperSig * accompLowUpperMute, accompLowUpperPan);
interludeSigPanned = Pan2.ar(interludeSig * interludeMute, interludePan);
clickSigPanned = Pan2.ar(clickSig * clickMute, clickPan);
masterSig = Mix.ar(
[
guitarSigPanned,
@ -52,6 +57,7 @@ SynthDef(\masterPlayerControl ++ ~hash, {
]) * masterVol * masterMute;
Out.ar(0, masterSig);
Out.ar(2, clickSigPanned); //change this if you want the click to go somewhere else
imp = Impulse.kr(10);
SendReply.kr(imp,
@ -63,7 +69,7 @@ SynthDef(\masterPlayerControl ++ ~hash, {
[
Amplitude.kr(guitarSig), Amplitude.kr(accompHighSig),
Amplitude.kr(accompLowLowerSig), Amplitude.kr(accompLowUpperSig),
Amplitude.kr(interludeSig)
Amplitude.kr(interludeSig), Amplitude.kr(clickSig)
]
);
}).add;
@ -76,6 +82,12 @@ SynthDef(\transport ++ ~hash, {arg measure = 0, beat = 0, gate = 1, dur = 1;
}).add;
SynthDef(\click ++ ~hash, {arg beat = 0, gate = 1, dur = 1;
Out.ar(~clickBus, 10 * BPF.ar(WhiteNoise.ar * EnvGen.kr(Env.perc(0.01, 0.1), gate), 440 * ((beat <= 1) + 1), 0.02));
EnvGen.kr(Env.sine(dur), gate, doneAction: 2);
}).add;
//~~~~karplus
SynthDef(\karplus ++ ~hash, {arg freq, gate = 1, amp = 0.5, bus;
Out.ar(bus,
@ -250,41 +262,15 @@ SynthDef(\interludeTremelo ++ ~hash, {arg gate = 0, amp = 1, freq1, freq2, tremR
\measure, Pseq(measureSeq),
\beat, Pseq(beatSeq),
\dur, beatFrac * 8
),
Pbind(
\instrument, \click ++ ~hash,
\beat, Pseq(beatSeq.drop(-1)),
\dur, beatFrac * 8
)
]);
pattern
});
};
)
/*
//machine options
(
var durUnit = 0.15;
SynthDef(\machine, {arg freq, gate = 1, sustain, amp;
var sound;
sound = TWChoose.ar(Impulse.kr(0), [
PinkNoise.ar(EnvGen.kr(Env.perc(0.01, sustain, amp * 10), gate, doneAction: 2)),
BrownNoise.ar(EnvGen.kr(Env.perc(0.01, sustain, amp * 2), gate, doneAction: 2))
], [0, 20], 1);
Out.ar([0, 1], sound)
}).add;
~machine1 = Pbind(
\instrument, \machine,
\amp, Pseq(3000.collect({arg i; (i / 2000).clip(0, 0.03)})),
\dur, Pseq(1000.collect({[durUnit, durUnit + (durUnit / 100).rand2].wchoose([10, 1].normalizeSum)}).flat),
\sustain, Pseq(1000.collect({durUnit * (1.75 + 0.5.rand)})),//2.25].wchoose([1, 20].normalizeSum)})),
\freq, Pseq(1000.collect({[[300, 250], [300, 250].choose].wchoose([10, 1].normalizeSum)}).flat / 2)
).play;
SynthDef(\machine, {arg freq, gate = 1, sustain, amp = 0.03;
var trig, sound;
trig = Impulse.kr(10);
sound = BrownNoise.ar(EnvGen.kr(Env.perc(0.01, 0.3 + TRand.kr(0, 0.1, trig), amp), TDelay.kr(trig, TRand.kr(0, 0.002, Dust.kr(0.75)))));
Out.ar([0, 1], sound)
}).play;
)
*/
)
Loading…
Cancel
Save