1<CsoundSynthesizer>
2<CsOptions>
3; Select audio/midi flags here according to platform
4; Audio out   Audio in    No messages
5-odac           -iadc     -d     ;;;RT audio I/O
6; For Non-realtime ouput leave only the line below:
7; -o lowpass2.wav -W ;;; for file output any platform
8</CsOptions>
9<CsInstruments>
10
11/* Written by Sean Costello */
12; Orchestra file for resonant filter sweep of a sawtooth-like waveform.
13  sr = 44100
14  kr = 2205
15  ksmps = 20
16  nchnls = 1
17
18          instr 1
19
20  idur    =          p3
21  ifreq   =          p4
22  iamp    =          p5 * .5
23  iharms  =          (sr*.4) / ifreq
24
25; Sawtooth-like waveform
26  asig    gbuzz 1, ifreq, iharms, 1, .9, 1
27
28; Envelope to control filter cutoff
29  kfreq   linseg 1, idur * 0.5, 5000, idur * 0.5, 1
30
31  afilt   lowpass2 asig,kfreq, 30
32
33; Simple amplitude envelope
34  kenv    linseg 0, .1, iamp, idur -.2, iamp, .1, 0
35          out afilt * kenv
36
37          endin
38
39
40</CsInstruments>
41<CsScore>
42
43/* Written by Sean Costello */
44f1 0 8192 9 1 1 .25
45
46i1 0 5 100 1000
47i1 5 5 200 1000
48e
49
50
51</CsScore>
52</CsoundSynthesizer>
53