-
Notifications
You must be signed in to change notification settings - Fork 757
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
Plugins: Choose Index.ar calc function based on phase arg #3436
Plugins: Choose Index.ar calc function based on phase arg #3436
Conversation
Index_next_a() is clearly meant for an audio-rate *index* input, not an audio-rate bufnum input. Same for IndexL, FoldIndex, WrapIndex, IndexInBetween and DetectIndex.
I am working on a UnitTest for this. It isn't fun :( Please give me a couple days to add the test before merging this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs a UnitTest. I'm writing a test at the moment.
I have a draft UnitTest over here: https://gist.github.com/patrickdupuis/077577a8c2800f24c2c3849a0592176d Currently, the second test fails because |
I found the issue was being cause by |
I have a UnitTest ready for this. Will push to this PR branch later tonight. |
Oops... forgot to change the name before pushing ;) |
Patrick's unit test is in now -- should be ready to merge. |
looks good from here. |
Classlib: Testsuite: Meaningful name for Index rate test On branch patrickdupuis-indexUnitTest filename should match class name delete old test file
3651c1a
to
fe3bbf0
Compare
Squashed the unit test down to one commit. Should be ready to merge. |
Index_next_k()
accesses indexZIN0(1)
once per control cycle -- i.e., assumes a kr index.Index_next_a()
accesses indexZIN0(1)
inNumSamples
times per control cycle -- ar index.Both calculation functions do
GET_TABLE
only once per control cycle -- so the bufnum input does not support ar under any circumstances.But, the Ctor chooses next_k for a control-rate bufnum, regardless of the rate of the input that matters (index). So this PR changes
INRATE(0)
toINRATE(1)
.Five other UGens follow the same pattern: IndexL, FoldIndex, WrapIndex, IndexInBetween and DetectIndex.
Test: without the fix, the following displays an obvious sample-and-hold. With the fix, Index.ar is correctly equivalent to BufRd.ar without interpolation.
I'll suggest 3.9.1 for this as it's a small bugfix.