Amplitude Scaling Stratregies

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

Hi guys!
As some of you may know i'm a newbie developer coming from csound, pd, synthedit ;) background....
i'm in the process to deal with vst sdk and dsp stuff...very early stage...
i have a question
when you do a polyphonic synth how do you scale the output signal so if i play 2 or more notes at full amp
the signal does'nt clip or distort?
in a mono synth is a fixed thing...but if you have a poly stuff how do you do 'dynamic' scaling in relation to the number of voices played?
thanx
lalo
ps : please be simple in explanations ;)
thnax again
lalo

Post

how do you scale the output signal so if i play 2 or more notes at full amp the signal does'nt clip or distort?
I don't.
Just add them.

Post

So is the SDK itself to take care about that stuff?

Post

Normaly you have something like a master volume. It's up to the user to get that right.

BTW, normaly you don't hit they keay as heavy as you can all the time.

Post

helium wrote:
how do you scale the output signal so if i play 2 or more notes at full amp the signal does'nt clip or distort?
I don't.
Just add them.
Yeah,
but this seems to be exactly the reason for many many commercial and free software synthesizers to distort the output finally (nearly 90 percent of them).

On most of them You have to reduce the volume manually if you play only one chord... and then the voices will be very quiet in the solo parts then... You finally need a person who tweeks the mixers all the time...

Whatever, you will not find such a bad realization on any digital hardware synthesizer...

So there should be a somehow better solution for a quality plugin.

If you don't reduce the volume on mixing, there must be at least a breakwall limiter at the end, or better a good maximizer, which scales down the peaks on playing with higher polyphony.

To say, this is by the user to do so (eat or die) is unprofessional, in my opinion.



:idea:
Last edited by blümchen on Wed Mar 24, 2004 12:54 pm, edited 2 times in total.

Post

Yeah,
but this seems to be exactly the reason for many many commercial and free software synthesizers to distort the output finally (nearly 90 percent of them).
Why should it distore? We use 32 Bit floating point numbers according to IEEE's standard. 1.0 is 0dB. This format can hold numbers up to 10^38. So if you don't have a very high polyphony ( ;) ) it won't distore.
Only thw host's output is cliped, but you have a mixer in most (all?) hosts, so you can control the volume even if you synth doesn't have a main volume control.

And now think about real instruments. If you hit two keys on a piano does the piano play more quietly than when you hit only one? If you play two strings on your guitar does it play more quietly than if you play only one? ...
The anser is clearly NO. And why should electronical or virtual instruments behave different to "real" instruments (you know what I mean by real)?

Post

breakwall limiter
I know brickwall limiter but ... :D
To say, this is by the user to do so (eat or die) is unprofessional, in my opinion.
Not reducing the volume is IMHO the most professional thing you can do.
What would it sound like if you would. you play a single note and than add another one and suddenly the volume of the first one is attenuated?
If a synth hardware or software would do this I wouldn't buy it.

Post

helium wrote:
Yeah,
but this seems to be exactly the reason for many many commercial and free software synthesizers to distort the output finally (nearly 90 percent of them).
Why should it distore? We use 32 Bit floating point numbers according to IEEE's standard. 1.0 is 0dB. This format can hold numbers up to 10^38. So if you don't have a very high polyphony ( ;) ) it won't distore.
Only thw host's output is cliped, but you have a mixer in most (all?) hosts, so you can control the volume even if you synth doesn't have a main volume control.

And now think about real instruments. If you hit two keys on a piano does the piano play more quietly than when you hit only one? If you play two strings on your guitar does it play more quietly than if you play only one? ...
The anser is clearly NO. And why should electronical or virtual instruments behave different to "real" instruments (you know what I mean by real)?

I spoke about digital distortion (clipping).

BY THE WAY:

There are some hosts out there (Orion and FruityLoops for instance), which cut the level of all VSTI's simply at the 0db mark, which finally leads all the times to digital distorted sound. This is an other unprofessional behavior ...


Whatever, this don't happen on Cubase, Nuendo or Logic.

To force th user to control the volumes all the time manually is really not a good solution, I think.

:!:

Post

helium wrote:
breakwall limiter
I know brickwall limiter but ... :D
To say, this is by the user to do so (eat or die) is unprofessional, in my opinion.
Not reducing the volume is IMHO the most professional thing you can do.
What would it sound like if you would. you play a single note and than add another one and suddenly the volume of the first one is attenuated?
If a synth hardware or software would do this I wouldn't buy it.
Exactly right.

So there must be obviously a "professional" solution for this, finally.

How do you think, work 128 x polyphonic samplers ???

If they wouldn't reduce the final volume somehow internally, you had some problems to play them...

:!:

Post

