View Issue Details

IDProjectCategoryView StatusLast Update
0002132ardourbugspublic2020-04-19 20:13
Reporterhansfbaier Assigned Totimbyr  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
PlatformLinux Ubuntu studio gutsyOSLinuxOS Version 2.6.22-14-rt
Summary0002132: Saving MIDI region loses note off on last note in region / corrupted MIDI file format: premature EOF
DescriptionWhen saving a MIDI session, the note with the last start time
will lose its note-off in the MIDI-file.
When trying to convert the MIDI-file with midi2abc or open it
with rosegarden, the programs complain about premature EOF.
Steps To ReproduceMake a midi track
Make a midi region
paint a few notes
save
open the midi file with rosegarden or midi2abc
Additional InformationThe problem seems to be in SMFSource::append_event_unlocked
since I added cerrs MidiModel::write_to and all note offs seem to be written
from there
TagsNo tags attached.

Activities

hansfbaier

2008-03-23 17:13

reporter   ~0004805

The problem is in:
int
SMFSource::flush_footer()
{
    fseek(_fd, 0, SEEK_END);//seek_to_end();
    write_footer();
    //fseek(_fd, 0, SEEK_END);//seek_to_end();

    return 0;
}

When I have it like this, the last note end is not lost
and midi2abc and rosegarden can read it without errors.

The -4 offset in
void
SMFSource::seek_to_end()
{
    fseek(_fd, -4, SEEK_END);
}

which was used before seems to overwrite the last note off event.
Also, if that offset is used, the calculated length in the Track header
is 4 bytes too large.

timbyr

2008-04-14 12:45

developer   ~0004864

According to svn log this issue was fixed by reporter in branches/3.0@3211

system

2020-04-19 20:13

developer   ~0021661

Issue has been closed automatically, by Trigger Close Plugin.
Feel free to re-open with additional information if you think the issue is not resolved.

Issue History

Date Modified Username Field Change
2008-03-20 17:18 hansfbaier New Issue
2008-03-23 17:13 hansfbaier Note Added: 0004805
2008-04-14 12:45 timbyr Status new => resolved
2008-04-14 12:45 timbyr Fixed in Version => SVN/MIDI (trunk)
2008-04-14 12:45 timbyr Resolution open => fixed
2008-04-14 12:45 timbyr Assigned To => timbyr
2008-04-14 12:45 timbyr Note Added: 0004864
2020-04-19 20:13 system Note Added: 0021661
2020-04-19 20:13 system Status resolved => closed