[Top][All Lists]

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

Re: Geting the list of MIDI instrument names

From: Mats Bengtsson
Subject: Re: Geting the list of MIDI instrument names
Date: Tue, 19 Feb 2008 17:29:12 +0100
User-agent: Thunderbird (X11/20070716)

The full list is available in an appendix to the notation reference and
as far as I can remember, it hasn't changed since the MIDI support
was implemented some 10 years ago, so it should be fairly safe to
include a hard-coded list in your application as well. Actually, the
list can be found also on many MIDI related sites all over the web
and is not specific to LilyPond in any way.

Having written this, I couldn't resist the temptation to try my very
rusty Scheme knowledge and managed to come up with

\version "2.10.0"
#(ly:load "midi.scm")
#(map (lambda (entry) (ly:message (car entry))) instrument-names-alist)

which produces the list on stderr.


Wilbert Berendsen wrote:

I'm looking for a stable way to get the list of supported MIDI instrument names from LilyPond, by running lilypond -e with a scheme expression to do just that (and not print a regular ps/pdf file).

It's for my plugin that could offer a nice help window to quickly assign a midi instrument to a staff.

Of course I could just include the list verbatim in my plugin, or even try to parse midi.scm myself :-O but I just wonder if there would be an elegant way to get the list...

best regards!
Wilbert Berendsen

        Mats Bengtsson
        Signal Processing
        School of Electrical Engineering
        Royal Institute of Technology (KTH)
        SE-100 44  STOCKHOLM
        Phone: (+46) 8 790 8463                         
       Fax:   (+46) 8 790 7260
        Email: address@hidden

reply via email to

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