lilypond-auto
[Top][All Lists]
Advanced

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

Re: [Lilypond-auto] Issue 3601 in lilypond: Docs: new MIDI output capabi


From: lilypond
Subject: Re: [Lilypond-auto] Issue 3601 in lilypond: Docs: new MIDI output capability: panning, etc.
Date: Tue, 29 Jul 2014 14:06:28 +0000


Comment #5 on issue 3601 by address@hidden: Docs: new MIDI output capability: panning, etc.
http://code.google.com/p/lilypond/issues/detail?id=3601

I'm sorry about not answering these questions earlier; being
only an occasional contributor to the source code, I hadn't checked
this issue for quite some time...  I hope the following answers
clarify how the context properties work.


1.

"Midi_control_function_performer" is a new performer that didn't exist
before: it was added specifically to handle changes in the new context
properties as they occur in the input.

2.

In addition to the pan position, reverb level, and chorus level, there's
also a context property for setting MIDI balance (the Staff.midiBalance
context property, which can be set to a number value between -1.0 and
1.0).

   [Side question: Locally, I have also a patch to add MIDI "expression"
   to this set of context properties.  What's the recommended policy to
   open a new issue for this patch?  As I'm only an occasional
   contributor, do I first need to ask for permission for opening an issue
   on the lilypond-devel mailing list, or can I just go ahead and run the
   git cl commands to create the new issue?]

As to how the properties are handled in LilyPond, the implementation will
simply map the floating point value of each context property to a range of
integers (specific to each property) using linear scaling (rounding
upwards), and use these integers to generate MIDI Control Change events
corresponding to the properties in the outputted MIDI file, similarly to
how the volume of every note is outputted as a "velocity" between 0 and
127 in MIDI.  More specifically, the mappings between the floating point
ranges and integer ranges for each context property are:

  Pan position     [-1.0, 1.0] -> [0, 16383]
  Balance          [-1.0, 1.0] -> [0, 16383]
  Reverb level     [0.0, 1.0]  -> [0, 127]
  Chorus level     [0.0, 1.0]  -> [0, 127]

Every context property (including pan position) supports all floating
point values in the (inclusive) input range.  (In LilyPond, #LEFT, #CENTER
and #RIGHT are aliases for the number values -1.0, 0.0 and 1.0,
respectively.)


To my knowledge, the MIDI standard gives only recommendations on how to
interpret the integer values in a synthesizer, and there are no standard
units used for the values.  Only the interpretation at the ends of each
range has been fixed (see, for example,
http://www.blitter.com/~russtopia/MIDI/~jglatt/tech/midispec.htm)

  Pan position:  0 = hard left; 8192 = center; 16383 = hard right
  Balance:       0 = leftmost emphasis; 8192 = center;
                 16383 = rightmost emphasis
  Reverb level:  0 = off; 127 = full effect
  Chorus level:  0 = off; 127 = full effect

There are, however, recommendations on how to interpret, for example, the
most significant 7 bits of the (integer) pan position as the gain to be
applied by a MIDI synthesizer to the right and left audio output channels
(http://www.midi.org/techspecs/rp36.php), or to convert a "reverb time" in
seconds into a corresponding "reverb level" integer value
(http://www.midi.org/techspecs/ca24.pdf, page 4).  (I just state these
for reference, I have no expert understanding about these.)

In the end, however, it's entirely up to the MIDI synthesizer that
actually generates audio from a MIDI file how the MIDI control change
events in the file get rendered in the output (if at all; for example, all
of the software synthesizers I've tested appear to just ignore the Balance
setting), and how faithfully the output matches the official
recommendations.  As LilyPond only translates the context properties into
MIDI control change events in an output file, this means that "bugs"
related to the context properties having no (or unexpected) effect on a
particular synthesizer cannot be fixed in LilyPond.

(This is actually no different from how note velocities, or "volume",
works: however, "volume" is probably just better supported across
different synthesizers since it's a more common property.)


--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings



reply via email to

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