Additive synthesis with different envelope for each partial

diaseis's icon

Hello !
I want to model a variety of instruments and I have for each of them :
* the frequencies of all the harmonics
* the amplitude factor for each of the frequencies
*an exponential curve to apply to each harmonics

And I would like to hear how it sounds on Max. I tried to use oscbank~ but I only manged to have the timber of the sound but not the envelope of the sound, since I cannot vary the amplitude (well I could, but that would mean generate all the exponential curves into one curve and I have not a clue how to do it).

So my question is : is there a better object than oscbank~ to do that? Or oscbank~ is enough
and I do it wrong?

Thanks for your help :D

Roman Thilenius's icon


oscbank is a great object unless you want to have different envelopes for every partial.

that would require patching everything parallel or using poly.

there is a little trick, which is kind of a compromise:
if you are okay with all time values of the envelopes beeing identical, you could set up 3 oscbank objects, A, D, and R, set the volumes for the "envelope" as you wish, and then blend through them.

;)

diaseis's icon

Thanks for the answer !
So I only need the Decay part : attack is null and I don't do release. However I don't see how you use oscbank to generate a set of decreasing exponentials since oscbanks generates only sine waveforms.
So, sorry for asking but can you be a little more specific on the trick you suggest? I must have missed something.

Roman Thilenius's icon


hm, well, when you need to have different time values for decay per oscillator it might not work this way.

but here is the basic idea.

of course it can be made better, for example it doesnt use equal power yet for the crossmixer.

#P user meter~ 270 558 350 571 50 0 168 0 103 103 103 255 153 0 255 0 0 217 217 0 153 186 0 12 3 3 3 3;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 116 271 273 9109513 phase of the envelope;
#P comment 116 92 273 9109513 magnitude points of the envelope;
#P message 700 245 64 9109513 1. \, 0. 2000.;
#P user meter~ 230 340 310 353 50 0 168 0 103 103 103 255 153 0 255 0 0 217 217 0 153 186 0 12 3 3 3 3;
#P user meter~ 360 384 440 397 50 0 168 0 103 103 103 255 153 0 255 0 0 217 217 0 153 186 0 12 3 3 3 3;
#P newex 242 528 78 9109513 *~ 0.;
#B color 5;
#P newex 566 508 78 9109513 !=~ 0.;
#B color 5;
#P newex 408 312 78 9109513 !-~ 1.;
#B color 5;
#P newex 205 312 78 9109513 *~ 0.;
#B color 5;
#P newex 339 356 78 9109513 *~ 0.;
#B color 5;
#P newex 623 291 78 9109513 line~ 0.5;
#B color 5;
#P message 623 244 64 9109513 1. \, 0. 300.;
#P newex 741 103 103 9109513 loadbang;
#P newex 389 182 150 9109513 oscbank~ 32 128 128;
#P toggle 144 554 15 0;
#P message 389 123 128 9109513 set 440. 0.1 550 0.001;
#P message 204 123 128 9109513 set 440. 0.1 550. 0.1;
#P newex 201 570 50 9109513 dac~;
#P newex 204 182 150 9109513 oscbank~ 32 128 128;
#P user panel 109 262 476 150;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 109 84 476 150;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P connect 15 0 3 0;
#P connect 15 0 3 1;
#P connect 15 0 21 0;
#P connect 11 0 15 0;
#P connect 11 0 16 0;
#P connect 12 0 17 0;
#P connect 12 0 15 0;
#P connect 6 0 3 0;
#P connect 8 0 4 0;
#P connect 4 0 2 0;
#P connect 2 0 12 0;
#P connect 10 0 12 1;
#P connect 14 0 15 1;
#P connect 7 0 11 0;
#P connect 8 0 5 0;
#P connect 5 0 7 0;
#P connect 13 0 11 1;
#P connect 10 0 13 0;
#P connect 10 0 14 0;
#P connect 18 0 10 0;
#P connect 9 0 10 0;
#P window clipboard copycount 22;

diaseis's icon

Thanks a lot ! I don't understand it right now but I will study more deeply this week end because right now I'm in a rush.