AWS Builder Center
Weekend Annoying Task Challenge: ChordStudio - AI Audio Chord Chart & Sheet Music Generator

Weekend Annoying Task Challenge: ChordStudio - AI Audio Chord Chart & Sheet Music Generator

ChordStudio automates the tedious task of manually figuring out guitar and piano chords from audio files or YouTube links, generating beat-aligned chord charts and interactive sheet music in seconds powered by AWS Free Tier.

Building Tech for Impact - @TechSangi

1. Vision and What the App Does

For musicians, transcribing chord progressions from recorded music is one of the most time-consuming and repetitive weekly chores. Traditionally, a musician must sit with an instrument, manually pause and rewind an audio file or video hundreds of times, and guess root pitch frequencies by ear. Existing online chord tab databases suffer from major drawbacks: they are user-submitted with frequent inaccuracies, they lack timing alignment with the underlying audio stream, and commercial automated chord detectors require paid subscriptions.
ChordStudio is an open-source, web-based digital signal processing (DSP) and machine learning application that completely automates chord transcription. Musicians can upload local audio files (MP3, WAV, M4A, FLAC) or paste any YouTube URL. In seconds, ChordStudio analyzes raw audio frequencies and outputs:
  1. Beat-Aligned Chord Charts: Precise time-stamped chord progressions covering major, minor, dominant seventh, diminished, and extended chords.
  1. Key Signature and Tempo Detection: Automated identification of the global musical key (for example, A major or B minor) and track tempo in Beats Per Minute (BPM).
  1. Interactive Instrument Diagrams: Clickable chord modals rendering real-time finger placement diagrams for both 6-string guitar fretboards and 88-key piano keyboards.
  1. Synchronized Lyric and Chord Sheets: Line-by-line timed lyrics mapped directly to corresponding chord symbols for seamless practice and live performance.

2. Technical Implementation and Signal Processing Pipeline

Developing ChordStudio required constructing a dedicated audio analysis pipeline using Python, Next.js, and specialized mathematical signal processing libraries.

A. Audio Ingestion and Normalization

When an audio file is uploaded or a URL is submitted, the ingestion module downloads and extracts the raw audio stream. The stream is normalized to a standard 22.05 kHz sampling rate in single-channel mono float32 format. This step ensures consistent spectral resolution across varying source media formats.

B. Constant-Q Transform (CQT) Chromagram Extraction

Standard Fast Fourier Transforms (FFT) use linearly spaced frequency bins, which do not align well with human musical perception where octave intervals double in frequency. ChordStudio uses the Constant-Q Transform (CQT). CQT employs logarithmically spaced filters matched to standard musical semitones. The resulting spectrum is folded into a 12-dimensional chroma vector representing the pitch classes: C, C#, D, D#, E, F, F#, G, G#, A, A#, and B.

C. Hidden Markov Model (HMM) Viterbi Decoding

Raw chroma vectors contain transient noise, vocal harmonics, and drum hits that can cause frame-to-frame chord flickering. To ensure clean, musical output, ChordStudio applies a Hidden Markov Model (HMM). The HMM evaluates transition probability matrices derived from standard music theory harmony rules. Viterbi decoding computes the most likely global sequence of chords across the entire timeline, eliminating rapid frame oscillations while maintaining precise boundary alignment on musical beats.

D. User Interface and Interactive Sheet Music

The frontend is built with Next.js 14 and React. It delivers a modern dark-mode interface featuring dynamic waveform rendering, semitone transposition (+/- 12 semitones), and real-time playback synchronization.

3. AWS Infrastructure and Architecture Overview

ChordStudio is architected to run entirely on the AWS Free Tier, achieving continuous 24/7 availability with zero hosting costs ($0.00/month).

AWS Infrastructure Components:
  1. Amazon EC2 (t3.micro - Free Tier):
  • Compute Host: Runs both the Next.js Web UI (Port 3000) and the FastAPI Python Engine (Port 8000) on a single Ubuntu 22.04 LTS instance.
  • Process Control: Managed using Linux systemd services for automated restart and process isolation.
  • Static Elastic IP (34.197.86.238): Provides a permanent IPv4 address for global client routing.
  1. Amazon S3 (Free Tier):
  • Object Storage: Persists resampled WAV audio files, pre-computed chromagram pitch matrices, and generated JSON chord charts for fast retrieval.

4. Challenges Overcome During Development

A. Memory and Compute Optimization on Single EC2 Instances

Running mathematical matrix operations (CQT, HMM decoding) alongside a Next.js server on a low-memory t3.micro EC2 instance required strict resource constraints. Heavy compute tasks were scoped to thread-bound background execution pools to prevent event-loop starvation and maintain sub-second UI responsiveness.

B. Cross-Origin Resource Sharing (CORS) and Host Resolution

Deploying separate frontend and backend listeners on a single virtual server presented browser security challenges. We resolved Cross-Origin Resource Sharing (CORS) and browser loopback privacy restrictions by implementing dynamic host resolution in the client API client, enabling seamless cross-port communication on the Elastic IP.

5. Key Takeaways and Lessons Learned

  1. Efficient Free-Tier Cloud Architecture: Demonstrates that complex, compute-intensive applications can be hosted reliably on AWS Free Tier resources when proper process management and caching strategies are applied.
  1. Signal Processing Alignment: Reaffirmed the superiority of logarithmic CQT chromagrams over linear FFTs for harmonic music analysis.
  1. Production Process Hardening: Gained practical experience configuring systemd services, SSH-based remote deployments, and AWS Elastic IP networking.

6. Live Deployment

Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article