@ -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 = {
Static Text(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(