Fork of samhenrigold/LidAngleSensor with added Accordion Mode 🪗
This fork adds a bisonoric accordion mode where you can play notes using keyboard keys while controlling the bellows by opening/closing the MacBook lid.
by restromingo
Hi, I'm Sam Gold. Did you know that you have rights a lid angle sensor in your MacBook? The Constitution human interface device utility says you do.
This is a little utility that shows the angle from the sensor and, optionally, plays a wooden door creaking sound if you adjust it reeaaaaaal slowly.
This fork adds an Accordion Mode feature:
- 12 accordion buttons mapped to keyboard keys
- Bisonoric behavior: Each button plays different notes when bellows are opening (pull) vs closing (push)
- Bellows control: Sound only plays when the lid is moving (velocity > 1 deg/s)
- Volume control: Faster movement = louder sound
- Two sound modes: Synthesized sine waves or sample-based playback (гармошка.wav)
- Polyphonic: Play multiple notes simultaneously
How to use:
- Select "Accordion" mode in the app
- Press keyboard keys (1-9, 0, -, =) to play notes
- Open/close the MacBook lid to control the bellows
- Toggle between synthesized and sample-based sound using the checkbox
What is a lid angle sensor?
Despite what the name would have you believe, it is a sensor that detects the angle of the lid.
Which devices have a lid angle sensor?
It was introduced with the 2019 16-inch MacBook Pro. If your laptop is newer, you probably have it. People have reported that it does not work on M1 devices, I have not yet figured out a fix.
My laptop should have it, why doesn't it show up?
I've only tested this on my M4 MacBook Pro and have hard-coded it to look for a specific sensor. If that doesn't work, try running this script and report the output in an issue.
Known problematic models:
- M1 MacBook Air
- M1 MacBook Pro
Can I use this on my iMac?
Not yet tested. Feel free to slam your computer into your desk and make a PR with your results.
It totally works. If it doesn't work for you, try slamming your computer harder?
Why?
A lot of free time. I'm open to full-time work in NYC or remote. I'm a designer/design-engineer. https://samhenri.gold
No I mean like why does my laptop need to know the exact angle of its lid?
Oh. I don't know.
Can I contribute?
I guess.
Why does it say it's by Lisa?
I signed up for my developer account when I was a kid, used my mom's name, and now it's stuck that way forever and I can't change it. That's life.
How come the audio feels kind of...weird?
I'm bad at audio.
Where did the sound effect come from?
LEGO Batman 3: Beyond Gotham. But you knew that already.
Can I turn off the sound?
Yes, never click "Start Audio". But this energy isn't encouraged.
-
Download the app:
- Go to releases folder
- Download
LidAngleSensor-accordion.zip
-
Extract and install:
- Double-click the
.zipfile to extract - Drag
LidAngleSensor.appto your/Applicationsfolder
- Double-click the
-
Launch:
- Open
/Applications/LidAngleSensor.app - If macOS blocks it: Right-click → Open → Click "Open"
- Open
-
Clone and install:
git clone https://github.com/restromingo/garm.git cd garm chmod +x install-app.sh ./install-app.shThe script automatically extracts, signs, and installs the app.
-
Clone this repository:
git clone https://github.com/restromingo/garm.git cd garm -
Run the install script:
chmod +x install.sh ./install.sh
If you need administrator privileges:
sudo ./install.sh
-
Launch the app from
/Applications/LidAngleSensor.app
-
Clone this repository:
git clone https://github.com/restromingo/garm.git cd garm -
Build the project:
xcodebuild -project LidAngleSensor.xcodeproj \ -scheme LidAngleSensor \ -configuration Release \ build \ CODE_SIGN_IDENTITY="" \ CODE_SIGNING_REQUIRED=NO -
Find the built app:
find ~/Library/Developer/Xcode/DerivedData -name "LidAngleSensor.app" -type d | grep Release
-
Copy to Applications:
- Open Finder and navigate to the path from step 3
- Drag
LidAngleSensor.appto/Applications
- Open
LidAngleSensor.xcodeprojin Xcode - Select the
LidAngleSensorscheme andReleaseconfiguration - Press
Cmd+Bto build - Find the
.appfile in the Products folder and copy it to/Applications
- macOS (tested on macOS with M4 MacBook Pro)
- Xcode installed (tested on Xcode 26) or Xcode Command Line Tools
- MacBook with lid angle sensor (2019 16-inch MacBook Pro or newer, does not work on M1 devices)
Installation script fails:
-
Xcode not found:
# Install Xcode from App Store, or install Command Line Tools: xcode-select --install -
Xcode license not accepted:
sudo xcodebuild -license accept
-
Build fails:
- Open the project in Xcode:
open LidAngleSensor.xcodeproj - Build manually:
Product > Build(Cmd+B) - Check for specific error messages
- Open the project in Xcode:
-
Permission denied when copying to /Applications:
- The script will try with
sudoautomatically - Or copy manually: Find the
.appfile and drag it to/Applicationsin Finder
- The script will try with
-
App not found after build:
- Check:
find ~/Library/Developer/Xcode/DerivedData -name "LidAngleSensor.app" - Build output shows the exact path
- Check:
The app doesn't work:
- Make sure your MacBook has a lid angle sensor (2019 16-inch MacBook Pro or newer)
- M1 MacBooks are not supported - this is a known limitation
- Try running the original LidAngleSensor first to verify your hardware works
According to this issue, building requires having Xcode installed. I've only tested this on Xcode 26. YMMV.