[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Lily 2.7.7 and MIDI
From: |
Michael Welsh Duggan |
Subject: |
Re: Lily 2.7.7 and MIDI |
Date: |
Fri, 26 Aug 2005 15:31:28 -0400 |
User-agent: |
Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) |
Erik Sandberg <address@hidden> writes:
> On Wednesday 24 August 2005 08.59, Daniel Johnson wrote:
>> Hello all --
>>
>> I know that MIDI output was broken under 2.7.5 (and 2.7.6?). Is it
>> functional under 2.7.7? I'm running the 2.7 series now and I'd prefer
>> not to have to do a parallel installation of 2.6 just for the sake of MIDI.
>
> A quick test shows that it seems to work with latest CVS, but that the output
> is pretty broken. ({c4 d e f} => {c4*1/384 d e f} )
>
> You can subscribe to the info-lilypond list to see announcements for new 2.7
> versions, if you're lucky it will be mentioned when midi is fixed.
>
> I'm afraid the suggested solution to your problem otherwise is to use a
> parallel 2.6 installation.
I've been looking into this. The problem is twofold:
1) Time offsets devolve into "1"s (instead of "384"s). This is due to
the addition of Rational::operator bool(). A rational offset is
being converted to an int in Midi_event::to_string(). In the past,
this used numeric promotion to call Rational::operator double().
However, since the addition of Rational::operator bool(), it used
that instead. (C++ still has some int/bool confusion.) The simple
fix is to add a Rational::operator int(). A patch is included.
2) Audio_tempo objects are not being added to the Audio_staffs. This
results in the tempo not being passed to the midi file. In the
past, it was added by Staff_performer::play_element(Audio_element).
Now, however, Staff_performer does not have a specialized
play_element function, and Lilypond relies upon
Staff_performer::acknowledge_audio_element(Audio_element_info) to
add Audio_items to the Audio_staffs. This never gets called for
the track name or the tempo because these elements are generated by
Staff_performer::initialize(), and
Performer_group::acknowledge_audio_elements() doesn't pass the
elements to the origin Performer.
I don't know the right way to fix this (although I can come up with
plenty of gross hacks which would work), so I pass the question of
the correct way to fix this to the developers.
lilypond-midi-patch.diff
Description: Text Data
--
Michael Welsh Duggan
(address@hidden)
Re: Lily 2.7.7 and MIDI, Han-Wen Nienhuys, 2005/08/24