Home / Hardstyle from scratch

The kick: punch, tail and distortion

LearningUpdated 2026-09-27

Build the hardstyle kick from a falling sine wave, a long decay and a hard clipper, and see why distortion makes the tail buzz.

Goal

The kick everything else in the genre hangs off: a sharp punch, then a long, squared-off, buzzing tail.

The idea

Start with the trance kick, a sine whose pitch falls fast with a decaying volume, and change two things.

  1. The tail is long, and it's a note. After the drop the pitch settles on G1 (49 Hz) and stays there while the volume decays over a few hundred milliseconds. The high start is the Punch, the low part the Tail.
  2. Everything gets smashed into a clipper. Multiply the wave by a big gain (Drive) and chop off whatever passes the maximum. That's Clipping, on purpose.

Why does that change everything? At 30 dB of drive (about 32 times louder), the sine slams into the limit and stays flat against it for as long as its level is above about 3% of full scale. A sine with flat tops is basically a square wave, and a square wave is full of odd harmonics (3, 5, 7 times the pitch).

Crank the input and the sine gets chopped flat. Right: the harmonics that adds. A hard-clipped sine's 3rd harmonic sits about 10 dB under the fundamental, like a square wave.

Three consequences:

The kick we're about to build. The pitch (dashed) falls from 400 Hz to 49 Hz in about 18 ms; the tail stays squared off for most of its length before fading.
Show the full code: hardstyle_kick.jsfx (95 lines)
desc:Hardstyle Kick
// A hardstyle kick from first principles:
//   1. a sine wave whose PITCH starts high and falls fast  (the punch)
//   2. settling on a tail pitch, which can follow the MIDI note (a tuned tail)
//   3. a long volume decay
//   4. pushed HARD into a clipper, so the long tail turns into a squared-off,
//      buzzing tone instead of fading away  (the hardstyle sound)
//   5. a low-pass filter to tame the fizz the clipper creates
// Every MIDI note-on triggers the kick. In "Follow MIDI note" mode the note
// number sets the tail pitch (MIDI 31 = G1 = 49 Hz); otherwise it is ignored.

slider1:400<100,900,1:log=400>Start pitch (Hz)
slider2:18<3,120,1>Pitch fall time (ms)
slider3:0<0,1,1{Fixed,Follow MIDI note}>Tail pitch
slider4:49<30,80,0.5>Fixed tail pitch (Hz)
slider5:350<100,900,1>Tail decay (ms)
slider6:30<0,48,0.5>Drive (dB)
slider7:1<0,1,1{Soft (tanh),Hard (brickwall)}>Clip style
slider8:3000<300,10000,1:log=2000>Tail low-pass (Hz)
slider9:-6<-24,0,0.5>Output (dB)

in_pin:none
out_pin:Left
out_pin:Right

@init
// Runs once when the effect loads: set up variables and helper functions.
ev_off = 0;      // event queue: up to 16 note-ons per audio block
ev_vel = 16;
ev_note = 32;
function tanh_(x) local(e) (
  x = min(max(x, -20), 20);
  e = exp(2 * x);
  (e - 1) / (e + 1);
);

playing = 0;
t = 0;
phase = 0;
lp1 = lp2 = 0;
tail = 49;

@slider
// Runs whenever a slider moves: turn slider values into ready-to-use numbers.
pitch_tau = slider2 * 0.001;
amp_tau = slider5 * 0.001 / 6.9;   // 6.9 time-constants = 60 dB drop
drive = 10 ^ (slider6 / 20);
outgain = 10 ^ (slider9 / 20);
drive_norm = 1 / tanh_(drive);
lpa = 1 - exp(-2 * $pi * min(slider8, srate * 0.45) / srate);
// the tail is over when (level x drive) has fallen to 0.0001
t_end = min(3, amp_tau * log(max(drive, 1) * 10000));

@block
// Runs before each chunk of audio: read the incoming MIDI notes here.
blk_pos = 0;
ev_n = 0;
ev_i = 0;
while (midirecv(offs, m1, m2, m3)) (
  (m1 & 0xF0) == 0x90 && m3 > 0 && ev_n < 16 ? (
    ev_off[ev_n] = offs;
    ev_vel[ev_n] = m3 / 127;
    ev_note[ev_n] = m2;
    ev_n += 1;
  );
);

@sample
// Runs once for EVERY audio sample (44,100+ times a second): make the sound here.
while (ev_i < ev_n && ev_off[ev_i] <= blk_pos) (
  vel = ev_vel[ev_i];
  tail = slider3 ? 440 * 2 ^ ((ev_note[ev_i] - 69) / 12) : slider4;
  playing = 1;
  t = 0;
  phase = 0;
  lp1 = lp2 = 0;
  ev_i += 1;
);

s = 0;
playing ? (
  freq = tail + (slider1 - tail) * exp(-t / pitch_tau);
  phase += 2 * $pi * freq / srate;
  phase > 2 * $pi ? phase -= 2 * $pi;
  s = sin(phase) * exp(-t / amp_tau) * drive;
  s = slider7 ? min(max(s, -1), 1) : tanh_(s) * drive_norm;
  lp1 += lpa * (s - lp1);
  lp2 += lpa * (lp1 - lp2);
  s = lp2 * vel * outgain;
  t += 1 / srate;
  t > t_end ? playing = 0;
);
spl0 = s;
spl1 = s;
blk_pos += 1;

Download hardstyle_kick.jsfx

It reads like the trance kick (The kick: a sine wave with a falling pitch explains the sections). New bits:

Build it

  1. The Kick track from Hardstyle project setup and the kick instrument, four notes per bar.
  2. Sliders:
SliderValueWhy
Start pitch (Hz)400where the punch starts
Pitch fall time (ms)18how fast it drops to the tail
Tail pitchFixedignore the MIDI note for now
Fixed tail pitch (Hz)49G1, the root
Tail decay (ms)35060 dB fall, before the clipper
Drive (dB)30how hard it hits the clipper
Clip styleHard (brickwall)flat tops
Tail low-pass (Hz)3000removes the fizz
Output (dB)-6headroom
  1. Notes on every beat, velocity about 110:
Step:  1 . . . 2 . . . 3 . . . 4 . . .
Kick:  X . . . X . . . X . . . X . . .
  1. Stretch the item to the end of bar 8, loop four bars, play.

Listen for

Drive at 0 dB: a clean thump that fades.
Drive at 30 dB, the table's settings. Both clips are scaled to the same peak, so what changes is loudness and tone.

Try this

Which part is the punch and which the tail?

The punch is the short high start; the tail is the long low note after it.

Why does heavy clipping keep the tail loud?

While the wave is pinned to the limit its level can't fall, even as the sine underneath decays.

Why does a clipped sine buzz?

Flattened peaks make it close to a square wave, which has strong odd harmonics.

What's the tail low-pass for?

Removing the very high fizz, including aliasing, that clipping's sharp corners create.

More resources for Hardstyle from scratch →