|
|
|
@ -1,21 +1,25 @@
|
|
|
|
|
(
|
|
|
|
|
var genWindow, masterView, faderView, buildGenerator, buildMetronome, buildTransport, buildAuxControls, buildMasterFader, buildTrackFader,
|
|
|
|
|
var genWindow, masterView, faderView, buildGenerator, buildMetronome, buildTransport, buildTempoControl, buildMasterFader, buildTrackFader,
|
|
|
|
|
updateSection, updateSubsection, clockStringFunc, metronomeStringFunc, metronomeColorFunc, updateTransport,
|
|
|
|
|
currentSection = 1, currentSubsection = 1;
|
|
|
|
|
|
|
|
|
|
buildGenerator = {arg view;
|
|
|
|
|
var ranSeed;
|
|
|
|
|
HLayout(
|
|
|
|
|
ranSeed = TextField(view, Rect(10, 10, 10, 20)).string_("19800725"),
|
|
|
|
|
ranSeed = TextField(view).string_("19800725"),
|
|
|
|
|
Button(view).states_([["reset seed"]]).action_({ ranSeed.string = "19800725"}.inEnvir),
|
|
|
|
|
Button(view).states_([["random seed"]]).action_({ ranSeed.string = 50000000.rand.asString}.inEnvir),
|
|
|
|
|
Button(view).states_([["generate"]]).action_({
|
|
|
|
|
{~genAll.value(ranSeed.string.asInteger); ~appStatus.string = "status: ready"}.fork(AppClock);
|
|
|
|
|
~appStatus.string = "status: generating"}.inEnvir),
|
|
|
|
|
[~appStatus = StaticText(view).string_("status: ready"), stretch: 1],
|
|
|
|
|
Button(view).states_([["transcribe"]]).action_({
|
|
|
|
|
{~transcribe.value(~scoreData, ~sectionData); ~appStatus.string = "status: ready"}.fork(AppClock);
|
|
|
|
|
~appStatus.string = "status: transcribing"}.inEnvir),
|
|
|
|
|
[~appStatus = StaticText(view).string_("status: ready"), stretch: 1], nil)
|
|
|
|
|
Button(view).states_([["bounce audio"]]).action_({
|
|
|
|
|
{~bounceAudio.value; ~appStatus.string = "status: ready"}.fork(AppClock);
|
|
|
|
|
~appStatus.string = "status: bouncing audio"}.inEnvir),
|
|
|
|
|
nil)
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// these funcs update the elements of the transport panel
|
|
|
|
@ -59,16 +63,30 @@ buildMetronome = {arg win;
|
|
|
|
|
[clock, metronome, layout]
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
updateSection = {arg mod, clock, metronome, sectionDisplay, refresh = true;
|
|
|
|
|
if(~sectionNavDict[[currentSection + mod, 1]] != nil, {
|
|
|
|
|
updateSection = {arg mod, clock, metronome, sectionDisplay, refresh = true, indirect = false;
|
|
|
|
|
var changeSection;
|
|
|
|
|
case
|
|
|
|
|
{(currentSubsection > 1) && (mod < 0)} {
|
|
|
|
|
currentSubsection = 1;
|
|
|
|
|
}
|
|
|
|
|
{(currentSubsection <= 1) && (mod < 0) && (currentSection > 1)} {
|
|
|
|
|
currentSection = currentSection + mod;
|
|
|
|
|
if(indirect, {
|
|
|
|
|
currentSubsection = ~sectionNavDict[[currentSection, 1]][1]
|
|
|
|
|
}, {
|
|
|
|
|
currentSubsection = 1;
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
{(mod > 0) && (~sectionNavDict[[currentSection + mod, 1]] != nil)} {
|
|
|
|
|
currentSection = currentSection + mod;
|
|
|
|
|
currentSubsection = 1;
|
|
|
|
|
if(refresh, {
|
|
|
|
|
updateTransport.value(clock, metronome, sectionDisplay,
|
|
|
|
|
~sectionNavDict[[currentSection, currentSubsection]], 1,
|
|
|
|
|
currentSection, currentSubsection
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if(refresh, {
|
|
|
|
|
updateTransport.value(clock, metronome, sectionDisplay,
|
|
|
|
|
~sectionNavDict[[currentSection, currentSubsection]][0], 1,
|
|
|
|
|
currentSection, currentSubsection
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -78,12 +96,12 @@ updateSubsection = {arg mod, clock, metronome, sectionDisplay, refresh = true;
|
|
|
|
|
currentSubsection = currentSubsection + mod;
|
|
|
|
|
if(refresh, {
|
|
|
|
|
updateTransport.value(clock, metronome, sectionDisplay,
|
|
|
|
|
~sectionNavDict[[currentSection, currentSubsection]], 1,
|
|
|
|
|
~sectionNavDict[[currentSection, currentSubsection]][0], 1,
|
|
|
|
|
currentSection, currentSubsection
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
}, {
|
|
|
|
|
updateSection.value(mod, clock, metronome, sectionDisplay, refresh)
|
|
|
|
|
updateSection.value(mod, clock, metronome, sectionDisplay, refresh, true)
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -112,7 +130,7 @@ buildTransport = {arg win, view, clock, metronome, preampBusses, accompBusses, p
|
|
|
|
|
Button(view).states_([["play", Color.black], ["stop", Color.black, Color.grey]]).action_({arg pState;
|
|
|
|
|
if(pState.value == 1, {
|
|
|
|
|
player = {
|
|
|
|
|
var startMeasure = ~sectionNavDict[[currentSection, currentSubsection]] - 1;
|
|
|
|
|
var startMeasure = ~sectionNavDict[[currentSection, currentSubsection]][0] - 1;
|
|
|
|
|
~patternProxy.source = ~genPlayablePatterns.value(startMeasure, ~patterns, preampBusses, accompBusses, postampBusses);
|
|
|
|
|
Pbind(\instrument, \click_ ++ ~hash, \beat, Pseq([1, 2, 1, 2]), \dur, 1).play(~tempoClock, quant: 0);
|
|
|
|
|
[1, 2, 1, 2].do({arg beat;
|
|
|
|
@ -131,7 +149,7 @@ buildTransport = {arg win, view, clock, metronome, preampBusses, accompBusses, p
|
|
|
|
|
~patternProxy.pause;
|
|
|
|
|
//player.stop;
|
|
|
|
|
updateTransport.value(clock, metronome, sectionDisplay,
|
|
|
|
|
~sectionNavDict[[currentSection, currentSubsection]], 1,
|
|
|
|
|
~sectionNavDict[[currentSection, currentSubsection]][0], 1,
|
|
|
|
|
currentSection.postln, currentSubsection.postln);
|
|
|
|
|
});
|
|
|
|
|
}.inEnvir),
|
|
|
|
@ -142,7 +160,7 @@ buildTransport = {arg win, view, clock, metronome, preampBusses, accompBusses, p
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
buildAuxControls = {arg view;
|
|
|
|
|
buildTempoControl = {arg view;
|
|
|
|
|
var tempo, address, updateSection;
|
|
|
|
|
HLayout(
|
|
|
|
|
tempo = TextField(view).string_("60"),
|
|
|
|
@ -199,7 +217,7 @@ masterView = {arg win, preampBusses, accompBusses, postampBusses;
|
|
|
|
|
generatorLayout = buildGenerator.value(view);
|
|
|
|
|
# clock, metronome, metronomeLayout = buildMetronome.value(win);
|
|
|
|
|
# sectionDisplay, transportLayout = buildTransport.value(win, view, clock, metronome, preampBusses, accompBusses, postampBusses);
|
|
|
|
|
auxControlsLayout = buildAuxControls.value(view);
|
|
|
|
|
auxControlsLayout = buildTempoControl.value(view);
|
|
|
|
|
|
|
|
|
|
view.layout_(
|
|
|
|
|
HLayout(
|
|
|
|
|