lilypond-user
[Top][All Lists]
Advanced

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

Re: Changing and playing a different instrument in MIDI


From: David Kastrup
Subject: Re: Changing and playing a different instrument in MIDI
Date: Fri, 22 Jul 2016 10:06:10 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Gilles <address@hidden> writes:

> On Fri, 22 Jul 2016 08:51:52 +0200, Mojca Miklavec wrote:
>> Hello,
>>
>> I don't have much experience with MIDI. I just tried all the media
>> players on OS X and realized than only QuickTime Player 7 had some
>> very very basic support for playing MIDI files (I cannot even make it
>> play loud enough, let alone do anything else with it). None of the
>> others I have installed worked (VLC, MPlayerX, QuickTime Player,
>> RealPlayer, ...)
>>
>> So I went on and made a package for TiMidity++ and freepats.
>>
>> The problem is: I'm still unable to figure out how to change the
>> instrument to anything but Piano.
>>
>>
>> Here's a minimal example:
>>
>> \score {
>>   \new PianoStaff
>>   <<
>>     \new Voice = "melody" \fixed c'
>>     {
>>       \set midiInstrument = #"accordion"
>>       \time 3/4
>>       f4 g a
>>     }
>>   >>
>>   \midi{ \tempo 4 = 100 }
>> }
>>
>> But this doesn't help me in any way.
>
> \set Staff.midiInstrument = "accordion"

Without further specification, properties are set at "Bottom" level
(usually "Voice" or equivalent.  Properties are inherited downwards, so
a Voice context not having set some property itself sees the property
from the enclosing Staff (or even further up the hierarchy).  Engravers
(for PDF) and performers (for Midi) see properties from the view of the
context that instantiates them.

The performer responsible for setting the midiInstrument is the
Staff_performer which unsurprisingly is grouped at Staff level (see the
Internals Reference or ly/performer-init.ly).

Many properties are interpreted by engravers and performers at lowest
level so one tends to forget that one sometimes needs to set properties
at an explicitly higher level.

-- 
David Kastrup



reply via email to

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