let harmony = Engine.new(Palestrina);
fn detect_pitch(buf) -> Note
const MAX_VOICES: usize = 4;
voice_leading.reject_parallels()
struct GuitarInput { onset }
engine.harmonize(note, scale)
fn detect_pitch(
  buf: &[f32]
) -> Option<Note>
let voices =
  counterpoint::
    generate(line, mode);
if interval == Fifth
  && motion == Parallel
  { reject() }
#[inline(always)]
fn onset(
  frame: &Frame
) -> bool
block_size: 128
sample_rate: 48_000
latency_ms: 7.2
// Palestrina
// counterpoint
// rules.rs

Embed widgets — shared engine demo

Below: one harmony engine running invisibly, four widgets reading from it. Click the piano or fretboard, or use your computer keyboard:

  • Z X C V B N M + S D G H J — lower octave (C through B + sharps/flats)
  • Q W E R T Y U I + 2 3 5 6 7 — upper octave
  • + / - — shift octave up / down

Whichever instrument you trigger, the other lights up with the harmonized voices and the chord readout updates. All three surfaces are the same engine.

Chord

Piano

Fretboard

E2A2D3G3B3E43579121517192124

Fretboard (read-only, 24 frets)

Same engine state, no clicks, full neck. Demonstrates theinteractive={false} + frets=24 embed config.

E2A2D3G3B3E43579121517192124