Drum Synthesis
An brief presentation of my drum synthesis patches in PD.
Synthesis is an art; drum synthesis, doubly so. Even though the technological evolution of the past two decades saw sampling replacing synthesis for drums in most mainstream sound hardware of software, it is still worth looking into the field of drum synthesis, if anything because percussive sound are the most challenging to emulate.
My work in this field is largely based on Frank Barknecht's excellent "Building Drums in PD" article, definitely a recommanded reading for anyone interested in drum synthesis. I have to say, however, that I was puzzled to see the envelopes made using line~, as line does the trick. I also suspect using the regular line objects gets rid of the problem desribed at the end of the article, since the problem of the 1,45 ms delay due to PD processing signal in chunks of 64 sample does not apply to numbers. mind you, the envelope will eventually be fed to a *~ object, which will process the sound in 64 samples blocks, so I might be wrong.
However, this article is only a starting point. If you are interested in going further in this field, I strongly recommand you check out Sound on Sound series of articles on the topic : not only do they provide actual settings to synthetise drums (using the Roland's SH101 as an example, but those could easily be emulated in PD), but they actually start by explaining and analysing the acoustics of percussive instruments, providing harmonic series. On top of that, you get the original signal flow diagrams for Roland's TR909 and 808 kick and snare, plus their own re-writing of the diagrams in a clearer and simplified way. The three articles (general theory, plus practical synthesis for kick and snare) are here
I unfortunately haven't had the chance to give a shot at a proper tuned drum synthesis (including harmonics, rather than using ust filtered noise), but I sure hope to do so in the future.
Now for the patches :
Kick Drum
My kick patch is pretty much based on the well known technique described by Frank Barknecht : A sine wave has both its amplitude and its frequency modulated by two decaying envelopes. I aslo added a lpf for good mesure (If you've read Barknetch's article, you know about the "click" problem when the volume jumps striaght to 1 at the beginning of the envelope : this leads on to the author trying very short attack times, and him noticing the aformentioned problem due to the way PD process signal; I simply got rid of the click by providing a lpf, so you can adjust the amount of clickiness of your kick).
The patch receives a bang as a trigger, the starting and finishing frequency of the sine wave (you can make synthis bleepy sounds by haveing your frequency increasing, or even use the patch to generate simple sine basses), the decay time of the frequency envelope, the decay time of the amplitude envelope, the LPF cutoff frequency, and the volume.
download it here. If you are puzzled about the long name of the patch, it is just a matter of practicality to see the inlets a bit more easily.
if you feel lost, try somthing along the lines of start freq=130Hz, end freq=15Hz, freq decay=50ms, amplitude decay=200ms, and volume anywhere between 0 and 1.
Snare Drum
My snare patch started from the classic technique (also mentioned in Barknecht's article) of using Low Pass filtered white noise with a decaying amplitude. I found it to sound a bit loose, so what I did is add a separate envelope for the filter, which effectively enables your snare to have a two stage envelope : try short decays for the filter envelope and longer ones for the amplitude : you get the snap of the snare, then a longer, muffled tail.
The inlets are : a trigger (bang), the amplitude decay, the filter decay, the "amount" of the filter envelope, the constant filter cutoff, and the volume. To clarify things here, basically, the output of the filter envelope is then summed with the LPF cutoff constant value (wich will be heard once the filter decay is finished on the tail of the snare if the amplitude envelope is longer that the filter one). so basically, the filter cutoff starts at (envelope amount + Cutoff), and ends at the cutoff frequency. you obviously want to have at least a bit of constant cutoff frequency otherwise the sound will end at the end of the filter decay, whithe the LPF reaching 0.
This more or less achieves the same result as the technique used on Roland machines (for the noise part : TR snares also have a pitched part), where the white noise is separated in its high and low frequency components using a LPF and an HPF at a crossover frequency, and those components are modulated in amplitude by separate envelopes.
a good starting point for parameters are amplitude decay around 100ms, filter decay around 50ms, filter envelope amount around 1000Hz, andfilter cutoff around 400Hz. again, the volume has to be between 0 and 1.
Hi Hat
The hat sound was a tricky one to get. I couldn't find any tips on the internet (mind you, I did not look that hard) so after a bit of experimentation, I settled for decaying white noise, filtered with a band pass filter with variable Q. I am still not quite satisfied with it, so I plan to use my ADR envelope (which enable to get an ASR, or even a SR or a gate envelope, which is what I am after) and probably modulate the filter cutoff with a decaying envelope, but that will be for a further version.
the patch recieves a bang as a trigger, amplitude decay time, BPF frequency, BPF q, and volume.
decent sounding settings would be between 80 and 100ms of amplitudedecay, BPF frequency around 7kHz, with a q of 30 and the volume, of course, between 0 and 1.
The idea here is to give you a taste of very basic drum synthesis techniques and how they are achieved in PD. It is worth taking a look at the patches if you're new to the line object, and can't get it to output what you expect. If you want to quickly test the patches and what they sound like, I suggest you check out my beats.pd patch, a very simple step sequencer (I'm big on step sequencers in pure data, I'll make an article about them in the future)
To conclude, I must admit, I am no drum synthesis wizard. It is an art in itself : not only getting the signal flow and synthesis technique right, but also using the right parameters values to makes it sound good. Those three patches introduce basic concepts, decaying enveloppes, modulated oscillators or filter, multi-stage envelopes, so by mixing and matching you can do even better sounding ones. bear in mind that typical TR-style analog drum synthesis sounded so cheap and unrealistic because engineers were limited by the use of analog hardware. introducing extra envelope generators or filters, multi-stage envelopes, VCAs, etc. was costly so their choice of signal flow was a tradeoff between cost efficiency and what sounded decent enough. Pure data does not have those limitation, especially since the objects involved are relatively computationally inexpensive, (unless you start making huge patches, but then you're in the wonderful world of physical modelling...),so go forth and experiment!