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