Skip to content

About

Turn any song into chords: native iOS (SwiftUI) + Android (Compose) apps, FastAPI backend, PyTorch chord/beat worker.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

MusicDecoded

License: MIT / AGPL-3.0 contracts api worker android ios

Turn any song into chords you can follow. Pick a file, record audio, or find a song on YouTube or SoundCloud. MusicDecoded transcribes the beats, chords, key, BPM and time signature, then shows them on a scrolling player with a piano that plays along. Transcriptions are saved on your phone and work offline. An account is optional and only adds sync across devices.

Home: recent songs and sources Player: scrolling chord timeline over the waveform, piano with fingering Chord sheet view with Roman numerals Piano focus: current and next chord, inversions

Features

  • Native iOS (SwiftUI) and Android (Jetpack Compose) apps that share one API contract
  • Sources: files, the music library, the microphone, an in-app YouTube browser, SoundCloud links
  • Four player views: timeline, beat grid, chord sheet and piano focus, with Roman numerals, transpose, simplified chords, and piano voicings with inversions and fingering
  • Local-first: chord files and your own audio (files, recordings) are stored on the device and play offline; an optional account adds sync and Pro purchases
  • Python worker: beat tracking, a CNN-LSTM chord model, key, BPM and time signature detection
  • Runs on one small server with Docker Compose (deploy/README.md)

Architecture

flowchart TD
    ios["iOS app (SwiftUI)<br/>SwiftData + local audio/analysis"]
    android["Android app (Compose)<br/>Room + local audio/analysis"]
    api["FastAPI API<br/>auth (guest + account JWT) · uploads · jobs<br/>sync · config"]
    pg[(PostgreSQL)]
    redis[(Redis queue)]
    s3[("Object storage<br/>MinIO or any S3")]
    worker["Python worker<br/>FFmpeg → beats → chords → key → BPM/time sig → spectrogram<br/>→ analysis.json"]

    ios -- "HTTPS / REST (contracts/openapi.yaml)" --> api
    android -- "HTTPS / REST" --> api
    api --> pg
    api --> redis
    api -- presigned URLs --> s3
    redis --> worker
    worker --> s3
    worker --> pg
Loading

Apps talk only to the API; audio and analysis files move through presigned object-storage URLs. Analysis is cached globally, so a song that was already transcribed costs nothing. Details in PLAN.md §5.

Want to help? Start with CONTRIBUTING.md.

Start here

File What it's for
PLAN.md Vision, v1 scope, architecture, decisions, risks, milestones
TASKS.md The work board
DESIGN.md Screens and player spec
contracts/ API (openapi.yaml), analysis file format, chord voicings, fixtures

Stack

Layer Technology
iOS Swift, SwiftUI, SwiftData, AVFoundation
Android Kotlin, Jetpack Compose, Room, Media3
API Python, FastAPI, SQLAlchemy, JWT
Worker Python, FFmpeg, PyTorch (Beat Transformer, CNN-LSTM chords)
Data PostgreSQL, Redis, S3-compatible storage (MinIO / R2)

Structure

apps/
  android/   Kotlin Android app
  ios/       Swift iOS app
  api/       FastAPI API
  worker/    Python ML worker
contracts/   shared interfaces: openapi.yaml, analysis.schema.json, chord-voicings.json, fixtures/
docs/        architecture, data model, user flows, running locally

Running locally

See docs/running-locally.md.

git clone --recurse-submodules https://github.com/AblazedTC/musicDecoded.git && cd musicDecoded
docker compose up --build -d          # API on http://localhost:8080, worker, Postgres, Redis, MinIO

Then run the Android app from Android Studio (emulator) or the iOS app from Xcode (simulator); both point at the local API in debug builds. Debug builds include a sample song: long-press the Home title on Android, or tap Open Sunny Days fixture (Debug) on iOS.

To run it on a server, see deploy/README.md.

License

Part License
iOS app, Android app, contracts/, docs MIT
apps/api, apps/worker AGPL-3.0

Contributions to apps/api and apps/worker need a signed CLA (see CONTRIBUTING.md). "MusicDecoded" and its logo are not covered by these licenses. Forks must use a different name. See PLAN.md §9 for how the free and Pro plans work.

Docs

Doc Description
architecture.md Components, request lifecycle, security, hosting
data-model.md On-device storage, Postgres, object storage, Redis, queue message
user-flows.md Step-by-step flows for every feature
running-locally.md Local setup

About

Turn any song into chords: native iOS (SwiftUI) + Android (Compose) apps, FastAPI backend, PyTorch chord/beat worker.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages