DSPRelated.com
Forums

amplitude moduallation

Started by chinglnc April 24, 2008
Hi there, 

Can anyone explain why this code is not right for amplitude modulation
vst?
(steinberg kit)

Trem= (1- fDepth) + fDepth * (sin ((2 * PI * 10)* getSampleRate())
chinglnc wrote:
> Hi there, > > Can anyone explain why this code is not right for amplitude modulation > vst? > (steinberg kit) > > Trem= (1- fDepth) + fDepth * (sin ((2 * PI * 10)* getSampleRate())
At a guess I'd say you probably want: Trem = (1 - fDepth) + fDepth * (sin ((2 * PI * 10) / getSampleRate()) Paul
it's not working either.....
chinglnc wrote:
> it's not working either.....
If you want help then you'll need to supply a little more information. Paul
Hi, 

I have my sine modulator working by putting in the counter....

however, I'm now having problem with my sawtooth..i just can't get the
logic right.......help please......i heard loads of glitches and
distortion..


float sRate = getSampleRate();
float Trem  ;
long cycleDur, cycleDur_half; 	

cycleDur= (1/fFreq* sRate);
cycleDur_half= cycleDur/2;
    
while(--sampleFrames >= 0)
    {
       
if (counter < cycleDur-1)
    {

      counter ++;

     }
	
*out1 = *out2=  Trem * (*in1+ *in2);

Trem= (1- fDepth) + fDepth * (fFreq*10)* (counter/sRate);
		
Buffer[iWrite] = *in1 + *in2;

Hi, 

I have my sine modulator working by putting in the counter....

however, I'm now having problem with my sawtooth..i just can't get the
logic right.......help please......i heard loads of glitches and
distortion..


float sRate = getSampleRate();
float Trem  ;
long cycleDur, cycleDur_half; 	

cycleDur= (1/fFreq* sRate);
cycleDur_half= cycleDur/2;
    
while(--sampleFrames >= 0)
    {
       
if (counter < cycleDur-1)
    {

      counter ++;

     }
	
*out1 = *out2=  Trem * (*in1+ *in2);

Trem= (1- fDepth) + fDepth * (fFreq*10)* (counter/sRate);
		
Buffer[iWrite] = *in1 + *in2;