Debian Codegraph @

src/Examples/McCurdy Collection/Miscellaneous/date_dates.csd

raw
1 ;Written by Iain McCurdy, 2008
2
3 ;Modified for QuteCsound by René, February 2011
4 ;Tested on Ubuntu 10.04 with csound-float 5.13.0 and QuteCsound svn rev 817
5 ; AS OF WRITING THE OPCODE 'DATE' NOT WORK PROPERLY WITH CSOUND FLOAT
6
7 ;Notes on modifications from original csd:
8
9
10 ;my flags on Ubuntu: -odac -b1024 -B2048 -+rtaudio=alsa -+rtmidi=null -m0
11 <CsoundSynthesizer>
12 <CsOptions>
13
14 </CsOptions>
15 <CsInstruments>
16 sr = 44100 ;SAMPLE RATE
17 ksmps = 16 ;NUMBER OF AUDIO SAMPLES IN EACH CONTROL CYCLE
18 nchnls = 2 ;NUMBER OF CHANNELS (2=STEREO)
19
20
21 instr 1 ;AUTO UPDATE - TRIGGERS INSTR 2
22 ktrig metro 10
23 schedkwhen ktrig, 0, 0, 2, 0, 0.01
24 endin
25
26 instr 2
27 idate_secs date ;READ DATE SINCE 1ST JANUARY 1970 IN SECONDS
28 outvalue "Date", idate_secs ;SEND 'date' READING TO VALUE BOX
29 Sdate dates ;READ DATE SINCE 1ST JANUARY 1970 AS A STRING
30 outvalue "Dates", Sdate ;SEND 'dates' STRING TO TEXT BOX
31 endin
32 </CsInstruments>
33 <CsScore>
34 f 0 3600
35
36 i 2 0 0.01
37 </CsScore>
38 </CsoundSynthesizer>
39
40
41 <bsbPanel>
42 <label>Widgets</label>
43 <objectName/>
44 <x>73</x>
45 <y>204</y>
46 <width>495</width>
47 <height>269</height>
48 <visible>true</visible>
49 <uuid/>
50 <bgcolor mode="background">
51 <r>241</r>
52 <g>226</g>
53 <b>185</b>
54 </bgcolor>
55 <bsbObject version="2" type="BSBLabel">
56 <objectName/>
57 <x>2</x>
58 <y>2</y>
59 <width>493</width>
60 <height>267</height>
61 <uuid>{aa607456-d368-4d59-8497-d16d608404c3}</uuid>
62 <visible>true</visible>
63 <midichan>0</midichan>
64 <midicc>0</midicc>
65 <label>date, dates</label>
66 <alignment>center</alignment>
67 <font>Liberation Sans</font>
68 <fontsize>18</fontsize>
69 <precision>3</precision>
70 <color>
71 <r>255</r>
72 <g>255</g>
73 <b>255</b>
74 </color>
75 <bgcolor mode="background">
76 <r>5</r>
77 <g>27</g>
78 <b>150</b>
79 </bgcolor>
80 <bordermode>border</bordermode>
81 <borderradius>5</borderradius>
82 <borderwidth>2</borderwidth>
83 </bsbObject>
84 <bsbObject version="2" type="BSBLabel">
85 <objectName/>
86 <x>6</x>
87 <y>22</y>
88 <width>484</width>
89 <height>161</height>
90 <uuid>{e41f02b8-6ad4-46dc-805c-0b2eeafbd476}</uuid>
91 <visible>true</visible>
92 <midichan>0</midichan>
93 <midicc>0</midicc>
94 <label>----------------------------------------------------------------------------------------------------------------------
95 The 'date' opcode outputs at i-rate the number of seconds since January 1st 1970 (the beginning of the current epoch.)
96 The 'dates' opcode parses this information to output the same value as a string giving day, month, date, time (hours, minutes and seconds) and year. In the case of 'dates' the user can pass the opcode an explicit number of seconds since
97 1970 or allow it to read from the computer's system clock.
98 NB, AS OF WRITING 'DATE' DOES NOT WORK PROPERLY WITH CSOUND FLOAT.</label>
99 <alignment>left</alignment>
100 <font>Liberation Sans</font>
101 <fontsize>14</fontsize>
102 <precision>3</precision>
103 <color>
104 <r>255</r>
105 <g>255</g>
106 <b>255</b>
107 </color>
108 <bgcolor mode="nobackground">
109 <r>255</r>
110 <g>255</g>
111 <b>255</b>
112 </bgcolor>
113 <bordermode>noborder</bordermode>
114 <borderradius>1</borderradius>
115 <borderwidth>1</borderwidth>
116 </bsbObject>
117 <bsbObject version="2" type="BSBButton">
118 <objectName/>
119 <x>9</x>
120 <y>190</y>
121 <width>110</width>
122 <height>30</height>
123 <uuid>{119eae69-f0a5-4bdd-bd99-6df3318bc455}</uuid>
124 <visible>true</visible>
125 <midichan>0</midichan>
126 <midicc>0</midicc>
127 <type>event</type>
128 <pressedValue>1.00000000</pressedValue>
129 <stringvalue/>
130 <text>Manual Update</text>
131 <image>/</image>
132 <eventLine>i 2 0 0.01</eventLine>
133 <latch>false</latch>
134 <latched>false</latched>
135 </bsbObject>
136 <bsbObject version="2" type="BSBButton">
137 <objectName/>
138 <x>9</x>
139 <y>228</y>
140 <width>110</width>
141 <height>30</height>
142 <uuid>{4e4e20c5-d5a2-471f-8322-323282a5651c}</uuid>
143 <visible>true</visible>
144 <midichan>0</midichan>
145 <midicc>0</midicc>
146 <type>event</type>
147 <pressedValue>1.00000000</pressedValue>
148 <stringvalue/>
149 <text> Auto Update</text>
150 <image>/</image>
151 <eventLine>i 1 0 -1</eventLine>
152 <latch>true</latch>
153 <latched>false</latched>
154 </bsbObject>
155 <bsbObject version="2" type="BSBLineEdit">
156 <objectName>Dates</objectName>
157 <x>205</x>
158 <y>225</y>
159 <width>150</width>
160 <height>29</height>
161 <uuid>{cb2d0433-76ef-4261-b714-c7da0feed8a2}</uuid>
162 <visible>true</visible>
163 <midichan>0</midichan>
164 <midicc>0</midicc>
165 <label>Thu Mar 3 11:18:51 2011
166 </label>
167 <alignment>left</alignment>
168 <font>Liberation Sans</font>
169 <fontsize>10</fontsize>
170 <precision>3</precision>
171 <color>
172 <r>0</r>
173 <g>0</g>
174 <b>0</b>
175 </color>
176 <bgcolor mode="nobackground">
177 <r>240</r>
178 <g>235</g>
179 <b>226</b>
180 </bgcolor>
181 <background>nobackground</background>
182 </bsbObject>
183 <bsbObject version="2" type="BSBLabel">
184 <objectName/>
185 <x>122</x>
186 <y>193</y>
187 <width>80</width>
188 <height>25</height>
189 <uuid>{fa906a98-8efd-4449-b7a9-719e70220682}</uuid>
190 <visible>true</visible>
191 <midichan>0</midichan>
192 <midicc>0</midicc>
193 <label>Date (secs):</label>
194 <alignment>right</alignment>
195 <font>Liberation Sans</font>
196 <fontsize>10</fontsize>
197 <precision>3</precision>
198 <color>
199 <r>255</r>
200 <g>255</g>
201 <b>255</b>
202 </color>
203 <bgcolor mode="nobackground">
204 <r>255</r>
205 <g>255</g>
206 <b>255</b>
207 </bgcolor>
208 <bordermode>noborder</bordermode>
209 <borderradius>1</borderradius>
210 <borderwidth>1</borderwidth>
211 </bsbObject>
212 <bsbObject version="2" type="BSBDisplay">
213 <objectName>Date</objectName>
214 <x>205</x>
215 <y>194</y>
216 <width>179</width>
217 <height>28</height>
218 <uuid>{2a686a57-e646-4353-a8b8-9d32d48997dc}</uuid>
219 <visible>true</visible>
220 <midichan>0</midichan>
221 <midicc>0</midicc>
222 <label>1299147520.000</label>
223 <alignment>left</alignment>
224 <font>Liberation Sans</font>
225 <fontsize>10</fontsize>
226 <precision>3</precision>
227 <color>
228 <r>255</r>
229 <g>255</g>
230 <b>255</b>
231 </color>
232 <bgcolor mode="nobackground">
233 <r>255</r>
234 <g>255</g>
235 <b>255</b>
236 </bgcolor>
237 <bordermode>noborder</bordermode>
238 <borderradius>1</borderradius>
239 <borderwidth>1</borderwidth>
240 </bsbObject>
241 <bsbObject version="2" type="BSBLabel">
242 <objectName/>
243 <x>132</x>
244 <y>227</y>
245 <width>70</width>
246 <height>25</height>
247 <uuid>{e2f36491-ce20-4716-ab07-8c19cc859db7}</uuid>
248 <visible>true</visible>
249 <midichan>0</midichan>
250 <midicc>0</midicc>
251 <label>Date:</label>
252 <alignment>right</alignment>
253 <font>Liberation Sans</font>
254 <fontsize>10</fontsize>
255 <precision>3</precision>
256 <color>
257 <r>255</r>
258 <g>255</g>
259 <b>255</b>
260 </color>
261 <bgcolor mode="nobackground">
262 <r>255</r>
263 <g>255</g>
264 <b>255</b>
265 </bgcolor>
266 <bordermode>noborder</bordermode>
267 <borderradius>1</borderradius>
268 <borderwidth>1</borderwidth>
269 </bsbObject>
270 </bsbPanel>
271 <bsbPresets>
272 </bsbPresets>
273 <EventPanel name="" tempo="60.00000000" loop="8.00000000" x="913" y="162" width="655" height="346" visible="true" loopStart="0" loopEnd="0"> </EventPanel>