lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stopwatch time in markup


From: Tim Reeves
Subject: Re: Stopwatch time in markup
Date: Mon, 26 Jan 2009 11:33:29 -0800



> Date: Sat, 24 Jan 2009 22:03:29 +0100
> From: "James E. Bailey" <address@hidden>
> Subject: Re: Stopwatch time in markup
> To: Mark Polesky <address@hidden>
> Cc: address@hidden, Tom Hall <address@hidden>
> Message-ID: <address@hidden>
> Content-Type: text/plain; charset=UTF-8; delsp=yes; format=flowed
>
> See, that's just amazing. personally, I think \markup \concat {4\char  
> ##x2032 " 33"\char##x2033 } is a little shorter, but it's kind of  
> awesome that that can be done with all that stuff that apparently  
> means something.
>
> Am 24.01.2009 um 21:49 schrieb Mark Polesky:
>
> > Don't forget you can store all the formatting as a music-function:
> >
> > timestamp =
> > #(define-music-function (parser location minutes seconds) (number?  
> > number?)
> >    (let ((min (number->string minutes)) (sec (number->string  
> > seconds)))
> >     #{ \mark \markup \rounded-box \small \concat { $min ′ $sec  
> > ″ } #}))
> >
> > { c'1 \timestamp #4 #33 c' }
> >
> > And solely out of paranoia, here's a version that doesn't rely on
> > the special utf-8 characters -- in case my prime and double-prime
> > characters above get corrupted on the way to your mailbox/browser:
> >
> > timestamp =
> > #(define-music-function (parser location minutes seconds) (number?  
> > number?)
> >    (let ((min (number->string minutes)) (sec (number->string  
> > seconds)))
> >     #{ \mark \markup \rounded-box \small \concat
> >         { $min \char ##x2032 $sec \char ##x2033 } #}))
> >
> >
> > { c'1 \timestamp #4 #33 c' }
> >
> > - Mark
> >
>


It's true, James that

\markup \concat {4\char ##x2032 " 33"\char##x2033 }

is shorter if you just use it once, but if you use it a few times, or many times, then

{ c'1 \timestamp #4 #33 c' }

is shorter, and easier. The long part, the definition, could even be hidden away in another file that you \include.

Mind you, I could not have written that function, but I'm glad that there are those who can, and console myself with the thought that if I had the time, I could learn too.

BTW, who is transcribing John Cage's work where the pianist just sits and plays nothing for exactly four minutes and thirty-three seconds? I'm sure the Lilypond output will be just gorgeous! ;-)
reply via email to

[Prev in Thread] Current Thread [Next in Thread]