sinshu / go-meltysynth

A SoundFont MIDI synthesizer written in pure Golang
Other
60 stars 9 forks source link

main panics processing flourish.mid on MacOS Monterey #2

Closed Michael-F-Ellis closed 1 year ago

Michael-F-Ellis commented 1 year ago

Overall, the code looks like nice work, however, I can't get the demo app (main.go) to run on MacOS Monterey. It builds with no error but panics while trying process flourish.mid. Seems like the []times slice is coming up empty.

michaels-mbp go-meltysynth % ./go-meltysynth  
panic: runtime error: invalid memory address or nil pointer dereference  
\[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x1089c0d\]  
goroutine 1 \[running\]:  
github.com/sinshu/go-meltysynth/meltysynth.(\*MidiFile).GetLength(...)  
    /Users/mellis/go-meltysynth/meltysynth/midifile.go:368  
main.flourish()  
    /Users/mellis/go-meltysynth/main.go:70 +0x14d  
main.main()  
    /Users/mellis/go-meltysynth/main.go:15 +0x1c

Also, it would make life easier for folks who want to try it out if the main app didn't reference specific .sf2 and .mid files. At the very least, it should check the error return from os.Open().

System: Model Name: MacBook Pro Model Identifier: MacBookPro11,4 Processor Name: Quad-Core Intel Core i7 Processor Speed: 2.2 GHz Memory: 16 GB OS: Darwin Kernel Version 21.6.0: Sun Nov 6 23:31:16 PST 2022; root:xnu-8020.240.14~1/RELEASE_X86_64 x86_64

sinshu commented 1 year ago

This was resolved in the PR #1. Please reopen the issue if you still have the problem.