Everything about the Pre-Amp value!!!

Started by LPChip, October 15, 2006, 17:29:28

Previous topic - Next topic

LPChip

Today, Rewbs, Atlantis and I were having a nice discussion.

Based on the bug .45 Plugin levels screw up DXM plugin, we've got into a discussion on why it happened and such. This in particulair because Rewbs didn't seem to have this problem.

As it turned out, its all about the pre-amp value. In a past, a few comparisments gave as result that setting the preamp to max with a global volume of 64 creates very good circumstances to make music, as the levels would be at an ideal situation. The thing however is, that the way MPT handles the preamp levels and global volume, becomes an issue in certain situations. One of the issues is the bug, described above.

In order to go in-depth about how and why, first a few facts.

When you apply a DirectX plugin, Modplug will send the sound to the plugin, which does calculations, and then send its output back to modplug.

This is also the case with VST plugins, except that the DirectX plugin architecture does not allow the sound to go past 100% clipping point. So what basically happens, is that the sound inside of the plugin is being capped to produce 100% volume at max, where in a VST plugin, the volume can rise above it without causing clipping.

The reason behind this has everythign to do with both the plugin levels aswell as the pre-amp settings.

As you may know, we started with Original Plugin levels. This resulted in having volume twice as loud as intended, which was caused by a bug in the code. Pre-amp was actually there to bypass that bug. RC1 was going to fix this, but due to a typo it didn't do it 2x but 16x.

RC2 was going to fix it for good and make it as it supposed to be.

This is what RC2 plugin levels do:

MPT has a sample with a given volume. This sample is being amplified by the pre-amp setting, to alter the volume of the sample. It is then being send through the effects plugin. When it comes out the effects plugin, the Global volume will alter the end volume.

As you can see, its now easy to explain why the bug occurs.

I had the pre-amp at max with a global volume of 64.

With a vst, this happens:

sample is being amplified to extreme values, the vst does calculations with it, and the global volume reduces it back to normal values.

However, with DX plugins the following happens:

sample is being amplified to extrene values, the dx plugin does calculations, detects the output to be clipping like madness, and therefor reducing the output in such way that it sounds all destorted and such (eg. compressing) and the global volume then reduces it back to normal volume, except that due to the dx plugin, its not normal anymore.

With this knowledge, Rewbs, Atlantis and I were doing some tests.

It seems that a Pre-Amp value of about 33% (to 33.3333%) in conjunction to a global volume of 128 gets the perfect non-clipping range to make your music in.

For that reason, I recommend to use a Pre-Amp value of 33% at all times, with a combination of a global volume of 128.

Rewbs will make an RC3 plugin levels setting that will override the pre-amp value to 33% (the exact value is yet unknown, but it will result in a perfect 0.0 clip level.
"Heh, maybe I should've joined the compo only because it would've meant I wouldn't have had to worry about a damn EQ or compressor for a change. " - Atlantis
"yes.. I think in this case it was wishful thinking: MPT is makng my life hard so it must be wrong" - Rewbs

Atlantis

I'm still going to have to look into this a bit more tomorrow, but just to follow up on some of your points:

Yes, in the past (MPT 1.16), setting the Pre-Amp to full, and leaving the global volume at 128 gave a maximum output of -9.1 dB, which is an ideal situation for mixing most styles of music (the loudest instrument would get this level, i.e. a channel volume of 64, if the sample originally peaks at 0.0 dB, and the instrument and sample volumes are left at 64).

Based on the test I did earlier (OpenMPT1.17RC2), this output seems to have changed to -8.9 dB now (when using a global volume of 64 however), so there's another question for you...

About the DX architecture, what is "100% clipping", anyway? If you mean 0.0 dB, how does the level even get that high? I guess this would be something I need to look into still.

Now I'm not sure about DX effects, nor VST effects for that matter, but the Pre-Amp doesn't actually amplify the volume - it only scales it. As it is now (OpenMPT1.17RC2), a global volume of 128 and a Pre-Amp setting of full produces an output of -2.9 dB if the input sample peaks at 0.0 dB (and with all volumes on full), so it's not actually amplifying it...

As for setting the Pre-Amp to "33%", as far as I can tell this produces an output of around -13.0 dB, so wouldn't it be better to just set it closer to one step down from the middle line (thereby achieving the recommended -9.5 dB level)? Or in other words, 19 steps up from the bottom. Then again, I'm still not sure how the levels are handled internally, nor with DX effects for that matter, so I'll go over this all again tomorrow.

Finally, why would you even want to achieve a "perfect 0.0 dB clip"? What if it was an EQ effect, and you boosted the level higher?

What we want for RC3 (or at least I think so) is for the internal volume to be multiplied by 0.3333% to reduce the level by -9.54 dB, which is then fed into the plugin process (which is still well below clipping, and should allow for sufficient gain), and then further scaled down by the global volume (which would be 128 by default).

Well, this post is probably taking us back in circles again, so maybe I should just read our conversation again and do some more testing tomorrow. :)
Put an end to the loudness war. Don't limit or compress your mixdown until mastering; leave the master channel alone.

