Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Filters
Jacob Joaquin
October 6, 2010
jacobjoaquin@gmail.com
csoundblog.com
<CsoundSynthesizer>
<CsInstruments>
sr = 44100
kr = 4410
ksmps = 10
nchnls = 1
0dbfs = 1.0
instr 1
icutoff = p4 ; Cutoff / center frequency
a1 noise 0.707, 0
a2 butterlp a1, icutoff
out a2
endin
instr 2
icutoff = p4 ; Cutoff / center frequency
a1 noise 0.707, 0
a2 butterhp a1, icutoff
out a2
endin
instr 3
iwidth = p4 ; Width of band pass, in Hz
a1 noise 0.4, 0
a2 butterbp a1, 440, iwidth
a2 balance a2, a1 ; Make up for lost gain
out a2
endin
instr 4
iwidth = p4 ; Width of band reject, in Hz
a1 noise 0.4, 0
a2 butterbr a1, 440, iwidth
out a2
endin
</CsInstruments>
<CsScore>
; Low pass
i 1 0 1 22050
i 1 1.5 . 11025
i 1 3 . 5512
i 1 4.5 . 2756
i 1 6 . 1378
i 1 7.5 . 689
i 1 9 . 344
i 1 10.5 . 172
i 1 12 . 86
i 1 13.5 . 43
i 1 15 . 21
s 18
; High pass
i 2 0 1 21
i 2 1.5 . 43
i 2 3 . 86
i 2 4.5 . 172
i 2 6 . 344
i 2 7.5 . 689
i 2 9 . 1378
i 2 10.5 . 2756
i 2 12 . 5512
i 2 13.5 . 11025
i 2 15 . 22050
s 18
; Band pass
i 3 0 1 880
i 3 1.5 . 440
i 3 3 . 220
i 3 4.5 . 110
i 3 6 . 55
i 3 7.5 . 27
i 3 9 . 13
i 3 10.5 . 6
i 3 12 . 3
i 3 13.5 . 1
s 16
; Band reject
i 4 0 1 1
i 4 1.5 . 3
i 4 3 . 6
i 4 4.5 . 13
i 4 6 . 27
i 4 7.5 . 55
i 4 9 . 110
i 4 10.5 . 220
i 4 12 . 440
i 4 13.5 . 880
</CsScore>
</CsoundSynthesizer>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment