Page 1 of 1

DSP frequency generator amplitude

Posted: Tue Jul 09, 2019 2:05 pm
by S.Muse
Hi,
it's my first post here, hello to everybody!

I've recently bought FC8 and I'm playing with the DSP components.

Please, which is the proper way to control the FreqGenerator wave amplitude with a potentiometer?
so that 0V gives zero amplitude, and 5V full amplitude?

I've been trying with the Scale DSP component without good results,
the closest I can get is to actually scale the input waveform, but unfortunately it becomes also completely distorted when I watch it in the data recorder...

Thanks in advance for your time and patience with such newbie question.
cheers!
Sandro

Re: DSP frequency generator amplitude

Posted: Tue Jul 09, 2019 3:26 pm
by Benj
Hello Sandro,

Welcome to the forums. Can you attach what you have done so far and we will have a look for you and hopefully point you back in the right direction.

Re: DSP frequency generator amplitude

Posted: Tue Jul 09, 2019 5:00 pm
by S.Muse
Hi Benj,
thanks for your quick reply.
Here is my file attached.

Red potentiometer is the sine wave rate, and the blue one should be the sine wave amplitude control, from zero to unity gain.
I'm trying to use the Scale DSP component, have tried any macro within it, but without getting close to the desired behaviour.

I suspect I should do something to the blue potentiometer reading before using it with the Scale DSP, but can't figure out what to do.
many thanks for your help!

Re: DSP frequency generator amplitude

Posted: Wed Jul 10, 2019 10:28 am
by Benj
Hello,

It looks like the scale maths is going a bit strange for signed buffers in the simulator. I've changed the buffers to be unsigned and changed the parameters of the sine wave generator and now it is hopefully working as expected.
LFO.fcfx
(14.57 KiB) Downloaded 243 times
Let me know how you get on.

Re: DSP frequency generator amplitude

Posted: Wed Jul 10, 2019 5:22 pm
by S.Muse
Thanks Benj !
Will try it tonight,
thank you very much.
best
Sandro

Re: DSP frequency generator amplitude

Posted: Thu Jul 11, 2019 2:19 pm
by S.Muse
Hi Benj

the code was perfect, thank you very much.
I've also added an offset control, using a Sum DSP component... and it works!!

Now I'm trying to use one of the DSP buffers as a float variable,
please which would be the standard procedure to do so?

Re: DSP frequency generator amplitude

Posted: Thu Jul 11, 2019 2:37 pm
by Benj
Hello,

Brilliant, glad it's working correctly for you now.

The easiest way is to use an DSP output component and read the value into a float variable. Once there you can do any floating point calculations required.