Lavalink audio filters explained: nightcore, 8D, bass boost and more
What Lavalink's timescale, rotation, equalizer, tremolo and vibrato filters actually do, with the exact values Melodius for Discord uses for nightcore, lofi, daycore, 8D and bass boost in lavalink.py.
Every Discord music bot has a nightcore button. Few explain what it does. These are the filters in Melodius for Discord, built with lavalink.py on NodeLink, a Lavalink-compatible server, with the exact values and what each one means.
Timescale: speed, pitch and rate
- speed changes tempo without changing pitch.
- pitch changes pitch without changing tempo.
- rate changes both together, like playing a record faster.
Most "effects" are just combinations of these three.
Presets built on timescale
"nightcore": Timescale(speed=1.165, pitch=1.125, rate=1.05)
"lofi": Timescale(speed=0.75, pitch=0.8, rate=1.0)
"daycore": Timescale(speed=0.9, pitch=1.0, rate=1.0)
"slowmo": Timescale(speed=0.5, pitch=1.0, rate=0.8)
"chipmunk": Timescale(speed=1.05, pitch=1.35, rate=1.25)
"darthvader": Timescale(speed=0.975, pitch=0.5, rate=0.8)Nightcore is faster and higher. Lofi is slower and lower, the warm, dragging sound the name suggests. Daycore, nightcore's opposite, only slows the tempo. Darth Vader keeps the tempo nearly normal but drops the pitch an octave.
8D is rotation
"8d": Rotation(rotation_hz=0.3)"8D audio" pans the sound around your head. Rotation at 0.3 Hz completes a circle roughly every three seconds. It only works on headphones; on speakers it sounds like the volume wobbling.
Bass boost with 15 bands
Lavalink's equalizer has 15 bands, lowest first, with gains from −0.25 to 1.0:
BASS_BOOST = [0.2, 0.15, 0.1, 0.05, 0.0, -0.05] + [-0.1] * 9The lowest bands rise, then the rest dip slightly. Cutting the highs a little instead of only boosting lows keeps the overall level from jumping, which also reduces clipping.
Tremolo and vibrato
Tremolo varies volume (here 4 Hz, depth 0.75); vibrato varies pitch. "Vibrate" applies both at once. For how the same idea works in a browser with real EQ bands, see building a 10-band equalizer with Web Audio.
