<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Tiger</title>
    <description>The latest articles on DEV Community by Tiger (@eason87).</description>
    <link>https://dev.to/eason87</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4208879%2Fa2793e0c-a8b1-4a99-8846-610aaf01da6a.jpg</url>
      <title>DEV Community: Tiger</title>
      <link>https://dev.to/eason87</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/eason87"/>
    <language>en</language>
    <item>
      <title>Building a Frictionless Vocal Range Test: A Deep Dive into Web Audio API and Astro</title>
      <dc:creator>Tiger</dc:creator>
      <pubDate>Mon, 26 Oct 2026 14:05:24 +0000</pubDate>
      <link>https://dev.to/eason87/building-a-frictionless-vocal-range-test-a-deep-dive-into-web-audio-api-and-astro-2ja2</link>
      <guid>https://dev.to/eason87/building-a-frictionless-vocal-range-test-a-deep-dive-into-web-audio-api-and-astro-2ja2</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flooqyrs7iwvu9knf5qvi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flooqyrs7iwvu9knf5qvi.png" alt="Vocal Range Test" width="800" height="657"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I’m not a professional singer. My vocal performances are strictly limited to the shower. But I’ve always been curious about my actual vocal range. &lt;/p&gt;

&lt;p&gt;Whenever I looked online to test it, I hit the same barriers: sketchy mobile apps with forced sign-ups, or dry music theory articles without any interactive elements. I just wanted a clean, fast web tool to find my lowest and highest notes. So, I decided to build one: &lt;strong&gt;&lt;a href="https://vocalrangetest.io" rel="noopener noreferrer"&gt;Vocal Range Test&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;What started as a weekend project quickly turned into a deep rabbit hole of Web Audio APIs, music theory math, and audio signal processing. Here is a breakdown of the tech stack, the challenges, and how I built it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fiv8wihkmxqhok4ct2f77.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fiv8wihkmxqhok4ct2f77.png" alt="Vocal Range test" width="800" height="588"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  The Stack: Astro + React + Tailwind
&lt;/h4&gt;

&lt;p&gt;For a tool like this, friction is the enemy. If the page takes 3 seconds to load, the user is gone. That’s why I chose &lt;strong&gt;Astro&lt;/strong&gt; for the core framework. It allows me to ship a nearly zero-JS static shell, while hydrating only the interactive audio components using &lt;strong&gt;React 19&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;For styling, &lt;strong&gt;Tailwind CSS v4&lt;/strong&gt; kept the UI clean and responsive. When rendering dynamic graphics (like the vocal range result cards), I used &lt;strong&gt;html-to-image&lt;/strong&gt; to let users download and share their results natively without needing a backend.&lt;/p&gt;

&lt;h4&gt;
  
  
  The Audio Engine: Tone.js and Tonal
&lt;/h4&gt;

&lt;p&gt;I needed to generate precise, latency-free reference notes for users to match. Instead of hosting hundreds of MP3 files, I used &lt;strong&gt;Tone.js&lt;/strong&gt;. It wraps the Web Audio API beautifully, allowing me to build a custom synthesizer that produces clean piano-like tones on the fly.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;Tone&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;tone&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Note&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;tonal&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Initialize a basic synth&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;synth&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Tone&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Synth&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;oscillator&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;triangle&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;envelope&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;attack&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.05&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;decay&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;sustain&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;release&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nf"&gt;toDestination&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="c1"&gt;// Play a note using Tonal to handle the frequency math&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;playReferenceNote&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;noteName&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;Tone&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;start&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// Resume audio context&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;freq&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Note&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;freq&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;noteName&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; 
  &lt;span class="nx"&gt;synth&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;triggerAttackRelease&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;freq&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;1n&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But Tone.js is only half the story. To actually calculate the user's vocal range, I relied heavily on &lt;strong&gt;Tonal&lt;/strong&gt;. It’s an incredible music theory library that handles all the heavy lifting: converting between note names (C4, E3), calculating semitone distances, and figuring out the user's specific vocal type (Tenor, Soprano, Alto, etc.) based on their lowest and highest inputs.&lt;/p&gt;

&lt;h4&gt;
  
  
  Advanced Audio Analysis: Meyda and Essentia.js
&lt;/h4&gt;

&lt;p&gt;This is where things got complicated. My initial idea was to just use the microphone and automatically detect the user's pitch. &lt;/p&gt;

&lt;p&gt;For this, I integrated &lt;strong&gt;Meyda&lt;/strong&gt;, a fantastic audio feature extraction library. Meyda allows you to calculate the RMS (volume), spectral centroid, and pitch chroma in real-time from the mic stream. I also experimented with &lt;strong&gt;Essentia.js&lt;/strong&gt;, which is an absolute powerhouse for audio analysis (bringing C++ level audio processing to the browser via WebAssembly).&lt;/p&gt;

&lt;p&gt;However, I quickly ran into the classic Web Audio problem: &lt;strong&gt;Background Noise and Room Acoustics&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;If a user is singing into a cheap laptop mic in a noisy room, the pitch detection algorithms can easily get confused by octave errors or background hum. I realized that forcing a real-time mic analysis was leading to a frustrating UX.&lt;/p&gt;

&lt;p&gt;So, I pivoted. I built a "Guided Audio" flow. The app plays a note, the user listens and tries to match it, and then self-reports if it was comfortable or strained. Meyda and Essentia.js are still running in the background for my "Advanced Mode," but the core user journey is human-centric, not algorithm-centric.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fy7c7zb7nyv0jra23pmfy.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fy7c7zb7nyv0jra23pmfy.webp" alt="algorithm" width="799" height="504"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Visualizing the Music: AlphaTab
&lt;/h4&gt;

&lt;p&gt;To make the experience educational, I didn't want to just show text. I wanted users to &lt;em&gt;see&lt;/em&gt; the music. For rendering guitar tabs or sheet music representations of the scales they were testing, I used &lt;strong&gt;@coderline/alphatab&lt;/strong&gt;. It takes music notation data and renders it beautifully to HTML5 canvas, making the theory side of vocal ranges much more accessible.&lt;/p&gt;

&lt;h4&gt;
  
  
  Why Build This?
&lt;/h4&gt;

&lt;p&gt;Honestly, I built this to learn. But since launching it, I’ve received messages from voice coaches who use it as a quick warm-up tool, and from bedroom musicians who use it to find the perfect key for their next cover.&lt;/p&gt;

&lt;p&gt;Combining a lightweight framework like Astro with powerful music libraries like Tone.js and Tonal means you can build genuinely useful music tools directly in the browser. &lt;/p&gt;

&lt;p&gt;You can check out the tool here: &lt;strong&gt;&lt;a href="https://vocalrangetest.io" rel="noopener noreferrer"&gt;Vocal Range Test&lt;/a&gt;&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;If you’ve ever built audio tools for the web, I’d love to hear how you handled the microphone noise issues or real-time pitch detection in the comments!&lt;/p&gt;




</description>
      <category>programming</category>
      <category>javascript</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
