<?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: Tunerva</title>
    <description>The latest articles on DEV Community by Tunerva (@tunerva).</description>
    <link>https://dev.to/tunerva</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%2F4241475%2F3b7beb69-d6aa-48b9-aa80-1f4f62f9f478.png</url>
      <title>DEV Community: Tunerva</title>
      <link>https://dev.to/tunerva</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tunerva"/>
    <language>en</language>
    <item>
      <title>The Cassette Tape Deck Animation, Built on Real Tape Physics</title>
      <dc:creator>Tunerva</dc:creator>
      <pubDate>Thu, 12 Nov 2026 16:48:05 +0000</pubDate>
      <link>https://dev.to/tunerva/the-cassette-tape-deck-animation-built-on-real-tape-physics-28ho</link>
      <guid>https://dev.to/tunerva/the-cassette-tape-deck-animation-built-on-real-tape-physics-28ho</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://tunerva.app/tape-deck" rel="noopener noreferrer"&gt;tunerva.app&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Tunerva's Deck face hides a twin-well stereo cassette deck under its display. It would have been easy to fake — a looping GIF, a CSS spin, a video file. Instead the tape animation runs the same math a real Compact Cassette obeys: a constant tape speed of 47.6 mm/s, tape packs that conserve area as they transfer from one reel to the other, reel speeds that follow from v = ωr, and a mechanical counter geared to the take-up hub. This post is the geek-level tour of how it works.&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%2Fgzki9aeu8aajhajmvv1a.jpg" 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%2Fgzki9aeu8aajhajmvv1a.jpg" alt="Tunerva Deck playing a station in the browser — the real capture this post is about" width="800" height="371"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A real capture, not a mockup:&lt;/strong&gt; Tunerva Deck playing a station in the browser — &lt;a href="https://tunerva.app/cassette-tape-deck-animation.mp4" rel="noopener noreferrer"&gt;watch the 15-second capture (mp4)&lt;/a&gt;. The playing deck's reels turn at pack-dependent rpm, the level meters ride the actual audio, and the counter integrates the take-up hub's rotation.&lt;/p&gt;

&lt;h2&gt;
  
  
  The tape pack is area, not a timer
&lt;/h2&gt;

&lt;p&gt;Most tape animations cheat the same way: the left reel's radius shrinks linearly while the right one's grows linearly. Play one for a simulated hour and the two packs' areas drift apart — tape appears from nowhere, or vanishes. Real tape can't do that. A C90's tape is a fixed length of material wound between two hubs, so at every instant the two pack cross-sections sum to a constant:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rL² + rR² = rhub² + rfull²
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Tunerva's deck model uses true C90 geometry in millimetres — hub radius &lt;strong&gt;11 mm&lt;/strong&gt;, full-pack radius &lt;strong&gt;24.7 mm&lt;/strong&gt;. Given a side's progress &lt;code&gt;p&lt;/code&gt; (0 at the leader, 1 at the end), the take-up radius is &lt;code&gt;rR = √(11² + (24.7² − 11²) · (0.06 + 0.94p))&lt;/code&gt; and the supply radius falls out of the conservation law above. The 0.06 offset is the leader: a real cassette starts with a few percent of its wind already on the take-up side. Because radius grows with the &lt;em&gt;square root&lt;/em&gt; of progress, the pack visibly slows its growth as it fills — exactly the way a real deck's packs behave, fast at first, then settling.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reel speed is v over r — nothing is keyframed
&lt;/h2&gt;

&lt;p&gt;The capstan pulls tape at a constant &lt;strong&gt;47.6 mm/s&lt;/strong&gt; (1⅞ inches per second, the Compact Cassette standard). The hubs are slaves to that: each reel's angular speed is simply tape speed divided by its current pack radius. With a full pack that's about &lt;strong&gt;19 rpm&lt;/strong&gt;; run the same reel down to the bare hub and it spins at about &lt;strong&gt;41 rpm&lt;/strong&gt;. So over one 45-minute side, the supply reel accelerates more than twofold while the take-up reel lazes slower and slower — and in the animation you can watch it happen, because no angle is ever scripted. Every frame, each deck integrates &lt;code&gt;dθ = (47.6 / r) · dt&lt;/code&gt; from the pack radii the conservation law produced a moment earlier.&lt;/p&gt;

&lt;p&gt;A full side is a real C90 side: &lt;strong&gt;45 minutes&lt;/strong&gt; of playback to run the counter out, at which point the deck rewinds and starts the side again — the same loop a real auto-reverse-era deck owner would recognize, minus the wait.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Spec&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Tape speed&lt;/td&gt;
&lt;td&gt;47.6 mm/s (1⅞ ips), constant, capstan-true&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tape format&lt;/td&gt;
&lt;td&gt;C90 — 45 minutes per side&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hub radius&lt;/td&gt;
&lt;td&gt;11 mm&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Full pack radius&lt;/td&gt;
&lt;td&gt;24.7 mm&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Reel speed&lt;/td&gt;
&lt;td&gt;≈19 rpm at full pack → ≈41 rpm at the hub (ω = v/r)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Counter&lt;/td&gt;
&lt;td&gt;Belt-driven off the take-up hub; 0.129413 counts per radian; a full side lands on exactly 900&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Toy FF / REW&lt;/td&gt;
&lt;td&gt;540× wind — a full side in about 5 seconds, still integrated through the same pack physics&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Rendering&lt;/td&gt;
&lt;td&gt;Canvas 2D, drawn every frame — no video, no sprites, no image assets in the deck itself&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  The counter is belt-driven, so it lies like a real one
&lt;/h2&gt;

