青少年工程的PO-32声学调制解调器和合成器实现。
Teenage Engineering's PO-32 acoustic modem and synth implementation

原始链接: https://github.com/ericlewis/libpo32

## libpo32:PO-32 数据传输与合成库 libpo32 是一个小型、独立的 C99 库,旨在与 Teenage Engineering 的 PO-32 鼓机进行交互。它专注于复制数据传输过程和鼓合成,*不*作为完整的模拟器。 该库处理构建和解析 PO-32 数据包(补丁、模式、状态),将它们编码成与设备声学调制解调器兼容的音频信号,并将接收到的音频解码回数据。重要的是,它还允许本地合成 PO-32 的鼓声,以便预览和测试。 libpo32 专为嵌入式系统设计,仅需要标准的 C99 头文件,并避免使用 libc 或特定于平台的音频 API 等外部依赖项。它有助于构建向 PO-32 发送/接收数据的工具,并包含编码/解码、鼓合成甚至基本模式编辑器的演示。工作流程包括创建数据、将其渲染为音频,然后将其播放到 PO-32 中进行导入。

## Teenage Engineering PO-32 & 音频数据传输 - Hacker News 总结 最近的 Hacker News 讨论围绕着 Eric Lewis 的 GitHub 项目,该项目为 Teenage Engineering 的 PO-32 设备实现了一个声学调制解调器和合成器。该项目允许通过音频进行固件更新和数据传输,利用设备的扬声器和麦克风,而不是像 USB 这样的传统方法。 对话中提到,基于音频的数据传输并非新事物,并引用了历史上的例子,如 Commodore 64 磁带加载、Roland Juno 60 数据存储,甚至堪萨斯城标准唱片。用户分享了使用类似技术和工具(如 gnuradio 用于解调音频比特流)的经验。 PO-32 的方法将合成器参数和音符信息编码到音频信号中,有效地充当一个接收“预设”而不是样本的合成器。虽然有些人质疑其与 USB-C 相比的实用性,但另一些人则欣赏这种独特的方法及其吸引力,并指出它符合 Teenage Engineering 的品牌形象。该合成引擎基于 Sonic Charge 的 Microtonic。
相关文章

原文

Tests Codecov FOSSA Status

A small C99 library for Teenage Engineering PO-32 acoustic data transfers and drum synthesis.

libpo32 reimplements the PO-32 Tonic transfer stack and a compatible drum voice model. It is not a full PO-32 firmware or UI emulator; it covers the packet format, acoustic modem, frame decoder, and local drum synthesis needed to build, send, receive, and preview PO-32 transfers.

Area What libpo32 provides
Transfer protocol Build and parse PO-32 patch, pattern, and state packets
Acoustic modem Render transfer frames to DPSK audio for playback into the device
Decoder Recover normalized frames and packets from transfer audio
Drum synthesis Render the PO-32's 21-parameter drum voice locally for preview and testing

The core is freestanding C99: no libc runtime, no external DSP libraries, no platform audio APIs, no file I/O. Only the freestanding headers <stddef.h> and <stdint.h> are used. Suitable for embedded targets and bare-metal environments.

The PO-32 is not receiving finished drum audio when you transfer a sound or a pattern. It receives structured data:

Data Meaning
Patch packets The two patch endpoints per instrument (Left and Right), with the destination instrument slot encoded in the packet
Pattern packets Which instruments trigger on which steps, with the destination pattern slot encoded as pattern_number
State packet Tempo, swing, morph defaults, and the transferred pattern list

The device then uses its own internal synth engine to turn those parameters into sound.

At a high level, the workflow with real hardware is:

Step What you do
1 Build a transfer in software from patch, pattern, and state data
2 Render that transfer to a WAV or live audio stream
3 Put the PO-32 into its normal receive/import flow
4 Play the rendered transfer audio into the device
5 The PO-32 decodes the packets and writes them to the sound or pattern slots named inside those packets

From the repository root, configure, build, run tests, then the demo:

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j4
ctest --test-dir build --output-on-failure
./build/po32_demo

Optional, but recommended for local development:

./scripts/install-git-hooks.sh

That enables the repo-managed pre-commit hook, which runs clang-format on staged .c and .h files before each commit and validates commit subjects against Conventional Commits. The repo-managed pre-push hook runs the static analysis script before push.

The demo builds a transfer frame, renders it to audio, decodes it back (verifying a lossless roundtrip), synthesizes a drum hit, and writes two WAV files: demo_modem.wav and demo_kick.wav.

Command Purpose
./build/po32_example Minimal roundtrip: encode, render, decode, and verify
./build/po32_demo End-to-end demo: transfer frame build/render/decode plus local drum synthesis
./build/po32_pattern_editor Interactive PO-32 pattern editing and WAV export
./build/po32_decode_capture <input.wav> <out-dir> Packet and pattern dumps from a transfer WAV

See CONTRIBUTING.md for local setup, verification commands, and the Conventional Commits policy used for SemVer-friendly history.

Copyright (c) 2026 Eric Lewis. Licensed under the MIT License. See LICENSE.

联系我们 contact @ memedata.com