nfunc

v0.5.1

A two-deck sample tool for the audio on your own machine: loop, trim, fade and mix, then publish a sample with Nostr.

What it is

A desktop app for Apple and Linux. Load two files side by side, find the part you want, shape it, and save or publish the result. What you publish plays on smpl.fizx.uk.

The stack

Tauri 2 desktop binary, React 19, TypeScript, Tailwind v3. The frontend is Vite, and builds with bun or npm.

Access to your files goes through Rust commands. Edits run through ffmpeg, and tempo detection through aubio.

Why this stack: web technology matches the smpl.fizx.uk site, so the Nostr and audio code is shared, while Tauri ships it as a real desktop app that fits the rest of the suite.

Get it

Version 0.5.1. Every release, and the source: GitHub.

Features

Browse a samples folder
Type a path and see every audio file in it, or work down through a tree of folders.
Two decks
Two players with their waveforms, and a master strip between them.
more

Two WaveSurfer players. The master strip has one play/pause for both, transport, cue, and click-to-seek.

Loop regions
Drag across a waveform to mark an in and an out on each deck; playback wraps round the loop.
Edits
Trim, prune, fade in and out, gain, and padding at the start or end.
more

A two-track mix bounce renders both decks to a single WAV file. The edits run through ffmpeg.

Tempo
Detects the BPM for you, with a calculator that works from a count of bars. The result goes into a store that nplay and the other apps share.
Knows where a clip came from kind:31237
Traces a clip back to the release it was cut from, and can narrow the view to releases ndisc has published.
how

Clip and source are linked through ~/.config/ndisc-suite/roots.json, a file the suite’s apps share on your machine. Nothing here is read from the network.

Clip-coverage bars
In a folder of clips, each one shows how much of its source track it covers.
more

The length is measured when the folder is opened, as a fraction of the source track, with a total for the folder. It matches ntree’s library bar and copes with clips of any length.

Nostr

Your key
Make a key, bring one, or forget it. It is kept in the operating system’s own store, never in browser storage.
  • Linux — the Secret Service (libsecret)
  • macOS — the Keychain
Publish a sample kind:1063
The file is uploaded to a file host — nostr.build unless you choose another — then announced on a relay, with a link you can share.
How Nostr does it

A sample is uploaded over HTTP (NIP-96), with the request signed by your key (NIP-98). The address that comes back goes into a file event of kind 1063 (NIP-94), sent to a relay. These are Nostr standards: smpl.fizx.uk reads the same events, and so can any other client.

One limit today: nsmpl only publishes. It does not yet read a feed or other people’s samples.

Event kinds

  • kind:1063 a file and its metadata (NIP-94)
  • kind:31237 a release — the suite’s own convention

NIPs in play

  • NIP-94 file metadata — the sample event
  • NIP-96 uploading the sample over HTTP
  • NIP-98 signing the upload request
  • NIP-19 the share link to a published sample

Still to come

smpl.fizx.uk, the companion site

A web page that plays the samples this app publishes: smpl.fizx.uk.