Urgent.News

What's breaking now, across thousands of outlets.

Tech

Building a Browser Pitch Detector (and Reusing It for a Guitar Tuner)

01 · Why this is harder than it looks Every musician has used a phone tuner app. Building one in the browser sounds straightforward: grab the mic, run FFT, show the note. Ship it. Then reality shows up. Browser mic input comes with echo cancellation, noise suppression, and auto-gain control — all useful for video calls, all terrible for pitch detection. AGC in particular will quietly stretch your…

Building a Browser Pitch Detector and Reusing It for a Guitar Tuner reveals the intricacies of creating accurate pitch detection tools in web browsers. The author highlights challenges posed by browser microphone features like echo cancellation and noise suppression which interfere with precise pitch readings. By disabling these settings, the raw audio signal remains clear, leading to more reliable pitch detection.

The core of the tool is a three-layer pipeline: mic input, audio graph, and engine. The mic input passes through a ScriptProcessorNode with a 4096-sample buffer, capturing time-domain audio data essential for accurate pitch detection. The engine utilizes the pitchy library, employing gates for RMS threshold, peak normalization, and clarity bounds to filter out noise and ensure reliable pitch readings.

The display component processes the detected pitch, mapping frequencies to musical notes and calculating cents for precision. It introduces a "held" phase to maintain the last valid note during brief gaps, preventing constant flicker on the display. React components handle the UI, reading the display state at a throttled rate to avoid performance issues.

The architecture allows for easy extension, with the core detection pipeline reusable across different applications like general-purpose pitch detectors and specialized guitar tuners.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

SNI, Host headers and the limits of name-based virtual hosting: CVE-2026-102795 explained

SNI, Host headers and the limits of name-based virtual hosting: CVE-2026-102795 explained Overview On 2 October 2026 the Apache Software Foundation published CVE-2026-102795 for Apache Traffic Server.

  • Apache Traffic Server vulnerable to CVE-2026-102795 due to improper access control enforcement
  • SNI and Host header values inconsistently compared, allowing unauthorized access exploitation
  • Upgrade to versions 9.2.15 or 10.1.4 to mitigate risk and enhance security

TypeBloom 🌸💮🪷

Saw a bunch of people sharing generative floral typography lately and loved the concept, so I decided to build my own version.

35 free developer tools that run entirely in your browser — no signup, no uploads

Two things always bothered me about the usual "paste your JSON here" websites: half of them quietly upload your data to a server, and the other half drown you in ads.

  • JSON Formatter formats, validates, and minifies JSON locally in browser
  • JWT Decoder decodes authentication tokens without sharing sensitive data
  • Regex Tester provides live highlighting and capture groups for regex patterns

The Fellowship of the STL: C++ Data Structures Every Competitive Programmer Needs

The Quest Begins (The "Why") I still remember my first ICPC‑style contest. I was cruising through a problem that needed a dynamic median, and I reached for a priority_queue like a trusty sword.

  • Priority Queue hides underlying container, allowing manual heap manipulation
  • Unorderedmap reserve() and load-factor control prevent unnecessary rehashes
  • Vector shrinktofit() and swap() idiom minimize memory usage

More from Saturday 10 October →