durtools.seconds_to_clock_string

abjad.tools.durtools.seconds_to_clock_string(total_seconds, escape=False)

Format seconds as m'ss" string rounded to the nearest second.

abjad> durtools.seconds_to_clock_string(117)   
'1\'57"'

Set escape = True to escape " seconds indicator. Useful when formatting ouput as LilyPond markup.

abjad> t = Note(0, (1, 4))

abjad> durtools.seconds_to_clock_string(117, escape = True)
'1\'57\\"'
abjad> clock_string = _

abjad> t.markup.up.append('"%s"' % clock_string)
abjad> print t.format
c'4 ^ \markup { "1'57\"" }

Previous topic

durtools.rationalize

Next topic

durtools.sum_preprolated

This Page