-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How should we handle sample interpolation? #43
Comments
Trying to review this and clarify what I meant here. I was basically wishing that interpolation be part of the functionality built into using SampleVector = std::vector; That gives us both operator[] and at() functions. These return a reference to the element at a specific index. I would propose a function like the following that provides element access with interpolation baked in: Jamoma::SampleVector sv (3); sv[0] = 0.0; sv[1] = 1.0; sv[2] = 1.5; Jamoma::Sample interp_out1 = sv.value_at(0.5); // output should be 0.5 Jamoma::Sample interp_out1 = sv.value_at(1.5); // output should be 1.25 My instinct tells me putting it at such a low level would be very DRY. This would greatly simplify other tasks, such as our recent discussions about Delays and issue #60. However, I notice that this uses @tap: Any thoughts? Reaction? |
I like the gist of this. I wonder if one can overload the [] operator for floats. If so, then it could be as easy as
Questions:
I don't know if it is possible to do the following, or if we need to think about some other syntax.
Hmmm... Thinking more about the wrapping at the ends dependent on type and the allpass maybe also dependent on something or another I wonder if the interpolation should be outside of the data container and then applied to it. This would be consistent with the "STL Algorithms":http://en.cppreference.com/w/cpp/algorithm which are defined so that they can be applied to any of the standard data containers. ? |
I like this syntax very much:
It seems very clear what is going on. Compare that to the way things are now:
We push the burden for figuring out a lot of things into the SampleVector class itself. NOTE: one reason I suggested |
In the following issue from JamomaCore, we talked a bit about interpolation from the TTSampleMatrix:
jamoma/JamomaCore#127
Probably not an urgent priority, but @tap and I should have a discussion about how we want to address this with the new SampleBundle model before we go too far down the road. I don't think interpolation should be completely the users' responsibility.
My initial instinct: only ImmutableSampleBundles should have methods for pulling samples that are interpolated. Not sure if that is feasible though.
The text was updated successfully, but these errors were encountered: