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
New curryable extract #931
base: main
Are you sure you want to change the base?
Conversation
fc77554
to
07d1dad
Compare
07d1dad
to
3712034
Compare
3712034
to
7a4d5b8
Compare
Ok, so I didn't write down what the goal is here. Doing so now. Meyda has roughly two categories of state it depends on. The first category is the big overarching things that get reused across many buffers of audio, like AudioContext. Generally, one Meyda per audio context seems fine. The user (by which I mean "the developer using meyda") shouldn't need to shuffle their audio context around in their own state, and could do with constructing an object with a reference to it one time and reusing their Meyda object. The second category of dependent state are things that could reasonably change between frames - in a realtime extraction situation the user may need to change which audio features they need, or might need to switch sample rate, or windowing function, number of mel bands, etc. Rather than using classes and Meyda.extract(REUSED_ARGS)(CHANGING_ARGS)(signal); Of course, directly applying each argument in one call would work fine, or applying the first two and then repeatedly calling the returned function, or providing the changing args each time you provide a signal would be fine too. I had a lot of trouble getting typescript to display the type signatures of the returned partially applied functions, or the return type of the fully applied function call to be constructed based on the features provided in the changing args. So the help that I would need here is both:
Let me know if anyone would like to help on any of those 3 points! |
Thanks for the explanation @hughrawlinson! I've mostly used the |
Sounds great! The difference between this and |
This should help with #257 #847 and #298.
(I definitely don't intend to remove the existing interface without an awful lot of consideration first)