Mantis - Squeak
Viewing Issue Advanced Details
2381 Files minor always 12-18-05 22:39 12-18-05 22:48
Eddie Cottongim  
cdegroot  
normal  
assigned 3.9  
open  
none    
none  
0002381: [BUG] MidiFileReader can't handle certain MIDI files
A few midi files throw an error(below) when loaded in squeak, but read fine with other players. I'm not sure if this some unsupported MIDI feature, a bad file, or what, but we can at least tolerate it. I put a 'isNotNil' test around the problem area and the files will read now.

A problem file is included.
UndefinedObject(Object)>>doesNotUnderstand: #'>='
MIDIFileReader>>readTrackEvents
MIDIFileReader>>readTrackContents:
MIDIFileReader>>readTrackChunk
[] in MIDIFileReader>>readMIDIFrom: {[self readTrackChunk]}
SmallInteger(Integer)>>timesRepeat:
MIDIFileReader>>readMIDIFrom:
[] in ScorePlayerMorph class>>playMidiFile: {[:midiReader | f := (FileStream oldFileNamed: fullName) binary. score := (...]}
SystemDictionary(Dictionary)>>at:ifPresent:
ScorePlayerMorph class>>playMidiFile:
SimpleServiceEntry>>performServiceFor:
[] in MenuItemMorph>>invokeWithEvent: {[(selArgCount := selector numArgs) = 0 ifTrue: [target perform: selector] ...]}
BlockContext>>ensure:
CursorWithMask(Cursor)>>showWhile:
MenuItemMorph>>invokeWithEvent:
MenuItemMorph>>mouseUp:
MenuItemMorph>>handleMouseUp:
MouseButtonEvent>>sentTo:
MenuItemMorph(Morph)>>handleEvent:
MorphicEventDispatcher>>dispatchDefault:with:

 horde1.mid.gz [^] (11,753 bytes) 12-18-05 22:39
 midibadbytefix-efc.1.cs.gz [^] (989 bytes) 12-18-05 22:47

Notes
(0003344)
Eddie Cottongim   
12-18-05 22:48   
Attached file avoids the problem by adding a check for nil. I'd rather know why the nil is being thrown, but don't have time to check now.