Wavetable synthesis. theory, practice, fear?

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

earlevel wrote:
mystran wrote:What would be wrong with this:

Code: Select all

return wave->data[int(wave->size * phase)]
     - wave->data[int(wave->size * offsetPhase)];
For what it's worth, I actually spent a little bit of effort to try to make sure to use names that would result in the correct mental associations, which also making it as easy as possible to parse visually.
Nothing wrong with it. For me, a sample has a size (16-bit, etc.), and a buffer of samples has a length, but no big deal. Maybe due to decades of C (sizeof, strlen, etc.). Anyway, like I said, I word things a little differently for examples, and maybe "waveTable->waveTableLen" is over-explaining, but hey. I stress enough about the wording of my articles ;-)
Well... i suppose you could choose "length" just as well, but STL likes to use "size()" so I went with that. :)

Post

Well... i suppose you could choose "length" just as well, but STL likes to use "size()" so I went with that. :)
STL is work of Russian hackers in their own style :lol:
~stratum~

Post

In defense of everybody who has ever coded anything - naming is hard! And as I am reminded daily when refactoring my old code: it may very well be a lot easier to write code than it is to read it. Maybe this is one of the reasons people always seem to want to create new "better" languages. :)

Post Reply

Return to “DSP and Plugin Development”