Tuesday, October 9, 2012

Csound Mini-Lesson 3: Kicks in Csound

Kicks are the heartbeat in music. A wonderful pulse that gives music liveliness. In electronic dance music, it is the most important aspect of a track.

There is more than one way to make a kick synthetically. I'm going to show you the way I make my kicks.

By the end of this tutorial, you'll be able to make kicks that sound like this:



So, let's get started!

PART 1: the "boom"

The first part of our kick will be what I call the "boom" of the kick. This is the main part of our kick. To make this, we will start of by putting a 60hz sine wave through an exponential envelope:

gisine ftgen 0, 0, 4096, 10, 1
instr 1   
kenv expseg 1, .6, 0.0001
a1 oscil .9*kenv, 60, gisine
outs a1, a1
endin

This is known in the industry as an "808" kick (though I highly doubt this is how it actually was done on a tr-808.) Useful for layering, but there isn't enough body for a main kick. What I do is create a line which goes from a little over 60hz to a little bit under 60hz. If done very quickly (under 500ms), this can be perceived as a percussive sound:

gisine ftgen 0, 0, 4096, 10, 1
instr 1   
kdrop linseg 120, .2, 40
kenv expseg 1, .6, 0.0001
a1 oscil .9, kdrop, gisine
outs a1*kenv, a1*kenv
endin

This sounds a lot better! If your music is a sparse, this might be a good stopping point. If not, you may need to add a some click. You may also notice that instead of applying the amp envelope at the oscil opcode, I applied right at the output. Since all we are doing is scaling a signals frequency, both places work!

PART 2: the "click"

Another aspect of a kick is it's click. This high frequency content will define the attack of the instrument. To make this, we will take a white noise generator and put it through a very fast envelope. I played around a little bit with balance and changed some routing:

gisine ftgen 0, 0, 4096, 10, 1
instr 1   
kdrop linseg 120, .2, 40
kenv expseg 1, .6, 0.0001
arand rand .05
kclik linseg 1, 0.004, 1, 0, 0
a1 oscil .9, kdrop, gisine
aOut = (a1 + (arand*kclik))*kenv
outs aOut, aOut
endin

Here is a line-by-line play of our final kick, bottom to top:

"endin": the instrument end tag.

"outs aOut, aOut": send the audio signal aOut to our left and right speakers.

"aOut = (a1 + (arand*kclik))*kenv": Mixing our click and boom together. Order of operations matter here. (arand*kclik) is our click. we are taking our white noise and multiplying it by our fast envelope. a1 is our boom. We are combining our boom and click together and then multiplying that by one envelope. This makes it sound more unified.

"a1 oscil .9, kdrop, gisine": Our oscillator creating our "boom." Amplitude of 9, linear envelope modulating pitch, f-table referencing sine.

"kclik linseg 1, 0.004, 1, 0, 0": This is our very fast envelope (4ms) that will make our click.

"arand rand .05": white noise generator.

"kenv expseg 1, .6, 0.0001": exponential envelope which will shape the amplitude of our kick.

"kdrop linseg 120, .2, 40":  linear envelope which quickly jumps from 120 to 40 hz.

"instr 1": instrument begins. it has an ID of 1

"gisine ftgen 0, 0, 4096, 10, 1": our generated sine wave in an f-table. has a global i-rate variable called "gisine."




And there you have it!

No comments:

Post a Comment

Post a Comment