Convert ANY song into Heavy Metal
Metalizer/
├── app/
│ ├── api/
│ │ └── routes.py # FastAPI routers and request models
│ ├── core/
│ │ └── config.py # Settings, paths, environment toggles
│ ├── services/
│ │ └── processor.py # MetalizerPipeline orchestration logic
│ ├── utils/
│ │ └── audio_io.py # Shared helpers (file validation, temp dirs)
│ └── main.py # FastAPI app entrypoint
├── assets/
│ ├── drums/ # High-quality double-kick drum samples
│ └── midi/ # MIDI motifs, riffs, tempo templates
├── data/
│ ├── inputs/ # Uploaded source tracks (per-session)
│ ├── outputs/ # Rendered heavy metal remixes
│ └── samples/ # Reference stems for experiments/tests
├── models/ # Pre-trained separation/backbone checkpoints
├── requirements.txt # Python dependencies
└── README.md
This layout keeps runtime artifacts (data/*) isolated from code, makes FastAPI modules discoverable, and creates clear homes for DSP assets and ML checkpoints.
- Persistent jobs: Every remix request is tracked in
data/jobs.sqlite3. Metadata survives restarts and old rows are pruned after 24 hours along with their rendered stems. - Queue backends: By default jobs run locally, but setting
QUEUE_BACKEND=rqandREDIS_URL=redis://...routes work to an RQ queue (seeapp/worker.py). - Job API:
/api/jobs,/api/jobs/{id}, and/api/jobs/{id}/resultexpose status, download links, and deletion. - Asset management: Use
/api/assetsand/api/assets/uploadto inspect or extend the drum/guitar sample banks without redeploying.
-
Install the Fly CLI
curl -L https://fly.io/install.sh | sh fly auth login -
Seed the Fly config
cp fly.example.toml fly.toml # edit fly.toml -> set `app`, `primary_region`, and any env overrides -
Provision persistent storage (used for uploads, renders, and SQLite fallbacks)
fly volumes create metalizer_data --size 10 --region <your-region>
-
Configure secrets / env vars
fly secrets set \ METALIZER_ASSETS_API_KEY=<random> \ METALIZER_REDIS_URL=redis://default:pass@host:port/0 \ METALIZER_JOBS_DB_URL=postgresql+psycopg://user:pass@host:5432/metalizer
- Attach your preferred Redis and Postgres services (Fly Postgres, Upstash, etc.).
- The
fly.example.tomlmapsMETALIZER_REDIS_URL→REDIS_URLso both the API (RQ enqueue) and the worker (rq worker --url ...) hit the same instance; don’t leave it unset or the worker will loop/crash. - Assets directory defaults to
/app/assets; mount additional packs via volumes or object storage if needed.
-
Deploy the API
fly deploy
-
Scale workers (RQ)
fly scale count app=1 fly scale count worker=1
The sample
fly.example.tomldefinesapp(uvicorn) andworker(RQ) process groups. Adjust counts or add machines per workload.
- The Docker image installs
ffmpegand binds/datafor uploads/outputs. Always attach themetalizer_datavolume (or equivalent) so rendered mixes persist. - If you prefer SQLite for jobs, keep the default
METALIZER_JOBS_DB_URL=sqlite:////data/jobs.sqlite3. Otherwise switch to Postgres for multi-instance deployments. - Use
fly secrets set METALIZER_ASSET_MAX_BYTES=52428800(for example) to enforce tighter upload limits per environment.