Re: Doubling a note makes MIDI output louder

2023-07-09 Thread mskala
On Sun, 9 Jul 2023, Knute Snortum wrote:

> note out of the other hand.  This is why I suggested that the MIDI performer
> could ignore \parenthesize notes.  Would this create a pile of workarounds
> for you?

Not as long as I don't use \parenthesize.  But I think it's preferable not
to have a presentation command ("print this in parentheses") with
non-obvious semantic consequences ("don't include these notes in MIDI
output").  Parentheses can mean many different things in different pieces
of music; your situation is only one of those.  Making remove-from-MIDI
always the behaviour of parentheses, or the default unless overridden,
would create Surprises! for anyone who tries to use parentheses for some
other purpose and expects them to just be marks on the page.

Better for "don't include this in MIDI" to be a separate command instead
of a side effect of parentheses.  Less good, but pragmatic because it
doesn't require changing LilyPond, would be to use "tagging" to exclude
the unwanted notes from the version of the music used to generate MIDI.

-- 
Matthew Skala
msk...@ansuz.sooke.bc.ca People before tribes.
https://ansuz.sooke.bc.ca/

Re: Doubling a note makes MIDI output louder

2023-07-09 Thread Knute Snortum
On Sun, Jul 9, 2023 at 7:54 AM  wrote:

> On Sun, 9 Jul 2023, David Wright wrote:
>
> > players. But that's the problem here. When two real voices happen on
> > the same note, the result doesn't sound like one louder voice, yet
> > that's the effect you get from MIDI,¹ where the "two" voices are
>
> Not on *my* MIDI synthesizer.  Two notes are two notes!  I'm inclined to
> be concerned by this because I do a lot of doubling of notes between
> different MIDI channels.  Each channel plays on a different patch, or in a
> separate monophonic recording run on the same patch, and a doubled note is
> quite different from a louder note.
>
> If LilyPond were to start automatically deleting notes because someone
> think's it's a bug for unisons to exist between MIDI tracks, it would make
> the pile of workarounds I already need to use to get decent MIDI out of
> LilyPond, that much worse.
>

Well, I didn't say it was a bug, and surely two MIDI tracks should normally
play two notes, especially if they are different instruments.  But I'm
talking about a specific piano performance technique.  When two voices
(hands) have the same note written, the pianist doesn't play the same note
with both hands.  Instead they pick a hand to play the note and leave the
note out of the other hand.  This is why I suggested that the MIDI
performer could ignore \parenthesize notes.  Would this create a pile of
workarounds for you?

--
Knute Snortum


Re: Doubling a note makes MIDI output louder

2023-07-09 Thread David Wright
On Sun 09 Jul 2023 at 10:53:58 (-0400), msk...@ansuz.sooke.bc.ca wrote:
> On Sun, 9 Jul 2023, David Wright wrote:
> 
> > players. But that's the problem here. When two real voices happen on
> > the same note, the result doesn't sound like one louder voice, yet
> > that's the effect you get from MIDI,¹ where the "two" voices are
> 
> Not on *my* MIDI synthesizer.  Two notes are two notes!  I'm inclined to
> be concerned by this because I do a lot of doubling of notes between
> different MIDI channels.  Each channel plays on a different patch, or in a
> separate monophonic recording run on the same patch, and a doubled note is
> quite different from a louder note.

That may explain why you asked whether it was a problem. It is,
but perhaps only with certain devices (like the poor snipped PCs).
Even there, it could depend on the specific software involved.

> If LilyPond were to start automatically deleting notes because someone
> think's it's a bug for unisons to exist between MIDI tracks, it would make
> the pile of workarounds I already need to use to get decent MIDI out of
> LilyPond, that much worse.

That's your terminology, not mine. I have no idea what LP's actions
are when two voices play the same note, partcombined or not, nor
how difficult it would be to make LP automatically delete particular
notes upon instructions to do so.

If the problem was of sufficient importance to me, I'd attack it
in a completely different way, by postprocessing the MIDI output.

Cheers,
David.



Re: Doubling a note makes MIDI output louder

2023-07-09 Thread David Kastrup
Knute Snortum  writes:

> On Sun, Jul 9, 2023 at 6:57 AM  wrote:
>
>> On Sun, 9 Jul 2023, Knute Snortum wrote:
>>
>> > I'm not sure exactly how one would deal with this problem, other than
>> with
>> > tags.  Maybe \parenthesize could not produce MIDI output?  Or is there a
>> way
>>
>> Is that a problem?  If these are two notes in different MIDI channels,
>> then the MIDI output is just reflecting what you wrote - two notes played
>> at once that happen to be the same pitch - and deleting one would be
>> incorrect.  If the MIDI output is really just a single "louder" note (what
>> does that mean - higher velocity?) then it implies some deliberate
>> detection of this case within LilyPond, which might reasonably be
>> adjustable.
>>
>
> In the MWE the instrument is a piano, so you wouldn't want the note to
> sound louder than the surrounding notes, because the doubled note is played
> by only one hand.

Frankly, a player who does not differentiate overlapping identical notes
in momentarily converging voices from single notes is not doing the
listener a favor.

-- 
David Kastrup



Re: Doubling a note makes MIDI output louder

2023-07-09 Thread mskala
On Sun, 9 Jul 2023, David Wright wrote:

> players. But that's the problem here. When two real voices happen on
> the same note, the result doesn't sound like one louder voice, yet
> that's the effect you get from MIDI,¹ where the "two" voices are

Not on *my* MIDI synthesizer.  Two notes are two notes!  I'm inclined to
be concerned by this because I do a lot of doubling of notes between
different MIDI channels.  Each channel plays on a different patch, or in a
separate monophonic recording run on the same patch, and a doubled note is
quite different from a louder note.

If LilyPond were to start automatically deleting notes because someone
think's it's a bug for unisons to exist between MIDI tracks, it would make
the pile of workarounds I already need to use to get decent MIDI out of
LilyPond, that much worse.

-- 
Matthew Skala
msk...@ansuz.sooke.bc.ca People before tribes.
https://ansuz.sooke.bc.ca/

Re: Doubling a note makes MIDI output louder

2023-07-09 Thread David Wright
On Sun 09 Jul 2023 at 09:57:23 (-0400), msk...@ansuz.sooke.bc.ca wrote:
> On Sun, 9 Jul 2023, Knute Snortum wrote:
> 
> > I'm not sure exactly how one would deal with this problem, other than with
> > tags.  Maybe \parenthesize could not produce MIDI output?  Or is there a way
> 
> Is that a problem?  If these are two notes in different MIDI channels,
> then the MIDI output is just reflecting what you wrote - two notes played
> at once that happen to be the same pitch - and deleting one would be
> incorrect.  If the MIDI output is really just a single "louder" note (what
> does that mean - higher velocity?) then it implies some deliberate
> detection of this case within LilyPond, which might reasonably be
> adjustable.

Back in the 1960s, I remember seeing an article pinned up in the
school music room (no social media back then) about making orchestras
more efficient. Instead of a dozen first violins, just amplify a
single player instead; the same across the strings alone could
drastically cut costs (wages, travel, stage size, etc).

Of course, it was just a joke, and everyone knows that one player
amplified does not sound anything like an ensemble of a dozen
players. But that's the problem here. When two real voices happen on
the same note, the result doesn't sound like one louder voice, yet
that's the effect you get from MIDI,¹ where the "two" voices are
being generated from the same source.

¹ My experience is limited to MIDI voices being mixed by PCs,
  not specialist equipment.

Cheers,
David.



Re: Doubling a note makes MIDI output louder

2023-07-09 Thread mskala
On Sun, 9 Jul 2023, Knute Snortum wrote:

> In the MWE the instrument is a piano, so you wouldn't want the note to sound
> louder than the surrounding notes, because the doubled note is played by
> only one hand.  But I can see this might be a problem if the two staves were
> for two voices.  Maybe you want it louder in that situation?  That's why I

LilyPond generates separate MIDI tracks, in separate channels, for the two
staves, so as far as anything playing the MIDI file is concerned, it is
not a "louder" note; it is two notes in unison.  Nothing about a standard
MIDI file indicates to the playing software that these two tracks happen
to be the right and left hands on a single instrument.

If you don't want the two notes to play at once, I think what needs to be
changed is the fact that LilyPond is generating separate tracks per stave.
You might be able to use \partcombine to collapse them into a single
track and eliminate unisons.

-- 
Matthew Skala
msk...@ansuz.sooke.bc.ca People before tribes.
https://ansuz.sooke.bc.ca/

Re: Doubling a note makes MIDI output louder

2023-07-09 Thread Knute Snortum
On Sun, Jul 9, 2023 at 6:57 AM  wrote:

> On Sun, 9 Jul 2023, Knute Snortum wrote:
>
> > I'm not sure exactly how one would deal with this problem, other than
> with
> > tags.  Maybe \parenthesize could not produce MIDI output?  Or is there a
> way
>
> Is that a problem?  If these are two notes in different MIDI channels,
> then the MIDI output is just reflecting what you wrote - two notes played
> at once that happen to be the same pitch - and deleting one would be
> incorrect.  If the MIDI output is really just a single "louder" note (what
> does that mean - higher velocity?) then it implies some deliberate
> detection of this case within LilyPond, which might reasonably be
> adjustable.
>

In the MWE the instrument is a piano, so you wouldn't want the note to
sound louder than the surrounding notes, because the doubled note is played
by only one hand.  But I can see this might be a problem if the two staves
were for two voices.  Maybe you want it louder in that situation?  That's
why I suggested using \parenthesize to signal that the note should be
played once.

--
Knute Snortum


Re: Doubling a note makes MIDI output louder

2023-07-09 Thread David Kastrup
Michael Gerdau  writes:

> AFAICT the note is not played louder. However it is played twice and
> then depending on your sound device that may or may not result in that
> note being louder.

When my sound device is a violin, I can testify that playing the same
note simultaneously on two different strings makes the result louder
than playing it on a single string.

-- 
David Kastrup



Re: Doubling a note makes MIDI output louder

2023-07-09 Thread mskala
On Sun, 9 Jul 2023, Knute Snortum wrote:

> I'm not sure exactly how one would deal with this problem, other than with
> tags.  Maybe \parenthesize could not produce MIDI output?  Or is there a way

Is that a problem?  If these are two notes in different MIDI channels,
then the MIDI output is just reflecting what you wrote - two notes played
at once that happen to be the same pitch - and deleting one would be
incorrect.  If the MIDI output is really just a single "louder" note (what
does that mean - higher velocity?) then it implies some deliberate
detection of this case within LilyPond, which might reasonably be
adjustable.

-- 
Matthew Skala
msk...@ansuz.sooke.bc.ca People before tribes.
https://ansuz.sooke.bc.ca/

Re: Doubling a note makes MIDI output louder

2023-07-09 Thread Michael Gerdau
AFAICT the note is not played louder. However it is played twice and then 
depending on your sound device that may or may not result in that note being 
louder.

Mobil gesendet

> Am 09.07.2023 um 15:46 schrieb Knute Snortum :
> 
> 
> Hi everyone.
> 
> If two voices play the same note, the MIDI output for that note is louder 
> (twice as loud?) than the surrounding notes.
> 
> %%%
> \version "2.25.6"
> 
> \score {
>   \new PianoStaff <<
> \new Staff { g'8 d' e' d' g'2 }
> \new Staff { \clef bass b8 d' c' d' b2 }
>   >>
>   \layout {}
>   \midi {}
> }
> %%%
> 
> I'm not sure exactly how one would deal with this problem, other than with 
> tags.  Maybe \parenthesize could not produce MIDI output?  Or is there a way 
> to check internally if the same note is played by two voices not to double 
> the loudness?
> 
> --
> Knute Snortum
> 


Doubling a note makes MIDI output louder

2023-07-09 Thread Knute Snortum
Hi everyone.

If two voices play the same note, the MIDI output for that note is louder
(twice as loud?) than the surrounding notes.

%%%
\version "2.25.6"

\score {
  \new PianoStaff <<
\new Staff { g'8 d' e' d' g'2 }
\new Staff { \clef bass b8 d' c' d' b2 }
  >>
  \layout {}
  \midi {}
}
%%%

I'm not sure exactly how one would deal with this problem, other than with
tags.  Maybe \parenthesize could not produce MIDI output?  Or is there a
way to check internally if the same note is played by two voices not to
double the loudness?

--
Knute Snortum