@ -1,7 +1,7 @@
(
(
var clockStringFunc, metronomeStringFunc, metronomeColorFunc, updateTransport, updateSubsection,
var clockStringFunc, metronomeStringFunc, metronomeColorFunc, updateTransport, updateSubsection,
buildGenerator, buildMetronome, updateSection, buildTransport, buildTempoControl, buildMasterFader, buildTrackFader,
buildGenerator, buildMetronome, updateSection, buildTransport, buildTempoControl, buildMasterFader, buildTrackFader,
masterView, faderView, currentSection = 1, currentSubsection = 1;
masterView, faderView, helpView, currentSection = 1, currentSubsection = 1;
// these funcs update the elements of the transport panel
// these funcs update the elements of the transport panel
clockStringFunc = {
clockStringFunc = {
@ -162,44 +162,55 @@ buildTempoControl = {arg view;
};
};
buildMasterFader = {arg view, masterVol, masterMute, masterIndicators;
buildMasterFader = {arg view;
HLayout([
var trackIndicators, layout, volSlider, muteButton;
trackIndicators = {LevelIndicator()} ! 2;
OSCFunc.new({arg msg;
{trackIndicators[0].value = msg[3].ampdb.linlin(-50, 0, 0, 1)}.defer;
{trackIndicators[1].value = msg[4].ampdb.linlin(-50, 0, 0, 1)}.defer
}, '/masterLevels_' ++ ~hash, s.addr);
layout = HLayout([
VLayout(
VLayout(
HLayout(
HLayout(
Slider(view).value_(0.8).action_(
volSlider = Slider(view).value_(0.8).action_(
{arg v; masterVol = v.value * 1.25; ~play.set(\masterVol, masterVol)}.inEnvir),
{arg v; var masterVol = v.value * 1.25; ~play.set(\masterVol, masterVol)}.inEnvir),
masterIndicators[0],
track Indicators[0],
masterIndicators[1]),
track Indicators[1]),
Button(view).states_([["mute", Color.black], ["mute", Color.black, Color.grey]]).action_(
muteButton = Button(view).states_([["mute", Color.black], ["mute", Color.black, Color.grey]]).action_(
{arg v; masterMute = (1 - v.value).abs; ~play.set(\masterMute, masterMute)}.inEnvir),
{arg v; var masterMute = (1 - v.value).abs; ~play.set(\masterMute, masterMute)}.inEnvir),
StaticText(view).string_("master").align_(\center)
StaticText(view).string_("master").align_(\center)
), stretch: 2], nil)
), stretch: 2], nil);
[layout, volSlider, muteButton]
};
};
buildTrackFader = {arg view, name, index, initVal ;
buildTrackFader = {arg view, name, index;
var trackIndicator;
var trackIndicator, layout, volSlider, muteButton, panKnob ;
trackIndicator = LevelIndicator();
trackIndicator = LevelIndicator();
OSCFunc.new({arg msg; {trackIndicator.value = msg[3].ampdb.linlin(-50, 0, 0, 1)}.defer},
OSCFunc.new({arg msg; {trackIndicator.value = msg[3].ampdb.linlin(-50, 0, 0, 1)}.defer},
'/trackLevel_' ++ index ++ "_" ++ ~hash, s.addr);
'/trackLevel_' ++ index ++ "_" ++ ~hash, s.addr);
HLayout(
layout = HLayout(
VLayout(
VLayout(
HLayout(
HLayout(
Slider(view).value_(0.8).action_(
volSlider = Slider(view).value_(0.8).action_(
{arg v; var vol = v.value * 1.25; ~play.set(\vol_ ++ index, vol)}.inEnvir),
{arg v; var vol = v.value * 1.25; ~play.set(\vol_ ++ index, vol)}.inEnvir),
trackIndicator),
trackIndicator),
Button(view).states_([["mute", Color.black], ["mute", Color.black, Color.grey]]).action_(
muteButton = Button(view).states_([["mute", Color.black], ["mute", Color.black, Color.grey]]).action_(
{arg v; var mute = (1 - v.value).abs; ~play.set(\mute_ ++ index, mute)}.inEnvir).value_(initVal ),
{arg v; var mute = (1 - v.value).abs; ~play.set(\mute_ ++ index, mute)}.inEnvir).value_(0 ),
VLayout(
VLayout(
StaticText(view).string_("pan").align_(\center),
StaticText(view).string_("pan").align_(\center),
Knob(view).action_({arg v; var pan = v.value * 2 - 1; ~play.set(\pan_ ++ index, pan)}.inEnvir).value_(0.5)
panKnob = Knob(view).action_({arg v; var pan = v.value * 2 - 1; ~play.set(\pan_ ++ index, pan)}.inEnvir).value_(0.5)
),
),
StaticText(view).string_(name).align_(\center)
StaticText(view).string_(name).align_(\center)
),
),
nil)
nil);
[layout, volSlider, muteButton, panKnob]
};
};
@ -231,7 +242,7 @@ masterView = {arg win, preampBusses, accompBusses, postampBusses;
faderView = {arg win;
faderView = {arg win;
var view, masterIndicators, trackIndicators, master, tracks;
var view, masterIndicators, trackIndicators, master, tracks, openButton, saveButton ;
var partAbbr = ["*", "III", "II", "I", "accomp_I", "accomp_II", "click"];
var partAbbr = ["*", "III", "II", "I", "accomp_I", "accomp_II", "click"];
var trackNames = ["*", "III", "II", "I", "accomp_I", "accomp_II", "click"];
var trackNames = ["*", "III", "II", "I", "accomp_I", "accomp_II", "click"];
var partVols, partMutes, partPans;
var partVols, partMutes, partPans;
@ -248,11 +259,33 @@ faderView = {arg win;
masterIndicators = {LevelIndicator()} ! 2;
masterIndicators = {LevelIndicator()} ! 2;
trackIndicators = {LevelIndicator()} ! 6;
trackIndicators = {LevelIndicator()} ! 6;
master = buildMasterFader.value(view, masterVol, masterMute, masterIndicators );
master = buildMasterFader.value(view);
tracks = {arg part;
tracks = {arg part;
buildTrackFader.value(view, trackNames[part], part, 0 );
buildTrackFader.value(view, trackNames[part], part);
} ! 7;
} ! 7;
view.layout_(HLayout(master, nil, *tracks))
openButton = Button(view).states_([["open", Color.black]]).action_({
Dialog.openPanel({ arg path;
path.postln;
},{
"cancelled".postln;
});
});
saveButton = Button(view).states_([["save", Color.black]]).action_({
Dialog.savePanel({ arg path;
path.postln;
},{
"cancelled".postln;
});
});
view.layout_(HLayout(HLayout(master[0], nil, *tracks.slice(nil, 0)), VLayout(nil, openButton, saveButton)))
};
helpView = {arg win;
TextView(win).string_(File.readAllString(~dir +/+ "tkam_readme.scd")).editable_(false);
};
};
@ -274,6 +307,6 @@ faderView = {arg win;
helpButton = Button().states_([["help", Color.white, Color.grey], ["help", Color.black]]).action_(
helpButton = Button().states_([["help", Color.white, Color.grey], ["help", Color.black]]).action_(
{tabButtonReset.value; helpButton.value = 0; tabs.index = 2 }.inEnvir).value_(1)
{tabButtonReset.value; helpButton.value = 0; tabs.index = 2 }.inEnvir).value_(1)
),
),
tabs = StackLayout(masterView.value(win, preampBusses, accompBusses, postampBusses), faderView.value(win)/*, helpView.value*/ ));
tabs = StackLayout(masterView.value(win, preampBusses, accompBusses, postampBusses), faderView.value(win), helpView.value(win) ));
};
};
)
)