Author Topic: Previous BASS_MIDI_NOTEOFF1 related fix problem  (Read 365 times)

Falcosoft

  • Posts: 200
Hi Ian,
You seem to have changed the behavior of the mentioned flag. I would like to report that this change made the overall behavior worse than before and less compatible with Yamaha/Roland gears.
Previously (tested on Bassmidi v2.4.12.1 and v2.4.14.1) when the BASS_MIDI_NOTEOFF1 flag was enabled it only affected notes that had not finished playing fully. Now Bassmidi remembers missing Note Offs and the flag affects notes that start to play even when all previous notes have finished playing.
I have made a test file to demonstrate the issue. Compare the playback to any Yamaha/Roland HW or soft synths and older vs. current beta Bassmidi.
In case of older Bassmidi and Yamaha/Roland gears the note that starts to play at 00:14.00 finishes right since it has a corresponding Note Off event. Contrary on newest beta version of Bassmidi the Note at 00:14.00 is sustained and Note Off is ignored since there was a missing Note Off after the Note On at  00:02.00.
So this change results in more hanging notes than previously that cannot be reproduced on older Bassmidi and on Yamaha/Roland gears.

Soundfont for testing:
https://falcosoft.hu/reality_gmgs_falcomod.zip

@Edit:
It seems the situation is not so black and white as I suspected. The original SC-55 seems to handle the situation the same way as newest beta Bassmidi while e.g. S-YXG50 and Roland/Edirol Virtual Sound Canvas work the same way as older Basmmidi versions.
And MS GM/GS soft synth works like Bassmidi without the BASS_MIDI_NOTEOFF1 flag enabled...

@Edit2:
Sorry, my last correction was wrong, even the original SC-55 works the same way as old Bassmidi versions but the piano has a longer release phase so you have to wait longer than in my test file the last note waits. In case of newest beta Bassmidi you can wait forever, it still remembers the missing Note Off. 
 
« Last Edit: 10 Jun '24 - 19:00 by Falcosoft »

Ian @ un4seen

  • Administrator
  • Posts: 26028
Re: Previous BASS_MIDI_NOTEOFF1 related fix problem
« Reply #1 on: 11 Jun '24 - 13:33 »
Previously (tested on Bassmidi v2.4.12.1 and v2.4.14.1) when the BASS_MIDI_NOTEOFF1 flag was enabled it only affected notes that had not finished playing fully. Now Bassmidi remembers missing Note Offs and the flag affects notes that start to play even when all previous notes have finished playing.

Doesn't the latter seem more logical and reliable? As you noted with the SC-55 piano, the old system results may vary depending on the soundfont, while the new system should always have the same result. So MIDI files that are sounding OK with the old system might not still do so with a different soundfont. Do you have any real world MIDI files that are broken by the change? If so, please upload them to have a look at.

Btw, the change was introduced in response to the issue here:

   www.un4seen.com/forum/?topic=20035.msg139995#msg139995

Falcosoft

  • Posts: 200
Re: Previous BASS_MIDI_NOTEOFF1 related fix problem
« Reply #2 on: 11 Jun '24 - 15:22 »
Previously (tested on Bassmidi v2.4.12.1 and v2.4.14.1) when the BASS_MIDI_NOTEOFF1 flag was enabled it only affected notes that had not finished playing fully. Now Bassmidi remembers missing Note Offs and the flag affects notes that start to play even when all previous notes have finished playing.

Doesn't the latter seem more logical and reliable? As you noted with the SC-55 piano, the old system results may vary depending on the soundfont, while the new system should always have the same result. So MIDI files that are sounding OK with the old system might not still do so with a different soundfont. Do you have any real world MIDI files that are broken by the change? If so, please upload them to have a look at.

Btw, the change was introduced in response to the issue here:

   www.un4seen.com/forum/?topic=20035.msg139995#msg139995

The point is it's rather difficult to reproduce the problem that's why I created the test file.
I have noticed the change when I played some badly programmed Midi files (with fewer Note Off than Note On events) and I have noticed that contrary to older versions the missing Note Off events can affect later Midi files until SysEx reset or All Notes Off controller messages are sent. So the problem is not with specific Midi files but that earlier missing Note Off events can affect later (so far problem free) Midi files.
It's true that the current implementation is more consistent but it does not resemble any existing implementations.
But I do not want to argue. If you feel this is a more logical implementation then I can get used to it.
In all of my software the user can send reset messages manually if this problem happens.
« Last Edit: 11 Jun '24 - 15:31 by Falcosoft »

Ian @ un4seen

  • Administrator
  • Posts: 26028
Re: Previous BASS_MIDI_NOTEOFF1 related fix problem
« Reply #3 on: 12 Jun '24 - 13:55 »
I see. So the issue in your case, where multiple MIDI files may be played through the same stream, is that a dodgy MIDI file with missing note-offs could affect the next MIDI file too (if there's no reset events). The way the new BASS_MIDI_NOTEOFF1 system works is that each channel keeps a history of the last 128 notes, and any notes older than that (with the same key) will be released by a note-off along with the oldest one still in the history (if there is one). So any unreleased notes won't actually affect things forever. The note history could perhaps be made smaller to have older notes released sooner. Let me know if you have any other ideas.