-
Notifications
You must be signed in to change notification settings - Fork 400
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
wavetable morph interpolation discontinuity #7778
Conversation
This addresses the following: * continuous frame interpolation * seamless loop in "one shot"-mode
tableid = limit_range((int)intpart, 0, (int)oscdata->wt.n_tables - 2 + nointerp); | ||
|
||
if (tableid > last_tableid) |
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.
Why was this code removed?
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 is the logic for the old morph interpolation. It has to be removed for the new one to work.
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.
In that case please comment it out instead of removing it, since this code will have to remain here in order for the option switch to work.
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.
In that case please comment it out instead of removing it, since this code will have to remain here in order for the option switch to work.
ok, but you you told me the opposite about my last pr that I should just remove instead of commenting out, since there is a git history :)
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.
The difference is that we know we'll need this code soon. :) Leaving commented-out code blocks hanging around indefinitely is what we want to avoid.
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.
got it. I'll change it to a comment
@@ -62,10 +62,12 @@ void WavetableOscillator::init(float pitch, bool is_display, bool nonzero_init_d | |||
|
|||
n_unison = limit_range(oscdata->p[wt_unison_voices].val.i, 1, MAX_UNISON); | |||
|
|||
isOneShot = 0; |
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.
Since this is a bool you can use the constant true and false for better readability here
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.
isOneShot is actually not used anymore. I added it because it was used as a check in convolute(), but I realised later that it wasn't needed. I forgot to remove it.
Should I remove it or just change it to a bool?
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.
If it is completely unused it can be removed.
if (oscdata->wt.flags & wtf_is_sample) | ||
{ | ||
sampleloop = n_unison; | ||
n_unison = 1; | ||
isOneShot = 1; |
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.
And here
So that test failure looks real. Also added a couple of comments. Once those are resolved we should add a 1.4 issue to put this behind a flag or add a changelog entry |
removed isOneShot made removed logic a comment instead
Ok will have to look into that test you don’t have a Linux box right? If not I can look after the weekend but only have Mac with me right now |
Only pc/windows here :/ |
Ok! wonder what it could be |
So I just installed linux/ubuntu on virtualbox and it builds without any issues. All audio in virtualbox is glitchy though, so I can't really do any sound tests |
Does the test pass when you run it? That’s really what we need to figure out |
How do i do that? |
Sorry built the target surge-testrunner |
=============================================================================== But honestly I don't know what I'm doing so you should probably do a test yourself to be sure :) |
Ok lemme kick ci again just in case it’s an actions gremlin and if it fails I’ll try the particular test under sssn or some such |
And it worked! |
That’s frustrating - I should have tried that a week ago :( sorry about that Let me merge this then evil - any thoughts on the menu for the ifs? |
@baconpaul Similar to Sine osc, call the option Legacy mode, disabled by default for new patches, enabled for old patches. |
And stick it as deform on which param? Morph probably right? |
Yup! |
This addresses the following:
Continuous frame interpolation
The interpolation between frames weren't continuous, which could introduce lots of noise in some cases. It was especially apparent in noisy/phase shifting wavetables.
Seamless loop in "one shot"-mode
So it turns out that you can actually loop "one shots". In one-shot-mode the unison voices parameter acts as a loop counter.
Anything between 1-6 loops the sample that amount of times. Anything over 7 will loop forever.
The loop was not seamless though, so that has been adressed.
Addresses #7777