Skip to content

pmdarrow/simple-audio-player

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Audio Player

An Audio Unit instrument plugin for macOS that plays a playlist of supported audio files. Built with JUCE 8 and CMake.

Inspired by Simple Audio Player Swift, but written as an AU instrument plugin with C++ & JUCE.

Simple Audio Player plugin UI

Features:

  • Add and remove supported audio files from anywhere on disk, including WAV, AIFF, FLAC, OGG, MP3, M4A, AAC, and other CoreAudio-backed formats on macOS.
  • Play / pause and seek via a draggable progress slider.
  • Single click to select a track, double click (or the play button) to play it.
  • Auto-advances to the next track at end-of-file.
  • Playlist and current track persist in the plugin's host state.

Install

Run the installer directly from the repository:

curl -fsSL https://raw.githubusercontent.com/pmdarrow/simple-audio-player/main/scripts/install.sh | bash

The installer downloads the latest macOS release zip from GitHub Releases, extracts Simple Audio Player.component, and copies it into the system-wide Audio Unit folder:

/Library/Audio/Plug-Ins/Components/Simple Audio Player.component

Because this is a system-wide install, macOS will ask for an administrator password. Restart your DAW or rescan Audio Units after installing.

The component is not signed or notarized as I'm not really interested in paying to be a part of the Apple Developer Program.

Using the plugin

  1. Launch an AU-compatible host (Logic Pro, GarageBand, Ableton Live 11+, Reaper, AUM, …).
  2. Create a new instrument track and choose Peter Darrow → Simple Audio Player.
  3. Click Add to pick one or more supported audio files (from anywhere on disk) and drop them into the playlist. Remove deletes the selected track.
  4. Single-click a row to select it. Double-click a row (or use the round play button in the transport row) to start playback. The progress slider scrubs the current track; seeks commit on release. Playback auto-advances to the next track at end-of-file.

The playlist and the currently-loaded track are persisted in the plugin's host state, so reopening a session restores everything.

Development

Requirements

  • macOS 10.13 or later (Intel or Apple Silicon)
  • CMake 3.22 or later
  • Ninja (brew install ninja)
  • Xcode command-line tools (xcode-select --install) — a full Xcode install is recommended so the AU can be validated with auval
  • Git (used by CMake's FetchContent to pull JUCE)

Optional, for dev tooling:

  • brew install llvm — provides clang-format and clang-tidy used by the format / format-check / tidy CMake targets and the git pre-commit hook.

Building

From the project root:

cmake -B build -G Ninja
cmake --build build

The first configure step clones JUCE 8.0.12 into build/_deps/ via FetchContent; this can take a few minutes. Subsequent builds are incremental.

On success two artefacts are produced:

build/SimpleAudioPlayer_artefacts/AU/Simple Audio Player.component   # the AU plugin
build/SimpleAudioPlayer_artefacts/Standalone/Simple Audio Player.app # dev-only standalone app

The standalone app is handy for iterating on the UI without having to open a DAW — it wraps the same editor in a window and routes audio to the default output device.

For a universal (Intel + Apple Silicon) distribution build, override the architecture at configure time:

cmake -B build-universal -G Ninja -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"
cmake --build build-universal

Because COPY_PLUGIN_AFTER_BUILD is enabled in CMakeLists.txt, the bundle is also copied into the user plugin folder:

~/Library/Audio/Plug-Ins/Components/Simple Audio Player.component

Validating the plugin (optional)

macOS caches AU metadata aggressively. After the first install (or any time you re-build) you may want to:

killall -9 AudioComponentRegistrar || true
auval -v aumu Sapl Pdar

aumu is the AU type for music devices / instruments. Sapl is this plugin's four-character code and Pdar is the manufacturer code — both defined in CMakeLists.txt.

Tooling

All dev tooling is driven by CMake targets and a checked-in git hook — no Python/Node frameworks required.

The plugin is built with Apple Clang (standard for the macOS AU flow). clang-format and clang-tidy come from Homebrew's keg-only llvm, which the CMake targets and git hook locate automatically.

One-time setup after cloning:

brew install llvm gh                        # clang-format, clang-tidy, GitHub CLI
git config core.hooksPath .githooks         # activate the checked-in hook

The pre-commit hook (.githooks/pre-commit) runs clang-format --dry-run against staged C/C++ files and blocks the commit if anything would be reformatted. Bypass with git commit --no-verify.

Target What it does
format Rewrite sources in place via clang-format.
format-check Fail if any source needs reformatting. Useful in CI.
tidy Run clang-tidy across the sources.

Run any of them with cmake --build build --target <name>.

Creating a GitHub release

The release helper builds a universal AU, packages the component as dist/simple-audio-player-<version>-macos.zip, and uploads it to a GitHub release tagged v<version>. Before releasing, bump the version in project(SimpleAudioPlayer VERSION ...) in CMakeLists.txt and commit that change. The release script reads that CMake version automatically:

bash scripts/create-github-release.sh

Use --draft to create a draft release first:

bash scripts/create-github-release.sh --draft

The script requires a clean working tree and a current branch that is pushed to GitHub, so the release tag matches the packaged source. To test the packaging without publishing a release:

bash scripts/create-github-release.sh --dry-run

License

This project is released under the MIT License.

About

AU instrument plugin that plays a playlist of supported audio files, written with C++ and JUCE.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors