Debian Codegraph @

examples/FLslider-2.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-2.wav -W ;;; for file output any platform
8 </CsOptions>
9 <CsInstruments>
10
11 sr = 44100
12 kr = 441
13 ksmps = 100
14 nchnls = 1
15
16 ;By Andres Cabrera 2007
17
18 FLpanel "Slider Types", 410, 260, 50, 50
19 ; Distance of the left edge of the slider
20 ; from the left edge of the panel
21 ix = 10
22 ; Distance of the top edge of the slider
23 ; from the top edge of the panel
24 iy = 10
25 ; Create boxes to display widget values
26 givalue1 FLvalue "1", 60, 20, ix + 330, iy
27 givalue3 FLvalue "3", 60, 20, ix + 330, iy + 40
28 givalue5 FLvalue "5", 60, 20, ix + 330, iy + 80
29
30 givalue2 FLvalue "2", 60, 20, ix + 60, iy + 140
31 givalue4 FLvalue "4", 60, 20, ix + 195, iy + 140
32 givalue6 FLvalue "6", 60, 20, ix + 320, iy + 140
33
34 ;Horizontal sliders
35 gkdummy1, gihandle1 FLslider "Type 1", 200, 5000, -1, 1, givalue1, 320, 20, ix, iy
36 gkdummy3, gihandle3 FLslider "Type 3", 0, 15000, 0, 3, givalue3, 320, 20, ix, iy + 40
37 ; Reversed slider
38 gkdummy5, gihandle5 FLslider "Type 5", 1, 0, 0, 5, givalue5, 320, 20, ix, iy + 80
39
40 ;Vertical sliders
41 gkdummy2, gihandle2 FLslider "Type 2", 0, 1, 0, 2, givalue2, 20, 100, ix+ 30 , iy + 120
42 ; Reversed slider
43 gkdummy4, gihandle4 FLslider "Type 4", 1, 0, 0, 4, givalue4, 20, 100, ix + 165 , iy + 120
44 gkdummy6, gihandle6 FLslider "Type 6", 0, 1, 0, 6, givalue6, 20, 100, ix + 290 , iy + 120
45 FLpanelEnd
46
47 FLpanel "Plastic Slider Types", 410, 300, 150, 150
48 ; Distance of the left edge of the slider
49 ; from the left edge of the panel
50 ix = 10
51 ; Distance of the top edge of the slider
52 ; from the top edge of the panel
53 iy = 10
54 ; Create boxes to display widget values
55 givalue21 FLvalue "21", 60, 20, ix + 330, iy
56 givalue23 FLvalue "23", 60, 20, ix + 330, iy + 40
57 givalue25 FLvalue "25", 60, 20, ix + 330, iy + 80
58
59 givalue22 FLvalue "22", 60, 20, ix + 60, iy + 140
60 givalue24 FLvalue "24", 60, 20, ix + 195, iy + 140
61 givalue26 FLvalue "26", 60, 20, ix + 320, iy + 140
62
63 ;Horizontal sliders
64 gkdummy21, gihandle21 FLslider "Type 21", 200, 5000, -1, 21, givalue21, 320, 20, ix, iy
65 gkdummy23, gihandle23 FLslider "Type 23", 0, 15000, 0, 23, givalue23, 320, 20, ix, iy + 40
66 ; Reversed slider
67 gkdummy25, gihandle25 FLslider "Type 25", 1, 0, 0, 25, givalue25, 320, 20, ix, iy + 80
68
69 ;Vertical sliders
70 gkdummy22, gihandle22 FLslider "Type 22", 0, 1, 0, 22, givalue22, 20, 100, ix+ 30 , iy + 120
71 ; Reversed slider
72 gkdummy24, gihandle24 FLslider "Type 24", 1, 0, 0, 24, givalue24, 20, 100, ix + 165 , iy + 120
73 gkdummy26, gihandle26 FLslider "Type 26", 0, 1, 0, 26, givalue26, 20, 100, ix + 290 , iy + 120
74 ;Button to add color to the sliders
75 gkcolors, ihdummy FLbutton "Color", 1, 0, 21, 150, 30, 30, 260, 0, 10, 0, 1
76 FLpanelEnd
77 FLrun
78
79
80
81 ;Set some widget's initial value
82 FLsetVal_i 500, gihandle1
83 FLsetVal_i 1000, gihandle3
84
85 instr 10
86 ; Set the color of widgets
87 FLsetColor 200, 230, 0, gihandle1
88 FLsetColor 0, 123, 100, gihandle2
89 FLsetColor 180, 23, 12, gihandle3
90 FLsetColor 10, 230, 0, gihandle4
91 FLsetColor 0, 0, 0, gihandle5
92 FLsetColor 0, 0, 0, gihandle6
93
94 FLsetColor 200, 230, 0, givalue1
95 FLsetColor 0, 123, 100, givalue2
96 FLsetColor 180, 23, 12, givalue3
97 FLsetColor 10, 230, 0, givalue4
98 FLsetColor 255, 255, 255, givalue5
99 FLsetColor 255, 255, 255, givalue6
100
101 FLsetColor2 20, 23, 100, gihandle1
102 FLsetColor2 200,0 ,123 , gihandle2
103 FLsetColor2 180, 180, 100, gihandle3
104 FLsetColor2 180, 23, 12, gihandle4
105 FLsetColor2 180, 180, 100, gihandle5
106 FLsetColor2 180, 23, 12, gihandle6
107
108 FLsetColor 200, 230, 0, gihandle21
109 FLsetColor 0, 123, 100, gihandle22
110 FLsetColor 180, 23, 12, gihandle23
111 FLsetColor 10, 230, 0, gihandle24
112 FLsetColor 0, 0, 0, gihandle25
113 FLsetColor 0, 0, 0, gihandle26
114
115 FLsetColor 200, 230, 0, givalue21
116 FLsetColor 0, 123, 100, givalue22
117 FLsetColor 180, 23, 12, givalue23
118 FLsetColor 10, 230, 0, givalue24
119 FLsetColor 255, 255, 255, givalue25
120 FLsetColor 255, 255, 255, givalue26
121
122 FLsetColor2 20, 23, 100, gihandle21
123 FLsetColor2 200,0 ,123 , gihandle22
124 FLsetColor2 180, 180, 100, gihandle23
125 FLsetColor2 180, 23, 12, gihandle24
126 FLsetColor2 180, 180, 100, gihandle25
127 FLsetColor2 180, 23, 12, gihandle26
128
129 ; Slider values must be updated for colors to change
130 FLsetVal_i 250, gihandle1
131 FLsetVal_i 0.5, gihandle2
132 FLsetVal_i 0, gihandle3
133 FLsetVal_i 0, gihandle4
134 FLsetVal_i 0, gihandle5
135 FLsetVal_i 0.5, gihandle6
136 FLsetVal_i 250, gihandle21
137 FLsetVal_i 0.5, gihandle22
138 FLsetVal_i 500, gihandle23
139 FLsetVal_i 0, gihandle24
140 FLsetVal_i 0, gihandle25
141 FLsetVal_i 0.5, gihandle26
142
143 endin
144
145
146 </CsInstruments>
147 <CsScore>
148 f 0 3600 ;Dumy table to make csound wait for realtime events
149
150 e
151
152 </CsScore>
153 </CsoundSynthesizer>