[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Stopwatch time in markup
From: |
Mark Polesky |
Subject: |
Re: Stopwatch time in markup |
Date: |
Sun, 25 Jan 2009 12:05:53 -0800 (PST) |
Tom Hall wrote:
> This works well for most times, except when secs <10
>
> { c'1 \timestamp #4 #03 c' }
>
> Here 03 gets passed in as an integer of 3 I guess
> so the result looks not so good: 4"3'
>
> WOuld you know how to add to the func a way to pad a zero
> in case of situations like the above?
Whoops.
_____________________________________________________________
\version "2.12.1"
%{
%% paranoid version:
timestamp =
#(define-music-function (parser location minutes seconds) (number? number?)
(let* ((tens (if (< seconds 10) "0" ""))
(min (number->string minutes))
(sec (string-append tens (number->string seconds))))
#{ \mark \markup \rounded-box \small \concat
{ $min \char ##x2032 $sec \char ##x2033 } #}))
%}
timestamp =
#(define-music-function (parser location minutes seconds) (number? number?)
(let* ((tens (if (< seconds 10) "0" ""))
(min (number->string minutes))
(sec (string-append tens (number->string seconds))))
#{ \mark \markup \rounded-box \small \concat { $min ′ $sec ″ } #}))
{ c'1 \timestamp #4 #03 c' \timestamp #4 #33 c' }
_____________________________________________________________
- Mark
- Re: Stopwatch time in markup, (continued)
- Re: Stopwatch time in markup, Ole Schmidt, 2009/01/24
- Re: Stopwatch time in markup, James E. Bailey, 2009/01/24
- Re: Stopwatch time in markup, Ole Schmidt, 2009/01/24
- Re: Stopwatch time in markup, Tom Hall, 2009/01/24
- Re: Stopwatch time in markup, James E. Bailey, 2009/01/24
- Re: Stopwatch time in markup, James E. Bailey, 2009/01/24
Re: Stopwatch time in markup, Mark Polesky, 2009/01/24
Re: Stopwatch time in markup, Tim Reeves, 2009/01/26
Re: Stopwatch time in markup, Carl D. Sorensen, 2009/01/26