|
|
@ -41,7 +41,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
win = Window("Counterfeiting in Colonial Connecticut", Rect(500, 500, 1100, 500), false).front;
|
|
|
|
win = Window("Counterfeiting in Colonial Connecticut", Rect(500, 500, 1100, 500), false).front;
|
|
|
|
masterView = {
|
|
|
|
masterView = {
|
|
|
|
var view, masterIndicators, master, generator, transport, ranSeed, startPosText,
|
|
|
|
var view, masterIndicators, master, generator, transport, ranSeed, order, startPosText,
|
|
|
|
prevSectionButton, prevSubsectionButton, playStopButton, nextSubsectionButton, nextSectionButton,
|
|
|
|
prevSectionButton, prevSubsectionButton, playStopButton, nextSubsectionButton, nextSectionButton,
|
|
|
|
sectionDisplay, clock, metronome;
|
|
|
|
sectionDisplay, clock, metronome;
|
|
|
|
|
|
|
|
|
|
|
@ -52,10 +52,14 @@
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
~updateSection = {arg shift, stop = true, manualCall = true;
|
|
|
|
~updateSection = {arg shift, stop = true, manualCall = true;
|
|
|
|
if((manualCall || (manualCall.not && ~autoAdvance.not)).postln && ((~currentSection + shift) < ~patterns.size), {
|
|
|
|
var runThis;
|
|
|
|
|
|
|
|
runThis = (manualCall || (manualCall.not && ~autoAdvance.postln));
|
|
|
|
|
|
|
|
runThis = runThis && ((~currentSection + shift) < ~sectionOrder.size);
|
|
|
|
|
|
|
|
runThis = runThis && (((~currentSection % 4) == 3) && ~interludes && manualCall.not).not;
|
|
|
|
|
|
|
|
if(runThis, {
|
|
|
|
var truncOnly, section, subSection;
|
|
|
|
var truncOnly, section, subSection;
|
|
|
|
if(~isPlaying, {
|
|
|
|
if(~isPlaying, {
|
|
|
|
if(stop, {~patterns[~currentSection].stop});
|
|
|
|
if(stop, {~patterns[~sectionOrder[~currentSection]].stop});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
truncOnly = case
|
|
|
|
truncOnly = case
|
|
|
@ -70,18 +74,26 @@
|
|
|
|
~currentSection = ~currentSection.trunc(shift.abs);
|
|
|
|
~currentSection = ~currentSection.trunc(shift.abs);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
section = ((~currentSection / 4) + 1).asInteger;
|
|
|
|
section = ((~sectionOrder[~currentSection] / 4) + 1).asInteger;
|
|
|
|
subSection = ((~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, {
|
|
|
|
~play.set(\sel, ~currentSection % 2);
|
|
|
|
~play.set(\sel, ~currentSection % 2);
|
|
|
|
~patterns[~currentSection].play(quant: 0);
|
|
|
|
~patterns[~sectionOrder[~currentSection]].play(quant: 0);
|
|
|
|
|
|
|
|
if(~interludes && ((~currentSection % 4) == 3) && (~currentSection != (~sectionOrder.size - 1)), {
|
|
|
|
|
|
|
|
~droneFade.set(\gate, 1);
|
|
|
|
|
|
|
|
~dronePattern.play(quant: 0)
|
|
|
|
|
|
|
|
});
|
|
|
|
if((~currentSection % 4) == 0, {
|
|
|
|
if((~currentSection % 4) == 0, {
|
|
|
|
~droneFade.set(\gate, 0);
|
|
|
|
~droneFade.set(\gate, 0);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
if(((~currentSection % 4)) != 0 && ((~currentSection % 4) != 3), {
|
|
|
|
|
|
|
|
~droneFade.set(\gate, 0);
|
|
|
|
|
|
|
|
~dronePattern.stop
|
|
|
|
|
|
|
|
});
|
|
|
|
}, {
|
|
|
|
}, {
|
|
|
|
var measure, beat;
|
|
|
|
var measure, beat;
|
|
|
|
measure = ~sectionStartMeasure[~currentSection];
|
|
|
|
measure = ~sectionStartMeasure[~sectionOrder[~currentSection]];
|
|
|
|
beat = 1;
|
|
|
|
beat = 1;
|
|
|
|
~updateTransport.value(measure, beat);
|
|
|
|
~updateTransport.value(measure, beat);
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -126,18 +138,19 @@
|
|
|
|
if(pState.value == 0, {
|
|
|
|
if(pState.value == 0, {
|
|
|
|
var measure, beat;
|
|
|
|
var measure, beat;
|
|
|
|
~isPlaying = false;
|
|
|
|
~isPlaying = false;
|
|
|
|
~patterns[~currentSection].stop;
|
|
|
|
~patterns[~sectionOrder[~currentSection]].stop;
|
|
|
|
~droneFade.set(\gate, 0);
|
|
|
|
~droneFade.set(\gate, 0);
|
|
|
|
measure = ~sectionStartMeasure[~currentSection];
|
|
|
|
measure = ~sectionStartMeasure[~currentSection];
|
|
|
|
beat = 1;
|
|
|
|
beat = 1;
|
|
|
|
~updateTransport.value(measure, beat)
|
|
|
|
~updateTransport.value(measure, beat);
|
|
|
|
|
|
|
|
~droneFade.set(\gate, 0);
|
|
|
|
|
|
|
|
~dronePattern.stop
|
|
|
|
},{
|
|
|
|
},{
|
|
|
|
~isPlaying = true;
|
|
|
|
~isPlaying = true;
|
|
|
|
~play.set(\sel, ~currentSection % 2);
|
|
|
|
~play.set(\sel, ~currentSection % 2);
|
|
|
|
~patterns[~currentSection].play(quant: 0);
|
|
|
|
~patterns[~sectionOrder[~currentSection]].play(quant: 0);
|
|
|
|
if(~interludes && ((~currentSection % 4) == 3), {
|
|
|
|
if(~interludes && ((~currentSection % 4) == 3) && (~currentSection != (~sectionOrder.size - 1)), {
|
|
|
|
~droneFade.set(\gate, 1);
|
|
|
|
~droneFade.set(\gate, 1);
|
|
|
|
~play = Synth.new(\droneOut);
|
|
|
|
|
|
|
|
~dronePattern.play(quant: 0)
|
|
|
|
~dronePattern.play(quant: 0)
|
|
|
|
});
|
|
|
|
});
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -159,10 +172,27 @@
|
|
|
|
metronome = StaticText(win).string_([-30, -105, -104].asAscii).font_(Font("Monaco", 300)).stringColor_(Color.red)),
|
|
|
|
metronome = StaticText(win).string_([-30, -105, -104].asAscii).font_(Font("Monaco", 300)).stringColor_(Color.red)),
|
|
|
|
nil, transport, nil,
|
|
|
|
nil, transport, nil,
|
|
|
|
HLayout(Button(view).states_([["auto advance", Color.black], ["auto advance", Color.black, Color.grey]]).action_({
|
|
|
|
HLayout(Button(view).states_([["auto advance", Color.black], ["auto advance", Color.black, Color.grey]]).action_({
|
|
|
|
|v| ~autoAdvance = if(v == 0, {false}, {true})
|
|
|
|
|v| ~autoAdvance = if(v.value == 0, {false}, {true});~autoAdvance.postln;
|
|
|
|
}).value_(1),
|
|
|
|
}).value_(1),
|
|
|
|
Button(view).states_([["interludes", Color.black], ["interludes", Color.black, Color.grey]]).action_({
|
|
|
|
Button(view).states_([["interludes", Color.black], ["interludes", Color.black, Color.grey]]).action_({
|
|
|
|
|v| ~interludes = if(v == 0, {false}, {true})
|
|
|
|
|v| ~interludes = if(v.value == 0, {false}, {true})
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
[StaticText(view).string_(" "), stretch: 1]),
|
|
|
|
|
|
|
|
[StaticText(view).string_(" "), stretch: 1],
|
|
|
|
|
|
|
|
HLayout(
|
|
|
|
|
|
|
|
order = TextField(view).string_("1-4"),
|
|
|
|
|
|
|
|
Button(view).states_([["set order"]]).action_({
|
|
|
|
|
|
|
|
~patterns[~sectionOrder[~currentSection]].stop;
|
|
|
|
|
|
|
|
~sectionOrder = order.string.postln.split($,).collect({arg secEntry;
|
|
|
|
|
|
|
|
var bounds;
|
|
|
|
|
|
|
|
bounds = secEntry.split($-).collect({arg item; item.asInteger - 1});
|
|
|
|
|
|
|
|
((bounds.minItem)..(bounds.maxItem)).collect({arg sec;
|
|
|
|
|
|
|
|
(sec.asInteger * 4) + [0, 1, 2, 3]
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}).flat;
|
|
|
|
|
|
|
|
~sectionOrder.postln;
|
|
|
|
|
|
|
|
~currentSection = 0;
|
|
|
|
|
|
|
|
~updateSection.value(0);
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
[StaticText(view).string_(" "), stretch: 1]),
|
|
|
|
[StaticText(view).string_(" "), stretch: 1]),
|
|
|
|
[StaticText(view).string_(" "), stretch: 1], generator
|
|
|
|
[StaticText(view).string_(" "), stretch: 1], generator
|
|
|
|