Csound Csound-dev Csound-tekno Search About

Another drum

Date1999-08-26 05:45
FromHans Mikelson
SubjectAnother drum
Hi,

Here is another drum.  This one is much simpler and should be easier to
modify and play around with, and perhaps sounds fatter.  It basically takes
noise, sweeps a resonant low-pass filter over it, sweeping both frequency
and resonance with exponential envelopes, applies an amplitude envelope and
finally applies compression/limiting.  The p-fields should be useful for
generating a variety of sounds.  Try changing the limiting curve for more or
less compression.

Happy Csounding,
Hans Mikelson

; ORC
;---------------------------------------------------------
; Kick Drum
; Coded by Hans Mikelson August 25, 1999
;---------------------------------------------------------
sr      =        44100                      ; Sample rate
kr      =        44100                      ; Kontrol rate
ksmps   =        1                          ; Samples/Kontrol period
nchnls  =        2                          ; Normal stereo
        zakinit  50,50                      ; May need this later

;---------------------------------------------------------
; Kick Drum 1
;---------------------------------------------------------
       instr     10

idur   =         p3                         ; Duration
iamp   =         p4                         ; Amplitude
iacc   =         p5                         ; Accent
irez   =         p6                         ; Resonance

kfenv  expseg    1500*iacc,  .04, 200, .04, 120, idur-.04, 40 ; Freq
Envelope
krenv  expseg    .7,  idur, 1                                 ; Q Envelope
kaenv  expseg    .1, .001, 1, .02, 1, .04, .7, idur-.062, .7  ; Amp Envelope
kdclck linseg    0, .002, 1, idur-.004, 1, .002, 0            ; Declick
asig   rand      2                                            ; Random
number
; I use rand 2 to rely on moogvcf built in limiter

aflt   moogvcf   asig, kfenv, irez*krenv         ; Moog filter

aout1  =         aflt*kaenv*3                    ; Scale the sound

krms   rms       aout1, 1000                     ; Limiter, get rms
klim   table3    krms*.5, 5, 1                    ; Get limiting value
aout   =         aout1*klim*iamp*kdclck          ; Scale again and ouput

       outs      aout, aout                      ; Output the sound

       endin

; SCO
f1 0 65536 10 1
f5 0 1024 -8 1 256 1 256 .7 256 .1 256 .01 ; Compression/Limiting curve

;    Sta   Dur  Amp    Accent  Q
i10  0.0   .18  24000  1       1.2
i10  0.5   .    .      .8      1.5
i10  1.0   .    .      .5      1.8
i10  1.5   .    .      .4      2.2

i10  2.0   .18  24000  1       1.2
i10  2.5   .    .      .8      1.5
i10  3.0   .    .      .5      1.8
i10  3.75  .    .      .4      2.2
i10  3.5   .    .      .4      2.2

i10  4.0   .18  24000  1       1.2
i10  4.5   .    .      .8      1.5
i10  5.0   .    .      .5      1.8
i10  5.5   .    .      .4      2.2

i10  6.0   .18  24000  1       1.2
i10  6.5   .    .      .8      1.5
i10  7.0   .    .      .5      1.8
i10  7.75  .    .      .4      2.2
i10  7.5   .    .      .4      2.2