lilypond-user
[Top][All Lists]
Advanced

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

Re: Midi Instrument: change?


From: Guy Stalnaker
Subject: Re: Midi Instrument: change?
Date: Sat, 4 Sep 2021 16:52:56 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0

David and Jerry,

I've been using the "method" shown on that Lilypond doc page for years. I confirm that it does work for me. I can put

\set midiInstrument = #"<name>"

anywhere in a voice and LP will change the midi instrument. Which is why I suggested it to Jerry.

But there is no denying that David (of all people) certainly knows whereof he speaks. The example code he provided does exactly the same thing, without needing to modify the \staff and \voice contexts. It has the advantage that it's much easier to code (imagine that!)

JH - A working code example for you is David's code

%%%CODE
\version "2.20.0"
\language "English"
\score {
  \new Staff \with { midiInstrument = "violin" }
  { c'' c'' c'' c''
    \set Staff.midiInstrument = "pizzicato strings"
    c'' c'' c'' c''
    \set Staff.midiInstrument = "violin"
    c'' c'' c'' c''
  }
  \midi {}
}
%%%CODE
-- 
--

“Happiness is the meaning and the purpose of life, the whole aim and end of human existence.”

― Aristotle

reply via email to

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