adding visual metronone for interrupt sections

main
Michael Winter 7 years ago
parent 7d6a51db8b
commit 3d11b2ecd7

Binary file not shown.

@ -18,14 +18,15 @@
masterVolGroups = [0.8, 0.8, 0.8, 0.8, 0.8];
clockStringFunc = {
arg secInt;
var min, sec;
sec = secInt;
arg div, metronome = true;
var min, sec, metUni;
sec = if(metronome, {(div / 5).trunc}, {div});
metUni = case {metronome == false} {""} {div % 20 < 2} {"|◘"} {div % 4 < 2} {"|●"} {true} {"| "};
min = (sec / 60).trunc.asString;
if(min.size == 1, {min = "0" ++ min}, {});
sec = (sec % 60).trunc.asString;
if(sec.size == 1, {sec = "0" ++ sec}, {});
min ++ ":" ++ sec
min ++ ":" ++ sec ++ metUni;
};
~appStatusFunc = Task({
@ -56,8 +57,7 @@
VLayout(
HLayout(
Slider(view).value_(0.8).action_({|v| ~play.set(\allMasterVol, v.value * 1.25)}),
masterIndicators[0],
masterIndicators[1]),
masterIndicators[0], masterIndicators[1]),
Button(view).states_([["mute", Color.black], ["mute", Color.black, Color.grey]]).action_(
{|v| ~play.set(\allMasterMute, (1 - v.value).abs)}),
StaticText(view).string_(" master ").align_(\center),
@ -78,24 +78,25 @@
Button(view).states_([["play", Color.black], ["stop", Color.black, Color.grey]]).action_(
{| pState |
pauseButton.value = 0;
if(pState.value == 0, {~play.set(\playRate, 0, \startTrig, 0); clock.string = startPosText.string},
if(pState.value == 0, {~play.set(\playRate, 0, \startTrig, 0);
clock.string = clockStringFunc.value((startPos * ~totalDur * 5).trunc)},
{~play.set(\startPos, startPos, \playRate, 1, \startTrig, 1)})}),
pauseButton = Button(view).states_([["pause", Color.black], ["pause", Color.black, Color.grey]]).action_(
{| pState |
if(pState.value == 1, {~play.set(\playRate, 0)},{~play.set(\playRate, 1)})}),
StaticText(view).string_("start time"),
[Slider(view, Rect(0, 0, 30, 20)).action_(
[Slider(view, Rect(0, 0, 30, 5)).action_(
{|pos|
var min, sec;
startPosText.string = clockStringFunc.value(pos.value * ~totalDur);
startPosText.string = clockStringFunc.value((pos.value * ~totalDur).trunc, false);
startPos = pos.value;
}), stretch: 1],
startPosText = StaticText(win).string_("00:00").font_(Font("Monaco", 15)),
nil);
view.layout_(HLayout(master,
[VLayout(generator,
clock = StaticText(win).string_("00:00").font_(Font("Monaco", 300));,
transport
[VLayout(generator, nil,
clock = StaticText(win).string_("00:00|◘").font_(Font("Monaco", 220)),
nil, transport
), alignment: \top])) };
faderViews = { |group|
var view, masterIndicators, trackIndicators, master, tracks;

@ -40,7 +40,7 @@ SynthDef(\play, {
allMaster = Mix.new([guitarOMaster, guitarIMaster, percussionMaster, ensembleMaster, accompMaster]) * allMasterVol * allMasterMute;
Out.ar(0, allMaster);
curDur = ((A2K.kr(phasor) / BufFrames.kr(buf)) * BufDur.kr(buf)).trunc;
curDur = ((A2K.kr(phasor) / BufFrames.kr(buf)) * BufDur.kr(buf) * 5).trunc;
SendTrig.kr(Changed.kr(curDur), 0, curDur);
imp = Impulse.kr(10);
delimp = Delay1.kr(imp);

Loading…
Cancel
Save