Expand description
Sans-IO protocol library for Behringer DeepMind synthesizers.
This crate models the DeepMind MIDI protocol and nothing else. It never opens a
port, never spawns a thread and never blocks. The host application owns the
transport, feeds inbound bytes in and sends outbound bytes out.
DeepMind <--MIDI--> host application <--bytes--> deepmind-midi§Layout
| Module | Responsibility |
|---|---|
ids | Addressing primitives: device ID, model, bank, program number |
error | Crate-wide error type |
wire | MIDI bytes: running status, channel messages, SysEx reassembly |
sysex | DeepMind framing, the packed MS-bit codec, typed messages |
param | The 242 program parameters: names, ranges, value tables, NRPN |
effect | What an effect engine’s twelve bytes are, per algorithm |
front | What the instrument’s own front panel puts a control under |
generator | The shapes a set of parameters makes, for a host that draws them |
pixels | The one-bit grid of the marks, the source cells and the glyphs |
program | A program: the 242 bytes, typed accessors, names, value types |
syx | .syx files: the programs a preset pack carries, and building one |
device | The state machine: what the synthesizer holds, and what to send |
transport | The blocking adapter over a port and a clock (feature transport) |
sim | The other end of the conversation, for tests (feature sim) |
Each layer depends only on those above it: wire does not know what a
DeepMind is, and sysex does not know where its bytes came from.
use deepmind_midi::ids::DeviceId;
use deepmind_midi::sysex::{Frame, Message};
use deepmind_midi::wire::{Decoder, Event};
// Bytes off a port, in whatever chunks they arrived in.
let mut decoder: Decoder = Decoder::new();
decoder.feed(&[0xF0, 0x00, 0x20, 0x32, 0x20, 0x00, 0x03, 0xF7], |event| {
if let Ok(Event::SysEx(bytes)) = event {
let frame = Frame::parse(bytes).expect("a DeepMind frame");
assert_eq!(frame.device, DeviceId::Unit(0));
assert_eq!(frame.message, Message::EditBufferDumpRequest);
}
});See docs/architecture.md for the design and docs/midi-spec.md for the
protocol itself.
§Feature flags
std(default): impliesalloc, and addstransport::StdClockwhentransportis on. The error types implementcore::error::Errorwith or without it.alloc: APIs that allocate, such as bank decoding and.syxhandling.serde:Serialize/Deserializederives on the public data types.transport: the blocking adapter, which is the one part of this crate that knows what IO is. Needs neitherstdnor an allocator.sim: a synthesizer to talk to, for testing a host without one plugged in.descriptions: what a parameter or an effect slot does, in a sentence.param::ParamId::descriptionandeffect::FxSlot::descriptionanswerNonewithout it and a sentence with it, so a host writes one code path and an embedded build carries no prose.
Re-exports§
pub use device::Device;pub use device::Known;pub use effect::Algorithm;pub use effect::Engine;pub use error::Error;pub use error::Result;pub use ids::Bank;pub use ids::DeviceId;pub use ids::Model;pub use ids::PatternNumber;pub use ids::ProgramNumber;pub use ids::ProtocolVersion;pub use ids::Slot;pub use param::Group;pub use param::NrpnEdit;pub use param::ParamId;pub use program::Program;pub use program::ProgramName;pub use sysex::Command;pub use sysex::Frame;pub use sysex::Message;pub use transport::Transport;transportpub use wire::Channel;pub use wire::ChannelMessage;pub use wire::Decoder;
Modules§
- device
- The state machine a host drives: what the synthesizer holds, and what to send.
- effect
- The effect panels: what an engine’s twelve bytes mean, and which algorithm decides.
- error
- Crate-wide error type.
- front
- The front of the synthesizer: which parameters have a physical control, what is printed over them, and which of the panel’s two rows they are in.
- generator
- The shapes a set of parameters makes, for a host that draws them.
- ids
- Addressing primitives used throughout the protocol.
- param
- The parameter table: what each of the 242 program parameters is, and how it reaches the wire.
- pixels
- A square one-bit grid, for a display too small to stroke anything.
- program
- A program: the 242 bytes that are one sound, and the types that read them.
- sim
sim - A synthesizer to talk to, made of the same protocol.
- sysex
DeepMindSysEx: framing, the packed MS-bit codec and typed messages.- syx
.syxfiles: the format programs are traded in, read and written.- transport
transport - The blocking adapter: a port, a clock, and the loop between them.
- wire
- MIDI bytes: status, channel messages and
SysExreassembly.