Skip to content

sutrommusic/rust-scope

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust Scope — Apple Silicon VST3 + Audio Unit

Rust Scope is a transparent, multi-mode music visualizer for Apple Silicon Macs. It passes mono or stereo audio through unchanged and copies the samples into a lock-free atomic ring buffer for display in its egui editor.

The project builds two self-contained desktop plug-in formats from the same Rust code:

  • VST3: Rust Scope.vst3
  • Audio Unit v2: Rust Scope.component

The AU version is intended for Logic Pro, GarageBand, MainStage, and other macOS AU hosts. This is an AUv2 desktop component, not an AUv3 app extension or iOS plug-in.

Included visualizations

The editor has fourteen selectable views:

  1. Mono oscilloscope with peak and RMS readings
  2. Split left/right stereo waveform
  3. Peak and RMS meters
  4. Waveform persistence trails
  5. Rising zero-crossing triggered oscilloscope
  6. Circular waveform
  7. Log-frequency FFT spectrum analyser
  8. Scrolling spectrogram
  9. 24 logarithmic frequency-band bars
  10. Fundamental pitch, musical note, confidence, and cents offset
  11. Stereo vectorscope/goniometer
  12. Phase-correlation meter
  13. Mid/side waveforms and RMS readings
  14. Stereo-width history

FFT work, pitch estimation, history management, and drawing happen on the GUI thread. The realtime audio callback only copies left and right samples into preallocated atomic arrays. It takes no locks and performs no heap allocation.

Requirements

  • Apple Silicon Mac (arm64 only)
  • macOS with Apple Command Line Tools
  • Current stable Rust
xcode-select --install
rustup update stable

Run the commands from a native Apple Silicon Terminal. A Terminal process running under Rosetta reports x86_64 and is intentionally rejected by the installer.

Build and install

From the project directory:

./install-macos.sh

The script:

  1. Adds the aarch64-apple-darwin Rust target.
  2. Builds the Rust library in release mode for Apple Silicon.
  3. Uses clap-wrapper to create self-contained VST3 and AUv2 bundles.
  4. Ad-hoc signs both bundles for local use.
  5. Installs them to the per-user plug-in folders.

Installed locations:

~/Library/Audio/Plug-Ins/VST3/Rust Scope.vst3
~/Library/Audio/Plug-Ins/Components/Rust Scope.component

The installer replaces older copies of Rust Scope in those two locations. Restart the DAW or run a full plug-in rescan afterward.

Build without installing

rustup target add aarch64-apple-darwin
cargo build --package rust_scope --release --target aarch64-apple-darwin
cargo bundle --auv2-id aufx:Rscp:LRst \
  target/aarch64-apple-darwin/release/librust_scope.dylib

Generated bundles:

target/aarch64-apple-darwin/release/Rust Scope.vst3
target/aarch64-apple-darwin/release/Rust Scope.component
target/aarch64-apple-darwin/release/Rust Scope.clap

The .clap bundle is generated because CLAP is the internal implementation used by both wrappers. The install script installs only VST3 and AUv2.

Validate the Audio Unit

After installation:

auval -v aufx Rscp LRst

The Audio Unit identifier consists of three four-character codes:

Type:         aufx
Subtype:      Rscp
Manufacturer: LRst

Change these codes before distributing a derivative, while keeping each code exactly four ASCII characters. Changing them causes DAWs to treat the plug-in as a different Audio Unit.

Architecture check

Inspect either installed binary with:

file "$HOME/Library/Audio/Plug-Ins/VST3/Rust Scope.vst3/Contents/MacOS/Rust Scope"
file "$HOME/Library/Audio/Plug-Ins/Components/Rust Scope.component/Contents/MacOS/Rust Scope"

Both should report arm64. No Intel or universal slice is built.

Implementation notes

  • NIH-plug directly supplies the plug-in's CLAP implementation.
  • clap-wrapper exposes the same implementation as VST3 and AUv2.
  • RustFFT performs a 4,096-point Hann-windowed FFT on the GUI thread.
  • The spectrogram is derived from logarithmically spaced FFT samples.
  • Pitch estimation uses normalized autocorrelation on a downsampled recent window.
  • NIH-plug's native VST3 feature is disabled; the project uses the permissively licensed clap-wrapper VST3 bridge.

Files

  • src/lib.rs: plug-in definition, stereo realtime capture, editor setup, and export entry points.
  • src/visuals.rs: all analysis routines and fourteen visualization renderers.
  • install-macos.sh: Apple Silicon build, bundling, signing, and installation.
  • .cargo/config.toml: locks Cargo's target to aarch64-apple-darwin.
  • xtask/: cargo bundle command supplied by clap-wrapper-bundler.

About

Audio VST Plugin that does basic visualisation

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages