Skip to content
SpacekidLabsPublic

About

When existing tools didn't break audio hard enough, I built my own. DATABEND is an experimental offline audio glitching and sound mangling Electron app designed for sound designers and noise musicians.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

DATABEND

DATABEND is an experimental audio editor for glitching, slicing and wave-style processing. Load a file, work with transient slices and loop regions, run it through any of 49 processors, and export WAV.

The desktop app is native Rust: egui for the interface, CPAL for playback, Symphonia for decoding and RustFFT for spectral processing. It loads no JavaScript, HTML, Electron or webview.

DATABEND also runs in the browser at databend.spacekidlabs.com. That version is the original JavaScript app, kept in web/.

Run

Needs a recent stable Rust (edition 2024).

cargo run --release
# Open a file on launch:
cargo run --release -- /path/to/audio.wav

DATABEND opens in a window and comes back where you left it, at its last size and position or fullscreen (F11). --windowed ignores a remembered fullscreen.

Build the macOS app

rustup target add aarch64-apple-darwin x86_64-apple-darwin   # once
./scripts/build-native-macos.sh

This writes a universal dist/DATABEND.app (Apple Silicon + Intel, macOS 11 or later) and dist/DATABEND-<version>-universal.dmg. The version comes from Cargo.toml. The app is ad-hoc signed, not notarized, so macOS asks you to allow it the first time (right-click → Open). It uses the same bundle ID as the Electron app, so installing it replaces v1.x.

Release

Pushing a version tag builds the universal DMG on GitHub Actions and attaches it to a draft GitHub Release (.github/workflows/release.yml):

  1. Set version in Cargo.toml, run cargo check so Cargo.lock follows, and commit.

  2. Tag the commit, with the release notes in the tag message (one change per line), and push the tag:

    git tag -a v2.1.0 -m "- Added ...
    - Fixed ..."
    git push origin v2.1.0
  3. Check the draft under Releases on GitHub and press Publish.

The tag has to match the Cargo.toml version. spacekidlabs.com/download only sees published releases, so it switches to the new version on its next build after step 3.

Using it

The original fonts, palette, toolbar, waveform envelopes, processor names, parameter ranges and keyboard shortcuts carry over from the JavaScript app. The logo's context menu has the Destroy, slice-kit and Hard Cuts actions. Double-click the empty canvas, or choose Sample Browser from the waveform's context menu, to browse a folder.

Any file can be opened as sound: drop an image, a PDF or an app, or choose Open Any File (Cmd+Shift+O, or the context menus). Pick the bit depth, sign, byte order, rate and channels with a preview. The file is only read, up to its first 64 MB.

Stereo files stay stereo (a file with more channels gives its first two) and mono files mono. Processors run on each channel. Linked channels share the random seed, the slice points and the loudness match; untick Link Channels in the effect dialog or the logo's context menu to process them independently. Export is 16-bit WAV.

A file keeps its own sample rate (8 to 384 kHz) through editing and export; only playback converts to the output device's rate. Rates outside that range are converted to a multiple or fraction with a band-limited filter.

P opens the FX list. Type a few letters and press Enter, or move with the arrow keys; the star on an entry makes it a favourite. Favourites and the last eight processors used are at the top.

T shows the slices, and detects them the first time. Double-click adds a marker, or removes the one under the pointer; drag moves it; M puts one at the playhead. Split and Merge in the slice toolbar work on the selected slice. Grid slices to equal parts or to beats at a tempo. Changing the threshold detects again around the markers you placed, moved or removed, and can be undone.

Random Chain (C, or in the FX list) puts up to eight random processors in a row on the selection. It shows each step with its settings; reroll one or all, audition, and commit the chain as one undo step.

With slices showing, an effect can be applied to each slice by itself: the same settings, random settings per slice, or a random processor per slice (Each Slice in the slice toolbar). Markers follow changes in length, L locks a slice out, Audition plays the whole result, and it is one undo step. A slice a processor can't work on stays as it is.

Export Slice Kit, in the logo's and the waveform's context menu, writes each slice to its own WAV. It can name the files and a folder ({name}, {n}), trim silence, fade, normalise and write tags. The settings are remembered, silent slices are left out when trimming, and no file is ever overwritten.

Every effect dialog has Audition. It loops the processed selection (or the active loop, or the whole track) and refreshes when you move a slider, change a dropdown or press Random, without touching your edits or undo history. Stop Audition, Space, Cancel and Escape stop the preview. A (or the Processed button) switches to the dry sound and back while it plays, at matched loudness. If the result has another length, both loop on their own length and a switch lands at the same fraction of the loop. Commit uses the same rendered audio and random seed as the preview. The result is matched to the loudness of the source, raised by at most 12 dB, and limited instead of clipped. Fades, Tape Stop, Mute, Gate, Waveset K-Means and Spectral Rotator keep their own level.

Random picks new settings, menus included, from ranges that work for each processor; Lock next to a control keeps it as it is. Locks are remembered.

A processed region is blended into its neighbours over 2 ms at each edge. Choose Hard Cuts in the logo's context menu to paste it as it is. Loops fade over the same time into what leads up to the loop start, during playback only.

Recovery data is saved to ~/Library/Application Support/DATABEND/: the state in recovery.json and the audio next to it as a 32-bit float WAV, written only when the audio changed. Set DATABEND_DATA_DIR to use a different folder, for example for a test session. Loading a file is an undo step too. Undo history holds up to 100 snapshots (about 512 MiB) and isn't kept between launches. The current audio, selection, markers and folder are. A session from 2.0 with several tracks opens its active track; the others are written to recovered-tracks/ as WAV, and the old file is kept as recovery-2.0.json.

Tests

cargo test --locked --no-default-features

The Rust sound is the reference. tests/regression.rs renders every processor at its defaults, at each control's extremes and with each menu option, and compares every sample with what it rendered before (tests/fixtures/, within 0.000002). Transient positions are compared exactly at four sample rates. Other tests cover the editor (undo/redo, region replacement, fades, recovery, PCM16), loudness, and Audition on every effect.

When a processor is meant to sound different, update its fixture and say why in the commit:

UPDATE_FIXTURES=ring,comb cargo test --no-default-features --test regression   # or "all"

Only the named fixtures are rewritten, one file per processor. A new processor needs its fixture written the same way.

Notes

  • The spectral processors (Bin Sort, Spectral Freeze, Blur and Gate, Partial Swap) share one STFT (src/dsp/stft.rs) that gives the input back when nothing is changed. Block Smear, which used to be called Spectral Smear, works on blocks of samples.
  • DSP uses f64 arithmetic and f32 storage. Wavelet coefficients are the original's. Export rounds to 16 bit, so a 16-bit file that isn't edited comes out bit for bit.
  • Randomized effects stay random; a seeded generator makes tests reproducible.
  • The automation selectors and Melter's feedback control do nothing yet.

DATABEND online (web/)

web/ is the original JavaScript app (formerly the Electron desktop app, released up to v1.1.0). It's still live as DATABEND online. The Rust app was ported from it and no longer follows it.

cd web
npm run build:web   # writes web/web-dist/

Every push to main deploys it to databend.spacekidlabs.com through Cloudflare Workers Builds, with the build's root directory set to web (web/wrangler.jsonc).

The Electron shell (main.js, preload.js, the splash screen) is still in web/ but is no longer released. web/waveset-k-means-quantizer/ is an older, separate analysis prototype.

Project structure

  • src/: the Rust app (dsp/ holds the processors)
  • tests/: regression, editor and Audition tests, with the rendered fixtures
  • assets/: fonts, icon and the processor catalog
  • scripts/build-native-macos.sh: builds the universal .app and .dmg
  • web/: DATABEND online (JavaScript)

License

ISC. See LICENSE.

About

When existing tools didn't break audio hard enough, I built my own. DATABEND is an experimental offline audio glitching and sound mangling Electron app designed for sound designers and noise musicians.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages