Skip to content
Julián Petric
Back to work

Demo

Pitch Shifter

Built it end to end

Playback and the game run in the browser. Only “Download HQ” calls the API, which runs on a free Azure plan and can take about 20 seconds to wake up.

Stack

  • Angular 22
  • TypeScript
  • Web Audio API
  • AudioWorklet
  • Canvas 2D
  • Angular Material
  • RxJS
  • ASP.NET Core (.NET 8)
  • SoundTouch
  • LAME
  • Azure Static Web Apps
  • Azure App Service
  • GitHub Actions
  • Docker Compose
  • xUnit
  • Karma/Jasmine
The player on desktop with the Giant preset, an octave down: live spectrum, original and processed waveforms colored by frequency, knobs and presets.
The player, an octave down
Pitch Match on desktop after a Perfect round on Easy: confetti around the knob, 150 points and a meter comparing the target note with the chosen one.
Pitch Match, a perfect round
  • The player on a phone, playing an octave down: live spectrum, original and processed waveforms, transport controls and the top of the two knobs.
    The player
  • Pitch Match title screen on a phone: a short explanation, a selector with Easy, Medium and Hard, and a Start button.
    Picking a difficulty
  • Pitch Match result on a phone: Perfect, 150 points, the knob locked on C4 and a meter showing the note matches the target.
    A round result

What the demo does

Two knobs change the tempo, from 50% to 125%, and the pitch, from −12 to +12 semitones. The sound follows the knob while it moves, and presets such as “Practice” or “Giant” set both in one click.

The page draws the original and processed waveforms, colored by frequency on a five-octave scale, so a pitch shift visibly recolors the processed one. A live spectrum runs while the audio plays. The sample track is “Commercial” by Sub_Clair, used under the Pixabay Content License.

Pitch Match

A five-round game: hear a note, then turn the knob until yours matches it.

  • Easy and Medium use the notes of the scale. Easy lets you replay the target; Medium plays it once.
  • Hard targets any frequency, plays it once and briefly, and scores to the cent.
  • It has synthesized voices, a best score per difficulty and full keyboard play.

How it works

  • Pitch shifting runs in an AudioWorklet with a granular shifter written for this project: two overlapping grains read a circular buffer. The core is plain TypeScript, unit-tested on synthetic signals.
  • Tempo uses the media element’s playback rate with pitch preservation, so it changes without a request.
  • The spectrum, waveforms and confetti are drawn on Canvas. The app is Angular 22 with signals and zoneless change detection, and the game loads as a separate lazy chunk.
  • The knob is a custom accessible slider, with drag, wheel and keyboard control.
  • “Download HQ” is the one server feature: an ASP.NET Core minimal API on .NET 8 processes the track with SoundTouch and streams it as MP3, encoded with LAME, while it’s still encoding.

Deployment and checks

  • Azure Static Web Apps hosts the frontend. The API runs on an App Service free plan.
  • CI in GitHub Actions builds and tests the .NET and Angular code and runs a Docker Compose smoke test.
  • A scheduled check of the live demo runs every 6 hours.
  • Tests: xUnit on the API, Karma and Jasmine on the frontend. The code is MIT licensed.

Where music comes in

I’ve been a musician since childhood and I have a grounding in audio theory. I’ve explored modular synthesis in VCV Rack and tried writing my own modules in C++.

I’m not a DSP engineer. The live shifter is a compact granular design, and the high-quality download relies on SoundTouch.

More work

  • Co-founder · Live product

    Casabor

    A marketplace of chef-hosted, ticketed dining experiences. I co-founded it and lead the engineering, from the diner app to payments and infrastructure.

  • Case study

    AI agent for on-call alert triage

    An agent that cut the response time per on-call alert from about 30 minutes to about 5. I built it at Mercado Libre; later, together with the team, we let it apply the fix itself.