Device Details


Overview

Name | Version: Kasm Ableton WASM Rust - Source Code Example 1.0
Author: kevleyski
Device Type: MIDI Effect
Description: Manipulating live notes on-the-fly with Rust/WebAssembly (WASM)

This is a tutorial only (i.e. not an exciting new plugin) detailing a working example of how to manipulate MIDI data and potentially DSP audio signals using more efficient Rust code in Ableton Live 12.2 w/ Max4Live using WebAssembly in the newly added V8 Javascript engine

Features includes:
Passing inlet parameters from JS into to Rust
Rust code calling Max4Live outlet function (Rust code plays chords offset by semitones pssed in from Max4Live)
Max console debug post() messages from inside Rust code

How does it work, what does "Kasm" do for me? There are three primary layers working together to enable Rust execution within Max4Live/V8:

Rust Code Layer: Your MIDI/Audio DSP logic compiled as WebAssembly
JavaScript Bridge Layer: Handles WASM bytecode loading, setups parameter marshalling for Max4Live integration
Max4Live Layer: V8 JavaScript engine with an basic example .amxd device showing two way communication with Rust

Kasm then provides the base64-encoded WASM binary parts and compiles this as a blob for integration:

Base64 Decoding: Custom atob() implementation for Max4Live
WASM Compilation: Direct compilation from that decoded binary
Function Export: Cahing mapped Rust functions available to JavaScript
getStringFromWasm: Convert WASM memory strings into JavaScript strings

!! note for this to all work this project needs Ableton 12.2 or later as it utilises the new V8 engine, you'll need Live 12.2 Suite or Standard + Max4Live add-in !!

The example contains a heap of code comments, whilst you can figure it out from this it helps if you already know a bit about what WebAssembly is, Javascript and how to compile Rust code

Building and updating it is easy:
npm install
npm run build

This updates kasm_WASM_rust.js which then compiles the WASM, you simply copy and paste that into any 'v8' Max4Live object

The example .amxd demonstrates the Rust function being called and outlet and debugging messages from Rust code itself
kasm_midi_note_offset has two inlets and has one outlet
pub fn kasm_midi_note_offset(inlet_0: i32, inlet_1: i32) -> i32

kasm_midi_note_octave_hit shows how to generate chords and triggering MIDI events by calling the outlet() function from inside Rust and also debugging the Rust code into Max4Live console using post()

Details

Live Version Used: 12.2
Max Version Used: 9.0
Date Added: Jun 26 2025 03:33:25
Date Last Updated: Jun 27 2025 07:53:42
Downloads: 0
Website: https://kevleyski.gumroad.com/l/kasm_ableton_wasm_rust
License: None
Average Rating

Log in to rate this device

-n/a-



Login to comment on this device.

Browse the full library