helium wrote: And now think about real instruments. If you hit two keys on a piano does the piano play more quietly than when you hit only one? If you play two strings on your guitar does it play more quietly than if you play only one? ...
The anser is clearly NO. And why should electronical or virtual instruments behave different to "real" instruments (you know what I mean by real)?
This claim has no substance.
Are you an audio engineer?
You should do some research finally. Take an exact messurement of a polyphonic and dynamically playing piano. You will clearly get some new experiences...

This was even the problem on early recordings of classical instruments and orchestras for instance...

The dynamic range of real instruments lies far above the dynamical range of a digital domain.

There is some heavy knowledge and very good technique necessary to record such "analog events" finally with high quality.

The lack of digital simulations of acoustic instruments is always the lost of the dynamic range and the acoustic "room informations".

But this is a complete different theme.

:!:

Post

Hi guys!
thanx for the replys...
anyway i mean digital clipping inside the synth algorhythm path.....we have i.e. an internal resolution of 16 bit...so if i play 2 notes at a time both at full
amplitude (1111 1111 1111 1111 this is what i mean)
how can i avoid the clipping?...i think with a kind of auto-amplitude-scaling.....make it sense?...some developer experience in this area ?
thanx
lalo

Post

lalo wrote:Hi guys!
As some of you may know i'm a newbie developer coming from csound, pd, synthedit ;) background....
i'm in the process to deal with vst sdk and dsp stuff...very early stage...
i have a question
when you do a polyphonic synth how do you scale the output signal so if i play 2 or more notes at full amp
the signal does'nt clip or distort?
in a mono synth is a fixed thing...but if you have a poly stuff how do you do 'dynamic' scaling in relation to the number of voices played?
thanx
lalo
ps : please be simple in explanations ;)
thnax again
lalo
A good first start would be to reduce the volume of the oscillators in general. So it is not a good idea to perform a 32 polyphonic synth with each oscillator normalized to 0db.

Second would be the implementation of a simple but good limiter at the end of the channel output.

Perhaps a compressor with adjustable "punch" or a saturation unit could do this job too.

A bad idea would be to implement a kind of dynamic volume reducing on key trigger, because this finlly would lead into unnatural reducing the dynamic range.

:wink:

Post

The dynamic range of real instruments lies far above the dynamical range of a digital domain.
To use your words: This claim has no substance.

If you use 32 bit floating point numbers your range is -749.37042165915489752492182421894 dB(FS) to 770.62957834084510247507817578106 dB(FS). With which analog medium do you get this dynamic range? And you could easly extend it by using 64 bit numbers.

anyway i mean digital clipping inside the synth algorhythm path.....we have i.e. an internal resolution of 16 bit..
Nobody uses 16 bit integral values to represent the signal if you don't have to. Use 32 bit floats (in C++ the datatype is called float).
Second would be the implementation of a simple but good limiter at the end of the channel output.

Perhaps a compressor with adjustable "punch" or a saturation unit could do this job too.
When you record something in the real world, what do you do? You use a compressor/limiter. Is it built into the microfone? No. So let's do the same with virtual instruments and everybody is happy.
Last edited by helium on Wed Mar 24, 2004 3:17 pm, edited 1 time in total.

Post

lalo wrote:Hi guys!
thanx for the replys...
anyway i mean digital clipping inside the synth algorhythm path.....we have i.e. an internal resolution of 16 bit...so if i play 2 notes at a time both at full
amplitude (1111 1111 1111 1111 this is what i mean)
how can i avoid the clipping?...i think with a kind of auto-amplitude-scaling.....make it sense?...some developer experience in this area ?
thanx
lalo
Please imagine, that you wouldn't get the exactly double volume in reality with this theorem...

Why?
Normally you don't play notes exactly with the same amplitude, pitch and phase at ones.

This means, if you trigger polyphonic chords with 4 notes with a keyboard for instance, you will NOT get a loudness 4 times above the amplitude of the base note with this finally (it will be clearly less).

You have to consider the phases and the pitch of the 4 waveforms then.

There is a matimatical way to exactly calculate this. But I recommend to do it more approximateley, this also gives you better performance at the end.

:wink:

Post

helium wrote:When you record somethin in the real world, what do you do? You use a compressor/limiter. Is it built into the microfone? No. So let's do the same with virtual instruments and everybody is happy.
We want not record enything here, but construct a (polyphonic) synthesizer.

You know?

Did You ever program and release a commercial polyphonic synthesizer or sampler?

I did. Many.

BTW: "So let's do the same with virtual instruments and everybody is happy" ...

Even not. NOBODY would be happy with a clipping polyphonic synthesizer / sampler.

A synthesizer is not a microphone and should be able to create or reproduce sounds with highest quality. Digital cutting and clipping and forcing the user to manually adjust the levels each time he is playing another phrase is not that kind of "quality" we expect.

:wink:
Last edited by blümchen on Wed Mar 24, 2004 2:06 pm, edited 1 time in total.

Post Reply

Return to “DSP and Plugin Development”