|
|
@ -8,12 +8,14 @@
|
|
|
|
var partVols, partMutes, partPans;
|
|
|
|
var partVols, partMutes, partPans;
|
|
|
|
var masterMute, masterVol;
|
|
|
|
var masterMute, masterVol;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// set initial mixer values
|
|
|
|
partVols = [1, 1, 1, 1, 1];
|
|
|
|
partVols = [1, 1, 1, 1, 1];
|
|
|
|
partMutes = [1, 1, 1, 1, 1];
|
|
|
|
partMutes = [1, 1, 1, 1, 1];
|
|
|
|
partPans = [0, 0, 0, 0, 0];
|
|
|
|
partPans = [0, 0, 0, 0, 0];
|
|
|
|
masterMute = 1;
|
|
|
|
masterMute = 1;
|
|
|
|
masterVol = 1;
|
|
|
|
masterVol = 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// these funcs update the elements of the transport panel
|
|
|
|
clockStringFunc = {
|
|
|
|
clockStringFunc = {
|
|
|
|
arg measure, beat;
|
|
|
|
arg measure, beat;
|
|
|
|
var measureString, beatString, leadSpace;
|
|
|
|
var measureString, beatString, leadSpace;
|
|
|
@ -26,40 +28,29 @@
|
|
|
|
metronomeStringFunc = { arg beat; if(beat == 1, {[-30, -105, -104].asAscii}, {[-30, -105, -113].asAscii}) };
|
|
|
|
metronomeStringFunc = { arg beat; if(beat == 1, {[-30, -105, -104].asAscii}, {[-30, -105, -113].asAscii}) };
|
|
|
|
metronomeColorFunc = { arg beat; if(beat == 1, {Color.red},{Color.black}) };
|
|
|
|
metronomeColorFunc = { arg beat; if(beat == 1, {Color.red},{Color.black}) };
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
~appStatusFunc = Task({
|
|
|
|
|
|
|
|
loop {
|
|
|
|
|
|
|
|
{~appStatus.string = ~appStatusString ++ "*"}.defer;
|
|
|
|
|
|
|
|
0.5.wait; {~appStatus.string = ~appStatusString ++ "* *"}.defer;
|
|
|
|
|
|
|
|
0.5.wait; {~appStatus.string = ~appStatusString ++ "* * *"}.defer;
|
|
|
|
|
|
|
|
0.5.wait; {~appStatus.string = ~appStatusString ++ "* * * *"}.defer;
|
|
|
|
|
|
|
|
0.5.wait; {~appStatus.string = ~appStatusString ++ "* * * * *"}.defer;
|
|
|
|
|
|
|
|
0.5.wait;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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, order, startPosText,
|
|
|
|
var view, generator, transport, ranSeed, order, sectionDisplay, clock, metronome;
|
|
|
|
prevSectionButton, prevSubsectionButton, playStopButton, nextSubsectionButton, nextSectionButton,
|
|
|
|
|
|
|
|
sectionDisplay, clock, metronome;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// this func updates the whole transport panel
|
|
|
|
~updateTransport = {arg measure, beat;
|
|
|
|
~updateTransport = {arg measure, beat;
|
|
|
|
clock.string = clockStringFunc.value(measure, beat);
|
|
|
|
clock.string = clockStringFunc.value(measure, beat);
|
|
|
|
metronome.stringColor = metronomeColorFunc.value(beat);
|
|
|
|
metronome.stringColor = metronomeColorFunc.value(beat);
|
|
|
|
metronome.string = metronomeStringFunc.value(beat);
|
|
|
|
metronome.string = metronomeStringFunc.value(beat);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// this func handles the movement between sections
|
|
|
|
~updateSection = {arg shift, stop = true, manualCall = true;
|
|
|
|
~updateSection = {arg shift, stop = true, manualCall = true;
|
|
|
|
var runThis;
|
|
|
|
var runThis;
|
|
|
|
runThis = (manualCall || (manualCall.not && ~autoAdvance.postln));
|
|
|
|
runThis = (manualCall || (manualCall.not && ~autoAdvance));
|
|
|
|
runThis = runThis && ((~currentSection + shift) < ~sectionOrder.size);
|
|
|
|
runThis = runThis && ((~currentSection + shift) < ~sectionOrder.size);
|
|
|
|
runThis = runThis && (((~currentSection % 4) == 3) && ~interludes && manualCall.not).not;
|
|
|
|
runThis = runThis && (((~currentSection % 4) == 3) && ~interludes && manualCall.not).not;
|
|
|
|
if(runThis, {
|
|
|
|
if(runThis, {
|
|
|
|
var truncOnly, section, subSection;
|
|
|
|
var truncOnly, section, subSection;
|
|
|
|
if(~isPlaying, {
|
|
|
|
if(~isPlaying, {
|
|
|
|
if(stop, {~patterns[~sectionOrder[~currentSection]].stop});
|
|
|
|
if(stop, {
|
|
|
|
|
|
|
|
~patterns[~sectionOrder[~currentSection]].stop
|
|
|
|
|
|
|
|
})
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
truncOnly = case
|
|
|
|
truncOnly = case
|
|
|
@ -100,6 +91,7 @@
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// these funcs receive messages from the synth
|
|
|
|
OSCFunc({ arg msg, time;
|
|
|
|
OSCFunc({ arg msg, time;
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var measure, beat;
|
|
|
|
var measure, beat;
|
|
|
@ -108,7 +100,6 @@
|
|
|
|
~updateTransport.value(measure, beat)
|
|
|
|
~updateTransport.value(measure, beat)
|
|
|
|
}.defer;
|
|
|
|
}.defer;
|
|
|
|
},'/measureClock', s.addr);
|
|
|
|
},'/measureClock', s.addr);
|
|
|
|
|
|
|
|
|
|
|
|
OSCFunc({ arg msg, time; {metronome.string = ""}.defer},'/measureClockReset', s.addr);
|
|
|
|
OSCFunc({ arg msg, time; {metronome.string = ""}.defer},'/measureClockReset', s.addr);
|
|
|
|
|
|
|
|
|
|
|
|
view = View(win);
|
|
|
|
view = View(win);
|
|
|
@ -116,25 +107,14 @@
|
|
|
|
ranSeed = TextField(view, Rect(10, 10, 10, 20)).string_("20200525"),
|
|
|
|
ranSeed = TextField(view, Rect(10, 10, 10, 20)).string_("20200525"),
|
|
|
|
Button(view).states_([["reset seed"]]).action_({ ranSeed.string = "20200525"}),
|
|
|
|
Button(view).states_([["reset seed"]]).action_({ ranSeed.string = "20200525"}),
|
|
|
|
Button(view).states_([["random seed"]]).action_({ ranSeed.string = 50000000.rand.asString}),
|
|
|
|
Button(view).states_([["random seed"]]).action_({ ranSeed.string = 50000000.rand.asString}),
|
|
|
|
Button(view).states_([["generate"]]).action_({
|
|
|
|
Button(view).states_([["generate"]]).action_({~genAll.value(ranSeed.string.asInteger)}),
|
|
|
|
//~appStatusString = "generating data";
|
|
|
|
Button(view).states_([["transcribe"]]).action_({~transcribe.value(~scoreData)}),
|
|
|
|
//~appStatusFunc.start;
|
|
|
|
[StaticText(view).string_(" "), stretch: 1], nil);
|
|
|
|
~genAll.value(ranSeed.string.asInteger);
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
Button(view).states_([["transcribe"]]).action_({
|
|
|
|
|
|
|
|
~transcribe.value(~scoreData)
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
[StaticText(view).string_(" "), stretch: 1],
|
|
|
|
|
|
|
|
nil);
|
|
|
|
|
|
|
|
transport = HLayout(
|
|
|
|
transport = HLayout(
|
|
|
|
prevSectionButton = Button(view).states_([["<<", Color.black]]).action_({| pState |
|
|
|
|
Button(view).states_([["<<", Color.black]]).action_({arg pState; ~updateSection.value(-4)}),
|
|
|
|
~updateSection.value(-4);
|
|
|
|
Button(view).states_([["<", Color.black]]).action_({arg pState; ~updateSection.value(-1)}),
|
|
|
|
}),
|
|
|
|
Button(view).states_([["play", Color.black], ["stop", Color.black, Color.grey]]).action_(
|
|
|
|
prevSubsectionButton = Button(view).states_([["<", Color.black]]).action_({| pState |
|
|
|
|
{arg pState;
|
|
|
|
~updateSection.value(-1);
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
playStopButton = Button(view).states_([["play", Color.black], ["stop", Color.black, Color.grey]]).action_(
|
|
|
|
|
|
|
|
{| pState |
|
|
|
|
|
|
|
|
if(pState.value == 0, {
|
|
|
|
if(pState.value == 0, {
|
|
|
|
var measure, beat;
|
|
|
|
var measure, beat;
|
|
|
|
~isPlaying = false;
|
|
|
|
~isPlaying = false;
|
|
|
@ -156,15 +136,9 @@
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
),
|
|
|
|
),
|
|
|
|
nextSubsectionButton = Button(view).states_([[">", Color.black]]).action_({| pState |
|
|
|
|
Button(view).states_([[">", Color.black]]).action_({arg pState; ~updateSection.value(1)}),
|
|
|
|
~updateSection.value(1);
|
|
|
|
Button(view).states_([[">>", Color.black]]).action_({arg pState; ~updateSection.value(4)}), nil,
|
|
|
|
}),
|
|
|
|
sectionDisplay = StaticText(win).string_("section: 1.1").font_(Font("Monaco", 70)), nil);
|
|
|
|
nextSectionButton = Button(view).states_([[">>", Color.black]]).action_({| pState |
|
|
|
|
|
|
|
|
~updateSection.value(4);
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
nil,
|
|
|
|
|
|
|
|
sectionDisplay = StaticText(win).string_("section: 1.1").font_(Font("Monaco", 70)),
|
|
|
|
|
|
|
|
nil);
|
|
|
|
|
|
|
|
view.layout_(HLayout(
|
|
|
|
view.layout_(HLayout(
|
|
|
|
[VLayout(
|
|
|
|
[VLayout(
|
|
|
|
HLayout(clock = StaticText(win).string_(" 1.1").font_(Font("Monaco", 200)),
|
|
|
|
HLayout(clock = StaticText(win).string_(" 1.1").font_(Font("Monaco", 200)),
|
|
|
@ -172,10 +146,10 @@
|
|
|
|
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.value == 0, {false}, {true});~autoAdvance.postln;
|
|
|
|
arg v; ~autoAdvance = if(v.value == 0, {false}, {true});~autoAdvance;
|
|
|
|
}).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.value == 0, {false}, {true})
|
|
|
|
arg v; ~interludes = if(v.value == 0, {false}, {true})
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
[StaticText(view).string_(" "), stretch: 1]),
|
|
|
|
[StaticText(view).string_(" "), stretch: 1]),
|
|
|
|
[StaticText(view).string_(" "), stretch: 1],
|
|
|
|
[StaticText(view).string_(" "), stretch: 1],
|
|
|
@ -183,14 +157,13 @@
|
|
|
|
order = TextField(view).string_("1-4"),
|
|
|
|
order = TextField(view).string_("1-4"),
|
|
|
|
Button(view).states_([["set order"]]).action_({
|
|
|
|
Button(view).states_([["set order"]]).action_({
|
|
|
|
~patterns[~sectionOrder[~currentSection]].stop;
|
|
|
|
~patterns[~sectionOrder[~currentSection]].stop;
|
|
|
|
~sectionOrder = order.string.postln.split($,).collect({arg secEntry;
|
|
|
|
~sectionOrder = order.string.split($,).collect({arg secEntry;
|
|
|
|
var bounds;
|
|
|
|
var bounds;
|
|
|
|
bounds = secEntry.split($-).collect({arg item; item.asInteger - 1});
|
|
|
|
bounds = secEntry.split($-).collect({arg item; item.asInteger - 1});
|
|
|
|
((bounds.minItem)..(bounds.maxItem)).collect({arg sec;
|
|
|
|
((bounds.minItem)..(bounds.maxItem)).collect({arg sec;
|
|
|
|
(sec.asInteger * 4) + [0, 1, 2, 3]
|
|
|
|
(sec.asInteger * 4) + [0, 1, 2, 3]
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}).flat;
|
|
|
|
}).flat;
|
|
|
|
~sectionOrder.postln;
|
|
|
|
|
|
|
|
~currentSection = 0;
|
|
|
|
~currentSection = 0;
|
|
|
|
~updateSection.value(0);
|
|
|
|
~updateSection.value(0);
|
|
|
|
}),
|
|
|
|
}),
|
|
|
@ -204,38 +177,35 @@
|
|
|
|
trackIndicators = {LevelIndicator()} ! 5;
|
|
|
|
trackIndicators = {LevelIndicator()} ! 5;
|
|
|
|
|
|
|
|
|
|
|
|
OSCFunc.new({arg msg; {
|
|
|
|
OSCFunc.new({arg msg; {
|
|
|
|
{|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', s.addr);
|
|
|
|
'/masterLevels', s.addr);
|
|
|
|
OSCFunc.new({arg msg; {
|
|
|
|
OSCFunc.new({arg msg; {
|
|
|
|
{|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)} ! 5}.defer},
|
|
|
|
'/trackLevels', s.addr);
|
|
|
|
'/trackLevels', s.addr);
|
|
|
|
|
|
|
|
|
|
|
|
master = HLayout(
|
|
|
|
master = HLayout(
|
|
|
|
VLayout(
|
|
|
|
VLayout(
|
|
|
|
[HLayout(
|
|
|
|
[HLayout(
|
|
|
|
Slider(view).value_(0.8).action_(
|
|
|
|
Slider(view).value_(0.8).action_(
|
|
|
|
{|v| masterVol = v.value * 1.25; ~play.set(\masterVol, masterVol)}),
|
|
|
|
{arg v; masterVol = v.value * 1.25; ~play.set(\masterVol, masterVol)}),
|
|
|
|
masterIndicators[0],
|
|
|
|
masterIndicators[0],
|
|
|
|
masterIndicators[1]), stretch: 2],
|
|
|
|
masterIndicators[1]), stretch: 2],
|
|
|
|
Button(view).states_([["mute", Color.black], ["mute", Color.black, Color.grey]]).action_(
|
|
|
|
Button(view).states_([["mute", Color.black], ["mute", Color.black, Color.grey]]).action_(
|
|
|
|
{|v| masterMute = (1 - v.value).abs; ~play.set(\masterMute, masterMute)}),
|
|
|
|
{arg v; masterMute = (1 - v.value).abs; ~play.set(\masterMute, masterMute)}),
|
|
|
|
StaticText(view).string_(" master ").align_(\center)
|
|
|
|
StaticText(view).string_(" master ").align_(\center)
|
|
|
|
//StaticText(view).string_("("++groupNames[group]++")").align_(\center)
|
|
|
|
), nil);
|
|
|
|
),
|
|
|
|
tracks = {arg part;
|
|
|
|
nil);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tracks = { |part|
|
|
|
|
|
|
|
|
HLayout(
|
|
|
|
HLayout(
|
|
|
|
VLayout(
|
|
|
|
VLayout(
|
|
|
|
HLayout(
|
|
|
|
HLayout(
|
|
|
|
Slider(view).value_(0.8).action_(
|
|
|
|
Slider(view).value_(0.8).action_(
|
|
|
|
{|v| partVols[part] = v.value * 1.25; ~play.set(partAbbr[part] ++ "Vol", partVols[part])}),
|
|
|
|
{arg v; partVols[part] = v.value * 1.25; ~play.set(partAbbr[part] ++ "Vol", partVols[part])}),
|
|
|
|
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_(
|
|
|
|
{|v| partMutes[part] = (1 - v.value).abs; ~play.set(partAbbr[part] ++ "Mute", partMutes[part])}),
|
|
|
|
{arg v; partMutes[part] = (1 - v.value).abs; ~play.set(partAbbr[part] ++ "Mute", partMutes[part])}),
|
|
|
|
StaticText(view).string_("pan").align_(\center),
|
|
|
|
StaticText(view).string_("pan").align_(\center),
|
|
|
|
Knob(view).value_(0.5).action_(
|
|
|
|
Knob(view).value_(0.5).action_(
|
|
|
|
{|v| partPans[part] = v.value * 2 - 1; ~play.set(partAbbr[part] ++ "Pan", partPans[part])}),
|
|
|
|
{arg v; partPans[part] = v.value * 2 - 1; ~play.set(partAbbr[part] ++ "Pan", partPans[part])}),
|
|
|
|
StaticText(view).string_(trackNames[part]).align_(\center)
|
|
|
|
StaticText(view).string_(trackNames[part]).align_(\center)
|
|
|
|
),
|
|
|
|
),
|
|
|
|
nil)
|
|
|
|
nil)
|
|
|
|