Rapidmidiex / rmxtui

1 stars 0 forks source link

MIDI Audio rendering panics when playing chords #5

Closed harveysanders closed 1 year ago

harveysanders commented 1 year ago

If more than one note is played at once, you'll get this error:

panic: runtime error: index out of range [1206] with length 1188            

goroutine 653 [running]:
github.com/sinshu/go-meltysynth/meltysynth.(*combFilter).process(0xc0040e7830, {0xc0040ee200, 0x40, 0x3ed2b8f6002c3a8e?}, {0xc0040ee300, 0x40, 0xc002695d68?})
        /github.com/sinshu/go-meltysynth@v0.0.0-20230125141251-0af16dc927d3/meltysynth/reverb.go:266 +0x1f0
github.com/sinshu/go-meltysynth/meltysynth.(*reverb).process(0xc0040d9c20, {0xc0040ee200, 0x40, 0x40}, {0xc0040ee300?, 0x40, 0x40}, {0xc0040ee400, 0x40, 0x40})
        /github.com/sinshu/go-meltysynth@v0.0.0-20230125141251-0af16dc927d3/meltysynth/reverb.go:146 +0xbc
github.com/sinshu/go-meltysynth/meltysynth.(*Synthesizer).renderBlock(0xc004076b00)
        /github.com/sinshu/go-meltysynth@v0.0.0-20230125141251-0af16dc927d3/meltysynth/synthesizer.go:394 +0x55b
github.com/sinshu/go-meltysynth/meltysynth.(*Synthesizer).Render(0xc004076b00, {0xc00256e000, 0x15888, 0xc002695e98?}, {0xc0025dc000, 0x15888, 0x10034cba0?})
        /github.com/sinshu/go-meltysynth@v0.0.0-20230125141251-0af16dc927d3/meltysynth/synthesizer.go:326 +0x71
github.com/rapidmidiex/rmxtui/midi.Player.Play({0xc00011b290?, 0xc004076b00?, 0xc00405d980?}, {0xc002695f84?, 0x18?, 0xc000100900?}, 0xc0040cfa00?)
        /github.com/rapidmidiex/rmx-tui-client/midi/midi.go:83 +0x8b
github.com/rapidmidiex/rmxtui/jamui.(*model).playMIDI.func1()
        /github.com/rapidmidiex/rmx-tui-client/jamui/jam.go:431 +0x130

https://github.com/sinshu/go-meltysynth/blob/bd68d4de740f37e996e5e5b84e80a72223626f71/meltysynth/reverb.go#L337 https://github.com/sinshu/go-meltysynth/blob/bd68d4de740f37e996e5e5b84e80a72223626f71/meltysynth/reverb.go#L146 https://github.com/sinshu/go-meltysynth/blob/bd68d4de740f37e996e5e5b84e80a72223626f71/meltysynth/synthesizer.go#L394 https://github.com/sinshu/go-meltysynth/blob/bd68d4de740f37e996e5e5b84e80a72223626f71/meltysynth/synthesizer.go#L326 p.synth.Render(streamer.left, streamer.right) https://github.com/Rapidmidiex/rmxtui/blob/feat/midi-to-audio/midi/midi.go#L83

Needs investigation

harveysanders commented 1 year ago

6