返回资讯中心
外部精选
软件工程
#开发者实时流

Show HN: How 80s C64 games made 3 voices sound like a band – now with a tracker

The 1985 SID sound · music and sound effects · 2 KB player, MIT

Hacker News 最新ddecoene2026/11/23 · 今天20 分钟阅读

以下正文同步自 Hacker News 最新,版权归原站所有,已转换为易读排版。

The 1985 SID sound · music and sound effects · 2 KB player, MIT

The per-frame tricks of the classic C64 game music, in a grid you can see and edit while it plays. Make the sound effects with the same instruments, and drop music and effects into your own game: one call plays a laser over the tune.

▶ Hear it Open the tracker Play raster rumble

“Hear it” plays 40 seconds of the raster rumble soundtrack, recorded from this tracker’s own engine: the real 6502 player on the reSIDfp chip emulation. Free, no account, no server.

The Hubbard sound, with a grid

Rob Hubbard’s music for Monty on the Run, Commando or Sanxion made three voices sound like a band. The secret was not in the notes but in his player, which changed the sound of the SID chip 50 times a second while a note was playing. Every one of those tricks is a field in the instrument editor here:

The laser, the jump and the explosion come from the same player as the tune. An effect is a short pattern for one voice, made in the Effects tab with the same instruments and the same editor. Your game starts it with one call, the effect borrows a voice for a moment, and the music on that voice comes back in time. Hear it in the Sound effects demo, or play raster rumble, which makes all of its sound this way.

Hubbard wrote his music as numbers in his assembly source and played it with his own player. That player was never a tool anyone else could use, and its code is not free to copy. The trackers that came later show you the notes, but you have to build that per-frame sound yourself. Here the player was written from scratch around exactly those tricks, and the tracker runs that player: what you hear while you edit is what the exported files do on a real C64.

This project has two parts. The player is about 2 KB of 6502 assembly, written to be read in an afternoon. The tracker is a web page where you write songs for it. The page contains a 6502 core in JavaScript and the reSIDfp chip emulation, and it runs the real player code on them. Nothing is imitated: if it sounds right in the tracker, the same bytes sound right on the machine.

It began with a game. raster-rumble, a small C64 game, had a few hand-written sound effects and a simple tune, and they dragged it down. The classic players that sound right are not free to copy, and none of them came with a tracker where you can see the music while you write it. So both were built from scratch. raster-rumble now plays all of its sound through this player, and its music is a project you can open in the tracker.

Your song is plain data. The player reads it and writes SID registers once per frame, exactly as it does on a C64. Those writes go to a chip emulation, and the result goes to your speakers.

Song model 6502 player reSIDfp AudioWorklet

patterns, orders,instruments player.prg in aJS 6502 core SID chip, asWebAssembly samples to yoursound card

bytes SID writes samples

Signal path of the tracker The song model is serialised to player bytes, the real 6502 player runs in a JavaScript 6502 core, its SID register writes go to reSIDfp compiled to WebAssembly, and an AudioWorklet plays the samples.

Song model 6502 player reSIDfp AudioWorklet

patterns, order lists, instruments player.prg in a JS 6502 core SID chip, as WebAssembly samples to your sound card

bytes SID writes samples

Edit a note and the tracker writes the new bytes into the emulated memory between two frames. The player never stops, so you hear the change at once.

The song is turned into bytes in the player's own format: an order list per voice, patterns, an instrument table.

The real player runs on a 6502 core written in JavaScript, once per 50 Hz frame, and writes to the SID registers like on the C64.

The writes drive reSIDfp, a cycle-exact SID emulation compiled to WebAssembly, and an AudioWorklet plays what comes out.

Features

Live editingChange notes, patterns and instruments while the song plays. The new data goes into the running player between two frames.

Three voicesOne order list per voice, patterns shared between voices, transposition per order entry, mute per voice.

InstrumentsWaveforms, ADSR with the real SID times, a pulse width sweep, vibrato that starts late, an arpeggio of two or three notes, a pitch slide, and drums on any voice.

Sound effectsShort effects for your game, made with the same instruments and editor as the music. The game starts one with one call; it borrows a voice and the music comes back in time.

Patterns and order listsA grid with one row per tick, a keyboard layout like other trackers, undo and redo for every edit.

Seven demosSix songs and a set of sound effects. Open one, press play, and change things to see what each field does.

Exportsmusic.asm (the player), instruments.asm, sfx.asm and song_name.asm as ACME source, a ready-to-run .prg, and a .sid file for SID players.

Projects as JSONSave and open your work as a file. The tracker also keeps an autosave in the browser.

Runs in the browserNo server, no account. Once loaded it works offline. Chip model 6581 or 8580.

The instrument editor. The envelope graph and the times shown are the real SID values.

Demo songs

Six songs ship with the tracker, and a set of sound effects. Five songs are arrangements of public-domain pieces, rebuilt from printed scores, and one is an original tune. The link opens the demo in the tracker; press Play there.

The theme from the Ninth Symphony: a bright lead, inner parts as harmony, a triangle bass.

The whole bagatelle in three voices, inner voices as arpeggio chords, every repeat written out.

The whole third movement of the sonata K. 331, repeats included, with the left-hand chords as arpeggios.

The organ piece bar for bar, from the famous opening to the closing recitative. Pulse organ and a pedal bass.

The creeping march that starts quiet and staccato and climbs to the loud finale.

A 16-bar tune in A minor with bass, lead and drums, built from a few small patterns that are reused with transposition.

The original tune with game effects: a dodge, a chapter bell, a hit on two voices, a laser and a power-up. Open the Effects tab and play them over the song.

Export music.asm, instruments.asm, sfx.asm and your song file, include them in your ACME project, and make two calls. music_init takes the address of the song in A (low byte) and X (high byte). music_play goes in your raster interrupt, once per frame.

lda #<my_song ; address of the song header ldx #>my_song jsr music_init ; starts the song (volume is set to 15) ... irq jsr music_play ; once per frame, from the raster interrupt ... jsr music_stop ; silence, st_running = 0 ... lda #SFX_BOOM ; a sound effect from sfx.asm ldx #2 ; on voice 3 jsr sfx_play ; starts at the next music_play

The player needs 14 bytes of zero page and about 2 KB. It has no song table: pick a song by its label. How it behaves in every case, the memory map and the measured run time per frame are in docs/player.md.

It works end to end, and it is still being tuned by ear. Things it does not do yet:

The licence is split by what you use in your game.

Clean room. The player is an original design. It does not contain code, data, labels or byte formats from any other player or tracker, and it is not compatible with their formats on purpose.

Sound. The SID emulation is libresidfp (reSIDfp) by Dag Lem, Antti S. Lankila, Ken Händel and Leandro Nini, GPL.

Rob Hubbard. His name is used here only to describe the style of music this player is built for. WebSidTracker is not affiliated with or endorsed by him, and it contains none of his code or music.

Music. The clip behind “Hear it” is the soundtrack of raster rumble, by Dennis Decoene. The demo songs are arrangements of public-domain compositions. The notes were read from public-domain editions of the scores, typeset for the Mutopia Project. The tune labelled original is original.

Open the tracker Read the manual Source on GitHub

正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。

打开原文
去社区讨论 →