TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Jerrica, a 100% scheduled, Web Audio native, MOD player for JavaScript

138 pointsby gtrevorjayover 2 years ago

13 comments

bitwizeover 2 years ago
I love the name. Jerrica Benton was the true identity of the rock-star title character of <i>Jem and the Holograms</i>. She had an intelligent computer called Synergy who could put on holographic visual effects, manifest Jerrica&#x27;s Jem stage persona or other holographic disguises, and had other cyber-powers as the plot demanded. And her archenemy was a ruthless record executive named Eric Raymond.<p>Fitting name, then, for a JavaScript-based music player program. I love geeky references like this.
评论 #33360081 未加载
评论 #33362668 未加载
评论 #33361652 未加载
评论 #33360519 未加载
评论 #33360679 未加载
mwcampbellover 2 years ago
I&#x27;m using Edge on Windows. If I start playback, then switch to another application window, the player soon starts repeating the last fraction of a second of audio that it played. Then it resumes when I switch back to the Edge window. Presumably this is Edge putting the renderer process to sleep to save power and deal with sites that hog the CPU. The only exception is if I switch to a command prompt (console) window; in that case, the playback keeps going. Anyone know what&#x27;s going on there?
metadatover 2 years ago
In case this is the first you&#x27;ve heard of &quot;100% scheduled&quot; and &quot;web audio native&quot;:<p>&gt; By <i>&quot;100% scheduled&quot;</i> we mean that all the timing of audio events is handled using the web audio scheduler. Jerrica doesn&#x27;t use setTimeout, setInterval, or other timing hacks. It is recommended that its processMusic function is called once per frame via requestAnimationFrame, but that&#x27;s simply to ensure that sound events are always scheduled well ahead of when they need to occur.<p>&gt; By <i>&quot;web audio native&quot;</i> we mean that all audio effects are achieved via the web audio API. Many audio players manipulate audio at the sample level, treating web audio as a &quot;dumb pipe&quot; for an audio buffer. Jerrica doesn&#x27;t do that. After loading the samples from the MOD file, Jerrica only ever uses web audio functions to manipulate the sounds, for example via the playbackRate AudioParam.<p>To the author&#x27;s credit, these are both explained near the top of the README. Cheers.
aliqotover 2 years ago
Now -this- is cool <a href="http:&#x2F;&#x2F;uploads.ungrounded.net&#x2F;tmp&#x2F;1951000&#x2F;1951512&#x2F;file&#x2F;alternate&#x2F;alternate_2_r4.zip&#x2F;" rel="nofollow">http:&#x2F;&#x2F;uploads.ungrounded.net&#x2F;tmp&#x2F;1951000&#x2F;1951512&#x2F;file&#x2F;alter...</a><p>the numbers are tracker sequences and bars if anybody&#x27;s wondering.
评论 #33360258 未加载
评论 #33361898 未加载
评论 #33361775 未加载
hansjorgover 2 years ago
Nice! &quot;A Final Hyperbase&quot; by Firefox and Tip was made for the Amiga demo Enigma by Phenomena, which was released in 1991. Oh man, the nostalgia :)<p>This is how it sounds on a video grab from an Amiga:<p><a href="https:&#x2F;&#x2F;youtu.be&#x2F;iGpU3DicbLQ" rel="nofollow">https:&#x2F;&#x2F;youtu.be&#x2F;iGpU3DicbLQ</a>
评论 #33391684 未加载
codefloover 2 years ago
That’s really cool! But let’s have a technical discussion about the hiccups some commenters mention.<p>I’ve experimented with Web Audio stuff in the past, and wasn’t happy with it. It seems to be mainly intended to play back premade music files, not seamlessly playing dynamically generated samples.<p>Normal audio APIs issue a callback whenever their buffer gets low. This is done in a high-priority thread and has a high chance to work seamlessly even on a very busy system — think computer games. You get called, generate a few more bytes and everything is fine.<p>Web Audio, unless something changed, requires you to actively, manually schedule sending little audio snippets to the playback queue. You have to use timers for that, which are nondeterministic, and you’re competing with everything else that the JavaScript thread is doing. Any tiny hiccup is an audible artifact, and I had found no completely reliable way to avoid them.<p>Why is Web Audio like this? Are improvements on the horizon that would make this better?
评论 #33391702 未加载
Daunkover 2 years ago
I recently made a little tool for grabbing and searching mod music from the modland database - <a href="https:&#x2F;&#x2F;github.com&#x2F;Hezkore&#x2F;Modget" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;Hezkore&#x2F;Modget</a>
horsawlarwayover 2 years ago
This does some <i>very</i> wonky things in chromium based browsers if you switch to a different tab while it&#x27;s playing.<p>It plays normal audio for about 3 seconds, then begins what seems like a very short loop of the last few notes - repeating the same sounds forever (or until you navigate back to the tab)
评论 #33361491 未加载
评论 #33361796 未加载
评论 #33361086 未加载
评论 #33362814 未加载
评论 #33361300 未加载
postalratover 2 years ago
Sounds a lot different in firefox and chrome. Not bad in either but don&#x27;t know what the more accurate one is.
评论 #33359810 未加载
评论 #33360201 未加载
评论 #33360882 未加载
undowareover 2 years ago
I have bad news for anyone who recognizes the name-reference instantly<p>You&#x27;re old<p>Like me :P<p>Showtime, cynergi
Max-qover 2 years ago
Impressive! In iOS Safari there are some issues with the timing&#x2F;rythm of the melody in the mid part and some a the end of the song.
评论 #33365086 未加载
agentultraover 2 years ago
I did notice in some cases frames getting delayed in the hyper demo but otherwise it works really well. This is an interesting approach!
评论 #33359826 未加载
tkanarskyover 2 years ago
Thanks, what a cool demonstration of WebAudio! Time for my weekly re-listen of space_debris.mod :)