展示HN:Contrapunk – 基于吉他输入进行实时对位和声,使用Rust编写。
Show HN: Contrapunk – Real-time counterpoint harmony from guitar input

原始链接: https://contrapunk.com/

## Contrapunk:实时和声生成 Contrapunk是一个用Rust构建的免费开源工具,用于实时生成和声,专为吉他手和音乐家设计。它既是一个MIDI和声生成器,也是一个具有低于10毫秒延迟的吉他转MIDI转换器——足够快以用于现场表演。 用户可以选择8种和声模式(Palestrina、Bach、Jazz等)和28种音阶,受益于基于既定复调规则的确定性布声(防止平行和交叉)。 Contrapunk提供灵活的输入:可以通过MIDI控制器直接演奏,或插入吉他进行实时音高检测和和声化。它原生运行于桌面(Tauri),通过WebAssembly在浏览器中运行,或作为服务器应用程序运行,所有这些都共享相同的Rust核心引擎。其MIT许可证确保所有音乐家的可访问性。

## Contrapunk:基于吉他输入的实时复调和声 一位开发者创建了 **Contrapunk**,一个macOS应用程序(以及[contrapunk.com](https://contrapunk.com)网站版本),可以从吉他、MIDI或键盘输入实时生成复调和声。用户可以选择调性、声部进行风格以及在和声中的期望角色。 该项目使用Rust构建,以实现低延迟(M系列Mac上低于10毫秒),专注于精确的音高检测,并利用预分配的环形缓冲区来最大程度地减少处理开销。开发者正在积极寻求关于DSP方法和和声算法的反馈,并计划可能使用机器学习改进吉他到MIDI的检测。 目前的开发重点是解决macOS的打包问题,改进低音音符的处理,并添加诸如调性检测以及对复调体裁的更多控制等功能。该项目是开源的 ([https://github.com/contrapunk-audio/contrapunk](https://github.com/contrapunk-audio/contrapunk)),欢迎贡献。
相关文章

原文
Contrapunk

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)

Real-time MIDI harmony generator and guitar-to-MIDI converter. Proper counterpoint rules. Sub-10ms latency. Built in Rust.

Free. No login. Browser works in Chrome with any MIDI controller.

CONTRAPUNK WITH A GUITAR

🎹 HARMONY ENGINE

8 harmony modes with real counterpoint rules. Palestrina, Bach, Jazz, Free. 28 scale modes. Deterministic voicing.

🎸 GUITAR INPUT

Plug in your guitar. Real-time pitch detection, onset tracking, auto-calibration. Play guitar, hear counterpoint.

⚡ SUB-10MS LATENCY

Single-cycle detection, 2-frame voting, 128-sample buffers. Fast enough for live performance.

🌐 RUNS EVERYWHERE

Native desktop via Tauri. Browser via WebAssembly. Server mode for studios. Same Rust core everywhere.

🎼 VOICE LEADING

Parallel fifths rejection. Voice crossing prevention. Spacing rules. Centuries of music theory, in code.

🔓 OPEN SOURCE

MIT licensed. Counterpoint rules are centuries of human knowledge. They should be accessible to every musician.

联系我们 contact @ memedata.com