Closed lukephills closed 9 years ago
I wasn't having this issue on Chrome, but when i tested it with Safari, I heard what you're referring to. The LFO was in fact being forced into a square wave shape. I traced this problem to discrepancies between the WaveShaperNode on the two platforms, specifically in Tone.AudioToGain which uses a WaveShaper to map incoming values between [-1, 1] to a range of [0, 1]. I think i've fixed the problem and i'll be committing those changes shortly.
What you're describing sounds right except it was happening for us in chrome. I copied in the commit but that didn't change anything. I haven't tested on your dev branch yet so maybe I'm missing some other LFO or WaveShaper changes.
When the depth is above 1, the square wave is inevitable with the current logic. The depth controls the deviation from the delayTime in each of the LFOs, so when the depth is above 1, they are trying to modulate to negative delayTime values and instead it just stops at 0.
I can add some logic to keep the min delayTime above 0 which will give you a smooth oscillation, but the depth and delayTime values will not really be accurate anymore if i do this since the effect will be equivalent to increasing the delayTime and decreasing the depth. Though, maybe this is the best path to go since modulating to a negative delayTime is undefined behavior.
Try a chorus and set it's depth to something above 1 and you can hear that one of the LFOs aren't smoothly oscillating. It sounds a bit like it's set to a pulse wave.
Previously you used to be able to set the depth and delaytime high values and it would add interesting harmonies which sounded great.