Skip to main content

minilogue_xd/
lib.rs

1//! A comprehensive Rust library for the Korg Minilogue XD synthesizer,
2//! covering 100% of the MIDI Implementation chart (Revision 1.01). Provides
3//! strongly typed CC and NRPN parameter maps, SysEx program and global data
4//! blobs, a 16-step sequencer with motion sequences, sub-cent tuning tables,
5//! user module management for logue SDK units, and high-level builder and
6//! controller APIs for real-time performance and patch construction.
7//!
8//! # Architecture
9//!
10//! The crate is organized in four layers, each building on the one below:
11//!
12//! ```text
13//!  +------------------------------------------------------------------+
14//!  |  Layer 4 - High-Level API                                        |
15//!  |  PatchBuilder, SequenceBuilder, RealtimeController               |
16//!  +------------------------------------------------------------------+
17//!  |  Layer 3 - SysEx Layer                                           |
18//!  |  Program/Global blobs, tuning tables, user modules,              |
19//!  |  SysexTransaction (request/response with ACK/NAK)                |
20//!  +------------------------------------------------------------------+
21//!  |  Layer 2 - Parameter Layer                                       |
22//!  |  CC map (50+ params), NRPN map (29 params), 10-bit encoding,     |
23//!  |  typed enums for all stepped/discrete parameters                 |
24//!  +------------------------------------------------------------------+
25//!  |  Layer 1 - Foundation                                            |
26//!  |  7-bit codec, channel/realtime/common messages, MIDI I/O         |
27//!  +------------------------------------------------------------------+
28//! ```
29//!
30//! # Quick Start
31//!
32//! ## Building a patch
33//!
34//! ```
35//! use minilogue_xd::builder::PatchBuilder;
36//! use minilogue_xd::param::enums::*;
37//!
38//! let patch = PatchBuilder::new()
39//!     .name("MyPad").unwrap()
40//!     .vco1(VcoWave::Saw, VcoOctave::Eight, 0.5, 0.3)
41//!     .filter(0.7, 0.2, CutoffDrive::Off, CutoffKeytrack::Off)
42//!     .amp_eg(0.1, 0.5, 0.8, 0.4)
43//!     .delay(true, DelaySubType::Stereo, 0.5, 0.5, 0.5)
44//!     .build();
45//!
46//! assert_eq!(patch.synth.name.as_str(), "MyPad");
47//! ```
48//!
49//! ## Real-time control
50//!
51//! ```
52//! use minilogue_xd::controller::RealtimeController;
53//! use minilogue_xd::message::types::U4;
54//! use minilogue_xd::transport::MockOutput;
55//!
56//! let output = MockOutput::new();
57//! let channel = U4::new(0).unwrap();
58//! let mut ctrl = RealtimeController::new(output, channel);
59//!
60//! ctrl.set_cutoff(0.75).unwrap();
61//! ctrl.set_vco1_wave(minilogue_xd::param::enums::VcoWave::Saw).unwrap();
62//! ctrl.set_delay_on(true).unwrap();
63//! ```
64//!
65//! # Feature Flags
66//!
67//! | Feature        | Default | Description                                     |
68//! |----------------|---------|-------------------------------------------------|
69//! | `midi-io`      | Yes     | Real MIDI I/O via `midir`                       |
70//! | `file-formats` | Yes     | `.mnlgxdprog` / `.mnlgxdlib` file support       |
71//! | `std`          | Yes     | Standard library support (disable for `no_std`) |
72//!
73//! # MIDI Implementation Version
74//!
75//! This crate targets the Korg Minilogue XD MIDI Implementation **Revision 1.01**,
76//! supporting both the keyboard and desktop module variants.
77
78pub mod builder;
79pub mod codec;
80pub mod controller;
81pub mod error;
82pub mod message;
83pub mod midi_file;
84pub mod param;
85pub mod sysex;
86
87pub mod connection;
88pub mod transport;
89
90pub use error::{Error, Result};