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

feat: expose more of KAPLAY's internals in exported context #400

Open
dragoncoder047 opened this issue Sep 7, 2024 · 1 comment
Open
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@dragoncoder047
Copy link
Contributor

I recently discovered the little ZzFX sound generator by @KilledByAPixel, so I thought I'd try to write a KAPLAY plugin to add it... Unfortunately there is one thing that gets in the way of writing a well-behaved ZzFX plugin.

The plugin would add a function loadZzFX(name, ZzFX parameters) to KAPLAY, and then monkey-patch play() to check the ZzFX sound-name-to-parameters mapping as well and call zzfx() if the sound name is registered there, otherwise defer to KAPLAY's original function. This all can be done as-is, but a step up from that (and what would probably be expected) would be to patch ZzFX as well so that it inserts its audio into KAPLAY's masterNode so that ZzFX sounds respond to volume() and get record()'ed, but I can't do that because the only thing that is exposed on the context in terms of the audio system is the AudioContext, not the masterNode.

So I'm kind of asking for this specific handle to get exposed, but I'm also kind of asking a general question of "what is the reasoning for exposing vs. not exposing certain bits of KAPLAY's internals?"

@lajbel
Copy link
Collaborator

lajbel commented Sep 7, 2024

We can back to export kaplay internals, we were doing that, for v4000 will be

@lajbel lajbel added this to KAPLAY.js Sep 7, 2024
@lajbel lajbel moved this to TODO in KAPLAY.js Sep 7, 2024
@lajbel lajbel added this to the 4000 milestone Sep 7, 2024
@lajbel lajbel added the enhancement New feature or request label Sep 7, 2024
@lajbel lajbel self-assigned this Sep 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: TODO
Development

No branches or pull requests

2 participants