Here is a small piece of code to generate kick drum sounds which creates the transient, body and tail from one two-dimensional wavetable. Although I planned it as a ‘quick’ solution for creating a kick without browsing through thousands of samples, in the end it got a lot of parameters to tweak:
- Frames: Range determines the waves to be used from the table, starting from the upper value and ending at the lower. In the wavetables included, 256 corresponds to the one with most harmonics and 0 to a sine wave. Decay is the time until the waveform reaches the lower limit. Type determines whether the decay is more linear or more eponential-like.
- Sweep: Range determines how many octaves the drum body sound falls until it reaches the tuned value played on the keyboard or by MIDI. Again Decay is the time for that decay and Type the shape.
- Envelope: Trans determines the start value of the envelope, thus how strong the transient comes through (a bit like drum compression). Attack controls the build-up of the body and Decay the length of the tail. Here, Type ranges from 0 (soft convex shape) over 1/2 (linear) to 1 (box shape). Higher values produce the ‘tightness’ preferred in EDM and similar genres.
- The wavetables differ by the kind of harmonics included. ultrasaw: all, ulltrasquare: odd, fibo: Fibonacci numbers, primes: primes, and weierstrass: powers of 2 (octaves)
There are a couple of presets included. (Presets and wavetables are stored in the subdirectory qikdrum.) In some of them the instrument is tweaked so far that it is more kind of a bass or lead.