OneLoneCoder / synth

The latest code to make your own virtual sound synthesizer in Windows. Please see the videos associated with this code. Links in the source files.
http://www.onelonecoder.com
350 stars 128 forks source link

Wrong algorithm for LFO ? (Maybe) #5

Open iOSBrett opened 4 years ago

iOSBrett commented 4 years ago

I don't run Windows so I haven't actually tried running your code, but I was doing my own Synth and looked at your code and I think the following algorithm has an error in the LFO section.

FTYPE dFreq = w(dHertz) dTime + dLFOAmplitude dHertz (sin(w(dLFOHertz) dTime));

I don't think the second dHertz should be there. I think this is why you are using a DFLO Amplitude of 0.001 later as you are trying to cancel out the extra dHertz multiplication.

I could be completely wrong and sorry for doing the "I haven't run your code, but..."