minilogue-xd
A complete Rust library for the Korg Minilogue XD synthesizer — full MIDI implementation coverage: CC, NRPN, SysEx, program blobs, sequencer data, tuning tables, and user module management.
Rust 2021 MIDI impl rev 1.01 100% spec coverage 1,156 tests no_std compatible MIT / Apache-2.0
Korg Minilogue XD desktop module

The Minilogue XD exposes a remarkably deep MIDI surface: 50+ CC parameters, 29 NRPN parameters, a 1024-byte program blob containing the full synth state, a 16-step sequencer with 4-slot motion sequences, sub-cent tuning tables for all 128 notes, and a complete user module management protocol for logue SDK units.

This library covers all of it — with typed Rust APIs, correct 10-bit encoding, the Korg 7-bit SysEx codec, and file format support for .mnlgxdprog, .mnlgxdlib, and .mnlgxdunit archives. Additionally, performances can be exported as Standard MIDI Files (.mid) — complete with patch setup CCs, parameter automation, and note data — ready for notation software like Sibelius or any DAW.

The dream: treat the XD desktop module as a voice in an imaginary MIDI-based Eurorack system (or not so imaginary...), with every parameter reachable from Rust in real time. Working with the physical synth, we are limited to our two hands (and foot pedals); working with software, we become thousand-armed Chenrezig musicians.

# Cargo.toml
[dependencies]
minilogue-xd = "0.1"

Requires Rust 2021 edition. The midi-io feature (default on) pulls in midir for live MIDI port access. Disable it for pure file manipulation or no_std targets.

# no_std / file-only build
minilogue-xd = { version = "0.1", default-features = false, features = ["file-formats"] }
use minilogue_xd::{
    controller::RealtimeController,
    device,
    message::{U4, U7},
    param::enums::{VcoWave, LfoMode, EgTarget, MicroTuning},
    transport::MidirOutput,
};

fn main() -> minilogue_xd::Result<()> {
    let port = device::find_output_port()?
        .expect("Minilogue XD not found");
    let output = MidirOutput::connect(&port)?;
    let mut xd = RealtimeController::new(output, U4::new(0)?);

    // VCO control — natural units, typed enums
    xd.set_vco1_wave(VcoWave::Saw)?;
    xd.set_cutoff(0.6)?;        // 0.0 – 1.0
    xd.set_resonance(0.4)?;
    xd.set_lfo_rate(0.3)?;
    xd.set_lfo_mode(LfoMode::Bpm)?;
    xd.set_eg_target(EgTarget::Cutoff)?;

    // NRPN: deep parameters not on the CC surface
    xd.set_micro_tuning(MicroTuning::Pythagorean)?;
    xd.set_bend_range_plus(7)?;

    xd.play_note(U7::new(60)?, U7::new(100)?)?;  // middle C, velocity 100
    Ok(())
}
use minilogue_xd::{
    builder::patch::PatchBuilder,
    param::enums::{VcoWave, VcoOctave, CutoffDrive,
        CutoffKeytrack, DelaySubType},
    sysex::transaction::SysexTransaction,
};

// Build a patch programmatically
let patch = PatchBuilder::new()
    .name("Acid Bass")?
    .vco1(VcoWave::Saw, VcoOctave::Eight, 0.0, 0.5)
    .filter(0.35, 0.8, CutoffDrive::Full, CutoffKeytrack::Full)
    .amp_eg(0.0, 0.3, 0.0, 0.1)
    .delay(true, DelaySubType::Tape, 0.4, 0.6, 0.3)
    .build();

// Send it to the edit buffer over SysEx
let mut tx = SysexTransaction::new(&mut output, &mut input, channel);
tx.send_current_program(&patch)?;

// Load a .mnlgxdlib file from disk
use minilogue_xd::sysex::program::file::read_lib_file;
let file = std::fs::File::open("factory.mnlgxdlib")?;
let patches = read_lib_file(file)?;
println!("{} patches loaded", patches.len());
// cc
CC parameter map
All 50+ control change parameters. Typed enums for stepped values. Automatic 10-bit encoding via CC63+CC6 for high-resolution parameters.
// nrpn
NRPN parameters
All 29 NRPN entries: bend range, joystick assign, CV routing, micro-tuning, VPM params, user params, portamento mode, and more.
// sysex
Program & global blobs
Full 1024-byte program data parse/serialize. Global settings. Korg 7-bit codec. Request/response SysEx transactions with ACK/NAK handling.
// seq
Sequencer & motion
16-step sequencer with per-step note/velocity/gate data. 4-slot motion sequences with 5-point interpolation and 45 assignable parameters.
// tune
Micro-tuning
User scale (128 notes, 0.0061-cent precision) and user octave (12 notes) read/write. MIDI Tuning Standard bulk and single-note formats.
// sdk
User module management
Query, upload, download, clear, and swap logue SDK oscillator and FX slots. CRC32-verified payload transfer. .mnlgxdunit file support.
Phase 1 ✓
Foundation — codec, channel messages, MIDI I/O transport
6/6 milestones
Phase 2 ✓
Parameter layer — enum types, 10-bit encoding, CC map, NRPN map
4/4 milestones
Phase 3 ✓
SysEx layer — program blobs, global data, tuning, user modules, poly chain
8/8 milestones
Phase 4 ✓
High-level API — controller, transaction manager, patch & sequence builders
6/6 milestones

Runnable demos in the examples/ directory, verified on real hardware:

// discover
list_ports
Enumerate available MIDI output ports. The simplest possible example — connect and query.
// play
test_drive
Set up a lush saw+triangle pad with LFO, tape delay, and hall reverb. Plays a Cm9 chord progression.
// sequence
berlin_school
Tangerine Dream–style sequencer. Dual detuned saws, evolving filter sweeps, E minor / C minor modulation, velocity fade.
// two voices
exit
TD "Exit" era — aggressive D minor sequence + atmospheric pad layered via hybrid patch with full keytrack for timbral separation.
// export
export_midi
Export a performance as a Standard MIDI File (.mid) with patch CCs, cutoff automation, and a CC legend text file.
// inspect
read_patch
Read a stored program from the synth via SysEx and display every parameter — oscillators, filter, envelopes, LFO, effects, sequencer.
C / C++
korginc/logue-sdk
Official Korg SDK for onboard DSP units. Reference for user module binary format and CRC32.
Python
gekart/mnlgxd.py
Program blob parser and pretty-printer. Ground truth for TABLE 2 byte offsets.
Python
isnotinvain/minilogue-xd-util
Idiomatic patch object model. Useful for sequencer and motion byte layout validation.
Python
gazzar/loguetools
Cross-synth patch manipulation. Reference for .mnlgxd* file container formats.