Hi Joel,
Thats correct- SinOsc is just a naive implementation of a sine wave. I
don't know that there is a reason for this other than simplicity.
In performance-sensitive situations I have recommended using either
MagicSine (if it is not necessary to change the freq/phase rapidly) or
Gen9/Gen10, which are sinusoid wavetables.
I have been interested in developing a chugin that is just a really
fast/mathematically accurate wavetable sine. If you'd be interested in
making something like that, or collaborating on it, that'd be very cool. If
we got that in good shape we could replace the default sine, if there is no
other reason to keep it the way it is.
spencer
On Thu, Sep 17, 2015 at 6:52 PM, Joel Matthys
Hello! I was looking through the source recently, and I was a little surprised to find that the SinOsc UGen performs a trig function every sample. I was under the impression that most osc implementations use a lookup table with interpolation because it's considerably more efficient.
Was this a specific design decision? Would there be support for revising SinOsc for efficiency if the audible result was indistinguishable?
Thanks, Joel _______________________________________________ chuck-dev mailing list chuck-dev@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-dev
-- Spencer Salazar Doctoral Candidate Center for Computer Research in Music and Acoustics Stanford University spencer@ccrma.stanford.edu +1 831.277.4654 https://ccrma.stanford.edu/~spencer/