http://www.facebook.com/atlanteanrecords

LPChip

I'm not good with technical stuff, but when comparing with my music, setting preamp to 33 % with a global volume of 128, my song seems to sound the best. These have plugins, but also have been tuned on my old setting. Its true, I haven't changed the volume settings and volumes sound different, but it doesn't clip.

I'll do further testing myself to see if the preamp can be raised, but as rewbs pointed out in our conversation, setting pre-amp to about 33% is equally to no preamp at all.

I also think that if no preamp is being used, plugins have lower values to work with, which could result in a little better cpu management. Maybe a bad theory, but why not?

calculating with values under 10 is easier than with values under 1000 right?
"Heh, maybe I should've joined the compo only because it would've meant I wouldn't have had to worry about a damn EQ or compressor for a change. " - Atlantis
"yes.. I think in this case it was wishful thinking: MPT is makng my life hard so it must be wrong" - Rewbs

XAVT

Aren`t you a programmer lp?
I dont see how would lower volume levels effect the cpu as the lower the levels are the "higher" the db number that represents them is. Besides, I seriously doubt that the difference in cpu power needed to calculate 10s or 1000s is significantly different. Finally, don`t forget that this whole thing would later on have to be amplified, thus consuming our dear cpu again ;)

From what I gather you`ve descovered that working with certain volume levels in combination with VST`s can produce unwanted distortion.

