lilypond-devel
[Top][All Lists]
Advanced

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

Re: Geting the list of MIDI instrument names


From: Han-Wen Nienhuys
Subject: Re: Geting the list of MIDI instrument names
Date: Thu, 21 Feb 2008 12:05:30 -0300

2008/2/21, Reinhold Kainhofer <address@hidden>:

> Don't ask me how it is done, but at least that's how it works in lilypond:
>
>  lilypond -e '(display (string->list (format "abc~sdef" "ffff")))'

be careful with format; there are 2 routines: simple-format (the
default, implemented in C; format is aliased to it), which requires
the port argument, and the one from the (ice-9 format) module, which
has all sorts of bells and whistles.  It is slow and generates
ridiculous amounts of garbage memory.

There is also a ly:format routine, written in C++ which is slightly
more featureful for use int the backend.  It has support for
specifying precision in floating point numbers.

lily.scm defines:


(define-public fancy-format format)
(define-public (ergonomic-simple-format dest . rest)
  "Like ice-9 format, but without the memory consumption."

  (if (string? dest)
      (apply simple-format (cons #f (cons dest rest)))
      (apply simple-format (cons dest rest))))

(define format ergonomic-simple-format)

-- 
Han-Wen Nienhuys - address@hidden - http://www.xs4all.nl/~hanwen




reply via email to

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