[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: grace notes break preceding ties in MIDI
From: |
Adam Spiers |
Subject: |
Re: grace notes break preceding ties in MIDI |
Date: |
Sun, 13 Jan 2013 17:27:05 +0000 |
On Sun, Jan 13, 2013 at 4:40 PM, Adam Spiers
<address@hidden> wrote:
> On Sat, Jan 12, 2013 at 12:52 PM, Adam Spiers <address@hidden> wrote:
>> On Tue, Jan 8, 2013 at 5:59 PM, Adam Spiers <address@hidden> wrote:
>>> On Tue, Jan 8, 2013 at 5:41 PM, Eluze <address@hidden> wrote:
>>>> I've added an issue to the tracker:
>>>> https://code.google.com/p/lilypond/issues/detail?id=3091&thanks=3091&ts=1357666391
[snipped]
> I have finally pinned this down! And I'm close to a fix. The culprit
> is in Midi_walker::process():
>
> if (note->audio_->length_mom_.to_bool ())
> do_start_note (note);
>
> This to_bool () check is too simplistic. Here is the explanation ...
[snipped]
> I believe a reasonable approach would be to use a different check:
>
> if (note->audio_->length_mom_.main_part_ ||
> note->audio_->length_mom_.grace_part_.sign () == 1)
> do_start_note (note);
>
> It may even warrant a new Audio_note::is_positive_duration() method
> which could be used here.
>
> Thoughts?
>
> However, this suggested workaround is not sufficient by itself - there
> is a related issue with the ordering of NoteOff events which I'm
> working on now.
Addressing the related issue led me to a better, single fix for both.
The real problem is that \grace causes the immediately preceding
Audio_note (or Audio_notes if the \grace follows a chord) to be
shortened, but it fails to check whether the Audio_note is part of a
tie.
I have published my fix here and will submit to Rietveld soon:
https://github.com/aspiers/lilypond/commits/tie-grace-fix