I suggest you think about it a lil` more before posting ;)
A cigarette a day keeps the doctor at bay.
A joint a week makes him look unique.

speed-goddamn-focus

I'm a bit unsure about Atlantis' specified levels, aren't they depending on the number of channels?

Also, is there really a need for the preamp setting? There's already global volume, channel volume, a couple of sample volumes, instrument volume, VSTi volume and plugin gain.

rewbs

I have to admit that here are a couple of things irritating me here:

-. This should not be an announcement: it is a normal discussion topic. The top of this forum is already crowded enough! :)
-. The original post makes things sound a lot more complex than they really are. Here's the story:

1. The original MPT had an issue by which the volume of samples was halved before being sent to plugins. The output of plugins was then doubled, masking the problem to some extent.

2. Those who noticed plugins were not receiving the correct level found they could resolve this by pumping up the general "pre-amp" setting, which boosts sample volumes (or more precisely ends up diminishing the amount of standard attenuation) before any plugin processing occurs.

3. In 1.17 RC2, we fixed the volume-halving bug. Therefore leaving the pre-amp pumped up can cause higher levels to reach the plugs, which might result in saturation.

4. Additionally, the 1.17RC2 mix mode fixes the global volume so that it is applied after plugin processing. Anything below 128 global volume will lower the overall final output.

5. If you are upset or confused by the fixes in 1.17RC2, you can emulate the original MPT by using the original mix mode.

That's all you really need to know.
A little more info here: http://openmpt.xwiki.com/xwiki/bin/view/Manual/SongProperties#HPluginLevels


We did have further discussions around this topic, of which the conclusions were:
1. We should introduce a new mix mode (probably called RC3) in which pre-amp is disabled, global volume defaults to 128, and the sampler attenuation is less obscure, i.e. it defaults to approx -10.0db (thanks for the suggestion Atlantis) and is explicitly adjustable with less parameters all over the place.
2.We should address any backwards compatibility issues this entails. Exactly what this requires is TBD but so far we have done a pretty damn good job at providing options to preserve backwards compat, imho.

rewbs

Quote from: "speed-goddamn-focus"I'm a bit unsure about Atlantis' specified levels, aren't they depending on the number of channels?
There are several attenuation steps spread out in various places in the code. One is a fixed 16x downscale, one is indeed dependent on the number of channels (though it becomes fixed from 31 chans). And of course the levels also gets thrashed around by the parameters you list, plus envelopes, all the panning parameters, ramping, and probably some more.

This resulting opaqueness is source of confusion.

LPChip

Well said Rewbs. Sometimes it can be so hard to say something so easy :)

2Xavt, no need to tell me that i have to think before posting... We had a discussion that went over for about 2 hours, with lots of information. It was hard to make a good post out of it. I'm not that much of a programmer. Just a little webdevelopment.

Rewbs explained how the levels work but due to that I'm using windows messenger atm, I didn't have the history of the chat, and couldn't look up what was said.
"Heh, maybe I should've joined the compo only because it would've meant I wouldn't have had to worry about a damn EQ or compressor for a change. " - Atlantis
"yes.. I think in this case it was wishful thinking: MPT is makng my life hard so it must be wrong" - Rewbs

Atlantis

Quote from: "speed-goddamn-focus"I'm a bit unsure about Atlantis' specified levels, aren't they depending on the number of channels?
Sure, but I'm talking about the loudest instrument (with the highest peak level), on which you'll base the rest of the mix, and which should take the mix level to around -3.0 dB (which you can of course increase during mastering). At least, that's when you start out with your kick around -8.0 dB in dance music, but for most other styles it will be around -10.0 dB (the kick usually being the highest peaking instrument).

QuoteAlso, is there really a need for the preamp setting? There's already global volume, channel volume, a couple of sample volumes, instrument volume, VSTi volume and plugin gain.
I think we all agreed on that.
Put an end to the loudness war. Don't limit or compress your mixdown until mastering; leave the master channel alone.

http://www.facebook.com/atlanteanrecords

Snu

as much as i am for backwards compatability... i really think once we get the 'correct' mixing levels in the program, we should remove all the extra nonsense (pre amp, different mixing level presets), as they will only serve to confuse 99.99% of users, who would have no use for those...

that being said, if there are those that insist, perhaps there could remain an option in the .ini file, and it could merely be removed from the options dialogs...
but, i think that for whatever works in progress there are that are set to use a nonstandard mixing level, one could have an old version of mpt installed as well.
also, there is the point that this IS a beta version, no changes are guarenteed final as is the essence of a beta.

LPChip

As for removing the plugin levels...

On one hand, I agree on you, whilst on the other hand, I don't. :)

Indeed, we don't need the older plugin levels for new songs, but what about old songs that you still want to play in MPT?

Hiding the setting perhaps is a nice idea.
"Heh, maybe I should've joined the compo only because it would've meant I wouldn't have had to worry about a damn EQ or compressor for a change. " - Atlantis
"yes.. I think in this case it was wishful thinking: MPT is makng my life hard so it must be wrong" - Rewbs

speed-goddamn-focus

Quote from: "LPChip"but what about old songs that you still want to play in MPT?

Keep your old version of MPT for those.

Quote from: "Atlantis"Sure, but I'm talking about the loudest instrument (with the highest peak level), on which you'll base the rest of the mix, and which should take the mix level to around -3.0 dB (which you can of course increase during mastering).
I think you misinterpret me, if you read rewbs post perhaps you'll get my point (which is that levels vary depending on circumstances such as thte number of channels in the mod).

Asharin

I've always left the pre-amp setting alone :p
I am Dyslexic of Borg, resemblance is fertile, your ass will be laminated.

LPChip

Quote from: "Asharin"I've always left the pre-amp setting alone :p

I'm not sure if the setting is good by default though...
"Heh, maybe I should've joined the compo only because it would've meant I wouldn't have had to worry about a damn EQ or compressor for a change. " - Atlantis
"yes.. I think in this case it was wishful thinking: MPT is makng my life hard so it must be wrong" - Rewbs

Atlantis

Quote from: "speed-goddamn-focus"
Quote from: "Atlantis"Sure, but I'm talking about the loudest instrument (with the highest peak level), on which you'll base the rest of the mix, and which should take the mix level to around -3.0 dB (which you can of course increase during mastering).
I think you misinterpret me, if you read rewbs post perhaps you'll get my point (which is that levels vary depending on circumstances such as thte number of channels in the mod).
I see what you mean now. I wasn't even aware of that, and this would complicate things even more. I really don't see why would you want to downscale based on the number of channels though.
Put an end to the loudness war. Don't limit or compress your mixdown until mastering; leave the master channel alone.

http://www.facebook.com/atlanteanrecords