Re: Midi Instrument: change?

2021-09-04 Thread Guy Stalnaker

Understood and thanks for the clarification.

Guy

On 9/4/21 5:09 PM, David Kastrup wrote:

Guy Stalnaker  writes:


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 = #""

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

\set midiInstrument = ... is the same as \set Bottom.midiInstrument = ...
and in the normal Staff, Bottom will be a Voice context in general.  So
the change in midiInstrument is only visible within a Voice and moving
the Staff_performer to Voice level lets it see that change.

But that is putting the cart before the horse.  If you want to change
the instrument used by the Staff_performer at, well, Staff level, using
\set Staff.midiInstrument = ... is the right choice.  Moving the
Staff_performer has its uses (and the example in the manual shows
exactly one such use that may be common in a partitura, namely different
_simultaneous_ instruments in a Staff), but doing it just to avoid
setting midiInstrument at Staff level is rather strange and will have
additional effects not all of which may be desirable.


--
--

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

― Aristotle



Re: Midi Instrument: change?

2021-09-04 Thread David Kastrup
Guy Stalnaker  writes:

> 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 = #""
>
> anywhere in a voice and LP will change the midi instrument. Which is
> why I suggested it to Jerry.

\set midiInstrument = ... is the same as \set Bottom.midiInstrument = ...
and in the normal Staff, Bottom will be a Voice context in general.  So
the change in midiInstrument is only visible within a Voice and moving
the Staff_performer to Voice level lets it see that change.

But that is putting the cart before the horse.  If you want to change
the instrument used by the Staff_performer at, well, Staff level, using
\set Staff.midiInstrument = ... is the right choice.  Moving the
Staff_performer has its uses (and the example in the manual shows
exactly one such use that may be common in a partitura, namely different
_simultaneous_ instruments in a Staff), but doing it just to avoid
setting midiInstrument at Staff level is rather strange and will have
additional effects not all of which may be desirable.

-- 
David Kastrup



Re: Midi Instrument: change?

2021-09-04 Thread JxStarks
Thanks, David. This works a lot easier.
Jerry

On Sat, Sep 4, 2021 at 4:51 PM David Kastrup  wrote:

