"Additional output buffer" causes distortion when greater than 0

Please let our ADS show!

This sites offers only FREE software and it's supported by a few advertisement boxes (no intrusive popups).
Please:

  • disable your AdBlocker by adding CoolSoft website to whitelist
  • give the proper cookie consent
  • enable JavaScript for this website

This seconds wait is to let you update your browser configuration...

Ok, I've done the required changes... now show me your content!
!!! Please enable JavaScript !!!

Pages

Posts: 8
Joined: December 1, 2022 - 20:35
"Additional output buffer" causes distortion when greater than 0

Here is a video demonstrating this issue. Listen to the stretched notes during song changes. FSMP (also uses BASSMIDI) and MS GS Wavetable Synth do not have this issue.

Posts: 1972
Joined: March 25, 2012 - 01:19
Re: "Additional output buffer" causes distortion when greater than 0

Could you please check if the same bug happens with the newly released version (2.13.4)?
It features an updated BASS library version so, maybe, it will fix the bug.

If not, please let me know...

Posts: 8
Joined: December 1, 2022 - 20:35
Re: "Additional output buffer" causes distortion when greater than 0

2.13.4 doesn't fix the problem but it seems to be the way VirtualMIDISynth responds to midiStreamStop() or midiOutReset(). Maybe VirtualMIDISynth is holding onto buffers instead of releasing them.

Posts: 8
Joined: December 1, 2022 - 20:35
Re: "Additional output buffer" causes distortion when greater than 0

I confirmed that sending midiStreamStop() followed by midiOutReset() causes the problem. Sending midiStreamStop() then manually sending "all notes off" and "reset all controllers" to each channel (this is what midiOutReset() does) is the workaround. Only VirtualMIDISynth needs this workaround.

Posts: 1972
Joined: March 25, 2012 - 01:19
Re: "Additional output buffer" causes distortion when greater than 0
ceski wrote:
Here is a video demonstrating this issue. Listen to the stretched notes during song changes. FSMP (also uses BASSMIDI) and MS GS Wavetable Synth do not have this issue.

First of all, thank you very much for your detailed report and analysis.

ceski wrote:
it seems to be the way VirtualMIDISynth responds to midiStreamStop() or midiOutReset().

This is what I've found so far with these debug steps:

  1. created a test client that opens VMS device with midiStreamOpen()
  2. called midiStreamStop() on test program
  3. from MS docs: "The midiStreamStop() function turns off all notes on all MIDI channels for the specified MIDI output device."
    So I was expecting a lot of NoteOFF messages but... none of them comes in.
    VMS only received 16 x CC#64 message (sustain pedal, one for each MIDI channel) and nothing else.
  4. I've also tried to manually send a NoteON immediately followed by midiStreamStop() (supposing it will only silence the currently playing notes) but it had the same effect as single midiStreamStop() call.
  5. next I've called midiOutReset() on test program
  6. VMS received a MODM_RESET message, which is handled (I suppose) correctly by turning off all notes, resetting controllers and shutting down BASS library stream.
ceski wrote:
I confirmed that sending midiStreamStop() followed by midiOutReset() causes the problem

Is this what Doom does? (haven't checked it out...).
If yes, I wonder why they call those two (almost similar) functions in a row.
They should call one or the other, not both of them... Am I missing something 🙄?

ceski wrote:
Sending midiStreamStop() then manually sending "all notes off" and "reset all controllers" to each channel (this is what midiOutReset() does) is the workaround. Only VirtualMIDISynth needs this workaround.

Could it be because the "others" don't manage CC#64 the same way as BASS does?

Posts: 8
Joined: December 1, 2022 - 20:35
Re: "Additional output buffer" causes distortion when greater than 0

Here is a very simple test for playing three notes with the same problem. Here is the source code and .exe.

Posts: 8
Joined: December 1, 2022 - 20:35
Re: "Additional output buffer" causes distortion when greater than 0

Here is the same test but with the first note delayed by 20 ticks (~166 ms). Here is the source code and .exe. Seems to work with the delay, but it shouldn't be needed, right?

Posts: 1972
Joined: March 25, 2012 - 01:19
Re: "Additional output buffer" causes distortion when greater than 0
ceski wrote:

Here is a very simple test for playing three notes with the same problem. Here is the source code and .exe.

I was able to reproduce the bug on my side, thanks to your test code 👍.

Now I'm going to remove the elements from the MIDI chain one by one, to find what's wrong:
TestProgram --> Windows MIDI Layer (WinMM) --> VMS Driver --> VMS Synth --> BASS Library

I suppose that the bug is in BASS (because it does not happen with buffer=0, and buffer is a BASS thing), but I'd like to give Un4seen (the author of BASS) a test environment as simple as possible.

Posts: 129
Joined: September 25, 2013 - 16:38
Re: "Additional output buffer" causes distortion when greater than 0
coolsoft wrote:

I suppose that the bug is in BASS (because it does not happen with buffer=0, and buffer is a BASS thing)...

I have seen the first test video from OP and noticed that he also uses my FSMP. Maybe he could try to set  the "Buffer (Latency)" slider to the same value in FSMP as in VMS. I think "Buffer (Latency)" in FSMP is the same as "Additional buffer" in VMS. This way it could be determined if the problem is a general Bass/Bassmidi problem or not.

Posts: 1972
Joined: March 25, 2012 - 01:19
Re: "Additional output buffer" causes distortion when greater than 0

@falcosoft: AdditionalBuffer setting in VMS is applied to the BASS MIDI stream like this:

BASS_SetConfig(BASS_CONFIG_BUFFER, additionalBuffer);

@ceski: it should be great if you could do the test suggested by @falcosoft.
If you get the same bug in FSMP, then the issue is related to BASS/BASSMIDI and I (we) can involve Un4seen into this.
Otherwise it's a VMS bug and it's up to me to fix it 🙄

Pages