Expand description
Plato-MIDI Bridge — Style decomposition for MIDI with Eisenstein lattices and Penrose tilings.
§Core Types
StyleVector— 109-dimensional musical style vectorEisensteinLattice— 12-chamber hexagonal lattice encodingPenroseEncoder— 5D cut-and-project tiling encodingScaleLevel— Multi-scale analysis (micro, note, phrase, section, piece)
§Usage
use plato_midi_bridge::{StyleVector, EisensteinLattice, PenroseEncoder, PHI};
// Create a style vector from raw features
let style = StyleVector::new(&[0.5; 109]);
// Encode in Eisenstein lattice
let coupling = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1, 0.0];
let chamber = EisensteinLattice::chamber(&coupling);
assert!(chamber < 12);
// Encode in Penrose tiling
let encoder = PenroseEncoder::new(None);
let v = [1.0, 0.5, 0.7, 0.3, 0.6];
let (px, py, accepted) = encoder.encode(&v);
assert!(accepted);Structs§
- Eisenstein
Lattice - Eisenstein lattice — 12-chamber encoding for coupling vectors.
- Penrose
Encoder - Scale
Level - Multi-scale analysis — micro, note, phrase, section, piece.
- Style
Vector
Constants§
- FIFTH_
ROOTS - The 5th roots of unity for Penrose projection
- PHI
- Golden ratio φ = (1 + √5) / 2