Debian Codegraph @

examples/FLslider.csd

raw
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 FLslider.wav -W ;;; for file output any platform
8 </CsOptions>
9 <CsInstruments>
10
11 ; A sine with oscillator with flslider controlled frequency
12 sr = 44100
13 kr = 441
14 ksmps = 100
15 nchnls = 1
16
17 FLpanel "Frequency Slider", 900, 400, 50, 50
18 ; Minimum value output by the slider
19 imin = 200
20 ; Maximum value output by the slider
21 imax = 5000
22 ; Logarithmic type slider selected
23 iexp = -1
24 ; Slider graphic type (5='nice' slider)
25 itype = 5
26 ; Display handle (-1=not used)
27 idisp = -1
28 ; Width of the slider in pixels
29 iwidth = 750
30 ; Height of the slider in pixels
31 iheight = 30
32 ; Distance of the left edge of the slider
33 ; from the left edge of the panel
34 ix = 125
35 ; Distance of the top edge of the slider
36 ; from the top edge of the panel
37 iy = 50
38
39 gkfreq, ihandle FLslider "Frequency", imin, imax, iexp, itype, idisp, iwidth, iheight, ix, iy
40 ; End of panel contents
41 FLpanelEnd
42 ; Run the widget thread!
43 FLrun
44
45 ;Set the widget's initial value
46 FLsetVal_i 300, ihandle
47
48 instr 1
49 iamp = 15000
50 ifn = 1
51 kfreq portk gkfreq, 0.005 ;Smooth gkfreq to avoid zipper noise
52 asig oscili iamp, kfreq, ifn
53 out asig
54 endin
55
56
57 </CsInstruments>
58 <CsScore>
59
60 ; Function table that defines a single cycle
61 ; of a sine wave.
62 f 1 0 1024 10 1
63
64 ; Instrument 1 will play a note for 1 hour.
65 i 1 0 3600
66 e
67
68
69 </CsScore>
70 </CsoundSynthesizer>