by Hisymak » Sat Apr 14, 2018 5:53 pm
I'm bumping this because I have a clue what might be the cause of note cutoff issues.
Basically there's difference between old (MUSLIB's) "findFreeChannel" function and the new (Chocolate Doom's ?) "findFreeVoice" function logic.
It seems that the old function "findFreeChannel" was trying to some sort of magic like "give me the least recently used OPL voice", but the new function "findFreeVoice" is just very simple and gives the first OPL voice which is marked "free". And that does not work well.
The OPL voice is marked free, once there's a "note off" event. However after note off, the OPL voice is entering "Release" state, which is still playing a sound (it's fading off). And when there is adjacent note just after the previous note, the "note on" event tries to find first free OPL voice, and it finds the same voice as previous note was playing on, and breaks the previous note's release state - that's the audible note cut-off.
I think you will need to re-implement the logic of "findFreeChannel" function to fix this.
Not sure if it's the only problem, there can be more, but I'm trying to direct you. I would really appreciate if you try to fix this, because OPL Synth emulator is the key feature in GZDoom for me.
I created some MIDI files for analysis of this problem. I can provide the MIDI examples and more information if it will help you.
Thank you!
I'm bumping this because I have a clue what might be the cause of note cutoff issues.
Basically there's difference between old (MUSLIB's) "findFreeChannel" function and the new (Chocolate Doom's ?) "findFreeVoice" function logic.
It seems that the old function "findFreeChannel" was trying to some sort of magic like "give me the least recently used OPL voice", but the new function "findFreeVoice" is just very simple and gives the first OPL voice which is marked "free". And that does not work well.
The OPL voice is marked free, once there's a "note off" event. However after note off, the OPL voice is entering "Release" state, which is still playing a sound (it's fading off). And when there is adjacent note just after the previous note, the "note on" event tries to find first free OPL voice, and it finds the same voice as previous note was playing on, and breaks the previous note's release state - that's the audible note cut-off.
I think you will need to re-implement the logic of "findFreeChannel" function to fix this.
Not sure if it's the only problem, there can be more, but I'm trying to direct you. I would really appreciate if you try to fix this, because OPL Synth emulator is the key feature in GZDoom for me.
I created some MIDI files for analysis of this problem. I can provide the MIDI examples and more information if it will help you.
Thank you!