Add left padding on timer

This commit is contained in:
2024-05-14 11:22:37 +02:00
parent 6034e63638
commit 3a1d856f57
2 changed files with 5 additions and 22 deletions

View File

@ -190,24 +190,3 @@ m = MIDIOut.newByName("MIDI", "Bus 1");
});
~apply.play;
)
Main.elapsedTime
(
d.formatTime = {
arg seconds = 0;
var hours = seconds / 3600;
var minutes = (seconds % 3600) / 60;
var secs = (seconds % 60);
hours = hours.asString.padLeft(2, $0);
minutes = minutes.asString.padLeft(2, $0);
secs = secs.asString.padLeft(2, $0);
^hours ++ ":" ++ minutes ++ ":" ++ secs
};
)
d.formatTime
d.formatTime(20).postln;