Turn Your MacBook into an Accordion
Uses the lid angle sensor as bellows, keyboard as keys, with real-time polyphonic audio synthesis
Reads the MacBook lid opening angle and converts it into bellows push/pull force β the wider you move, the louder it gets
PolyAccordionSynth engine with dual detuned sawtooth waves and soft-clipping, outputting at 44.1 kHz in real time
Two-octave keyboard layout mimicking piano black and white keys, with octave transposition support
GUI sliders for real-time adjustment of bellows sensitivity, reed thickness, air noise, and 11 parameters total
Download the ready-to-run macOS app. No Python or dependencies needed.
Download LidAccordion.appRequires macOS. Check Releases for all versions.
pip install pygame numpy sounddevice pybooklid
python lid_accordion.py
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.
White keys: Q W E R T Y U I O P
Black keys: 1 2 4 5 6 8 9 0
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
If you enjoy this project, consider buying me a coffee or donating via crypto!
0xF821eaE8df237022F17235C36eb22D8426b989A4