Debian Codegraph @

examples/scantable.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 ; Select audio/midi flags here according to platform
4 -odac --limiter=0.95;;;realtime audio out & limiter
5 ;-iadc ;;;uncomment -iadc if realtime audio input is needed too
6 ; For Non-realtime ouput leave only the line below:
7 ; -o scantable.wav -W ;;; for file output any platform
8 </CsOptions>
9 <CsInstruments>
10
11 sr = 44100
12 ksmps = 32
13 nchnls = 2
14 0dbfs = 1
15
16 ; by Menno Knevel 2021
17
18 instr 1
19
20 initial ftgen 1, 0, p5, 10, 1 ; initial position = sine wave
21 imass ftgen 2, 0, p5, -7, .1, p5, 1 ; masses
22 istiff ftgen 3, 0, p5, -7, 0, p5*.3, 0.8*p5, p5*.7, 0 ; stiffness
23 idamp ftgen 4, 0, p5, -7, 1, p5, 1 ; damping
24 ivelo ftgen 5, 0, p5, -7, 0, p5, 0.5 ; initial velocity
25
26 iamp = .15
27 ipch = cpsmidinn(p4)
28 asig scantable iamp, ipch, 1, 2, 3, 4, 5
29 asig dcblock asig
30 asig butlp asig, 5000 ; lowpass filter
31 outs asig, asig;
32
33 endin
34
35 </CsInstruments>
36 <CsScore>
37 s
38 i1 0 20 50 128
39 i1 10 10 70 .
40 i1 15 3 40 .
41 s
42 i1 0 20 50 4096 ; f-tables now bigger tables
43 i1 10 10 70 . ; sounds different
44 i1 15 3 40 .
45 s
46 i1 0 20 50 1000 ; still big tables
47 i1 10 10 70 . ; but non-power of 2
48 i1 15 3 40 .
49 s
50 i1 0 20 50 20 ; small tables
51 i1 10 10 70 . ; & non-power of 2
52 i1 15 3 40 .
53 e
54 </CsScore>
55 </CsoundSynthesizer>