Output of VirtualMIDISynth MIDI Converter is not the same as the audio output of VirtualMidiSynth

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 !!!
Posts: 5
Joined: April 28, 2019 - 08:24
Output of VirtualMIDISynth MIDI Converter is not the same as the audio output of VirtualMidiSynth

I noticed a difference between the audio output of VirtualMidiSynth and the file output of the MIDI Converter.

When playing an audio, VirtualMIDISynth distorts the volume of the sound to avoid clipping.

When outputting a file, VirtualMIDISynth MIDI Converter does clipping. (assuming the standard format of 16-bit fixed point)

Outputting a file in floating point reveals that the sound sometimes goes outside the [-1,1) bounds. I think the peak (with the specific midi file and the specific soundfont that I tested) is about ±3.8765 (linear volume, not logarithmic dB). This volume is distorted to ±1 when playing an audio.

What's causing this difference quirk?

Posts: 1972
Joined: March 25, 2012 - 01:19
Re: Output of VirtualMIDISynth MIDI Converter is not the same as the audio output of VirtualMidiSynth

Starting from Windows 7 (or maybe Vista, I don't remember, exactly..) Microsoft introduced a builtin audio compressor on the analog audio device chain.

Lot of forums talk about it and propose some methods to reduce (or disable) it:
https://www.diyaudio.com/forums/pc-based/257844-disable-windows-7-sound-...
https://technicallyeasy.net/disable-audio-enhancements-windows-10/

In my experience the best way I've found to limit it is to decrease the Master volume to about 90% (and compensate it with my external amplifier...).
In VMS take a look at Master volume VUMeter and ensure it never reaches the red part.

Posts: 5
Joined: April 28, 2019 - 08:24
Re: Output of VirtualMIDISynth MIDI Converter is not the same as the audio output of VirtualMidiSynth
coolsoft wrote:

Starting from Windows 7 (or maybe Vista, I don't remember, exactly..) Microsoft introduced a builtin audio compressor on the analog audio device chain.

Lot of forums talk about it and propose some methods to reduce (or disable) it:
https://www.diyaudio.com/forums/pc-based/257844-disable-windows-7-sound-...
https://technicallyeasy.net/disable-audio-enhancements-windows-10/

In my experience the best way I've found to limit it is to decrease the Master volume to about 90% (and compensate it with my external amplifier...).
In VMS take a look at Master volume VUMeter and ensure it never reaches the red part.

How does "90%" achieve much, if levels of audio can reach above 400%? (okay it does depend on the exact midi file and the exact soundfont used)

there are 2 files: midirendersound.wav which is the fixed point output of the played sound of the MIDI, and midirenderconverted.wav which is the floating point output of the converter. Note how the played sound has distorted volume, and the converted version has a peak of about 478.31% which would obviously be clipped when played.

Attachments (Only registered users)
midirenderconverted.zip
midirendersound.zip
Posts: 1972
Joined: March 25, 2012 - 01:19
Re: Output of VirtualMIDISynth MIDI Converter is not the same as the audio output of VirtualMidiSynth

Have you tried to convert MIDI while VMS Master volume (on VMS MIDI Mixer) is set at 80-90%.
Or, another way, set the soundfont volume below 100%.

Does it make the rendered file better?

Posts: 5
Joined: April 28, 2019 - 08:24
Re: Output of VirtualMIDISynth MIDI Converter is not the same as the audio output of VirtualMidiSynth
coolsoft wrote:
Have you tried to convert MIDI while VMS Master volume (on VMS MIDI Mixer) is set at 80-90%.
    Or, another way, set the soundfont volume below 100%.
Does it make the rendered file better?

Why would I slightly miscalibrate the volume setting to remove 10% of the volume distortion (while playing) or volume clipping (while exporting)? This doesn't make sense. At a correctly calibrated setting of 100%, sounds with a total volume above 100% get distorted to 100% while playing, but their volume is preserved while exporting, but only in floating point. When exporting in anything else than floating point, the exporting tool generates clipping artifacts, without any warning of that coming.

Posts: 1972
Joined: March 25, 2012 - 01:19
Re: Output of VirtualMIDISynth MIDI Converter is not the same as the audio output of VirtualMidiSynth
Piotr Grochowski wrote:
Why would I slightly miscalibrate the volume setting to remove 10% of the volume distortion (while playing) or volume clipping (while exporting)?

When I've said "reduce to 90%" I meant "reduce to 90%, then 80%, then 70%..." to find the best value that leads to undistorted output.

VirtualMIDISynth play is less affected to distortion, because Windows Audio subsystem has a built-in compressor (as I wrote above); MIDI Converter, instead, has some kind of "direct output" which should not be compressed at all.

I suppose there's something unusual in your soundfont and/or the MIDI file.
Feel free to post their name/links (if freely available) so I can test them on my side and have a look.

Beware: I'm not such an expert in SF2 internals, but maybe someone more expert than me (@Falcosoft ;)) could jump in.

Posts: 5
Joined: April 28, 2019 - 08:24
Re: Output of VirtualMIDISynth MIDI Converter is not the same as the audio output of VirtualMidiSynth

" When I've said "reduce to 90%" I meant "reduce to 90%, then 80%, then 70%..." to find the best value that leads to undistorted output. "
Again, why would I miscalibrate my volume? Doesn't a post-processing normalization do the same thing?

" I suppose there's something unusual in your soundfont and/or the MIDI file.
Feel free to post their name/links (if freely available) so I can test them on my side and have a look. "

There isn't anything wrong with the soundfont https://musical-artifacts.com/artifacts/727

There isn't anything wrong with the midi files http://midkar.com/classical/classical_04.html

I don't think the midi specification forbids the total volume of active notes to exceed 1. When 4 notes of volume 1 play at the same time, the overall volume will be 4 which would be either clipped or distorted while playing.

Posts: 4
Joined: March 23, 2020 - 20:17
Re: Output of VirtualMIDISynth MIDI Converter is not the same as the audio output of VirtualMidiSynth
coolsoft wrote:

Starting from Windows 7 (or maybe Vista, I don't remember, exactly..) Microsoft introduced a builtin audio compressor on the analog audio device chain.

Lot of forums talk about it and propose some methods to reduce (or disable) it:
https://www.diyaudio.com/forums/pc-based/257844-disable-windows-7-sound-...
https://technicallyeasy.net/disable-audio-enhancements-windows-10/

In my experience the best way I've found to limit it is to decrease the Master volume to about 90% (and compensate it with my external amplifier...).
In VMS take a look at Master volume VUMeter and ensure it never reaches the red part.

I'd appreciate very much if you implement a clipping protection for the converter.

Posts: 1972
Joined: March 25, 2012 - 01:19
Re: Output of VirtualMIDISynth MIDI Converter is not the same as the audio output of VirtualMidiSynth
Nguyen 1 wrote:
I'd appreciate very much if you implement a clipping protection for the converter.

Well, it requires the converter to pre-analyze the MIDI (like converting it in-memory) to find peaks, then decrease volume and retry again till it finds an unclipped volume level.

This additional conversion will greatly increase conversion time, and most of the times it's useless...

AFAIR there's no way to get the actual volume during the conversion, because it's not done in realtime like VMS MIDI live play (where the MIDI Mixer polls MIDI synth to get instant volume level).