Skip to content
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

Issues after creating stk::FreeVerb instances repeatedly #120

Open
renetik opened this issue Mar 15, 2022 · 3 comments
Open

Issues after creating stk::FreeVerb instances repeatedly #120

renetik opened this issue Mar 15, 2022 · 3 comments

Comments

@renetik
Copy link

renetik commented Mar 15, 2022

I discovered that reverb effect is changing sound after I create remove repeatedly that I made simple test like this and it proved my theory that some value or something get modified and is shared across instances..

You can reproduce it like this:

 stk::FreeVerb *freeVerb20 = new stk::FreeVerb();
    stk::FreeVerb *freeVerb19 = new stk::FreeVerb();
    stk::FreeVerb *freeVerb18 = new stk::FreeVerb();
    stk::FreeVerb *freeVerb17 = new stk::FreeVerb();
    stk::FreeVerb *freeVerb16 = new stk::FreeVerb();
    stk::FreeVerb *freeVerb15 = new stk::FreeVerb();
    stk::FreeVerb *freeVerb14 = new stk::FreeVerb();
    stk::FreeVerb *freeVerb13 = new stk::FreeVerb();
    stk::FreeVerb *freeVerb12 = new stk::FreeVerb();
    stk::FreeVerb *freeVerb11 = new stk::FreeVerb();
    stk::FreeVerb *freeVerb10 = new stk::FreeVerb();
    stk::FreeVerb *freeVerb9 = new stk::FreeVerb();
    stk::FreeVerb *freeVerb8 = new stk::FreeVerb();
    stk::FreeVerb *freeVerb7 = new stk::FreeVerb();
    stk::FreeVerb *freeVerb6 = new stk::FreeVerb();
    stk::FreeVerb *freeVerb = new stk::FreeVerb();

Here just use the last instance .. It has broken sound..
I am trying to find out why now but not yet with luck.

@renetik
Copy link
Author

renetik commented Mar 15, 2022

Ok I fixed it by moving cDelayLengths and aDelayLengths inside constructor like this while commenting it out outside.

FreeVerb::FreeVerb( void )
{
  int cDelayLengths[] = {1617, 1557, 1491, 1422, 1356, 1277, 1188, 1116};
  int aDelayLengths[] = {225, 556, 441, 341};

This way problem is fixed .. looks like library is not used much because I cannot get how could I be alone to face this issue.

@renetik
Copy link
Author

renetik commented Mar 15, 2022

Would you be interested if I create pull request ?

@garyscavone
Copy link
Contributor

It is not immediately clear why the global definition outside the scope of the constructor would cause such behaviour but the fix makes sense and I would be happy to have it submitted as a PR. There could be several reasons why this has not come up before, including that example usage to reproduce the problem is not very typical and also because the issue seems like it may be compiler-specific.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants