Wavetable synthesis. theory, practice, fear?

DSP, Plug-in and Host development discussion.
mystran
KVRAF
4981 posts since 12 Feb, 2006 from Helsinki, Finland

Post Tue May 15, 2018 4:04 pm

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. :)
If you'd like Signaldust to return, please ask Katinka Tuisku to resign.

stratum
KVRAF
1842 posts since 29 May, 2012

Re: Wavetable synthesis. theory, practice, fear?

Post Wed May 16, 2018 1:31 am

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~

LiteX2
KVRer
13 posts since 3 May, 2018

Re: Wavetable synthesis. theory, practice, fear?

Post Sat May 19, 2018 6:33 am

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. :)

Return to “DSP and Plug-in Development”