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

Packing/Minifying breaks constructors of polytemplate based instruments #34

Open
Cygnusfear opened this issue Mar 2, 2021 · 2 comments

Comments

@Cygnusfear
Copy link

Cygnusfear commented Mar 2, 2021

Hey there, wanted to say Genish/Gibberish are incredible!

I've been playing around with it for a bit but then ran into an issue including it in a project.
I eventually discovered the polyphonic instruments based on polytemplate.js and the poly mixins no longer work once gibberish.js is minified. The gibberish_worker is no longer able to properly parse or recognize their constructors.

Have quickly glanced over the polytemplate.js code but I saw some comments about the proxy code being a nightmare and I have to say I don't understand enough of what's going on there or in Genish to be able to jump in and fix the issue. Though I would've liked to.

Thank you for the awesome work!

Edit: attached the errors thrown by the AudioWorklet for clarification
Screenshot 2021-03-02 at 17 51 40

@Cygnusfear Cygnusfear changed the title Packing/Minifying breaks constructors of polysynths Packing/Minifying breaks constructors of polytemplate based instruments Mar 2, 2021
@charlieroberts
Copy link
Collaborator

Hi and thanks for the kind words! There's code generation that relies on some global names to exist in the audio thread, and my guess is that minification breaks this. Can you configure the minifier to not shorten variable names? Not sure how much file size reduction you'd get after this but could still be a helpful amount... keep me posted!

@Cygnusfear
Copy link
Author

Hola! Yeah I had a feeling there was some sort of reflection going on being broken by the minifier. I initially used it in a create-react-app and I was trying to avoid ejecting the whole project for now. To verify I did an isolated test with a minifier and got the same issue.

I'm sideloading it now so my issues are fixed. But since the whole gibberish lib is on the heavy side I would be curious and willing to look for a fix if you could hint me at where this code gen is happening.

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