How come LilyPond can't output the correct MIDI for 2 or more simultaneous 
notes in a non-standard tuning? After all, it does output the correct MIDI for 
individual notes in a non-standard tuning.

Investigating LilyPond's limits in this area, I find that LilyPond outputs the 
correct MIDI for simultaneous notes in a non-standard tuning, /provided that/ 
they are in separate MIDI channels to which are assigned /different/ MIDI 
instruments (e.g. violin notes at the same time as piano notes). However, it 
outputs incorrect pitches for simultaneous notes to be played by identical MIDI 
instruments (e.g. all notes to be played by violin), even if I get LilyPond to 
get MIDI to assign these notes to separate channels. How come?

Is LilyPond actually assigning the notes to the same channel despite my efforts 
to get it to get MIDI to assign these notes to separate channels? If so, how do 
I get these notes assigned to separate channels, and would that produce the 
correct pitches anyway?

In the example below, the upper and lower voices should hold constant pitches 
but in the MIDI they don't.

%%%%%%%
\version "2.13.55"

% For syntax, see \usr\share\lilypond\current\ly\makam.ly
% The unit here is the tone.

xixPitchNames = #`(
    (c . ,(ly:make-pitch -1 0 0/38))
    (cs . ,(ly:make-pitch -1 0 12/38))
    (df . ,(ly:make-pitch -1 1 -14/38))
    (d . ,(ly:make-pitch -1 1 -2/38))
    (ds . ,(ly:make-pitch -1 1 10/38))
    (ef . ,(ly:make-pitch -1 2 -16/38))
    (e . ,(ly:make-pitch -1 2 -4/38))
    (es . ,(ly:make-pitch -1 2 8/38))
    (ff . ,(ly:make-pitch -1 3 -11/38))
    (f . ,(ly:make-pitch -1 3 1/38))
    (fs . ,(ly:make-pitch -1 3 13/38))
    (gf . ,(ly:make-pitch -1 4 -13/38))
    (g . ,(ly:make-pitch -1 4 -1/38))
    (gs . ,(ly:make-pitch -1 4 11/38))
    (af . ,(ly:make-pitch -1 5 -15/38))
    (a . ,(ly:make-pitch -1 5 -3/38))
    (as . ,(ly:make-pitch -1 5 9/38))
    (bf . ,(ly:make-pitch -1 6 -17/38))
    (b . ,(ly:make-pitch -1 6 -5/38))
    (bs . ,(ly:make-pitch -1 6 7/38))
)
pitchnames = \xixPitchNames
#(ly:parser-set-note-names parser xixPitchNames)

xixGlyphs = #`(
    (0/38 . "accidentals.natural")
    (12/38 . "accidentals.sharp")
    (-14/38 . "accidentals.flat")
    (-2/38 . "accidentals.natural")
    (10/38 . "accidentals.sharp")
    (-16/38 . "accidentals.flat")
    (-4/38 . "accidentals.natural")
    (8/38 . "accidentals.sharp")
    (-11/38 . "accidentals.flat")
    (1/38 . "accidentals.natural")
    (13/38 . "accidentals.sharp")
    (-13/38 . "accidentals.flat")
    (-1/38 . "accidentals.natural")
    (11/38 . "accidentals.sharp")
    (-15/38 . "accidentals.flat")
    (-3/38 . "accidentals.natural")
    (9/38 . "accidentals.sharp")
    (-17/38 . "accidentals.flat")
    (-5/38 . "accidentals.natural")
    (7/38 . "accidentals.sharp")
)
\layout
{
    \context
    {
        \Score
        \override KeySignature #'glyph-name-alist = \xixGlyphs
        \override Accidental #'glyph-name-alist = \xixGlyphs
        \override AccidentalCautionary #'glyph-name-alist = \xixGlyphs
        \override TrillPitchAccidental #'glyph-name-alist = \xixGlyphs
        \override AmbitusAccidental #'glyph-name-alist = \xixGlyphs
    }
}

xixNullKeySig = #`(
    (1 . -2/38)    ; d
    (2 . -4/38)    ; e
    (3 .  1/38)    ; f
    (4 . -1/38)    ; g
    (5 . -3/38)    ; a
    (6 . -5/38)    ; b
)

xixSetNullKeySig =
{
    \override Staff.KeySignature #'stencil = ##f
    \set Staff.keySignature = \xixNullKeySig
}

xixHacks =
{
    \set Staff.extraNatural = ##f
    \xixSetNullKeySig
}

global =
{
    \xixHacks
}

vna =
{
    g'1
}

vnb =
{
    ff'4 e' ef'4 ds'
}

vnc =
{
    c'1
}

\score
{
    <<
        \new Staff \with { midiInstrument = #"violin"} { << \global \vna >> }
        \new Staff \with { midiInstrument = #"violin"} { << \global \vnb >> }
        \new Staff \with { midiInstrument = #"violin"} { << \global \vnc >> }
    >>

    \layout { }
    \midi
    {
        \context
        {    \Staff
            \remove "Staff_performer"
        }
        \context
        {    \Voice
            \consists "Staff_performer"
        }
    }
} % score
%%%%%%%

                                          
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to