πŸͺ—

Lid Accordion

Turn Your MacBook into an Accordion

Uses the lid angle sensor as bellows, keyboard as keys, with real-time polyphonic audio synthesis

Features

πŸ“

Lid Angle Sensor

Reads the MacBook lid opening angle and converts it into bellows push/pull force β€” the wider you move, the louder it gets

🎡

Real-Time Synthesis

PolyAccordionSynth engine with dual detuned sawtooth waves and soft-clipping, outputting at 44.1 kHz in real time

🎹

Keyboard Mapping

Two-octave keyboard layout mimicking piano black and white keys, with octave transposition support

πŸŽ›οΈ

Live Tweak Panel

GUI sliders for real-time adjustment of bellows sensitivity, reed thickness, air noise, and 11 parameters total

Demo

Download & Install

Pre-Built App (Recommended)

Download the ready-to-run macOS app. No Python or dependencies needed.

Download LidAccordion.app

Requires macOS. Check Releases for all versions.

Run from Source

pip install pygame numpy sounddevice pybooklid
python lid_accordion.py

Build .app Yourself

chmod +x build_mac_app.sh
./build_mac_app.sh

# Run it
./dist/LidAccordion.app/Contents/MacOS/LidAccordion

Requires macOS + Python 3 (for source/build). Falls back to simulation mode (arrow keys) when the lid angle sensor is unavailable.

Key Bindings

Mid Range (MIDI 60–78)

White keys: Q W E R T Y U I O P

Black keys: 1 2 4 5 6 8 9 0

High Range (MIDI 72–94)

White keys: Z X C V B N M , . /

Black keys: A S D F G H J K L ;

Release Shift = octave up | Release Ctrl = octave down | Tab = reset to default

Support This Project

If you enjoy this project, consider buying me a coffee or donating via crypto!

β˜• Ko-fi

⟠ Ethereum Donation

0xF821eaE8df237022F17235C36eb22D8426b989A4