&lt;p&gt;On a real deck the tape counter isn't a clock — a belt off the take-up hub drives it, so its rate depends on how much tape is wound on that hub. Tunerva copies the mechanism, not the look: the counter integrates the take-up hub's rotation at &lt;code&gt;0.129413&lt;/code&gt; counts per radian, a gear ratio chosen so a full C90 side lands on exactly &lt;strong&gt;900 counts&lt;/strong&gt;. Early in a side, with the take-up pack small and spinning fast, the counter gallops; late in the side it crawls. RESET zeroes it (from the playing deck only — counters were always a playing-deck affair), and switching decks carries progress, angles and counts through a visible rewind before the incoming tape starts, the way you'd rewind a played tape before filing it back in the well.&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%2Fgzki9aeu8aajhajmvv1a.jpg" 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%2Fgzki9aeu8aajhajmvv1a.jpg" alt="Close-up of Tunerva's animated cassette tape deck: Deck A cued, Deck B playing, NORMAL tape type, counter running, EJECT key and live level meters" width="800" height="371"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Deck A cued, Deck B playing.&lt;/strong&gt; The center column carries the deck selector and the tape-type rail — NORMAL, CrO2, METAL — which re-skins the cassette shell the way the real formulations changed it. The twin level meters under Deck A ride the live audio analyser.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two decks, because dubbing decks were the good ones
&lt;/h2&gt;

&lt;p&gt;The Wide face's deck is a twin-well unit in the dubbing-deck tradition. One deck plays; the other is the &lt;em&gt;cue&lt;/em&gt; — it holds what's coming next (the next preset in the bank), its label carrying that station's name in the same handwriting as the playing tape's. Each well has its own working transport row: the toy keys aren't decoration. FF and REW wind the tape at 540× through the same pack physics — you can watch the packs swap mass in about five seconds — and EJECT runs the full sequence: stop, door, cassette lift. The DENSHI column plate between the wells cycles bare chassis → steel → glass, and there's a DNR switch in the furniture band because no late-80s deck was complete without one to argue about.&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%2F5qy7dax6nlkc32r8f1bo.jpg" 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%2F5qy7dax6nlkc32r8f1bo.jpg" alt="Tunerva Deck face with the cassette tape deck animation running under the clock display, a station playing" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The whole instrument.&lt;/strong&gt; The deck unit sits under the clock display on Tunerva's Deck face; on the Pocket (phone) face, the same dual-deck animation lives inside the display's analyzer area instead.&lt;/p&gt;

&lt;h2&gt;
  
  
  Drawn, not played back
&lt;/h2&gt;

&lt;p&gt;Everything you see in the deck — shells, screws, capstans, pinch rollers, the head block, label typography, the tape path threading down through the head gap and back up — is drawn on a 2D canvas each frame from the physics state. There is no video file and no sprite sheet inside the app; the only video linked from this post is a screen capture recorded from the real app running in a browser. That's also why the deck reacts like an instrument rather than a screensaver: eject mid-song and the spools stop the way a stopped deck stops; pause and the packs freeze mid-transfer, radii intact, ready to resume at the right ω.&lt;/p&gt;

&lt;h2&gt;
  
  
  Questions people ask about tape decks
&lt;/h2&gt;

&lt;h3&gt;
  
  
  How fast does a cassette tape actually move?
&lt;/h3&gt;

&lt;p&gt;1⅞ inches per second — 4.76 cm/s, or 47.6 mm/s. It's the slowest tape format that ever went mainstream, which is exactly why the reel choreography is so visible: at that speed, pack geometry dominates everything.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why does one reel speed up as the other slows down?
&lt;/h3&gt;

&lt;p&gt;The tape itself moves at a constant speed, but each reel's rpm is tape speed divided by its pack radius. The supply pack shrinks toward the 11 mm hub, so its reel must spin faster to feed the same 47.6 mm/s; the take-up pack grows toward 24.7 mm and slows. Tunerva's animation gets this for free because it never animates rpm directly — only tape position.&lt;/p&gt;

&lt;h3&gt;
  
  
  How long is a C90 side, really?
&lt;/h3&gt;

&lt;p&gt;45 minutes — about 128 metres of tape. In Tunerva the side length is the real 45 minutes at real speed; the FF and REW keys are the only sanctioned time travel, at 540×.&lt;/p&gt;




&lt;p&gt;The deck is live now, on both faces of Tunerva. Tap the display to cycle the views — spectrum bars, dots, waveform, VU meters — and the last stop is the tape deck. Or pick &lt;strong&gt;Tape deck&lt;/strong&gt; in Settings → Analyzer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://tunerva.app/app" rel="noopener noreferrer"&gt;Open Tunerva and find the deck →&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Tunerva™ — a 90s clock radio rebuilt as a web app. Free, no account, nothing to install.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>canvas</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
