music player for findingfocus stream music
  • Svelte 28%
  • HTML 27.6%
  • Shell 15.5%
  • CSS 11.4%
  • TypeScript 8.6%
  • Other 8.9%
Find a file
2026-09-10 16:56:28 -06:00
.kamal svelte rebuild with docker, kamal, and r2 storage 2026-08-29 12:49:44 -06:00
bin add failure hardening 2026-09-01 23:00:53 -06:00
config svelte rebuild with docker, kamal, and r2 storage 2026-08-29 12:49:44 -06:00
src artfetch 2026-09-05 18:33:31 -06:00
static svelte rebuild with docker, kamal, and r2 storage 2026-08-29 12:49:44 -06:00
.dockerignore svelte rebuild with docker, kamal, and r2 storage 2026-08-29 12:49:44 -06:00
.gitignore svelte rebuild with docker, kamal, and r2 storage 2026-08-29 12:49:44 -06:00
.npmrc svelte rebuild with docker, kamal, and r2 storage 2026-08-29 12:49:44 -06:00
docker-compose.yml svelte rebuild with docker, kamal, and r2 storage 2026-08-29 12:49:44 -06:00
Dockerfile svelte rebuild with docker, kamal, and r2 storage 2026-08-29 12:49:44 -06:00
nginx.conf svelte rebuild with docker, kamal, and r2 storage 2026-08-29 12:49:44 -06:00
package-lock.json svelte rebuild with docker, kamal, and r2 storage 2026-08-29 12:49:44 -06:00
package.json svelte rebuild with docker, kamal, and r2 storage 2026-08-29 12:49:44 -06:00
README.md update README 2026-09-02 19:57:53 -06:00
slides.html fullscreen mode 2026-09-10 16:56:28 -06:00
TOOLING.md update tooling 2026-09-02 20:00:10 -06:00
tsconfig.json svelte rebuild with docker, kamal, and r2 storage 2026-08-29 12:49:44 -06:00
vite.config.ts svelte rebuild with docker, kamal, and r2 storage 2026-08-29 12:49:44 -06:00

findingfocus.music

Waveform music player built with SvelteKit 5 (static adapter) and wavesurfer.js. Audio is streamed straight from Cloudflare R2 (bucket findingfocus-music).

Local dev

npm install
npm run dev

Checks & build

npm run check    # svelte-check
npm run build    # builds static site into /build (adapter-static)
npm run preview  # serve the production build locally

Local testing with Docker

docker compose up --build   # -> http://localhost:3000 (container: ffmusic)
docker compose down

Recording in SuperCollider

// REC TOGGLE — run once to start, again to stop
(
var numChans = 2;
var dir, path;
s.waitForBoot {
  if (s.isRecording) {
    s.stopRecording;
    "STOP -> % (exact take)".format(~recPath).postln;
    ~recPath = nil;
  } {
    dir = PathName(thisProcess.platform.userHomeDir) +/+ "recordings";
    path = (dir +/+ (Date.getDate.stamp ++ ".wav")).fullPath;
    s.recHeaderFormat = "wav";
    s.recSampleFormat = "int16";
    s.recChannels = numChans;
    s.record(path: path, numChannels: numChans);
    ~recPath = path;
    "REC ON -> %".format(path).postln;
  };
};
)

Publishing a track

Drop a take in $RECORDINGS_DIR (default ~/recordings), then run the publish script. It picks the newest .wav, renders peak data, encodes the MP3, uploads it to R2, and writes the resulting track straight into the live tracks.json — no code edits or deploy needed.

bin/publish-nightly.sh                # publish the newest .wav in ~/recordings
bin/publish-nightly.sh --wav ~/take.wav

Options:

Flag Description
--wav FILE WAV to publish (default: newest .wav in $RECORDINGS_DIR)
--code FILE Tidal code to attach (default: <date>.tidal in $FF_TIDAL_DIR, else pulled from findingfocus.io/findingfocus/tidal)
--title NAME Override the track title (with --replace: renames the existing track)
--fade N Loop crossfade width in seconds (default 0 = raw take; >0 wraps)
--edge-fade N Fade in/out at file edges (default 0.05; use 0 to disable)
--replace SLUG Re-encode and overwrite an existing track in place, e.g. 2026-08-29_1
--dry-run Build everything and print what would upload; upload nothing

The bucket must allow cross-origin GET requests (CORS GET, origin *) so the browser can fetch and decode audio for the waveform.

Deploy (Kamal)

Config in config/deploy.yml.

kamal setup    # first time (install/configure the web server)
kamal deploy