Am Donnerstag, 21. Februar 2008 schrieben Sie: > I haven't completely understood the whole discussion, but I'd just > like to know if there's a way to print the MIDI instruments list in > the PDF output, and not as a stderr message like Mats suggested;
Of course, there is. Instead of calling format on the strings, you can simply create a markup and display the resulting list of markups using \markuplines. Unfortunately this requires lilypond >= 2.11 :( In lilypond 2.10, one has to use make-column-markup instead, which unfortunately does not support automatic line breaking of the long list (well, I'm probably just missing the proper function from 2.10, so don't take my word as fact...). Anyway, I submitted a snippet containing both versions (.ly and .pdf from 2.11 are also attached to this mail): http://lsr.dsi.unimi.it/LSR/Item?u=1&id=392 BTW, I also created a similar scheme function displaying all x11 colors (including a filled box of that color), but didn't submit it to the LSR, because it takes a while to format and creates 21 pages of output (mainly due to the 100 different shades of gray, duplicated with the "grey" spelling). I'm attaching the .ly file, too, in case anyone is interested. I'm using \column-lines here to get a little spacing between the different colors (one could also add the \column-lines to the midi instruments snippet to get proper line spacing) Again, this works with 2.11. For 2.10 one could go a similar route as with the midi instruments snippet (but since there are no page breaks, the result would be quite useless, showing only the first page and the rest flowing out at the bottom of the page...) Cheers, Reinhold -- ------------------------------------------------------------------ Reinhold Kainhofer, Vienna University of Technology, Austria email: [EMAIL PROTECTED], http://reinhold.kainhofer.com/ * Financial and Actuarial Mathematics, TU Wien, http://www.fam.tuwien.ac.at/ * K Desktop Environment, http://www.kde.org, KOrganizer maintainer * Chorvereinigung "Jung-Wien", http://www.jung-wien.at/
\version "2.10.5" \header { title = "Creating the list of all supported midi instruments" } % We need to load the scheme file containing the definitions #(ly:load "midi.scm") % Code for lilypond 2.11: % We apply a lambda function to the list (instrument-names-alist) of instrument definitions % That function simply creates a markup containing the name as a simple string (the first % entry of the instrument definition is the name, thus the (car instr). % Since we return a list of markups, we have to define that function as a markup-list command % #(define-markup-list-command (midi-instruments-markup-list layout props) () % (interpret-markup-list layout props % (map (lambda (instr) (markup (car instr))) instrument-names-alist ) % ) % ) % simply display the list of markups generated by the function above % \markuplines \midi-instruments-markup-list % Code for lilypond 2.10: #(define-markup-command (midi-instruments-markup-list layout props) () (interpret-markup layout props (make-column-markup (map (lambda (instr) (markup (car instr))) instrument-names-alist ) ) ) ) \markup \midi-instruments-markup-list
midi_instruments.pdf
Description: Adobe PDF document
\version "2.11.35" \header { title = "Available X11 colors with examples" } #(ly:load "x11-color.scm") #(define-markup-list-command (listcolors layout props) () (interpret-markup-list layout props (map (lambda (colorspec) (markup #:with-color (x11-color (car colorspec)) #:filled-box (cons -0.5 10) (cons -1 3) #'1 (symbol->string (car colorspec)) ) ) x11-color-list ) ) ) \markuplines \column-lines \listcolors
_______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel