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

Postby gilwe on Wed Jan 16, 2008 12:39 am

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

Postby oddson on Wed Jan 16, 2008 1:38 am

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:
Image
oddson
wiki guru
 
Posts: 3883
Joined: Sun Jul 03, 2005 6:44 pm

Postby oddson on Wed Jan 16, 2008 1:51 am

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

Postby stefan on Wed Jan 16, 2008 7:30 am

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
User avatar
stefan
smunatic
 
Posts: 2384
Joined: Wed Dec 15, 2004 9:24 pm
Location: Gothenburg, Sweden

Postby oddson on Wed Jan 16, 2008 8:37 pm

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

Postby gilwe on Thu Jan 17, 2008 10:10 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

Postby stefan on Fri Jan 18, 2008 7:43 am

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
User avatar
stefan
smunatic
 
Posts: 2384
Joined: Wed Dec 15, 2004 9:24 pm
Location: Gothenburg, Sweden

Postby gilwe on Sat Jan 19, 2008 3:06 am

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


Return to Sound

Who is online

Users browsing this forum: No registered users and 0 guests