• Audio
  • Realtime audio drivers in Rust

Just a quick update: bela-sys now uses a BELA_SYSROOT environment variable instead of having to place subsets of files into a Cargo-internal folder. So just extract partition 1 (/) of the Bela image to a folder of your choice and point BELA_SYSROOT at it (in theory it should also build on the Bela itself, assuming cargo and rustc work on it). This should work much better when crates depend on bela-sys. Furthermore, static vs dynamic linking of bela is now switchable via a crate feature static and the hello-example is now a proper example (meaning its dependencies are now dev-dependencies!) and not the main.rs of a "hybrid" executable/library crate.

If you want to try out my branches of bela-sys or bela-rs, add

[patch.'https://github.com/andrewcsmith/bela-sys.git'.bela-sys]
git = "https://github.com/l0calh05t/bela-sys.git"
branch = "bela0.3.8b_rust1.52.0"

[patch.'https://github.com/andrewcsmith/bela-rs.git'.bela-rs]
git = "https://github.com/l0calh05t/bela-rs.git"
branch = "bela0.3.8b_rust1.52.0"

to your Cargo.toml and add the original version to your dependencies. (I didn't change any of the URLs in case @andrewcsmith is interested in merging these patches)

Would you mind doing a PR for this so we can get it merged upstream? I'm not sure Andrew is looking at this forum.

I'm on other parts of my project (doing all the analog bits), so I didn't update the board and didn't recompile anything for quite some time now, so this went unnoticed.

fwiw, cargo and rustc work well on bela, but it's horribly slow. I was doing it on the device initially, but since it's so easy to cross-compile with rust, I ended up compiling on my laptops and sending the binary.

We can also figure out the dasp situation, surely there is a way to sort it out.

    padenot Would you mind doing a PR for this so we can get it merged upstream? I'm not sure Andrew is looking at this forum.

    Done šŸ™‚

    padenot fwiw, cargo and rustc work well on bela, but it's horribly slow. I was doing it on the device initially, but since it's so easy to cross-compile with rust, I ended up compiling on my laptops and sending the binary.

    Yeah, I suspected as much and decided against trying it

    padenot We can also figure out the dasp situation, surely there is a way to sort it out.

    With the new min_const_generics feature, it should be possible to have a generic implementation where the proper compile-time channel counts is selected at run-time from a fixed set of known channel counts. Without such workarounds AFAICT not without changing dasp itself to support run-time variable channel counts.

    16 days later
    a month later
    15 days later

    l0calh05t Oh cool! This is great. I really look forward to your next post and reading about getting bela-sys and bela-rs working and happy.

    I'd be happy to help make a tutorial for Mac and Unix users as well.

      5 days later
      12 days later

      djensenius You're welcome! And thank you so much for the show of appreciation! Blogging and tweeting can feel a lot like talking to a wall when you only have a handful of followers, so thanks for the motivation to continue

      12 days later
      2 months later

      Thanks for the interesting write up, it's nice to see how straightforward it is to do SIMD in Rust.

      The reĀ­al thing alĀ­so had to apĀ­ply some tricks to conĀ­trol clickĀ­ing.

      Tell me about it (I wrote about it, glad to see some common interests šŸ™‚ ).

      Some of them even sound kinĀ­da orĀ­gan-ish.

      I modified an open source Hammond emulator for conducting a study (Ch 4 here) and something that made a big difference in the "realism" (or at least in making the sound passable) was the relative weighing of the partials: in practice the gains are far from unitary. To get an approximation of that I played all the notes on a Hammond C3 with only one drawbar active at any time. With a Matlab script I was able to infer the relative weights. Although clearly these are just an approximation of what happens when they are summed together, the difference it made to the sound was night and day.