RustedKeys - Rust-based patch for the Organelle

Hey everybody,

Today I’m releasing RustedKeys, a simple patch for the Organelle that lets you use it as a simple MIDI Controller capable of sending MIDI notes and CC messages.
My goal for this patch was to make the Organelle a bit more useful as a controller while I’m not using it as a sound source.

What’s unique about this patch is that it is, as far as I’m aware, the first patch for the Organelle developed in Rust.
Although it doesn’t use PD, the patch should work just like any other patch in the Organelle from a user perspective.

Download it for free at https://patchstorage.com/rustedkeys/


About Rust on The Organelle

I’ve been getting a lot more into Rust lately and since I hadn’t heard anyone talking about running Rust on the Organelle I figured it’d be a cool idea to see if I could get it up and running on the Organelle-M and maybe start creating something with it as an alternative to PureData.

While the install process was a bit more complicated than I expected, the good news is that it’s 100% possible to install, compile and run Rust code on the Organelle. What’s even better is that other people should be able to run the compiled binary without having to install Rust at all (in other words, only the devs would need to install it).

To make it easier to develop rust-based patches for the Organelle, I started working on a library that will work as a replacement for mother.pd that will facilitate the process of receiving data from the Organelle (keys and knobs) and controlling the OLED (basically some binders for the OSC messages). I hope to release it on crates.io soon.

While programming in Puredata is quite fun, I think that being able to create patches using such a fast, modern and secure language like Rust will let some people explore the Organelle in ways that were not possible before.

RustedKeys is the first patch that I’m developing using Rust and this new library and while it’s a very simple patch, I’m looking forward to adding more features to it in the future.

7 Likes

This is interesting indeed! I wasn’t looking for an excuse to learn Rust, but maybe you have provided one anyway :slight_smile:

I definitely like the idea of distributing single statically-linked binaries. By the way, have you tried adding the armv7-unknown-linux-gnueabihf or armv7-unknown-linux-musleabihf targets and cross compiling your program from your Mac? The Organelle-M/Raspberry Pi doesn’t need to have Rust installed, even for development.

Also, if you’re interested in integrating with Pd, you could use the foreign function interface to create a Pd external with Rust. Then you could utilize Pd and mother.pd for the UI and do all audio processing (plus networking or anything else) in Rust.

Here’s a preview of the chord memorizer that will be available in the upcoming 1.1 update for RustedKeys:

The chord memorizer will feature 12 save slots, adjustable interval between notes, realtime transposition (via second octave) and a humanizer that will affect both playback MIDI velocity and that interval between notes.

I just need to work on some minor bugs and I hope to release the update on PatchStorage soon.


@jmogens I’ve thought about cross-compiling the code but I find it easier to compile and run directly on the Organelle via SSH. Makes it easier to debug stuff imo.

2 Likes

woweee this is awesome. THanks!

That sounds great, I love the features in the chord memorizer! It is MIDI only right? do you have plans or ideas for audio processing in Rust?

this sounds awesome. thanks for sharing Bluestacks error Omegle

Yes! It’s only MIDI for now.

I would love to do some DSP in Rust but to be honest I haven’t looked too much into it yet. I’ve tried the rodio library but it didn’t seem to work out of the box.

If I can find a way to do it then it’s definitely a direction I’d end up taking sooner or later.

The 1.1 update is now available on PatchStorage!

It’s not 100% bug free but I decided to release the update as it stands so people can try the new chord memorizer out.
Hope you all enjoy it!

Hello,

I have been trying to build some Rust audio code on the Organelle 1 and I haven’t got very far. In particular the cpal audio library builds but doesn’t work - I get errors like this running the examples:

ALSA function 'snd_pcm_sw_params' failed with error 'EINVAL: Invalid argument'

I suspect it’s due to the old kernel (3.14) in the Organelle OS, but I’m not sure.

Did you use any library to talk to ALSA? Maybe you didn’t hit these issues as your patch is more about MIDI.

I have finally got DSP in Rust on Organelle to work - the trick is to give up on ALSA and go straight to JACK. As well as ALSA driver issues, I hit several bugs in Rust’s cpal audio library, and I didn’t fancy using the alsa-rs bindings directly as it’s rather low level. Using jack crate worked pretty much straight away, just need to call /root/fw_dir/scripts/start-jack.sh in your patch run.sh script.

2 Likes