## playing a few samples in once witout having volume raise

Sound synthesis techniques, DSP and related mathematics

Moderators: electrogear, exonerate

### playing a few samples in once witout having volume raise

This is a bit tricky. I'm trying a few approaches for building a multisample based instrument. In all methods, any time you play more than one note at once (=using polyphony), the overall output volume is raised, not quite like a "real" acoustic instrument. For example, on a real piano, you can hit 10 keys at once but the overall voume of the instrument is more or less the same. On the SM instrument, hit 10 keys and you get x10 the overall volume!

Any ideas ?
gilwe
essemer

Posts: 31
Joined: Mon Jul 03, 2006 9:36 pm

Playing ten keys on a real piano is surely louder than playing one, unless you hammer the one...

I posted what follows without testing the results... the problem with my initial thinking is as soon as you start releasing notes the volume goes back up in a very unnatural way.

...if you want to lower the overall volume based on the number of notes played you can do that by modulating the volume with an inverse value from the 'Trigger Counter' output from the Voices to Poly primitive inside the MIDI to Poly module.

That might cost a bit in CPU (though not very much) so you could also use the MIDI to Mono primitive which has an output that gives how many notes are active as green data. An inverse of this value could be used to control the volume in the poly or even mono section of the instrument.

Using a straight inverse will give you the reverse problem (diminishing overall volume with each extra voice) so you need to come up with some means of cutting the volume that is more tapered than that.

Try something like this:
oddson
wiki guru

Posts: 3883
Joined: Sun Jul 03, 2005 6:44 pm

You could do it by diminishing the velocity values while still in MIDI. Then the volume reduction is based on how many notes are active when the note on message is received and you don't get strange envelope changes.

diminishVelo.osm
oddson
wiki guru

Posts: 3883
Joined: Sun Jul 03, 2005 6:44 pm

This is a quite classic misconception.

You could in the digital case use a limiter, but it will sound unnatural.

The piano raises its total volume when you play more and more keys in almost the same way playing the same keys as samples in a virtual instrument does (there are of course more advanced physical processes going on, but overall, the volume will act the same).

FWIW, the volume does not get 10 times as loud when playing 10 different piano samples at once instead of just one More like, maybe around 9dB or something, which is about 2.8 times as loud, linearly speaking. You can however get peaks that are at values 10 times as high as when playing just one sample, but that applies in both the "real" and the virtual domain.
Stefan

stefan
smunatic

Posts: 2384
Joined: Wed Dec 15, 2004 9:24 pm
Location: Gothenburg, Sweden

I'm with Stefan on this point. While the velocity approach above does more or less what you've asked for I'm very skeptical that it is an improvement over doing nothing.
oddson
wiki guru

Posts: 3883
Joined: Sun Jul 03, 2005 6:44 pm

Thanks guys,

Sure a piano will sound louder, as any other software synth will, but I feel that the raise in level is a bit exaggerated on SM.

Will surely try oddson idea, although I thought that being a synth "maker", SM must have some more basic way to handle these issues...
gilwe
essemer

Posts: 31
Joined: Mon Jul 03, 2006 9:36 pm

gilwe wrote:Thanks guys,

Sure a piano will sound louder, as any other software synth will, but I feel that the raise in level is a bit exaggerated on SM.

Will surely try oddson idea, although I thought that being a synth "maker", SM must have some more basic way to handle these issues...

The raise is not exaggerated, it's just waveforms being added together Unless there's something odd going on in your specific scenario, but I doubt it. Keep in mind however that the total _perceived_ rise in volume depends on how the energy is spread over the spectra in the samples you are using.
Stefan

stefan
smunatic

Posts: 2384
Joined: Wed Dec 15, 2004 9:24 pm
Location: Gothenburg, Sweden

You're probably right.

I tried my project with *piano* samples instead of the drums samples I had there at first, and the behavior *does* sound more natural. Will keep checking into it. Thanks.
gilwe
essemer

Posts: 31
Joined: Mon Jul 03, 2006 9:36 pm