max4.live

a better search for max devices
Kasm Rust Emanator Ableton MIDI Generative Tool screenshot

Kasm Rust Emanator Ableton MIDI Generative Tool

by kevleyski

Emanator, generates complex MIDI note/velocity sequences wit...

View on maxforlive.com

Type
MIDI Generator
Author
kevleyski
Version
1.12.2
License
None
Live version
12.2
Max version
9.0
Downloads
846
Updated
2025-08-02

Description

Emanator, generates complex MIDI note/velocity sequences with Rust code!

This Ableton Live 12.2 MIDI Generator device was built with source code available here:

https://maxforlive.com/library/device/12909/kasm-ableton-wasm-rust-source-code-example

This is the Ableton MIDI Generator version of the Kasm Emanator - it's the same Rust code but generates Ableton Note data instead of pushing to the MIDI output

!! NOTE: you need the latest Ableton 12.2 for this as it uses the new V8 jsinterp from Max9 !!

Kasm is WebAssembly so you can develop and test things in web browser too, try it out here:

https://pyrmontbrewery.com/kasm

For the enquisitive the Kasm SDK abstracts the Max4Live bang calls into serde JSON to generate the Ableton Notes dictionary...

// Clear any existing notes in the collection

ABLETON_NOTES_COLLECTION.write().unwrap().clear();

// Call bang which will now populate the notes collection instead of sending to outlets

bang(inlet_0_note, inlet_1_semitone, inlet_2_velocity, inlet_3_enc1, inlet_4_enc2, inlet_5_selector);

// Collect all the notes that were added during the bang() call

let collected_notes = ABLETON_NOTES_COLLECTION.read().unwrap().clone();

// Reset mode back to Max4Live MIDI output for next time

*KASM_ABLETON_MODE.write().unwrap() = KasmAbletonMode::Max4LiveMIDIOutput;

// Return the collected notes as an Ableton MIDI Generator dictionary

if collected_notes.is_empty() {

JsValue::NULL

} else {

serde_wasm_bindgen::to_value(&Notes { notes: collected_notes }).unwrap_or_else(|err| {

post!(&format!("Serialization error: {}", err));

JsValue::NULL

})

}

...

full source code is here https://maxforlive.com/library/device/12909/kasm-rust-ableton-wasm-source-code

← Back to search