Closed nwolek closed 8 years ago
Good question. Makes my head hurt a little. I'm thinking I may have stepped into an old trap/habit of mine where I let "perfect" be the enemy of "good". But this is incremental development: we can always do something and then change it if reality dictates...
So in both this case and the interpolation case, I would say that if there is motivation to pursue one direction or the other that we should just do it. Then we can evaluate something in concrete terms, and refactoring (if needed at all) will be easier with something legit from which to start.
That said, I'm attracted to the idea that we could fill a std::vector or a CircularBuffer or a SampleVector or a SampleBundle or std::array each with e.g. a cosine wave using the same algorithm. YMMV
I am actually investigating this very thing by leveraging std::generate. Whatever I do, I will keep in a branch for you to review and comment.
Perfect!
@tap - Please take a look at the work so far on branch issue/68
. This is showing a lot of promise in my initial tests! A couple of questions I have for you:
std::generate
function. "fill" and "generate" seem to be key terms.Sample
. If you have any insight into the right syntax for this, please let me know. Working on the review right now. Being a little picky. Some of my questions might sound rhetorical but they are not. For example, the struct vs class question.
I completely agree that we should not use "fill" terminology but instead "generate" terminology so that we are in alignment with the STL standard.
It ended-up being easier to express myself in code than in comments about code. Hopefully I haven't over-stepped!
Nope. It looks like you pushed things forward in exactly the places I was stuck! Thanks!!!
Talk to you in the morning.
List of algorithms we had in Jamoma1's SampleMatrix:
In this case, "Mod" really means unipolar. I know this term is used in Roads CMT, therefore I would suggest we adopt this term.
Another reference here are the fill/apply methods for the buffer~ object. Specifically I'm thinking of the sinc
function and also of only generating half of the wave.
Perhaps we should think of unipolar and generating half the wave as well as the frequency as attributes/parameters of the generators?
This work is migrating to JamomaGenerator.h
All shapes from SampleMatrix now implemented. Opening new issues for remaining shapes discussed with @tap.
Found in code for
Jamoma::Sample
:Would seem to be a prerequisite to implementing a Wavetable object (issue #5).
Some of the recent discussion about interpolation may impact the way this is designed (issue #43). i.e. If we decide that interpolation should be outside the data container, does that mean the same thing for fill operations?