Skip to main content

Crate plato_midi_bridge

Crate plato_midi_bridge 

Source
Expand description

Plato-MIDI Bridge — Style decomposition for MIDI with Eisenstein lattices and Penrose tilings.

§Core Types

  • StyleVector — 109-dimensional musical style vector
  • EisensteinLattice — 12-chamber hexagonal lattice encoding
  • PenroseEncoder — 5D cut-and-project tiling encoding
  • ScaleLevel — 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§

EisensteinLattice
Eisenstein lattice — 12-chamber encoding for coupling vectors.
PenroseEncoder
ScaleLevel
Multi-scale analysis — micro, note, phrase, section, piece.
StyleVector

Constants§

FIFTH_ROOTS
The 5th roots of unity for Penrose projection
PHI
Golden ratio φ = (1 + √5) / 2