Control your Mac with a wave of your hand. Sonar uses your Mac’s built-in speakers and microphone to detect movement.
This is an experiment in progress. Requires a Mac with Apple silicon (M-series chip) running macOS 14 or later. Sonar does not work on MacBook Neo, and Intel Macs are not guaranteed to work.
Download Sonar Classic v0.1.6 for Apple silicon. Open the DMG and drag Sonar into Applications. This is an experimental pre-release; testing across MacBook models is ongoing.
Install Apple’s command-line developer tools with xcode-select --install, then:
git clone https://github.com/eperez28/sonar.cool.git
cd sonar.cool
./script/build_and_run.shThe script builds and tests Sonar Classic, installs it to ~/Applications/Sonar Classic.app, and opens it. Source files live in work/Sonar/. Try the gestures on your Mac to see how they respond to your setup.
A Package.swift is included for IDE support. Open the project in Xcode with:
xed .Xcode gives you autocomplete, jump-to-definition, and inline errors while editing.
Press ⌘R to run. The Xcode build shares script/Info.plist with the build script, so it reports the same version and asks for microphone access.
Two cosmetic items are not available in the Xcode build: the generated app icon and the logo mark in the sidebar. These are produced by the build script. Controlling other apps needs Accessibility access, which is simplest to grant to the app the build script installs.
Use the build script for a release-quality build with full icons and signing. Use Xcode for day-to-day editing and development runs.
Allow microphone access and Accessibility access for controlling other apps. Choose a mode, press Start, and keep your hands still during the countdown. Stop the session from the menu bar or with Control–Option–Command–Space.
Use the built-in speakers and microphone. Stop if the tone is audible or uncomfortable.
FYI for pets: The default tone is 20 kHz. Dogs and cats can hear this frequency. Use Sonar away from pets and stop if they seem uncomfortable. Pet safety and sound levels across Mac models still need evaluation.
Sonar checks which sound setting works on your Mac. Rest your hands for a 10-second sound check. Then follow the prompts to lift and lower your hand, and stop when it says STOP. Settings are saved only after those checks pass.
If a setting fails, you can try the next sound setting or save a report to share for help. Nothing is sent automatically. Open Settings → Recalibrate to run setup. Setup is optional. You can use your current settings, and a failed or cancelled check keeps them unchanged. Moving into position before GO is not scored.
Setup checks basic sensing and simulated gesture decisions; try each mode yourself afterward. Changing volume during a running session restarts its calibration. Setup also learns a small resting-motion tolerance, checks it on a separate resting sample, and saves it only when intentional movement and stopping pass. Normal use applies that tolerance at the tested frequency and volume; rerun setup to learn it at a different volume.
Use Practice here to try the bundled demos. For Other apps, bring the target app forward and click its content. More about gestures and app compatibility.
Lift your palm to scroll and lower it to stop. To change direction, enable Air double-tap, then push down twice quickly.
Sweep your hand sideways to browse photos or navigate apps that accept arrow keys. Pause before returning your hand. Direction controls let you reverse Swipe.
Push toward the screen to zoom in. Pull back toward yourself to zoom out. Browser zoom returns to 100%. Reverse gestures flips the direction.
Signal shows an illustration of the sound changes as you move.
Your Mac’s speakers play a steady, high-frequency tone, set to 20 kHz by default. Some of that sound bounces off your hand and returns to the microphone.
As your hand moves toward the speakers and microphone, the reflected sound shifts slightly higher in frequency. Moving away shifts it lower. This is the Doppler effect, the same effect that changes the pitch of a passing siren.
Sonar compares the reflected sound with the tone it’s playing. It looks for patterns in those frequency changes, then turns a recognized gesture into a scroll, swipe, or zoom command. The microphone also picks up reflections from your desk, room, and other movement. Separating those reflections from your hand’s movement is part of the experiment.
Sonar describes using sound and echoes to sense something. The Doppler effect is the frequency change this app uses to detect movement.
Scrolling and Swipe have worked on the development Mac. Sideways gestures are inferred from movement toward and away from the audio hardware. Return strokes can trigger extra swipes, and Zoom recognition still needs testing across setups. Distance and Position are ongoing experiments.
Power and battery testing is ongoing. Measurement notes.
Reports from other Mac models and pull requests are welcome. Include your Mac model, macOS version, mode, and what happened.
Microphone audio is processed locally in memory and discarded after processing. Recent motion readings and optional verification reports are saved locally in ~/Library/Caches/Sonar/ for debugging.
Inspired by SoundWave: Using the Doppler Effect to Sense Gestures, by Sidhant Gupta, Dan Morris, Shwetak Patel, and Desney Tan (CHI 2012). Their research demonstrated gesture sensing with existing speakers and microphones. Sonar is Emanuel Perez’s independent implementation.
Thanks also to Daniel Rapp for Doppler, his browser implementation of SoundWave. We studied his sensing code and demos as a reference while building Sonar.
Sonar's source is available under the MIT license. The bundled SoundWave paper retains its original copyright and separate terms.
By submitting a pull request, you agree that your contribution is licensed under the same MIT license.
If you’re enjoying Sonar, you can buy me a coffee.
Swipe photo sources and their separate license are listed in photo credits.
The Yoda practice image was supplied for this demo and retains its separate rights. For concerns about either bundled item, contact Emanuel.
If Sonar says Active but nothing happens—or it scrolls while your hand is still—open Run diagnostics… in the sidebar. The test pauses gesture control, checks the microphone and speaker signal, and asks you to move your palm. It measures calibration variation and runs the scroll rules without controlling your apps to check for unwanted scrolling. After it finishes, optional frequency and longer stillness checks add to the same report. You can also send one timed test scroll to another app and tell Sonar whether it worked.
Choose Save report… to save a readable .txt file with the result first and technical details below. The report includes your Mac model, macOS and app versions, permission status, session-local audio route numbers, volume/mute values, audio callback errors, and summary signal measurements. It contains no recorded audio, screenshots, window titles, device names, serial numbers, or file paths. Nothing is uploaded automatically.
The checks help narrow down a problem; they cannot identify every source of interference. Frequency checks do not change your normal settings. Diagnostics are included in Sonar 0.1.3 and later.