> Guy Stalnaker  writes:
>
> > See
> >
> http://lilypond.org/doc/v2.19/Documentation/notation/midi-channel-mapping
> >
> > Where the method is shown. Basically, you put the instrument into the
> > Voice context:
> >
> > %%% Code
> >
> >   \midi {
> > \context {
> >   \Staff
> >   \remove "Staff_performer"
> > }
> > \context {
> >   \Voice
> >   \consists "Staff_performer"
> > }
> >
> > %%% Code
> >
> > You'll see how it works. I do this all the time.
>
> Frankly, I have no idea what you all are talking about.
>
>
> Works fine without moving the Staff_performer.
>
> --
> David Kastrup
>


Re: Midi Instrument: change?

2021-09-04 Thread Guy Stalnaker

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 = #""

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



Re: Midi Instrument: change?

2021-09-04 Thread David Kastrup
Guy Stalnaker  writes:

>> On Sat, Sep 4, 2021, 3:51 PM David Kastrup  wrote:
>>
>>> Guy Stalnaker  writes:
>>>
>>> > See
>>> >
>>> http://lilypond.org/doc/v2.19/Documentation/notation/midi-channel-mapping
>>> >
>>> > Where the method is shown. Basically, you put the instrument into the
>>> > Voice context:
>>> >
>>> > %%% Code
>>> >
>>> >   \midi {
>>> > \context {
>>> >   \Staff
>>> >   \remove "Staff_performer"
>>> > }
>>> > \context {
>>> >   \Voice
>>> >   \consists "Staff_performer"
>>> > }
>>> >
>>> > %%% Code
>>> >
>>> > You'll see how it works. I do this all the time.
>>>
>>> Frankly, I have no idea what you all are talking about.
>>>
>>>
>>> Works fine without moving the Staff_performer.
>>
>
> Just following the docs (per the link provided). Should the docs be
> updated?

The docs referring to per-voice/per-staff channel mapping have no
relation to changing the midi instrument temporarily and they don't
state anything like that either.

-- 
David Kastrup



Re: Midi Instrument: change?

2021-09-04 Thread Guy Stalnaker
Just following the docs (per the link provided). Should the docs be updated?

Guy

On Sat, Sep 4, 2021, 3:51 PM David Kastrup  wrote:

> Guy Stalnaker  writes:
>
> > See
> >
> http://lilypond.org/doc/v2.19/Documentation/notation/midi-channel-mapping
> >
> > Where the method is shown. Basically, you put the instrument into the
> > Voice context:
> >
> > %%% Code
> >
> >   \midi {
> > \context {
> >   \Staff
> >   \remove "Staff_performer"
> > }
> > \context {
> >   \Voice
> >   \consists "Staff_performer"
> > }
> >
> > %%% Code
> >
> > You'll see how it works. I do this all the time.
>
> Frankly, I have no idea what you all are talking about.
>
>
> Works fine without moving the Staff_performer.
>
> --
> David Kastrup
>


Re: Midi Instrument: change?

2021-09-04 Thread David Kastrup
Guy Stalnaker  writes:

> See
> http://lilypond.org/doc/v2.19/Documentation/notation/midi-channel-mapping
>
> Where the method is shown. Basically, you put the instrument into the
> Voice context:
>
> %%% Code
>
>   \midi {
>     \context {
>   \Staff
>   \remove "Staff_performer"
>     }
>     \context {
>   \Voice
>   \consists "Staff_performer"
>     }
>
> %%% Code
>
> You'll see how it works. I do this all the time.

Frankly, I have no idea what you all are talking about.

\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 {}
}
Works fine without moving the Staff_performer.

-- 
David Kastrup


Re: Midi Instrument: change?

2021-09-04 Thread jh


   1. Midi Instrument: change? (JxStarks)
   2. Re: Midi Instrument: change? (Guy Stalnaker)

GuyS
I too wanted to know how to do this.  Since I have limited experience 
with the latest versions of lilypond due to total confusion of the new 
syntax's.  I did find this example you linked to and provided, before 
this question came to the newsletter..  However without a minimal 
example (which I did not find so if it's available somewhere a link 
would be fine).  So I'm pathetic but I could not see how this works.

J


See 
http://lilypond.org/doc/v2.19/Documentation/notation/midi-channel-mapping


Where the method is shown. Basically, you put the instrument into the 
Voice context:


%%% Code

  \midi {
\context {
  \Staff
  \remove "Staff_performer"
}
\context {
  \Voice
  \consists "Staff_performer"
}

%%% Code

You'll see how it works. I do this all the time.

Regards,

GuyS



Re: Midi Instrument: change?

2021-09-04 Thread JxStarks
This is great! Thanks for your help.

Jerry

On Fri, Sep 3, 2021 at 8:46 PM Guy Stalnaker  wrote:

> See
> http://lilypond.org/doc/v2.19/Documentation/notation/midi-channel-mapping
>
> Where the method is shown. Basically, you put the instrument into the
> Voice context:
>
> %%% Code
>
>   \midi {
> \context {
>   \Staff
>   \remove "Staff_performer"
> }
> \context {
>   \Voice
>   \consists "Staff_performer"
> }
>
> %%% Code
>
> You'll see how it works. I do this all the time.
>
> Regards,
>
> GuyS
> On 9/3/21 7:36 PM, JxStarks wrote:
>
> Hi all,
> Is it possible to change the midi-instrument in the middle of a part? This
> is particularly useful for strings voices which do occasional pizzicato
> sections. It seems awfully cumbersome to write a whole part just for 5 or 6
> measures of pizzicato. How would the change (and the change back) be coded?
>
> Thanks in advance,
>
> Jerry
>
> --
> --
>
> “Happiness is the meaning and the purpose of life, the whole aim and end of 
> human existence.”
>
> ― Aristotle
>
>


Re: Midi Instrument: change?

2021-09-03 Thread Guy Stalnaker
See 
http://lilypond.org/doc/v2.19/Documentation/notation/midi-channel-mapping


Where the method is shown. Basically, you put the instrument into the 
Voice context:


%%% Code

  \midi {
    \context {
  \Staff
  \remove "Staff_performer"
    }
    \context {
  \Voice
  \consists "Staff_performer"
    }

%%% Code

You'll see how it works. I do this all the time.

Regards,

GuyS

On 9/3/21 7:36 PM, JxStarks wrote:

Hi all,
Is it possible to change the midi-instrument in the middle of a part? 
This is particularly useful for strings voices which do occasional 
pizzicato sections. It seems awfully cumbersome to write a whole part 
just for 5 or 6 measures of pizzicato. How would the change (and the 
change back) be coded?


Thanks in advance,

Jerry


--
--

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

― Aristotle



Midi Instrument: change?

2021-09-03 Thread JxStarks
Hi all,
Is it possible to change the midi-instrument in the middle of a part? This
is particularly useful for strings voices which do occasional pizzicato
sections. It seems awfully cumbersome to write a whole part just for 5 or 6
measures of pizzicato. How would the change (and the change back) be coded?

Thanks in advance,

Jerry