Hello everyone, i am trying to build the additive synthesis module like illustrated in this example. https://faust.grame.fr/doc/tutorials/#additive-synthesis
The thing is that the normalization applied at the end of the signal (dividing by the number of harmonics) prevents overloading but in the same time reduces drastically the level output if the energy in the spectrum is low. So instead of dividing by number of harmonics, i choose to divide by ba.slidingRMSn to prevent overloading and maintain the level ouput. And here are my questions. - using slidingRMSn, is this the "good" way to normalize ouput knowing i want to maintain the level output even if i drop some harmonic's energy? in the documentation, we got: usage _ : slidingRMSn(N,maxN) : _ - What is the purpose of maxN ? - N has to be different of maxN ? - And last question, how i choose N ? I tought i should do that: next_power_of_2(Fs / 2*lowest frequency) but that doesn't work well at low frequency. So i did that instead: next_power_of_2(Fs / lowest frequency) works fine but don't know really why here is a sample of my code: additiveSynth = freq <: par(i,nHarmonics,oscilator(i)):>_<:_,(_ : ba.slidingRMSn(512,512)) : _/_ :> _*gain : envelope with{ freq = vgroup("[0]control",hgroup("params",hslider("fundamental[style:knob]",440,125,3000,0.01))); gain = vgroup("[0]control",hgroup("params",hslider("gain[style:knob]",-10,0,-100,0.01): ba.db2linear(_))); gate = vgroup("[1]control",button("gate")); envelope = _*en.asr(0.35,1,0.35,gate); nHarmonics = 10; }; I thank you for you help bests Benoit
_______________________________________________ Faudiostream-users mailing list Faudiostream-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/faudiostream-users