lilypond-user
[Top][All Lists]
Advanced

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

Re: Pitch-bent note's release-phase


From: Graham Breed
Subject: Re: Pitch-bent note's release-phase
Date: Sun, 19 Jun 2011 21:03:41 +0100

Richard Sabey <address@hidden> wrote:

> But you don't need this problem when a note allocated to
> a channel is followed by a rest in that channel. Is
> Lilypond writing a MIDI "pitch wheel change" message to
> take effect at the same instant as the MIDI "note off"
> message? If I'm right (I don't know of any app which
> converts a .mid file into a form I could understand -
> perhaps I'll have to write a C program myself!) then I
> think that Lilypond could produce better MIDI if it sent
> "pitch wheel change" messages only "on demand", i.e.
> together with "note on" messages, but not also with "note
> off" messages.

Yes, it does what you say.  It makes the implementation
simpler, on the assumption that pitch bends are going to be
rare.

What I have, hot of the presses, is a script that can take
a MIDI file produced by Lilypond and convert the pitch
bends into MIDI Tuning Standard messages.  It's a widely
ignored standard, but it works with Timidity at least.
Then there's no problem with the tails, and no need to
split chords into independent polyphonic lines.  You can
get it for your favorite version of Python.

Python 2.6+:

http://x31eq.com/addmts.py

Python 3:

http://x31eq.com/addmts.py3

It's a hack, but it works with what I've thrown at it.
There is a problem, in that if two notes are assigned to
the same MIDI key (even in different voices) they'll have
the same tuning.  That makes it possible for C and C# to
become confused.

This highlights an interesting feature of Lilypond's pitch
bend support.  The pitch is always rounded *down* to the
next lowest equally tempered value, and then the pitch bend
applied *upwards*.  That means, for meantone temperaments
where C-C# is less than 100 cents, C and C# will, indeed,
end up with the same key number.  It would make sense if
the pitch were rounded to the *nearest* equally tempered
value instead.  I don't know if this is in the issue
tracker.

If you want to keep pitch bends, it would be fairly easy to
hack my script to write one before every note-on instead of
the MTS message.


                           Graham (not that one)



reply via email to

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