I'm using the AnalogOscillator & DigitalOscillator classes as LFOs. But I can't figure out how to set their phase, or the point where the waveform starts.
When I create a new oscillator, set the frequency, and start reading the values, the DigitalOscillator always starts from the beginning of the cycle, and the AnalogOscillator from a more or less random position (I guess it's simulating a freerunning osc?). The GetCycle() method runs from 0 to 1 when the oscillator completes one cycle, which makes sense. One would assume that SetCycle(x) would then set the position in the cycle (or phase), but no matter how much I call it, it seems to do absolutely nothing... the oscillator just keeps running.
Did I miss something obvious here? Help!
(BTW, is there a reason why the methods of the VM classes start with a capital letter? My understanding is that the standard is to start with a lowercase letter, ie. setCycle() instead of SetCycle(). Not a biggie, just interested... I constantly write it wrong in my code. Old habits... )
Oscillator phase & SetCycle()
Re: Oscillator phase & SetCycle()
I've had the same problem. I've implemented lots of features in my modules, but I simply haven't been able to figure out how to reset the phase of oscillators with SetCycle(). My understanding is that it should set the phase, with 0-1 mapping to 0-360, but I've tried calling it in every way that I could think of, and nothing had any effect. It was driving me crazy, so I put it aside for the time being, but I'm glad to know I'm not the only one not getting it. Perhaps someone from Cherry Audio could provide a specific example of how to use this in code? I think it would be really helpful. I'm sure it is one of those things that *should* be obvious, but apparently it isn't and we're just missing something.
Re: Oscillator phase & SetCycle()
Same problem here.
The development documentation too basic for a seriuous development, and il lacks of detailed info about the methods that can be invoked.
There is a method that I'm currently trying, without success, that is the .ResetCycle(). Anyway it is not listed.
What I'm doing is to set the new cycle and after reset the oscillator to keep this new value.
The development documentation too basic for a seriuous development, and il lacks of detailed info about the methods that can be invoked.
There is a method that I'm currently trying, without success, that is the .ResetCycle(). Anyway it is not listed.
What I'm doing is to set the new cycle and after reset the oscillator to keep this new value.
Re: Oscillator phase & SetCycle()
Good to know I'm not alone. Yeah, ResetCycle() is a good find. Looks like it actually resets the cycle to the beginning, but still, I also couldn't find a way to set the cycle/phase freely to any position. We really need better documentation, it's frustrating to try to guess how something works, only to find out that it doesn't seem to work at all. And without documentation, you can't be sure if there's a bug, or if you are doing something wrong.
CA guys, "You are doing it wrong, do it like this", or "There's a bug, we'll fix it" would be super helpful.
CA guys, "You are doing it wrong, do it like this", or "There's a bug, we'll fix it" would be super helpful.
-
- Site Admin
- Posts: 257
- Joined: Fri Jul 27, 2018 5:36 pm
Re: Oscillator phase & SetCycle()
Good catch everyone - the SetCycle() function was broken due to a silly mistake, and has been fixed for a future release. (We have a new build (1.3.1) scheduled for possible release this week, and this fix is unfortunately not included.)
Thanks for catching this! Also, we didn't realize that ResetCycle() wasn't in the Library. This function has been added to the Library in Module Designer.
Dan
Thanks for catching this! Also, we didn't realize that ResetCycle() wasn't in the Library. This function has been added to the Library in Module Designer.
Dan
Re: Oscillator phase & SetCycle()
Great! Good to know a fix is on the way Thanks!
-
- Site Admin
- Posts: 257
- Joined: Fri Jul 27, 2018 5:36 pm
Re: Oscillator phase & SetCycle()
All,
SetCycle is fixed in the new VM 1.3.3 release. Thanks again for bringing this to our attention!
Dan
SetCycle is fixed in the new VM 1.3.3 release. Thanks again for bringing this to our attention!
Dan
Re: Oscillator phase & SetCycle()
So it is! You are welcome, and thanks for the fix! Life (or at least the module coding part of it) is much easier now...