metronome and score tweaks

main
Michael Winter 5 years ago
parent 90113bc9e2
commit 81c9d6be56

Binary file not shown.

@ -21,9 +21,9 @@
arg div; arg div;
var min, sec; var min, sec;
sec = (div / 5).trunc; sec = (div / 5).trunc;
min = (sec / 60).trunc.asString; min = (sec / 60).asInteger.asString;
if(min.size == 1, {min = "0" ++ min}, {}); if(min.size == 1, {min = "0" ++ min}, {});
sec = (sec % 60).trunc.asString; sec = (sec % 60).asInteger.asString;
if(sec.size == 1, {sec = "0" ++ sec}, {}); if(sec.size == 1, {sec = "0" ++ sec}, {});
min ++ ":" ++ sec min ++ ":" ++ sec
}; };
@ -84,7 +84,7 @@
{| pState | {| pState |
pauseButton.value = 0; pauseButton.value = 0;
if(pState.value == 0, {~play.set(\playRate, 0, \startTrig, 0); if(pState.value == 0, {~play.set(\playRate, 0, \startTrig, 0);
clock.string = clockStringFunc.value((startPos * ~totalDur * 5).trunc)}, clock.string = clockStringFunc.value((startPos * ~totalDur * 5).asInteger)},
{~play.set(\startPos, startPos, \playRate, 1, \startTrig, 1)})}), {~play.set(\startPos, startPos, \playRate, 1, \startTrig, 1)})}),
pauseButton = Button(view).states_([["pause", Color.black], ["pause", Color.black, Color.grey]]).action_( pauseButton = Button(view).states_([["pause", Color.black], ["pause", Color.black, Color.grey]]).action_(
{| pState | {| pState |
@ -93,7 +93,7 @@
[Slider(view, Rect(0, 0, 30, 5)).action_( [Slider(view, Rect(0, 0, 30, 5)).action_(
{|pos| {|pos|
var min, sec; var min, sec;
startPosText.string = clockStringFunc.value((pos.value * ~totalDur * 5).trunc); startPosText.string = clockStringFunc.value((pos.value * ~totalDur * 5).asInteger);
startPos = pos.value; startPos = pos.value;
}), stretch: 1], }), stretch: 1],
startPosText = StaticText(win).string_("00:00").font_(Font("Monaco", 15)), startPosText = StaticText(win).string_("00:00").font_(Font("Monaco", 15)),

Loading…
Cancel
Save