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

libfaust (LLVM) support? #22

Open
YPares opened this issue Mar 18, 2024 · 6 comments
Open

libfaust (LLVM) support? #22

YPares opened this issue Mar 18, 2024 · 6 comments

Comments

@YPares
Copy link

YPares commented Mar 18, 2024

Hi! I'm working on a plugin that loads DSPs using the llvm backend ( https://github.com/YPares/nih-faust-jit ). I knew about rust-faust from the start, but given my specific needs (and also as a learning process) I ended up rewriting an ad-hoc wrapper for libfaust myself (based on bindgen), both for loading DSPs and creating their GUIs.
Now that I have a better idea of how to use libfaust as part of a Rust project, would you be interested in a PR to rust-faust to add support for the llvm backend?

@obsoleszenz
Copy link
Collaborator

I think it would be nice! Also for hot reloading this could be quite cool. I myself stopped using faust-state but having faust-llvm parallel to faust-build and a maybe a layer on top if needed could be nice.

Do you have an idea how this could be integrated or how this could look like?

@YPares
Copy link
Author

YPares commented Mar 18, 2024

@obsoleszenz faust-states is for representing in Rust datastructures the internal state of a DSP, right?

I think implementing faust-types with llvm-based DSPs should be the way to go, and it shouldn't be too hard to it for any dsp (the abstract faust class). The wrappers in my project are a bit higher-level for now (because the fewer functions to bind, the easier). The major question is the build. I link with a system-installed libfaust, maybe building it as part of a new faust-llvm crate might be simpler and more OS-agnostic.

@obsoleszenz
Copy link
Collaborator

Hmmm i think for building it would be nice to statically link against faust + llvm. But not exactly sure how to do it.

@sletz
Copy link

sletz commented Mar 18, 2024

faust-llvm @YPares do you mean this system level crate that would embed the libfaust binaries themselves ?

@YPares
Copy link
Author

YPares commented Mar 18, 2024

@sletz That's what I meant, yes. libfaust is not super heavy, so it may be worth it, in order to make the build process simpler (at least on some OSs with no decent package managers...).

@YPares
Copy link
Author

YPares commented Mar 20, 2024

I've split the faust llvm logic on https://github.com/YPares/nih-faust-jit in a separate faust_jit crate (which would be roughly equivalent to that sys crate we were talking about, though the API isn't changed yet to be more aligned with what rust-faust expects). But that makes it reusable already.
Drawing the DSP widgets with egui is also done by a separate faust_jit_egui crate.

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

3 participants