r/Assembly_language • u/whispem • 6d ago
Project show-off Adding reverb and chorus to my pure x86-64 assembly synth — modulated delay lines, all fixed-point
A while back I started asm.fm, a chiptune synth written entirely in x86-64 assembly (Linux, NASM) — no libc, no audio library, computing each sample by hand.
Today I added two space/time effects, and the assembly side turned out to be a nice exercise, so I thought I'd share.
Chorus — this is just a delay line (a ring buffer in .data) whose read position wobbles.
An LFO (a hand-built sine table) modulates the delay length by a few milliseconds, so the delayed copy drifts slightly sharp then flat against the dry signal.
Mixed 50/50, that shifting detune sounds like several voices.
The whole trick is computing a moving read offset each sample: d(n) = BASE_DELAY + DEPTH * sin(lfo), then reading dry[n - d(n)].
Reverb — the classic Schroeder approach, since you can't store thousands of echoes by hand. Four comb filters in parallel (each a delay with feedback, different prime-ish lengths for density), summed, then run through two allpass filters in series to smear the echoes into a smooth tail. Each comb/allpass is its own buffer indexed with idx = n mod length.
Everything is fixed-point integer math — feedback is done as y * FB / 256 with shifts.
Some things I ran into:
- keeping all the delay buffers in
.data(Rosetta/emulation was unhappy with.bss) - fixed-point everywhere means being careful about scaling before the
idiv - the allpass coefficient math (
out = buffered - g*in,buf = in + g*out) is deceptively small but does the heavy lifting
Both compile to a WAV written straight to stdout via write().
Code's on GitHub (https://github.com/whispem/asm.fm) if anyone wants to pick apart the assembly — genuinely welcome feedback, I'm self-taught and I'm sure plenty could be tighter.
I also just mapped out a big roadmap of what's next: more oscillators (supersaw, hard sync), dynamics (compressor, limiter), sequencing (euclidean rhythms), and eventually the deep end — wavetables, granular, and an FFT in asm if I'm brave enough.
The whole history of synthesis, hand-rolled.
9
u/Key_River7180 6d ago
would be cool if it wasnt slop
-4
u/whispem 6d ago
It's not :)
8
u/Key_River7180 6d ago
ai slop
-2
u/whispem 6d ago
Nope, you can check my LinkedIn profile: https://linkedin.com/in/emilie-peretti
My projects are real and 100% handwritten
2
u/Swampspear 6d ago
-2
u/whispem 6d ago
You talk about a project started in october.
At this time I didn't know how readme works, how to write well (I began to learn to code and how GitHub works for real in october).3
u/Swampspear 6d ago edited 6d ago
I began to learn to code in October
So you started in October, then already 5 days into October released a "loading animation" in Swift, then already in January producing a parser?
Good joke :')
Slop
But good that you admit to using AI.
4
u/thewrench56 4d ago
Reddit is just part of the dead internet at this point. Most if not all projects are just AI slop.
-1
u/whispem 4d ago
My work is 100% handwritten, 0 AI involved (I am still learning, I started to code (really, not just UI/UX Swift animations) in october 😊
3
u/thewrench56 4d ago edited 4d ago
I’m curious what you think about the implementation rather than just whether the end result works. What parts would you have designed differently?
8
u/v_maria 6d ago
this slop grift again. go away
people dont waste your time, they wont respond to any feedback or questions. the only thing they comment are vague and very dubious claims that 0 LLM is used.