History

Merge remote-tracking branch 'origin/main' into qt6-main

Spencer Salazars committed 3 years ago

Commit 2fbfa982 parents 0506c4a d0ee61c263 files · +29036 −10344Browse files

Unified · Split

263 files
  1. .github/workflows/linux-build-unit-tests.yml +1 −1
  2. .github/workflows/macos-build-unit-tests.yml +1 −6
  3. examples/ai/features/centroid.ck +42 −0
  4. examples/ai/features/chroma.ck +62 −0
  5. examples/ai/features/features-combined.ck +59 −0
  6. examples/ai/features/flux.ck +0 −0
  7. examples/ai/features/flux0.ck +0 −0
  8. examples/ai/features/kurtosis.ck +36 −0
  9. examples/ai/features/mfcc-basic.ck +48 −0
  10. examples/ai/features/mfcc-mean.ck +91 −0
  11. examples/ai/features/rms.ck +0 −0
  12. examples/ai/features/rolloff.ck +0 −0
  13. examples/ai/features/rolloff2.ck +0 −0
  14. examples/ai/features/sfm.ck +47 −0
  15. examples/ai/features/zerox.ck +0 −0
  16. examples/ai/genre-classify/data/gtzan-23.txt +1000 −0
  17. examples/ai/genre-classify/feature-extract.ck +212 −0
  18. examples/ai/genre-classify/genre-classify.ck +338 −0
  19. examples/ai/genre-classify/x-validate.ck +323 −0
  20. examples/ai/hmm/hmm-load.ck +37 −0
  21. examples/ai/hmm/hmm-train.ck +31 −0
  22. examples/ai/knn/knn-search.ck +38 −0
  23. examples/ai/knn/knn2-classify.ck +64 −0
  24. examples/ai/knn/knn2-search.ck +68 −0
  25. examples/ai/mlp/mlp-manual.ck +164 −0
  26. examples/ai/mlp/mlp.ck +62 −0
  27. examples/ai/mlp/model-load.ck +34 −0
  28. examples/ai/mlp/model-save.ck +54 −0
  29. examples/ai/mlp/model.txt +15 −0
  30. examples/ai/pca/pca.ck +41 −0
  31. examples/ai/svm/svm-basic.ck +34 −0
  32. examples/ai/wekinator/currentData.arff +19 −0
  33. examples/ai/wekinator/wekinator-basic.ck +121 −0
  34. examples/ai/wekinator/wekinator-customize.ck +232 −0
  35. examples/ai/wekinator/wekinator-import.ck +48 −0
  36. examples/ai/word2vec/poem-i-feel.ck +195 −0
  37. examples/ai/word2vec/poem-randomwalk.ck +122 −0
  38. examples/ai/word2vec/poem-spew.ck +109 −0
  39. examples/ai/word2vec/poem-ungenerate.ck +284 −0
  40. examples/ai/word2vec/word2vec-basic.ck +211 −0
  41. examples/ai/word2vec/word2vec-prompt.ck +468 −0
  42. examples/analysis/features/centroid.ck +0 −23
  43. examples/array/array_associative.ck +26 −0
  44. examples/array/array_negative.ck +11 −0
  45. examples/array/array_zero.ck +14 −0
  46. examples/basic/rec-auto-stereo.ck +1 −1
  47. examples/basic/rec-auto.ck +2 −1
  48. examples/basic/rec.ck +2 −1
  49. examples/deep/ks-chord.ck +149 −0
  50. examples/deep/say-chu.ck +1 −1
  51. examples/event/event-extend.ck +4 −1
  52. examples/event/event-x-bpm-1.ck +144 −0
  53. examples/event/event-x-bpm-2.ck +139 −0
  54. examples/hid/kbhit/kb.ck +0 −0
  55. examples/hid/kbhit/kb2.ck +0 −0
  56. examples/io/chout.ck +3 −0
  57. examples/io/jabberwocky.txt +37 −0
  58. examples/io/read-byte.ck +36 −0
  59. examples/io/read-byte.txt +2 −0
  60. examples/io/read-float.ck +33 −0
  61. examples/io/read-float.txt +4 −0
  62. examples/io/read-int.ck +6 −1
  63. examples/io/read-int.txt +0 −1
  64. examples/io/read-line.ck +6 −1
  65. examples/io/read-line.txt +0 −0
  66. examples/io/read-str.ck +1 −1
  67. examples/io/read-str.txt +0 −0
  68. examples/io/read-tokens.ck +66 −0
  69. examples/io/seek.ck +40 −0
  70. examples/io/write-byte.ck +35 −0
  71. examples/io/write.ck +8 −3
  72. examples/io/write2.ck +8 −3
  73. examples/machine/crash.ck +4 −0
  74. examples/machine/eval.ck +22 −0
  75. examples/machine/intsize.ck +2 −0
  76. examples/machine/is-realtime.ck +6 −0
  77. examples/machine/machine-shred.ck +24 −0
  78. examples/math/map.ck +28 −0
  79. examples/math/math-help.ck +6 −0
  80. examples/osc/multi-msg/r-multi-msg.ck +1 −2
  81. examples/osc/multicast/r.ck +23 −13
  82. examples/osc/one2many/r.ck +22 −12
  83. examples/osc/one2many/s-sender.ck +10 −4
  84. examples/osc/osc-dump.ck +20 −11
  85. examples/osc/r.ck +22 −12
  86. examples/shred/machine.ck +0 −1
  87. examples/special/LiSa-munger3.ck +1 −1
  88. examples/type/polymorph.ck +71 −0
  89. examples/type/type_object.ck +4 −4
  90. examples/type/type_primitives.ck +4 −2
  91. examples/type/type_query.ck +75 −0
  92. examples/type/type_type.ck +116 −0
  93. notes/VERSIONS +639 −6
  94. src/core/chuck.cpp +145 −89
  95. src/core/chuck.h +15 −17
  96. src/core/chuck.y +1 −1
  97. src/core/chuck_absyn.cpp +49 −49
  98. src/core/chuck_absyn.h +15 −14
  99. src/core/chuck_carrier.cpp +4 −4
  100. src/core/chuck_carrier.h +8 −8
  101. src/core/chuck_compile.cpp +107 −103
  102. src/core/chuck_compile.h +12 −7
  103. src/core/chuck_def.h +17 −7
  104. src/core/chuck_dl.cpp +231 −92
  105. src/core/chuck_dl.h +61 −55
  106. src/core/chuck_emit.cpp +357 −250
  107. src/core/chuck_emit.h +7 −5
  108. src/core/chuck_errmsg.cpp +55 −53
  109. src/core/chuck_errmsg.h +7 −7
  110. src/core/chuck_frame.cpp +9 −4
  111. src/core/chuck_frame.h +1 −1
  112. src/core/chuck_globals.cpp +206 −206
  113. src/core/chuck_globals.h +21 −21
  114. src/core/chuck_instr.cpp +594 −302
  115. src/core/chuck_instr.h +162 −92
  116. src/core/chuck_io.cpp +664 −640
  117. src/core/chuck_io.h +29 −29
  118. src/core/chuck_lang.cpp +749 −151
  119. src/core/chuck_lang.h +36 −2
  120. src/core/chuck_oo.cpp +219 −62
  121. src/core/chuck_oo.h +66 −43
  122. src/core/chuck_otf.cpp +29 −28
  123. src/core/chuck_otf.h +1 −1
  124. src/core/chuck_parse.cpp +468 −12
  125. src/core/chuck_parse.h +7 −5
  126. src/core/chuck_scan.cpp +209 −125
  127. src/core/chuck_scan.h +2 −2
  128. src/core/chuck_shell.cpp +252 −252
  129. src/core/chuck_shell.h +80 −80
  130. src/core/chuck_stats.cpp +10 −10
  131. src/core/chuck_stats.h +10 −10
  132. src/core/chuck_symbol.cpp +9 −9
  133. src/core/chuck_symbol.h +1 −1
  134. src/core/chuck_table.cpp +6 −6
  135. src/core/chuck_table.h +2 −2
  136. src/core/chuck_type.cpp +586 −344
  137. src/core/chuck_type.h +121 −56
  138. src/core/chuck_ugen.cpp +78 −78
  139. src/core/chuck_ugen.h +6 −6
  140. src/core/chuck_utils.cpp +3 −3
  141. src/core/chuck_utils.h +1 −1
  142. src/core/chuck_vm.cpp +70 −70
  143. src/core/chuck_vm.h +18 −18
  144. src/core/chuck_win32.h +2 −2
  145. src/core/dirent_win32.h +37 −37
  146. src/core/hidio_sdl.cpp +100 −100
  147. src/core/hidio_sdl.h +4 −4
  148. src/core/lo/config.h +200 −200
  149. src/core/lo/lo.h +16 −16
  150. src/core/lo/lo_endian.h +32 −32
  151. src/core/lo/lo_lowlevel.h +14 −14
  152. src/core/lo/lo_macros.h +3 −3
  153. src/core/lo/lo_osc_types.h +48 −48
  154. src/core/lo/lo_types.h +2 −2
  155. src/core/lo/lo_types_internal.h +52 −52
  156. src/core/makefile +15 −10
  157. src/core/makefile.x/makefile.alsa +8 −2
  158. src/core/makefile.x/makefile.jack +8 −2
  159. src/core/makefile.x/makefile.mac +5 −5
  160. src/core/makefile.x/makefile.pulse +8 −2
  161. src/core/midiio_rtmidi.cpp +123 −123
  162. src/core/midiio_rtmidi.h +15 −15
  163. src/core/regex/config.h +185 −185
  164. src/core/regex/regex.h +4 −4
  165. src/core/regex/tre-ast.h +14 −14
  166. src/core/regex/tre-config.h +52 −52
  167. src/core/regex/tre-internal.h +31 −31
  168. src/core/regex/tre-match-utils.h +149 −149
  169. src/core/regex/tre-mem.h +4 −4
  170. src/core/regex/tre-parse.h +1 −1
  171. src/core/regex/tre-stack.h +20 −20
  172. src/core/regex/tre.h +54 −54
  173. src/core/regex/xmalloc.h +14 −14
  174. src/core/rtmidi.cpp +12 −12
  175. src/core/rtmidi.h +10 −10
  176. src/core/uana_extract.cpp +1435 −180
  177. src/core/uana_xform.cpp +218 −212
  178. src/core/ugen_filter.cpp +239 −163
  179. src/core/ugen_osc.cpp +101 −101
  180. src/core/ugen_osc.h +2 −2
  181. src/core/ugen_stk.cpp +901 −854
  182. src/core/ugen_stk.h +139 −141
  183. src/core/ugen_xxx.cpp +595 −553
  184. src/core/ulib_ai.cpp +6921 −0
  185. src/core/ulib_ai.h +370 −0
  186. src/core/ulib_machine.cpp +236 −31
  187. src/core/ulib_machine.h +6 −10
  188. src/core/ulib_math.cpp +389 −51
  189. src/core/ulib_math.h +11 −6
  190. src/core/ulib_opsc.cpp +292 −286
  191. src/core/ulib_regex.cpp +76 −77
  192. src/core/ulib_regex.h +4 −4
  193. src/core/ulib_std.cpp +101 −99
  194. src/core/util_buffers.cpp +26 −26
  195. src/core/util_buffers.h +52 −52
  196. src/core/util_console.cpp +32 −52
  197. src/core/util_hid.cpp +1310 −1313
  198. src/core/util_hid.h +4 −2
  199. src/core/util_math.c +15 −1
  200. src/core/util_math.h +18 −4
  201. src/core/util_network.c +1 −1
  202. src/core/util_opsc.cpp +254 −275
  203. src/core/util_opsc.h +51 −51
  204. src/core/util_platforms.cpp +5 −5
  205. src/core/util_platforms.h +4 −4
  206. src/core/util_serial.cpp +15 −17
  207. src/core/util_serial.h +3 −1
  208. src/core/util_sndfile.c +154 −147
  209. src/core/util_sndfile.h +103 −97
  210. src/core/util_string.cpp +39 −41
  211. src/core/util_string.h +1 −1
  212. src/core/util_thread.cpp +39 −39
  213. src/core/util_thread.h +18 −18
  214. src/core/util_xforms.c +2 −2
  215. src/host/chuck_audio.cpp +91 −73
  216. src/host/chuck_audio.h +4 −5
  217. src/host/chuck_main.cpp +24 −5
  218. src/host_web/README.txt +58 −0
  219. src/host_web/chuck_emscripten.cpp +9 −6
  220. src/host_web/chuck_emscripten.h +0 −0
  221. src/makefile +23 −19
  222. src/test/01-Basic/113.ck +7 −0
  223. src/test/01-Basic/113.txt +1 −0
  224. src/test/01-Basic/114.ck +5 −0
  225. src/test/01-Basic/114.txt +1 −0
  226. src/test/01-Basic/115.ck +10 −0
  227. src/test/01-Basic/116.ck +15 −0
  228. src/test/01-Basic/116.txt +1 −0
  229. src/test/01-Basic/117.ck +6 −0
  230. src/test/01-Basic/118.ck +29 −0
  231. src/test/01-Basic/119.ck +12 −0
  232. src/test/01-Basic/120.ck +20 −0
  233. src/test/01-Basic/120.txt +1 −0
  234. src/test/01-Basic/121.ck +7 −0
  235. src/test/01-Basic/122.ck +9 −0
  236. src/test/01-Basic/122.txt +1 −0
  237. src/test/01-Basic/123.ck +17 −0
  238. src/test/01-Basic/124.ck +50 −0
  239. src/test/01-Basic/94.ck +75 −0
  240. src/test/01-Basic/95.ck +8 −0
  241. src/test/01-Basic/95.txt +1 −0
  242. src/test/01-Basic/96.ck +12 −0
  243. src/test/01-Basic/96.txt +1 −0
  244. src/test/01-Basic/97.ck +7 −0
  245. src/test/01-Basic/97.txt +1 −0
  246. src/test/01-Basic/98.ck +45 −0
  247. src/test/01-Basic/99.ck +13 −0
  248. src/test/05-Global/01b.txt +1 −1
  249. src/test/05-Global/102a.txt +3 −3
  250. src/test/05-Global/113.ck +10 −0
  251. src/test/05-Global/95.ck +5 −0
  252. src/test/05-Global/95.txt +1 −0
  253. src/test/05-Global/96.ck +12 −0
  254. src/test/05-Global/96.txt +1 −0
  255. src/test/05-Global/97.ck +7 −0
  256. src/test/05-Global/97.txt +1 −0
  257. src/test/README +19 −6
  258. src/test/test.py +8 −4
  259. src/visual-studio/chuck-vs10.vcxproj +532 −530
  260. src/visual-studio/chuck.dsp +17 −0
  261. src/visual-studio/chuck.vcxproj +7 −5
  262. src/visual-studio/chuck.vcxproj.filters +7 −1
  263. src/xcode/chuck.xcodeproj/project.pbxproj +12 −2
.github/workflows/linux-build-unit-tests.yml+1−1
@@ -18,7 +18,7 @@ jobs: · 17 unmodified lines
1818 run: sudo apt update && sudo apt install --fix-missing -y libsndfile1-dev libpulse-dev libasound2-dev
1919
2020 - name: Compile - Linux
21− run: cd src/ && make linux-pulse
21+ run: cd src/ && make -j linux-pulse
2222
2323 - name: Unit Tests - Linux
2424 run: cd src/ && export PATH=$PATH:$(pwd) && cd test/ && python test.py
.github/workflows/macos-build-unit-tests.yml+1−6
@@ -14,13 +14,8 @@ jobs: · 13 unmodified lines
1414 steps:
1515 - uses: actions/checkout@v2
1616
17− - name: Install dependencies
18− run: |
19− python -m pip install --upgrade pip
20− pip install pathlib
21−
2217 - name: Compile - macOS
23− run: cd src/ && make mac
18+ run: cd src/ && make -j mac
2419
2520 - name: Unit Tests - macOS
2621 run: cd src/ && export PATH=$PATH:$(pwd) && cd test/ && python test.py
examples/ai/features/centroid.ck+42−0
@@ -0,0 +1,42 @@
1+//---------------------------------------------------------------------
2+// name: centroid.ck
3+// desc: fantastic audio features and where to extract them:
4+// extracting spectral centroid; also demonstrates using
5+// unit analyzers (UAna), connecting them using the
6+// upchuck operator (=^), and getting results
7+//
8+// author: Ge Wang (https://ccrma.stanford.edu/~ge/)
9+// date: Spring 2023
10+//---------------------------------------------------------------------
11+
12+// synthesis / analysis network
13+SinOsc foo => FFT fft =^ Centroid centroid => blackhole;
14+// set sine frequency
15+440 => foo.freq;
16+
17+// set FFT size
18+1024 => fft.size;
19+// set window type and size
20+Windowing.hann(fft.size()) => fft.window;
21+// our hop size (how often to perform analysis)
22+fft.size()::samp => dur HOP;
23+// compute srate
24+second / samp => float srate;
25+
26+// let one FFT-size of time pass (to buffer)
27+fft.size()::samp => now;
28+// control loop
29+while( true )
30+{
31+ //----------------------------------------------------------------
32+ // upchuck() computes our centroid, automatically computing upstream
33+ // dependencies connected to it using =^ (e.g., FFT)
34+ //----------------------------------------------------------------
35+ centroid.upchuck();
36+
37+ // get and print the output
38+ <<< "centroid (hz):", centroid.fval(0) * srate / 2 >>>;
39+
40+ // advance time
41+ HOP => now;
42+}
examples/ai/features/chroma.ck+62−0
@@ -0,0 +1,62 @@
1+//---------------------------------------------------------------------
2+// name: chroma.ck
3+// desc: chroma unit anlyzer, used for feature extraction of pitch data
4+// e.g., a set of frequencies
5+//
6+// uncomment for Chroma API:
7+// Chroma.help();
8+//
9+// author: Yikai Li
10+// Ge Wang (https://ccrma.stanford.edu/~ge/)
11+// date: Winter 2023
12+//---------------------------------------------------------------------
13+
14+// synthesis / analysis network
15+SinOsc s => FFT fft =^ Chroma chroma => blackhole;
16+
17+// set FFT size
18+2048 => fft.size;
19+// set window type and size
20+Windowing.hann(fft.size()) => fft.window;
21+// our hop size (how often to perform analysis)
22+fft.size()::samp => dur HOP;
23+
24+// pitch names
25+["C4", "C#", "D4", "D#", "E4", "F4", "F#", "G4", "G#", "A4", "A#", "B4"] @=> string note_names[];
26+// test frequencies
27+[262, 277, 294, 311, 330, 349, 370, 392, 415, 440, 466, 494] @=> int freqs[];
28+
29+// print header
30+cherr <= "freq ";
31+for (0 => int i; i < 12; i++) {
32+ cherr <= note_names[i] + " ";
33+}
34+cherr <= IO.newline();
35+
36+// let one FFT-size of time pass (to buffer)
37+fft.size()::samp => now;
38+
39+// extract chroma features
40+for( 0 => int i; i < freqs.size(); i++ )
41+{
42+ // set frequency for test
43+ freqs[i] => s.freq;
44+
45+ //----------------------------------------------------------------
46+ // upchuck() computes our Chroma, automatically computing upstream
47+ // dependencies connected to it using =^ (e.g., FFT)
48+ //----------------------------------------------------------------
49+ chroma.upchuck();
50+
51+ // print features
52+ cherr <= freqs[i] <= ": ";
53+ for( 0 => int j; j < chroma.fvals().size(); j++ )
54+ {
55+ Math.round(chroma.fval(j) * 100) => float tmp;
56+ cherr <= (tmp < 10 ? " ":"") <= tmp <= " ";
57+ }
58+ cherr <= IO.newline();
59+
60+ // advance time
61+ HOP => now;
62+}
examples/ai/features/features-combined.ck+59−0
@@ -0,0 +1,59 @@
1+//---------------------------------------------------------------------
2+// name: features-combined.ck
3+// desc: extracting multiple features; collect into one vector
4+// e.g., Centroid, Flux, RMS, MFCC
5+//
6+// author: Ge Wang (https://ccrma.stanford.edu/~ge/)
7+// date: Spring 2023
8+//---------------------------------------------------------------------
9+
10+// audio input into a FFT
11+adc => FFT fft;
12+// a thing for collecting multiple features into one vector
13+FeatureCollector combo => blackhole;
14+// add spectral feature: Centroid
15+fft =^ Centroid centroid =^ combo;
16+// add spectral feature: Flux
17+fft =^ Flux flux =^ combo;
18+// add spectral feature: RMS
19+fft =^ RMS rms =^ combo;
20+// add spectral feature: MFCC
21+fft =^ MFCC mfcc =^ combo;
22+
23+// set number of coefficients in MFCC (how many we get out)
24+// 13 is a commonly used value; using less here for printing
25+13 => mfcc.numCoeffs;
26+// set number of mel filters in MFCC
27+10 => mfcc.numFilters;
28+
29+// set FFT size
30+2048 => fft.size;
31+// set window type and size
32+Windowing.hann(fft.size()) => fft.window;
33+// our hop size (how often to perform analysis)
34+fft.size()::samp => dur HOP;
35+
36+// let one FFT-size of time pass (to buffer)
37+fft.size()::samp => now;
38+// control loop
39+while( true )
40+{
41+ //-----------------------------------------------------------------
42+ // a single upchuck() will trigger analysis on everything
43+ // connected upstream from combo via the upchuck operator (=^)
44+ // the total number of output dimensions is the sum of
45+ // dimensions of all the connected unit analyzers
46+ //-----------------------------------------------------------------
47+ combo.upchuck();
48+
49+ // print
50+ cherr <= "features (" <= combo.fvals().size() <= " total dims): ";
51+ // print the MFCC results
52+ for( int i; i < combo.fvals().size(); i++ )
53+ { cherr <= combo.fval(i) <= " "; }
54+ // endline
55+ cherr <= IO.newline();
56+
57+ // advance time
58+ HOP => now;
59+}
examples/ai/features/flux.ckrenamed from examples/analysis/features/flux.ck+0−0

File renamed without changes.

examples/ai/features/flux0.ckrenamed from examples/analysis/features/flux0.ck+0−0

File renamed without changes.

examples/ai/features/kurtosis.ck+36−0
@@ -0,0 +1,36 @@
1+//---------------------------------------------------------------------
2+// name: kurtosis.ck
3+// desc: chroma unit anlyzer, used for feature extraction
4+//
5+// uncomment for Chroma API:
6+// Kurtosis.help();
7+//
8+// author: Yikai Li
9+// Ge Wang (https://ccrma.stanford.edu/~ge/)
10+// date: Winter 2023
11+//---------------------------------------------------------------------'
12+
13+// our patch
14+adc => FFT fft =^ Kurtosis kurtosis => blackhole;
15+
16+// set parameters
17+1024 => fft.size;
18+// set hann window
19+Windowing.hann(1024) => fft.window;
20+// our hop size (how often to perform analysis)
21+fft.size()::samp => dur HOP;
22+
23+// control loop
24+while( true )
25+{
26+ //----------------------------------------------------------------
27+ // upchuck() computes our kurtosis, automatically computing upstream
28+ // dependencies connected to it using =^ (e.g., FFT)
29+ //----------------------------------------------------------------
30+ kurtosis.upchuck() @=> UAnaBlob blob;
31+ // print out Kurtosis
32+ <<< blob.fval(0) >>>;
33+
34+ // advance time
35+ HOP => now;
36+}
examples/ai/features/mfcc-basic.ck+48−0
@@ -0,0 +1,48 @@
1+//---------------------------------------------------------------------
2+// name: mfcc-basic.ck
3+// desc: mel-frequency cepstral coefficients
4+// basic MFCC feature extractor
5+//
6+// uncomment for MFCC API:
7+// MFCC.help();
8+//
9+// author: Ge Wang (https://ccrma.stanford.edu/~ge/)
10+// date: Spring 2023
11+//---------------------------------------------------------------------
12+
13+// synthesis / analysis network
14+adc => FFT fft =^ MFCC mfcc => blackhole;
15+
16+// set number of coefficients in MFCC (how many we get out)
17+// 13 is a commonly used value; using less here for printing
18+7 => mfcc.numCoeffs;
19+// set number of mel filters in MFCC
20+10 => mfcc.numFilters;
21+
22+// set FFT size
23+2048 => fft.size;
24+// set window type and size
25+Windowing.hann(fft.size()) => fft.window;
26+// our hop size (how often to perform analysis)
27+fft.size()::samp => dur HOP;
28+
29+// let one FFT-size of time pass (to buffer)
30+fft.size()::samp => now;
31+// control loop
32+while( true )
33+{
34+ //----------------------------------------------------------------
35+ // upchuck() computes our MFCC, automatically computing upstream
36+ // dependencies connected to it using =^ (e.g., FFT)
37+ //----------------------------------------------------------------
38+ mfcc.upchuck();
39+ // print
40+ cherr <= "MFCC: ";
41+ // print the MFCC results
42+ for( int i; i < mfcc.fvals().size(); i++ )
43+ { cherr <= mfcc.fval(i) <= " "; }
44+ // endline
45+ cherr <= IO.newline();
46+ // advance time
47+ HOP => now;
48+}
examples/ai/features/mfcc-mean.ck+91−0
@@ -0,0 +1,91 @@
1+//---------------------------------------------------------------------
2+// name: mfcc-mean.ck
3+// desc: mel-frequency cepstral coefficients
4+// this example aggregates multiple MFCC frames; compute mean
5+//
6+// to see API, uncomment:
7+// MFCC.help();
8+
9+// author: Yikai Li and Ge Wang
10+// date: Spring 2023
11+//---------------------------------------------------------------------
12+
13+// analysis patch
14+adc => FFT fft =^ MFCC mfcc => blackhole;
15+
16+// FFT size
17+2048 => fft.size;
18+// FFT hop size
19+512 => int hopSize;
20+// number of filters in MEL space
21+10 => mfcc.numFilters;
22+// number of MFCC coefficients to compute per frame
23+13 => mfcc.numCoeffs => int nCoeffs;
24+// used to compute the frame size
25+.1::second => dur aggregateTime;
26+// set FFT window
27+Windowing.hamming(fft.size()) => fft.window;
28+// current sample sample
29+second / samp => float sampleRate;
30+// this should already be set to the current chuck srate
31+// but could be overridden, if desired
32+// sampleRate => mfcc.sampleRate;
33+
34+// calculate the number of frames
35+(aggregateTime/second * sampleRate / hopSize + .5) $ int => int nFrames;
36+
37+// print out
38+chout <= IO.newline();
39+<<< "--------------------------------------------", "" >>>;
40+<<< "num filters:", mfcc.numFilters() >>>;
41+<<< "num MFCC coefficients:", mfcc.numCoeffs() >>>;
42+<<< "agregrateTime:", aggregateTime/second, "seconds" >>>;
43+<<< "num frames:", nFrames >>>;
44+<<< "--------------------------------------------", "" >>>;
45+chout <= IO.newline();
46+
47+// per-frame MFCC coefficients
48+float mfccs[nFrames][nCoeffs];
49+// average of MFCC coefficients across all frames
50+float mfccMean [nCoeffs];
51+
52+// let one FFTsize of time pass
53+fft.size()::samp => now;
54+
55+// analysis loop
56+while( true )
57+{
58+ // aggregate mfcc features
59+ for( 0 => int fi; fi < nFrames; fi++ )
60+ {
61+ // triggers MFCC and its dependencies (e.g., FFT)
62+ mfcc.upchuck();
63+ // get contents
64+ for( 0 => int i; i < nCoeffs; i++ )
65+ {
66+ // copy the resulting coeffs
67+ mfcc.fval(i) => mfccs[fi][i];
68+ }
69+ // advance time by one hop
70+ hopSize::samp => now;
71+ }
72+
73+ // compute mean
74+ for( 0 => int i; i < nCoeffs; i++ )
75+ {
76+ // zero out
77+ 0.0 => mfccMean[i];
78+ // sum
79+ for (0 => int j; j < nFrames; j++)
80+ {
81+ mfccs[j][i] +=> mfccMean[i];
82+ }
83+ // divide by frames
84+ nFrames /=> mfccMean[i];
85+ // print
86+ chout <= mfccMean[i] <= " ";
87+ }
88+
89+ // new line
90+ chout <= IO.newline();
91+}
examples/ai/features/rms.ckrenamed from examples/analysis/features/rms.ck+0−0

File renamed without changes.

examples/ai/features/rolloff.ckrenamed from examples/analysis/features/rolloff.ck+0−0

File renamed without changes.

examples/ai/features/rolloff2.ckrenamed from examples/analysis/features/rolloff2.ck+0−0

File renamed without changes.

examples/ai/features/sfm.ck+47−0
@@ -0,0 +1,47 @@
1+//---------------------------------------------------------------------
2+// name: sfm.ck
3+// desc: Spectral Flatness Measure
4+//
5+// uncomment for SFM API:
6+// SFM.help();
7+//
8+// author: Yikai Li
9+// Ge Wang
10+// date: Winter 2023
11+//---------------------------------------------------------------------
12+
13+// synthesis / analysis network
14+SinOsc s => FFT fft =^ SFM sfm => blackhole;
15+
16+// set FFT size
17+2048 => fft.size;
18+// set window type and size
19+Windowing.hann(fft.size()) => fft.window;
20+// our hop size (how often to perform analysis)
21+fft.size()::samp => dur HOP;
22+
23+// let one FFT-size of time pass (to buffer)
24+fft.size()::samp => now;
25+// control loop
26+while( true )
27+{
28+ //----------------------------------------------------------------
29+ // upchuck() computes SFM, automatically computing upstream
30+ // dependencies connected to it using =^ (e.g., FFT)
31+ //----------------------------------------------------------------
32+ sfm.upchuck();
33+ // print
34+ cherr <= "SFM: ";
35+ // print the SFM results
36+ for( int i; i < sfm.fvals().size(); i++ )
37+ {
38+ Math.round(sfm.fval(i) * 10) / 10 => float tmp;
39+ cherr <= tmp <= (tmp == 1 || tmp == 0?".0":"") <= " ";
40+ }
41+ // endline
42+ cherr <= IO.newline();
43+ // advance time
44+ HOP => now;
45+ // randomize frequency
46+ Math.random2f(20, 1000) => s.freq;
47+}
examples/ai/features/zerox.ckrenamed from examples/analysis/features/zerox.ck+0−0

File renamed without changes.

examples/ai/genre-classify/data/gtzan-23.txt+1000−0
@@ -0,0 +1,1000 @@
1+0.094776 0.656543 0.0016323 -248.387 43.9911 0.336913 2.57967 3.61398 0.720551 1.4437 -1.65657 0.568342 -0.454847 3.86889e-13 0.454847 -0.568342 1.65657 -1.4437 -0.720551 -3.61398 -2.57967 -0.336913 -43.9911 blues
2+0.0707113 0.56226 0.00122693 -266.855 37.8975 7.74374 4.33491 3.95315 2.69442 2.0144 -0.217602 1.56059 0.594256 4.03997e-13 -0.594256 -1.56059 0.217602 -2.0144 -2.69442 -3.95315 -4.33491 -7.74374 -37.8975 blues
3+0.0801188 0.696338 0.00216605 -243.609 49.1735 1.16757 1.70333 2.18707 -1.74482 2.34557 -0.204502 0.958125 -0.3666 3.86131e-13 0.3666 -0.958125 0.204502 -2.34557 1.74482 -2.18707 -1.70333 -1.16757 -49.1735 blues
4+0.0474175 0.418836 0.00185957 -268.353 43.4403 12.4681 3.87979 2.73242 1.57632 1.66339 0.743285 1.1124 0.624885 4.12555e-13 -0.624885 -1.1124 -0.743285 -1.66339 -1.57632 -2.73242 -3.87979 -12.4681 -43.4403 blues
5+0.107857 0.670531 0.00130198 -249.116 41.3907 -1.19663 0.87539 0.797056 -4.59644 0.904956 -1.03792 1.17297 -0.805917 3.82971e-13 0.805917 -1.17297 1.03792 -0.904956 4.59644 -0.797056 -0.87539 1.19663 -41.3907 blues
6+0.0940557 0.552465 0.00132731 -255.775 40.8029 5.86899 3.58061 1.69693 -2.00106 1.2801 -1.34313 0.623947 -0.280834 3.91164e-13 0.280834 -0.623947 1.34313 -1.2801 2.00106 -1.69693 -3.58061 -5.86899 -40.8029 blues
7+0.0626831 0.472488 0.00147565 -262.963 43.92 7.75907 0.982827 5.40229 3.89001 1.79868 -1.81289 -0.565676 -0.0134577 4.07684e-13 0.0134577 0.565676 1.81289 -1.79868 -3.89001 -5.40229 -0.982827 -7.75907 -43.92 blues
8+0.0688619 0.587154 0.00150006 -259.678 44.3634 5.67171 1.57202 5.24038 3.92032 2.5693 -1.58223 -0.0641301 0.532631 4.04172e-13 -0.532631 0.0641301 1.58223 -2.5693 -3.92032 -5.24038 -1.57202 -5.67171 -44.3634 blues
9+0.091842 0.614496 0.00194205 -245.366 44.4959 0.394854 3.20549 3.6305 1.42828 2.98063 -2.04265 0.751465 -0.697596 3.82946e-13 0.697596 -0.751465 2.04265 -2.98063 -1.42828 -3.6305 -3.20549 -0.394854 -44.4959 blues
10+0.0967951 0.62757 0.00114996 -260.953 39.4053 4.34067 4.66164 4.22501 -2.29097 -0.250551 -0.760924 0.957235 -0.673282 3.95622e-13 0.673282 -0.957235 0.760924 0.250551 2.29097 -4.22501 -4.66164 -4.34067 -39.4053 blues
11+0.0701727 0.583397 0.00163934 -259.493 46.3253 5.7827 -2.08845 -0.938179 -2.63775 -0.653382 -1.2738 -0.144209 0.235608 4.059e-13 -0.235608 0.144209 1.2738 0.653382 2.63775 0.938179 2.08845 -5.7827 -46.3253 blues
12+0.0686134 0.444143 0.000681981 -286.48 28.8082 12.2139 6.8491 4.3866 2.62512 2.27881 1.33384 1.17875 0.553771 4.17757e-13 -0.553771 -1.17875 -1.33384 -2.27881 -2.62512 -4.3866 -6.8491 -12.2139 -28.8082 blues
13+0.0778387 0.573786 0.00145304 -260.381 41.8949 2.12533 3.52107 10.78 1.66132 -0.336912 1.09868 1.54993 -1.04243 3.98809e-13 1.04243 -1.54993 -1.09868 0.336912 -1.66132 -10.78 -3.52107 -2.12533 -41.8949 blues
14+0.0690982 0.629822 0.00129754 -266.019 41.7531 8.46387 5.64934 6.41876 1.39449 -0.827188 -0.621073 0.844113 -0.747725 4.05936e-13 0.747725 -0.844113 0.621073 0.827188 -1.39449 -6.41876 -5.64934 -8.46387 -41.7531 blues
15+0.0525012 0.571146 0.000809768 -282.066 33.7329 13.2531 6.62121 5.99685 1.97103 -0.568997 -1.09533 -1.20875 -1.68897 4.16645e-13 1.68897 1.20875 1.09533 0.568997 -1.97103 -5.99685 -6.62121 -13.2531 -33.7329 blues
16+0.0793699 0.674495 0.000935917 -270.91 36.6859 5.65969 2.57167 6.11587 2.02084 0.452793 0.0781596 0.468262 -0.977393 4.07284e-13 0.977393 -0.468262 -0.0781596 -0.452793 -2.02084 -6.11587 -2.57167 -5.65969 -36.6859 blues
17+0.0774297 0.689189 0.00111092 -266.893 40.1304 5.65312 1.41333 4.61215 1.50117 0.80422 0.36266 -0.0888416 -2.05718 4.05659e-13 2.05718 0.0888416 -0.36266 -0.80422 -1.50117 -4.61215 -1.41333 -5.65312 -40.1304 blues
18+0.0574543 0.596452 0.00134294 -265.441 42.4988 7.07483 4.35272 9.2069 3.07162 -0.427723 -0.534954 -0.089147 -1.24821 4.06707e-13 1.24821 0.089147 0.534954 0.427723 -3.07162 -9.2069 -4.35272 -7.07483 -42.4988 blues
19+0.0844697 0.551832 0.000939111 -272.51 35.4993 8.15451 7.04911 7.67329 2.39488 0.54561 -0.511962 -0.256619 -1.78678 4.0585e-13 1.78678 0.256619 0.511962 -0.54561 -2.39488 -7.67329 -7.04911 -8.15451 -35.4993 blues
20+0.0571708 0.609279 0.001203 -269.624 41.2452 10.1698 4.57695 6.19583 0.829363 -0.772816 -0.265492 -0.725032 -2.18483 4.09234e-13 2.18483 0.725032 0.265492 0.772816 -0.829363 -6.19583 -4.57695 -10.1698 -41.2452 blues
21+0.0703402 0.678218 0.00093663 -271.398 40.4066 10.9318 3.99894 3.10138 0.4874 -0.643795 -1.06124 -0.309574 -0.765582 4.1205e-13 0.765582 0.309574 1.06124 0.643795 -0.4874 -3.10138 -3.99894 -10.9318 -40.4066 blues
22+0.05588 0.585745 0.00119384 -271.147 39.6546 10.011 4.37196 5.93705 1.53465 0.418714 -0.18219 -1.0899 -2.38864 4.09392e-13 2.38864 1.0899 0.18219 -0.418714 -1.53465 -5.93705 -4.37196 -10.011 -39.6546 blues
23+0.0529446 0.596268 0.00145923 -270.052 40.0237 10.1125 5.44835 7.74417 2.3432 0.853041 0.942445 0.434093 -1.66335 4.08254e-13 1.66335 -0.434093 -0.942445 -0.853041 -2.3432 -7.74417 -5.44835 -10.1125 -40.0237 blues
24+0.0622054 0.61062 0.00162969 -260.342 46.4476 6.51419 2.52436 7.80647 0.877526 -0.585775 -0.525437 -0.9876 -1.16528 4.05121e-13 1.16528 0.9876 0.525437 0.585775 -0.877526 -7.80647 -2.52436 -6.51419 -46.4476 blues
25+0.0535359 0.614756 0.00143024 -266.567 43.3169 8.84317 4.01372 8.31675 1.84961 -0.408863 -0.16293 -0.361396 -0.716056 4.09366e-13 0.716056 0.361396 0.16293 0.408863 -1.84961 -8.31675 -4.01372 -8.84317 -43.3169 blues
26+0.0520959 0.576685 0.00136193 -270.588 40.8063 9.83395 5.92599 9.43755 3.01046 -0.453987 -0.557309 -0.849451 -1.13157 4.11088e-13 1.13157 0.849451 0.557309 0.453987 -3.01046 -9.43755 -5.92599 -9.83395 -40.8063 blues
27+0.0628458 0.590304 0.000899693 -275.579 35.7542 7.43987 4.29472 8.82161 3.55477 0.430246 0.601208 0.0769746 -1.045 4.12086e-13 1.045 -0.0769746 -0.601208 -0.430246 -3.55477 -8.82161 -4.29472 -7.43987 -35.7542 blues
28+0.0694364 0.557985 0.00117163 -264.084 42.1323 4.89211 4.25948 10.3348 0.693413 -2.01398 -0.819873 -0.617318 -0.897736 4.04405e-13 0.897736 0.617318 0.819873 2.01398 -0.693413 -10.3348 -4.25948 -4.89211 -42.1323 blues
29+0.0536213 0.634338 0.00153383 -266.142 44.9278 8.8956 0.63959 5.73206 3.21636 0.369936 -0.2793 0.0295689 -0.62233 4.1241e-13 0.62233 -0.0295689 0.2793 -0.369936 -3.21636 -5.73206 -0.63959 -8.8956 -44.9278 blues
30+0.079282 0.519523 0.00165912 -265.225 38.7217 13.7972 9.8695 2.31989 1.81986 2.92897 -1.88353 -0.377912 -0.897459 3.99563e-13 0.897459 0.377912 1.88353 -2.92897 -1.81986 -2.31989 -9.8695 -13.7972 -38.7217 blues
31+0.0712111 0.472352 0.00215832 -257.477 42.7504 13.2412 9.15323 2.03015 2.16226 3.7747 -1.9215 0.786615 0.259114 3.9515e-13 -0.259114 -0.786615 1.9215 -3.7747 -2.16226 -2.03015 -9.15323 -13.2412 -42.7504 blues
32+0.0729186 0.467142 0.00201897 -259.668 41.6618 14.1381 11.0454 2.20911 1.79883 3.39558 -2.67849 -0.400673 -0.170522 3.96025e-13 0.170522 0.400673 2.67849 -3.39558 -1.79883 -2.20911 -11.0454 -14.1381 -41.6618 blues
33+0.0512932 0.360279 0.00154851 -274.947 38.2 15.8634 8.46109 3.86512 3.82606 4.26099 1.18719 1.13702 0.587335 4.13436e-13 -0.587335 -1.13702 -1.18719 -4.26099 -3.82606 -3.86512 -8.46109 -15.8634 -38.2 blues
34+0.0669127 0.390866 0.00177177 -265.344 39.6512 16.5826 12.5964 2.9211 0.771276 2.44823 -1.34527 0.746979 0.141564 3.99999e-13 -0.141564 -0.746979 1.34527 -2.44823 -0.771276 -2.9211 -12.5964 -16.5826 -39.6512 blues
35+0.0743195 0.494192 0.00166527 -264.127 40.5279 13.8335 9.58931 1.28566 0.668524 3.53724 -0.430464 1.01728 0.0881112 4.00469e-13 -0.0881112 -1.01728 0.430464 -3.53724 -0.668524 -1.28566 -9.58931 -13.8335 -40.5279 blues
36+0.0778148 0.459088 0.00241455 -249.455 46.0189 10.8058 7.26375 -0.702014 0.0917107 4.14863 -1.41134 1.50828 0.473765 3.88702e-13 -0.473765 -1.50828 1.41134 -4.14863 -0.0917107 0.702014 -7.26375 -10.8058 -46.0189 blues
37+0.0645415 0.451467 0.00260859 -254.889 45.7257 13.4003 9.38092 1.85038 1.23073 3.28937 -1.64212 0.383319 -0.0526141 3.94956e-13 0.0526141 -0.383319 1.64212 -3.28937 -1.23073 -1.85038 -9.38092 -13.4003 -45.7257 blues
38+0.0641579 0.498099 0.000780921 -279.487 31.5496 11.375 6.87733 2.94449 1.74606 3.0286 0.412368 0.419421 -0.0543965 4.1126e-13 0.0543965 -0.419421 -0.412368 -3.0286 -1.74606 -2.94449 -6.87733 -11.375 -31.5496 blues
39+0.0763746 0.468155 0.00211999 -257.318 41.9016 12.6261 9.76404 2.14978 2.83004 4.06111 -1.63569 0.877838 -0.105381 3.93629e-13 0.105381 -0.877838 1.63569 -4.06111 -2.83004 -2.14978 -9.76404 -12.6261 -41.9016 blues
40+0.0420705 0.31711 0.000969185 -279.567 38.7526 19.3152 8.41221 2.52069 0.600202 0.370006 -0.511538 -0.226304 -0.0190581 4.19385e-13 0.0190581 0.226304 0.511538 -0.370006 -0.600202 -2.52069 -8.41221 -19.3152 -38.7526 blues
41+0.126881 0.669677 0.00176699 -240.061 37.8254 -2.79441 9.23466 6.90432 -0.830786 3.4998 -1.85146 1.54504 -1.33135 3.63828e-13 1.33135 -1.54504 1.85146 -3.4998 0.830786 -6.90432 -9.23466 2.79441 -37.8254 blues
42+0.13114 0.58812 0.00169654 -240.719 36.4317 -1.56508 8.08727 4.15993 -0.121177 3.75505 -1.23361 2.23901 -0.92641 3.63912e-13 0.92641 -2.23901 1.23361 -3.75505 0.121177 -4.15993 -8.08727 1.56508 -36.4317 blues
43+0.12925 0.473297 0.0014901 -246.643 34.0024 -5.97008 7.53021 9.2188 4.022 6.93976 -0.731585 1.44235 -0.152169 3.7094e-13 0.152169 -1.44235 0.731585 -6.93976 -4.022 -9.2188 -7.53021 5.97008 -34.0024 blues
44+0.112709 0.613147 0.00171232 -244.159 39.0495 0.338103 6.84052 3.04135 0.216004 3.88263 -0.487748 3.1161 -0.0840585 3.72701e-13 0.0840585 -3.1161 0.487748 -3.88263 -0.216004 -3.04135 -6.84052 -0.338103 -39.0495 blues
45+0.120085 0.597984 0.00186987 -242.955 37.5327 0.00437348 10.9699 6.42084 -0.490371 3.7207 -2.0134 1.34781 -0.690799 3.674e-13 0.690799 -1.34781 2.0134 -3.7207 0.490371 -6.42084 -10.9699 -0.00437348 -37.5327 blues
46+0.0948217 0.563474 0.00191759 -254.625 37.075 2.1073 12.4853 10.7897 3.40552 4.62073 -0.440435 0.787621 -0.412037 3.83243e-13 0.412037 -0.787621 0.440435 -4.62073 -3.40552 -10.7897 -12.4853 -2.1073 -37.075 blues
47+0.0953317 0.46543 0.00135599 -262.495 34.7674 5.36288 12.2136 8.84747 2.92612 4.04385 -0.354849 0.630453 0.057555 3.91285e-13 -0.057555 -0.630453 0.354849 -4.04385 -2.92612 -8.84747 -12.2136 -5.36288 -34.7674 blues
48+0.107711 0.435254 0.00141346 -251.232 38.2032 1.80997 11.9725 7.8063 -1.16737 2.24524 -2.14072 -0.0756429 -0.555799 3.79366e-13 0.555799 0.0756429 2.14072 -2.24524 1.16737 -7.8063 -11.9725 -1.80997 -38.2032 blues
49+0.115936 0.60568 0.00164684 -242.084 40.0084 -2.99309 5.97908 5.24602 0.193764 3.53262 -1.61247 1.95808 -0.69439 3.71291e-13 0.69439 -1.95808 1.61247 -3.53262 -0.193764 -5.24602 -5.97908 2.99309 -40.0084 blues
50+0.0699258 0.423488 0.00114293 -269.715 36.7604 9.96285 11.9665 9.89725 1.92221 2.24239 -0.358726 -1.67392 -1.17284 4.02477e-13 1.17284 1.67392 0.358726 -2.24239 -1.92221 -9.89725 -11.9665 -9.96285 -36.7604 blues
51+0.112997 0.620078 0.00212504 -239.564 40.3516 -3.24542 6.62253 6.70796 1.77742 4.34926 -0.958026 1.70599 -1.14041 3.68207e-13 1.14041 -1.70599 0.958026 -4.34926 -1.77742 -6.70796 -6.62253 3.24542 -40.3516 blues
52+0.104058 0.684975 0.00256395 -232.628 46.4065 -6.70064 2.5799 8.70665 0.144359 1.5629 -2.70157 1.01342 -0.798122 3.68057e-13 0.798122 -1.01342 2.70157 -1.5629 -0.144359 -8.70665 -2.5799 6.70064 -46.4065 blues
53+0.0782949 0.455302 0.00118107 -265.746 37.7178 3.38295 4.03364 9.08774 2.89339 1.46638 0.964782 1.10937 -0.55657 4.01495e-13 0.55657 -1.10937 -0.964782 -1.46638 -2.89339 -9.08774 -4.03364 -3.38295 -37.7178 blues
54+0.116245 0.717367 0.0021652 -235.827 43.0206 -8.60221 0.997313 8.02383 -1.02612 2.16101 -1.74484 1.22461 -0.701843 3.68293e-13 0.701843 -1.22461 1.74484 -2.16101 1.02612 -8.02383 -0.997313 8.60221 -43.0206 blues
55+0.107817 0.680833 0.00261664 -234.203 43.1411 -5.58363 4.25919 7.77743 1.5793 4.02005 -2.15152 1.30441 -0.593978 3.65847e-13 0.593978 -1.30441 2.15152 -4.02005 -1.5793 -7.77743 -4.25919 5.58363 -43.1411 blues
56+0.11953 0.659544 0.002027 -237.463 42.1024 -9.55695 1.46244 10.2151 -1.16754 0.780879 -0.649389 2.95008 -1.30015 3.68052e-13 1.30015 -2.95008 0.649389 -0.780879 1.16754 -10.2151 -1.46244 9.55695 -42.1024 blues
57+0.0932682 0.407423 0.00185353 -252.427 39.1817 1.38453 6.97487 8.12487 3.03057 3.12461 0.154465 2.04915 -0.780233 3.8418e-13 0.780233 -2.04915 -0.154465 -3.12461 -3.03057 -8.12487 -6.97487 -1.38453 -39.1817 blues
58+0.0996299 0.663232 0.00234115 -241.512 43.9037 -4.08018 2.35521 7.71269 3.40601 4.32788 -1.98136 1.25465 0.371372 3.78593e-13 -0.371372 -1.25465 1.98136 -4.32788 -3.40601 -7.71269 -2.35521 4.08018 -43.9037 blues
59+0.130588 0.61842 0.002277 -233.198 39.2643 -4.88147 6.92556 6.73682 -1.11555 2.69156 -2.57264 1.0966 -1.73481 3.57092e-13 1.73481 -1.0966 2.57264 -2.69156 1.11555 -6.73682 -6.92556 4.88147 -39.2643 blues
60+0.125723 0.669768 0.00210613 -236.395 38.7072 -8.82586 5.26894 11.48 -0.821043 1.18886 -1.8765 2.88302 -1.21711 3.61172e-13 1.21711 -2.88302 1.8765 -1.18886 0.821043 -11.48 -5.26894 8.82586 -38.7072 blues
61+0.114841 0.657089 0.00247367 -232.575 42.6428 -8.18921 3.06448 8.61292 1.14842 3.6533 -1.08974 2.74567 -0.712685 3.62829e-13 0.712685 -2.74567 1.08974 -3.6533 -1.14842 -8.61292 -3.06448 8.18921 -42.6428 blues
62+0.135772 0.680542 0.00177887 -234.503 37.249 -8.47028 7.38172 9.19912 -2.69059 5.33745 -2.34385 1.51693 0.220401 3.56792e-13 -0.220401 -1.51693 2.34385 -5.33745 2.69059 -9.19912 -7.38172 8.47028 -37.249 blues
63+0.121587 0.685565 0.00142485 -244.931 39.5229 -4.32176 4.50954 4.80358 -4.74321 3.39092 -0.873121 0.110129 0.0980056 3.74596e-13 -0.0980056 -0.110129 0.873121 -3.39092 4.74321 -4.80358 -4.50954 4.32176 -39.5229 blues
64+0.162135 0.688962 0.00119297 -244.264 32.7499 -4.02539 8.11595 3.31154 -4.83636 2.12053 -2.01514 0.561276 -0.742758 3.63598e-13 0.742758 -0.561276 2.01514 -2.12053 4.83636 -3.31154 -8.11595 4.02539 -32.7499 blues
65+0.140575 0.68552 0.00150178 -236.602 38.3139 -4.98908 7.84019 5.529 -5.24681 1.04321 -2.41615 0.724882 -0.2927 3.60568e-13 0.2927 -0.724882 2.41615 -1.04321 5.24681 -5.529 -7.84019 4.98908 -38.3139 blues
66+0.15788 0.687287 0.00137208 -237.771 34.9476 -5.48528 6.06909 2.73713 -4.32688 2.3658 -2.93338 0.341245 -0.508412 3.58857e-13 0.508412 -0.341245 2.93338 -2.3658 4.32688 -2.73713 -6.06909 5.48528 -34.9476 blues
67+0.130373 0.702369 0.00145916 -241.782 38.1923 -3.56842 5.48564 3.55028 -3.65006 2.15487 -1.98885 0.810495 -0.932152 3.6791e-13 0.932152 -0.810495 1.98885 -2.15487 3.65006 -3.55028 -5.48564 3.56842 -38.1923 blues
68+0.119668 0.745122 0.00171444 -237.967 41.9865 -3.78847 4.53654 3.27319 -3.91357 1.46436 -1.83684 0.753797 -0.541895 3.68319e-13 0.541895 -0.753797 1.83684 -1.46436 3.91357 -3.27319 -4.53654 3.78847 -41.9865 blues
69+0.141821 0.656718 0.00132196 -241.954 37.3932 -4.40692 7.06286 3.9528 -6.43238 -0.212297 -1.6713 2.32862 0.0878459 3.66496e-13 -0.0878459 -2.32862 1.6713 0.212297 6.43238 -3.9528 -7.06286 4.40692 -37.3932 blues
70+0.118264 0.640971 0.00154247 -241.954 41.8155 -3.27825 5.89515 4.67181 -6.35297 1.61444 -1.61554 -0.120766 -1.07343 3.71618e-13 1.07343 0.120766 1.61554 -1.61444 6.35297 -4.67181 -5.89515 3.27825 -41.8155 blues
71+0.114887 0.711403 0.00136448 -245.36 40.7944 -1.19439 4.47342 2.78963 -2.21563 1.57855 -3.28804 0.0248982 0.295001 3.78188e-13 -0.295001 -0.0248982 3.28804 -1.57855 2.21563 -2.78963 -4.47342 1.19439 -40.7944 blues
72+0.138309 0.693864 0.00158359 -235.546 38.3968 -5.45642 7.76101 5.44981 -5.96177 0.575654 -2.23234 2.04792 -0.105489 3.58809e-13 0.105489 -2.04792 2.23234 -0.575654 5.96177 -5.44981 -7.76101 5.45642 -38.3968 blues
73+0.148667 0.564768 0.00132092 -240.993 34.8334 -0.259499 10.8562 3.00426 -5.60938 2.69451 -2.04031 0.55228 0.976232 3.61906e-13 -0.976232 -0.55228 2.04031 -2.69451 5.60938 -3.00426 -10.8562 0.259499 -34.8334 blues
74+0.108404 0.651632 0.00328655 -225.819 45.2893 -4.31466 5.80192 5.16555 -1.8029 2.70046 -3.3482 1.70162 -1.11171 3.55236e-13 1.11171 -1.70162 3.3482 -2.70046 1.8029 -5.16555 -5.80192 4.31466 -45.2893 blues
75+0.134101 0.69099 0.00264674 -225.324 38.8546 -2.62386 5.7917 1.26663 0.057306 4.50294 -4.02289 1.19069 -1.28659 3.47243e-13 1.28659 -1.19069 4.02289 -4.50294 -0.057306 -1.26663 -5.7917 2.62386 -38.8546 blues
76+0.115125 0.702075 0.00244103 -238.258 39.4686 -2.78088 4.92032 5.01945 1.3759 3.8238 -2.14936 1.55072 -0.434953 3.66565e-13 0.434953 -1.55072 2.14936 -3.8238 -1.3759 -5.01945 -4.92032 2.78088 -39.4686 blues
77+0.141609 0.542383 0.00275116 -224.955 36.6072 -6.74715 5.25713 3.78892 -0.00900903 4.78623 -2.27209 2.50026 -1.4068 3.43602e-13 1.4068 -2.50026 2.27209 -4.78623 0.00900903 -3.78892 -5.25713 6.74715 -36.6072 blues
78+0.11547 0.697587 0.00313345 -226.161 43.1053 -4.35935 2.97932 2.11583 0.673393 5.08646 -2.2935 2.22484 -0.332473 3.55299e-13 0.332473 -2.22484 2.2935 -5.08646 -0.673393 -2.11583 -2.97932 4.35935 -43.1053 blues
79+0.126769 0.762922 0.00335235 -218.379 42.4099 -7.16806 2.81564 2.44154 -0.730187 4.30848 -3.21404 2.11721 -1.18629 3.43051e-13 1.18629 -2.11721 3.21404 -4.30848 0.730187 -2.44154 -2.81564 7.16806 -42.4099 blues
80+0.133899 0.620659 0.00342166 -216.974 38.8761 -6.39909 4.76402 3.33703 1.24508 5.90593 -1.98554 2.63918 0.0976787 3.37606e-13 -0.0976787 -2.63918 1.98554 -5.90593 -1.24508 -3.33703 -4.76402 6.39909 -38.8761 blues
81+0.0947063 0.642088 0.00309355 -231.958 48.13 -3.92946 1.53771 2.67097 -2.03197 3.23421 -1.39724 1.68485 -0.437259 3.69052e-13 0.437259 -1.68485 1.39724 -3.23421 2.03197 -2.67097 -1.53771 3.92946 -48.13 blues
82+0.12255 0.668207 0.00360729 -214.551 43.7801 -9.32046 2.59605 3.95567 -2.93359 4.19178 -2.74378 1.83616 -0.792756 3.39353e-13 0.792756 -1.83616 2.74378 -4.19178 2.93359 -3.95567 -2.59605 9.32046 -43.7801 blues
83+0.114302 0.68572 0.00348326 -219.805 45.5088 -5.43792 2.57206 1.04585 -3.30529 3.05695 -3.4275 1.76487 -0.633078 3.48744e-13 0.633078 -1.76487 3.4275 -3.05695 3.30529 -1.04585 -2.57206 5.43792 -45.5088 blues
84+0.12367 0.610505 0.00337549 -220.116 42.2324 -8.26688 3.36525 4.15529 -1.22827 4.95729 -2.83132 2.37559 -0.0555443 3.45568e-13 0.0555443 -2.37559 2.83132 -4.95729 1.22827 -4.15529 -3.36525 8.26688 -42.2324 blues
85+0.108192 0.631832 0.00285232 -229.529 44.5085 -5.30227 0.612802 2.36931 0.24014 2.88251 -2.64567 1.57665 -0.591592 3.62531e-13 0.591592 -1.57665 2.64567 -2.88251 -0.24014 -2.36931 -0.612802 5.30227 -44.5085 blues
86+0.0910881 0.53782 0.00212604 -241.724 42.5569 -1.19867 1.95739 2.10723 1.0177 5.30587 1.94465 1.39768 -0.420916 3.75999e-13 0.420916 -1.39768 -1.94465 -5.30587 -1.0177 -2.10723 -1.95739 1.19867 -42.5569 blues
87+0.0713937 0.561402 0.00141591 -265.004 38.9251 9.20468 6.49176 4.84434 2.14611 2.38063 -0.332197 0.292479 -0.307641 4.01253e-13 0.307641 -0.292479 0.332197 -2.38063 -2.14611 -4.84434 -6.49176 -9.20468 -38.9251 blues
88+0.0702727 0.507535 0.00205451 -255.447 44.3182 8.09195 7.32288 4.72958 0.81309 2.58828 -0.878563 0.169451 0.344739 3.95193e-13 -0.344739 -0.169451 0.878563 -2.58828 -0.81309 -4.72958 -7.32288 -8.09195 -44.3182 blues
89+0.0505433 0.563093 0.00154517 -270.508 41.1256 11.7109 5.76287 6.39389 4.65461 2.41807 -0.158985 0.276616 0.440174 4.12837e-13 -0.440174 -0.276616 0.158985 -2.41807 -4.65461 -6.39389 -5.76287 -11.7109 -41.1256 blues
90+0.0420183 0.45155 0.000619516 -287.788 31.2776 15.5547 6.59604 3.83237 2.33997 1.17674 0.795434 0.745355 0.345788 4.22384e-13 -0.345788 -0.745355 -0.795434 -1.17674 -2.33997 -3.83237 -6.59604 -15.5547 -31.2776 blues
91+0.0810321 0.515158 0.00178746 -257.598 39.526 7.27109 9.64219 6.74502 1.68181 1.98943 -1.67551 0.759581 -0.0870476 3.91044e-13 0.0870476 -0.759581 1.67551 -1.98943 -1.68181 -6.74502 -9.64219 -7.27109 -39.526 blues
92+0.0441391 0.446323 0.0013528 -273.302 40.1661 14.7118 5.8025 3.49837 2.96337 3.084 1.72316 1.34357 0.332731 4.14172e-13 -0.332731 -1.34357 -1.72316 -3.084 -2.96337 -3.49837 -5.8025 -14.7118 -40.1661 blues
93+0.0377751 0.371533 0.000694814 -289.768 28.1787 15.2876 9.97136 7.70228 5.29194 3.3797 1.66909 0.711087 -0.0137788 4.20253e-13 0.0137788 -0.711087 -1.66909 -3.3797 -5.29194 -7.70228 -9.97136 -15.2876 -28.1787 blues
94+0.0278032 0.317427 0.000823097 -285.455 34.5004 17.763 6.11781 2.88099 3.58609 3.43787 1.72364 0.564726 0.187268 4.23332e-13 -0.187268 -0.564726 -1.72364 -3.43787 -3.58609 -2.88099 -6.11781 -17.763 -34.5004 blues
95+0.0941147 0.467578 0.00196002 -245.994 40.9266 -1.7736 3.89377 4.35604 -0.180557 5.57733 1.37048 1.47732 0.69981 3.79364e-13 -0.69981 -1.47732 -1.37048 -5.57733 0.180557 -4.35604 -3.89377 1.7736 -40.9266 blues
96+0.069485 0.535029 0.00235791 -250.186 47.9329 7.46287 5.61323 2.626 -0.571442 0.458379 -2.08907 1.98459 1.93344 3.94096e-13 -1.93344 -1.98459 2.08907 -0.458379 0.571442 -2.626 -5.61323 -7.46287 -47.9329 blues
97+0.0545855 0.344298 0.000458099 -280.616 36.0231 13.2141 1.89899 -1.15735 -1.51527 -0.393935 0.840447 1.05455 -0.0320538 4.19188e-13 0.0320538 -1.05455 -0.840447 0.393935 1.51527 1.15735 -1.89899 -13.2141 -36.0231 blues
98+0.0777612 0.613152 0.00240976 -247.087 45.4175 2.46823 4.86092 7.00275 2.161 1.72329 -0.574963 1.39712 -1.02444 3.85327e-13 1.02444 -1.39712 0.574963 -1.72329 -2.161 -7.00275 -4.86092 -2.46823 -45.4175 blues
99+0.117592 0.600458 0.0016621 -240.585 40.28 -5.43639 3.79394 5.48961 -2.23973 3.22053 0.144163 2.29207 -0.94721 3.69234e-13 0.94721 -2.29207 -0.144163 -3.22053 2.23973 -5.48961 -3.79394 5.43639 -40.28 blues
100+0.0730561 0.544654 0.00129553 -262.498 41.8424 4.67573 1.73033 3.54899 -1.10885 1.61282 1.39654 0.535375 -0.0413087 4.0261e-13 0.0413087 -0.535375 -1.39654 -1.61282 1.10885 -3.54899 -1.73033 -4.67573 -41.8424 blues
101+0.0805354 0.562542 0.000458467 -272.108 38.1278 2.61418 -6.52588 -2.2837 -0.264191 1.20319 1.49732 0.347882 -0.627294 4.1404e-13 0.627294 -0.347882 -1.49732 -1.20319 0.264191 2.2837 6.52588 -2.61418 -38.1278 classical
102+0.0663804 0.406469 0.000338849 -280.294 34.8681 8.77738 -1.2972 0.302561 1.31664 0.600447 -0.0244019 -0.310362 -0.391481 4.19591e-13 0.391481 0.310362 0.0244019 -0.600447 -1.31664 -0.302561 1.2972 -8.77738 -34.8681 classical
103+0.0784647 0.558192 0.00067428 -265.157 42.3567 2.52171 -4.85681 -1.48061 -1.25442 1.38336 2.01761 0.537874 -0.636338 4.08994e-13 0.636338 -0.537874 -2.01761 -1.38336 1.25442 1.48061 4.85681 -2.52171 -42.3567 classical
104+0.0844165 0.441056 0.000412288 -273.65 35.2784 -0.255948 -7.0504 -1.50828 -0.607703 1.42491 2.36884 0.0040395 -1.37315 4.12195e-13 1.37315 -0.0040395 -2.36884 -1.42491 0.607703 1.50828 7.0504 0.255948 -35.2784 classical
105+0.085419 0.540494 0.000546148 -267.529 39.9159 1.73957 -3.91195 0.811345 -0.204264 0.17346 0.730186 0.710393 0.172851 4.09937e-13 -0.172851 -0.710393 -0.730186 -0.17346 0.204264 -0.811345 3.91195 -1.73957 -39.9159 classical
106+0.0755185 0.556891 0.000688784 -265.544 42.2958 3.9936 -1.09208 2.97825 -0.00957002 -1.1077 -0.696726 -0.317956 -0.472574 4.08971e-13 0.472574 0.317956 0.696726 1.1077 0.00957002 -2.97825 1.09208 -3.9936 -42.2958 classical
107+0.0821099 0.439229 0.000403404 -273.495 36.3162 3.69068 -1.41451 2.37794 -0.215214 -1.65948 -0.724823 -0.144992 -0.566871 4.12193e-13 0.566871 0.144992 0.724823 1.65948 0.215214 -2.37794 1.41451 -3.69068 -36.3162 classical
108+0.0551558 0.446213 0.000432503 -283.461 32.2439 10.0111 1.97586 2.17791 0.869546 -0.179478 0.24812 0.537447 0.184052 4.19474e-13 -0.184052 -0.537447 -0.24812 0.179478 -0.869546 -2.17791 -1.97586 -10.0111 -32.2439 classical
109+0.069303 0.515028 0.000384205 -280.705 32.9674 7.58899 0.316593 1.41781 0.0510828 -0.957821 -0.729868 -0.107953 0.042349 4.17398e-13 -0.042349 0.107953 0.729868 0.957821 -0.0510828 -1.41781 -0.316593 -7.58899 -32.9674 classical
110+0.0769632 0.41863 0.000223967 -287.241 27.8084 7.98739 2.12996 2.19058 -0.697618 -2.35002 -1.17763 -0.201784 -0.270665 4.18724e-13 0.270665 0.201784 1.17763 2.35002 0.697618 -2.19058 -2.12996 -7.98739 -27.8084 classical
111+0.0727876 0.54564 0.000330408 -282.717 30.7562 7.06114 0.560303 1.33901 -0.274864 -1.13107 -0.882942 -0.48183 -0.547328 4.16801e-13 0.547328 0.48183 0.882942 1.13107 0.274864 -1.33901 -0.560303 -7.06114 -30.7562 classical
112+0.0483108 0.397869 0.000285886 -286.933 31.5124 13.5427 3.41303 0.900318 -0.649179 -2.09741 -2.10031 -1.20537 -0.478673 4.2223e-13 0.478673 1.20537 2.10031 2.09741 0.649179 -0.900318 -3.41303 -13.5427 -31.5124 classical
113+0.061294 0.437973 0.000494607 -274.564 39.921 9.06276 -2.07186 0.136664 0.0662408 -1.47796 -1.32099 -1.09728 -1.14822 4.17841e-13 1.14822 1.09728 1.32099 1.47796 -0.0662408 -0.136664 2.07186 -9.06276 -39.921 classical
114+0.0683481 0.511338 0.000413924 -277.875 34.6559 6.29384 -0.819858 1.54985 0.25204 -1.00984 -0.938441 -0.746781 -0.780507 4.15703e-13 0.780507 0.746781 0.938441 1.00984 -0.25204 -1.54985 0.819858 -6.29384 -34.6559 classical
115+0.0766009 0.553908 0.000450862 -277.142 35.3639 6.1359 -1.79991 1.0159 0.496776 -1.28129 -1.90298 -1.46278 -1.06044 4.16067e-13 1.06044 1.46278 1.90298 1.28129 -0.496776 -1.0159 1.79991 -6.1359 -35.3639 classical
116+0.0625801 0.506964 9.12297e-05 -299.974 17.621 6.89785 -0.442515 -2.06036 -1.08799 -0.389685 -0.613485 -1.08997 -0.945707 4.23594e-13 0.945707 1.08997 0.613485 0.389685 1.08799 2.06036 0.442515 -6.89785 -17.621 classical
117+0.0426491 0.447619 6.72422e-05 -304.66 14.4337 9.92551 5.28599 2.04629 0.367799 -0.202665 -0.169595 0.0328155 0.104222 4.24581e-13 -0.104222 -0.0328155 0.169595 0.202665 -0.367799 -2.04629 -5.28599 -9.92551 -14.4337 classical
118+0.0646224 0.551113 0.000768043 -267.473 42.4216 6.22066 -3.25908 -2.05713 -1.55198 -0.130279 -0.532176 -0.660506 -0.732004 4.11785e-13 0.732004 0.660506 0.532176 0.130279 1.55198 2.05713 3.25908 -6.22066 -42.4216 classical
119+0.0533075 0.414713 0.00037801 -284.261 33.1533 11.3372 -0.0334572 -0.568079 -0.104097 -1.39386 -2.14067 -1.66709 -0.862018 4.21987e-13 0.862018 1.66709 2.14067 1.39386 0.104097 0.568079 0.0334572 -11.3372 -33.1533 classical
120+0.0527648 0.508045 7.80672e-05 -303.264 15.0275 8.26425 3.13569 0.977505 0.206664 -0.256686 -0.437978 -0.334911 -0.155211 4.24196e-13 0.155211 0.334911 0.437978 0.256686 -0.206664 -0.977505 -3.13569 -8.26425 -15.0275 classical
121+0.0594525 0.484915 0.000286228 -283.557 32.724 9.32803 -1.29454 -0.482421 0.599746 -0.253287 -0.741182 -0.591478 -0.403037 4.21243e-13 0.403037 0.591478 0.741182 0.253287 -0.599746 0.482421 1.29454 -9.32803 -32.724 classical
122+0.0823521 0.595008 0.000858216 -260.704 41.622 1.64882 -1.87524 0.806843 -0.747024 0.266713 -0.752861 0.29853 -0.613178 4.0147e-13 0.613178 -0.29853 0.752861 -0.266713 0.747024 -0.806843 1.87524 -1.64882 -41.622 classical
123+0.064029 0.535761 0.00083516 -264.055 46.0535 5.71284 -4.45204 -0.206231 -0.35143 -0.699847 0.124726 0.227773 -0.481334 4.12422e-13 0.481334 -0.227773 -0.124726 0.699847 0.35143 0.206231 4.45204 -5.71284 -46.0535 classical
124+0.0394449 0.350145 0.000192203 -295.769 23.5441 13.0643 6.03078 3.51208 2.11587 0.712522 0.0280162 -0.0416573 -0.0368618 4.23762e-13 0.0368618 0.0416573 -0.0280162 -0.712522 -2.11587 -3.51208 -6.03078 -13.0643 -23.5441 classical
125+0.0615986 0.53108 0.000868036 -265.15 45.4659 6.88793 -3.28353 -0.0121778 -0.0570773 -0.208787 0.26526 0.346655 -0.396106 4.12742e-13 0.396106 -0.346655 -0.26526 0.208787 0.0570773 0.0121778 3.28353 -6.88793 -45.4659 classical
126+0.0615252 0.550295 0.000883567 -265.286 46.412 7.98363 -2.86627 0.744474 0.327186 -1.1814 -0.95049 -0.176358 -0.13289 4.14495e-13 0.13289 0.176358 0.95049 1.1814 -0.327186 -0.744474 2.86627 -7.98363 -46.412 classical
127+0.0614443 0.535267 0.000970841 -262.814 45.1201 4.76476 -4.06876 -0.00619186 0.417108 1.02223 0.500399 0.0756941 -0.952541 4.09175e-13 0.952541 -0.0756941 -0.500399 -1.02223 -0.417108 0.00619186 4.06876 -4.76476 -45.1201 classical
128+0.0501616 0.410353 0.000473729 -279.116 37.7217 12.5774 0.686172 -0.335588 -0.07971 0.170765 0.21834 -0.805383 -1.43716 4.1941e-13 1.43716 0.805383 -0.21834 -0.170765 0.07971 0.335588 -0.686172 -12.5774 -37.7217 classical
129+0.0649462 0.522201 0.000749776 -265.833 42.4847 5.09753 -2.4417 0.0942941 -0.146465 0.728314 0.151157 -0.073674 -0.59874 4.09634e-13 0.59874 0.073674 -0.151157 -0.728314 0.146465 -0.0942941 2.4417 -5.09753 -42.4847 classical
130+0.0928572 0.589894 0.00015925 -293.394 21.191 3.57244 -2.17194 -0.321364 -0.359296 -1.72727 -1.62244 -0.569558 -0.0724952 4.21011e-13 0.0724952 0.569558 1.62244 1.72727 0.359296 0.321364 2.17194 -3.57244 -21.191 classical
131+0.0765643 0.564061 0.000343989 -278.07 33.8966 5.68086 -0.0985328 2.81169 0.668992 -1.38029 -0.987962 -0.180391 -0.316196 4.15186e-13 0.316196 0.180391 0.987962 1.38029 -0.668992 -2.81169 0.0985328 -5.68086 -33.8966 classical
132+0.0427601 0.609411 0.000521502 -280.501 38.121 15.4432 2.39023 -0.192052 -0.169797 -0.183123 -0.00142718 0.114316 -0.0242831 4.21965e-13 0.0242831 -0.114316 0.00142718 0.183123 0.169797 0.192052 -2.39023 -15.4432 -38.121 classical
133+0.0373472 0.343341 7.84221e-05 -302.948 16.7984 11.9801 6.67924 2.72795 0.705191 0.227171 0.492004 0.73878 0.557113 4.24797e-13 -0.557113 -0.73878 -0.492004 -0.227171 -0.705191 -2.72795 -6.67924 -11.9801 -16.7984 classical
134+0.0469661 0.381318 9.30897e-05 -300.877 18.3552 11.0251 4.58402 1.22453 0.282239 0.565442 1.20697 1.48388 1.01666 4.24806e-13 -1.01666 -1.48388 -1.20697 -0.565442 -0.282239 -1.22453 -4.58402 -11.0251 -18.3552 classical
135+0.0574252 0.415668 0.000772611 -269.621 41.2653 8.01535 1.94067 4.34993 1.32078 0.127069 0.312216 0.565729 0.390705 4.12512e-13 -0.390705 -0.565729 -0.312216 -0.127069 -1.32078 -4.34993 -1.94067 -8.01535 -41.2653 classical
136+0.0849404 0.677503 0.000453644 -272.812 35.4154 0.7384 -3.72171 3.23672 2.02312 -0.456831 -0.6659 -0.315562 -1.02499 4.11308e-13 1.02499 0.315562 0.6659 0.456831 -2.02312 -3.23672 3.72171 -0.7384 -35.4154 classical
137+0.0798806 0.409533 0.000290092 -291.476 26.3542 12.4437 5.88836 3.14569 0.561249 -0.406641 -0.692509 -1.2677 -1.21573 4.20583e-13 1.21573 1.2677 0.692509 0.406641 -0.561249 -3.14569 -5.88836 -12.4437 -26.3542 classical
138+0.068091 0.633336 0.000673153 -270.493 39.3748 5.10861 -1.49296 2.89569 1.63562 -0.211154 -0.703717 -0.281447 -0.728929 4.12158e-13 0.728929 0.281447 0.703717 0.211154 -1.63562 -2.89569 1.49296 -5.10861 -39.3748 classical
139+0.063271 0.397597 0.000281096 -283.222 32.9486 9.26958 -1.21443 -0.128449 1.11683 0.392772 -0.333425 -0.786819 -0.830899 4.20788e-13 0.830899 0.786819 0.333425 -0.392772 -1.11683 0.128449 1.21443 -9.26958 -32.9486 classical
140+0.0976081 0.613155 0.000154734 -291.014 21.8443 1.93947 -2.97457 -0.741964 0.122962 0.063058 -0.793328 -1.82589 -1.85437 4.17788e-13 1.85437 1.82589 0.793328 -0.063058 -0.122962 0.741964 2.97457 -1.93947 -21.8443 classical
141+0.0724564 0.447752 0.000238653 -284.492 31.1922 8.88289 -0.336403 -0.284525 0.253807 0.333583 -0.00415952 -0.395247 -0.373345 4.20086e-13 0.373345 0.395247 0.00415952 -0.333583 -0.253807 0.284525 0.336403 -8.88289 -31.1922 classical
142+0.0628027 0.41155 0.000289869 -289.178 28.1441 10.3728 1.49875 0.957848 1.04474 -0.142333 -0.817205 -0.316973 0.156554 4.2255e-13 -0.156554 0.316973 0.817205 0.142333 -1.04474 -0.957848 -1.49875 -10.3728 -28.1441 classical
143+0.0689193 0.540809 0.00170499 -249.198 53.6602 0.388518 -8.60431 0.175294 -0.103357 -0.191754 -0.482762 -0.629468 -1.11426 4.03423e-13 1.11426 0.629468 0.482762 0.191754 0.103357 -0.175294 8.60431 -0.388518 -53.6602 classical
144+0.0568875 0.349813 0.00156282 -258.21 51.834 9.7156 -1.88893 0.066806 -0.29605 -0.662434 -1.13688 -0.794607 -0.452461 4.11006e-13 0.452461 0.794607 1.13688 0.662434 0.29605 -0.066806 1.88893 -9.7156 -51.834 classical
145+0.0591073 0.405327 0.0002002 -287.623 29.452 9.69413 -0.790665 -1.24323 0.440962 0.614169 -0.543851 -1.98958 -2.00148 4.21301e-13 2.00148 1.98958 0.543851 -0.614169 -0.440962 1.24323 0.790665 -9.69413 -29.452 classical
146+0.0566027 0.434215 0.0016993 -255.957 53.2578 8.63552 -4.10296 -0.996529 0.00946034 -0.178898 -0.688537 -0.303566 -0.0722267 4.10869e-13 0.0722267 0.303566 0.688537 0.178898 -0.00946034 0.996529 4.10296 -8.63552 -53.2578 classical
147+0.1106 0.630022 0.00150963 -237.844 42.3242 -3.73549 0.548391 0.627906 0.706776 2.49706 -0.159163 0.0829432 0.489749 3.73108e-13 -0.489749 -0.0829432 0.159163 -2.49706 -0.706776 -0.627906 -0.548391 3.73549 -42.3242 classical
148+0.055859 0.396051 0.000117867 -295.536 23.5667 11.6709 2.50005 -0.861557 -1.14251 -1.06215 -1.00046 -0.647685 -0.230069 4.24183e-13 0.230069 0.647685 1.00046 1.06215 1.14251 0.861557 -2.50005 -11.6709 -23.5667 classical
149+0.0581337 0.448757 0.00222231 -246.111 54.6359 3.27748 -4.30188 2.30943 2.66755 1.71552 0.0994499 -0.870047 -1.77447 3.99e-13 1.77447 0.870047 -0.0994499 -1.71552 -2.66755 -2.30943 4.30188 -3.27748 -54.6359 classical
150+0.0976687 0.57994 0.00188063 -240.926 47.304 -2.15521 0.104367 2.82792 0.406577 1.52392 -0.0800737 0.408902 -0.703764 3.81897e-13 0.703764 -0.408902 0.0800737 -1.52392 -0.406577 -2.82792 -0.104367 2.15521 -47.304 classical
151+0.0652632 0.471723 9.36486e-05 -301.319 16.946 8.93533 3.60958 1.70021 0.554104 -0.664435 -1.29157 -1.18863 -0.687674 4.23684e-13 0.687674 1.18863 1.29157 0.664435 -0.554104 -1.70021 -3.60958 -8.93533 -16.946 classical
152+0.0687055 0.359571 0.000240468 -296.31 24.2477 16.1597 8.69149 3.57004 0.99178 -0.140406 -0.884955 -1.26735 -0.958201 4.23527e-13 0.958201 1.26735 0.884955 0.140406 -0.99178 -3.57004 -8.69149 -16.1597 -24.2477 classical
153+0.124561 0.600111 0.000912219 -253.972 35.2878 1.00174 2.96688 1.03772 1.77551 1.61153 0.683137 0.684299 -0.389484 3.84227e-13 0.389484 -0.684299 -0.683137 -1.61153 -1.77551 -1.03772 -2.96688 -1.00174 -35.2878 classical
154+0.0796515 0.524884 0.00185852 -243.256 50.8763 -2.50872 -4.2782 2.11457 -0.983111 0.961014 -0.126494 0.213662 -0.755457 3.90342e-13 0.755457 -0.213662 0.126494 -0.961014 0.983111 -2.11457 4.2782 2.50872 -50.8763 classical
155+0.0901486 0.675514 0.00206858 -245.511 48.4713 -3.07915 -5.4091 1.54037 -4.17901 -4.70123 -3.70666 -0.311774 -0.641481 3.90678e-13 0.641481 0.311774 3.70666 4.70123 4.17901 -1.54037 5.4091 3.07915 -48.4713 classical
156+0.0737054 0.40685 5.35561e-05 -304.626 13.5395 7.74514 3.53273 1.94193 1.22374 0.293488 -0.446358 -0.556982 -0.289737 4.24246e-13 0.289737 0.556982 0.446358 -0.293488 -1.22374 -1.94193 -3.53273 -7.74514 -13.5395 classical
157+0.0795354 0.416184 0.0027228 -236.723 52.6814 -3.81714 -2.76974 5.21059 -0.748463 -0.670601 -0.987131 1.74412 -0.0436178 3.83619e-13 0.0436178 -1.74412 0.987131 0.670601 0.748463 -5.21059 2.76974 3.81714 -52.6814 classical
158+0.0746921 0.495823 0.000203474 -287.587 27.4644 7.98531 -0.629632 -1.39444 -0.192355 0.247255 0.492841 0.757889 0.538537 4.20188e-13 -0.538537 -0.757889 -0.492841 -0.247255 0.192355 1.39444 0.629632 -7.98531 -27.4644 classical
159+0.0521547 0.340669 0.000476353 -275.714 40.4514 10.2458 -4.75181 -3.5544 0.418629 2.38987 2.33162 -0.0999081 -1.86062 4.1966e-13 1.86062 0.0999081 -2.33162 -2.38987 -0.418629 3.5544 4.75181 -10.2458 -40.4514 classical
160+0.0743711 0.582322 0.00110734 -256.188 47.0983 1.50803 -3.12847 3.08243 0.52265 0.0476436 -0.202329 -0.450361 -0.593507 4.03236e-13 0.593507 0.450361 0.202329 -0.0476436 -0.52265 -3.08243 3.12847 -1.50803 -47.0983 classical
161+0.0951131 0.620059 0.000741006 -261.599 41.6336 2.08443 -1.11997 2.25845 0.271132 -0.539137 -0.802768 -0.356502 -0.37205 4.03308e-13 0.37205 0.356502 0.802768 0.539137 -0.271132 -2.25845 1.11997 -2.08443 -41.6336 classical
162+0.0566422 0.555316 0.000367098 -281.859 34.8912 11.2003 -1.04661 -0.906924 1.81332 1.94053 0.74207 -0.398719 -0.704685 4.21248e-13 0.704685 0.398719 -0.74207 -1.94053 -1.81332 0.906924 1.04661 -11.2003 -34.8912 classical
163+0.0886876 0.601317 0.000831891 -260.116 41.9898 1.24872 -3.4495 0.682316 1.13827 1.46055 0.0480129 -0.794701 -0.147154 4.03103e-13 0.147154 0.794701 -0.0480129 -1.46055 -1.13827 -0.682316 3.4495 -1.24872 -41.9898 classical
164+0.0315096 0.277131 0.00028705 -293.648 28.2932 19.4586 9.76336 2.59221 -1.13361 -2.33103 -2.25492 -1.67638 -0.888612 4.24186e-13 0.888612 1.67638 2.25492 2.33103 1.13361 -2.59221 -9.76336 -19.4586 -28.2932 classical
165+0.0484022 0.279973 0.000191645 -297.435 22.7369 14.1032 5.98173 1.21637 -0.648648 -1.21551 -1.43872 -1.40581 -0.910906 4.24033e-13 0.910906 1.40581 1.43872 1.21551 0.648648 -1.21637 -5.98173 -14.1032 -22.7369 classical
166+0.0382847 0.450177 0.000306397 -292.127 29.0425 17.6538 6.89906 0.645138 -1.61292 -1.92255 -1.57776 -1.02628 -0.471908 4.24245e-13 0.471908 1.02628 1.57776 1.92255 1.61292 -0.645138 -6.89906 -17.6538 -29.0425 classical
167+0.043587 0.316722 0.000397875 -290.619 29.9649 16.8089 6.04462 0.811338 -1.25208 -2.41065 -3.03673 -2.80477 -1.67687 4.2338e-13 1.67687 2.80477 3.03673 2.41065 1.25208 -0.811338 -6.04462 -16.8089 -29.9649 classical
168+0.0530013 0.325729 0.000233225 -297.161 23.6078 15.748 7.70503 2.28471 -0.367842 -1.41439 -1.6886 -1.44261 -0.81277 4.24203e-13 0.81277 1.44261 1.6886 1.41439 0.367842 -2.28471 -7.70503 -15.748 -23.6078 classical
169+0.08138 0.534221 0.000749534 -262.865 44.3724 2.13318 -5.09594 0.872489 -0.179882 -0.90643 -0.0845451 -0.628412 -1.44634 4.08678e-13 1.44634 0.628412 0.0845451 0.90643 0.179882 -0.872489 5.09594 -2.13318 -44.3724 classical
170+0.0753191 0.435943 0.000522132 -269.67 41.7084 4.32165 -6.26533 -0.839609 0.132129 -0.749368 0.202814 -0.0452414 -1.09226 4.14964e-13 1.09226 0.0452414 -0.202814 0.749368 -0.132129 0.839609 6.26533 -4.32165 -41.7084 classical
171+0.0654797 0.519488 0.000449205 -281.083 32.289 6.69071 -0.413395 1.59233 0.59198 -0.600739 -0.324825 -0.245733 -0.563006 4.16982e-13 0.563006 0.245733 0.324825 0.600739 -0.59198 -1.59233 0.413395 -6.69071 -32.289 classical
172+0.0662993 0.43836 0.00114618 -261.283 46.7382 5.02477 -3.70305 -0.262931 -1.92026 -1.81754 -1.14172 -1.07784 -1.03458 4.08932e-13 1.03458 1.07784 1.14172 1.81754 1.92026 0.262931 3.70305 -5.02477 -46.7382 classical
173+0.0640955 0.466152 0.000322476 -285.348 30.2627 8.67804 0.791572 1.86155 1.12141 -0.664286 -0.619221 0.17626 0.305228 4.2044e-13 -0.305228 -0.17626 0.619221 0.664286 -1.12141 -1.86155 -0.791572 -8.67804 -30.2627 classical
174+0.0686407 0.507961 0.000614614 -271.575 40.5316 6.34984 -3.95666 -0.74295 -0.595242 -1.47595 -1.07103 -0.945285 -1.09328 4.15287e-13 1.09328 0.945285 1.07103 1.47595 0.595242 0.74295 3.95666 -6.34984 -40.5316 classical
175+0.0636205 0.490927 0.000456591 -275.759 38.4131 8.98478 -1.51002 0.0138994 0.258446 -0.488765 -0.331883 -0.191138 -0.387547 4.1775e-13 0.387547 0.191138 0.331883 0.488765 -0.258446 -0.0138994 1.51002 -8.98478 -38.4131 classical
176+0.0735629 0.458385 0.000223619 -285.483 28.7115 5.32899 -1.59096 1.35576 0.332319 -2.20054 -1.66193 -0.553857 -0.493129 4.19212e-13 0.493129 0.553857 1.66193 2.20054 -0.332319 -1.35576 1.59096 -5.32899 -28.7115 classical
177+0.0660034 0.465908 0.001247 -257.81 49.0681 5.64591 -2.05505 2.15796 -0.12707 -1.17562 -0.42809 -0.247732 -0.920759 4.06796e-13 0.920759 0.247732 0.42809 1.17562 0.12707 -2.15796 2.05505 -5.64591 -49.0681 classical
178+0.0405635 0.188471 0.000134796 -299.744 19.9489 12.2184 4.68746 0.0295061 -2.01014 -2.74431 -2.86489 -2.39005 -1.34961 4.23981e-13 1.34961 2.39005 2.86489 2.74431 2.01014 -0.0295061 -4.68746 -12.2184 -19.9489 classical
179+0.0328686 0.322263 0.000110194 -300.352 19.6465 12.978 6.0744 1.50126 -0.500885 -1.06208 -1.18036 -1.10754 -0.707119 4.24262e-13 0.707119 1.10754 1.18036 1.06208 0.500885 -1.50126 -6.0744 -12.978 -19.6465 classical
180+0.0370486 0.485595 0.000272142 -290.357 30.0207 15.7727 3.7844 -1.49021 -2.32399 -2.06791 -1.73865 -1.1272 -0.444616 4.2424e-13 0.444616 1.1272 1.73865 2.06791 2.32399 1.49021 -3.7844 -15.7727 -30.0207 classical
181+0.0441437 0.42999 0.000135692 -299.33 19.8652 11.494 5.00361 2.19295 0.989314 -0.124641 -0.981036 -1.19197 -0.785521 4.23932e-13 0.785521 1.19197 0.981036 0.124641 -0.989314 -2.19295 -5.00361 -11.494 -19.8652 classical
182+0.05248 0.486604 0.000190088 -291.366 27.4218 12.1219 1.9477 -0.221961 0.603379 0.910852 0.7277 0.566388 0.336154 4.23941e-13 -0.336154 -0.566388 -0.7277 -0.910852 -0.603379 0.221961 -1.9477 -12.1219 -27.4218 classical
183+0.0835901 0.491289 0.00062862 -263.809 41.9403 0.621009 -4.01004 1.6095 -1.42498 -1.34364 0.0115798 -0.633823 -1.12738 4.06569e-13 1.12738 0.633823 -0.0115798 1.34364 1.42498 -1.6095 4.01004 -0.621009 -41.9403 classical
184+0.0369908 0.344131 0.000341401 -286.507 34.0084 16.8159 3.02463 -1.90769 -1.48252 -0.629235 -0.690148 -0.776314 -0.461881 4.2419e-13 0.461881 0.776314 0.690148 0.629235 1.48252 1.90769 -3.02463 -16.8159 -34.0084 classical
185+0.0475845 0.325898 0.000203037 -289.537 29.1769 12.4173 1.61672 -0.465345 0.218801 -0.130625 -1.00048 -1.19341 -0.705759 4.23406e-13 0.705759 1.19341 1.00048 0.130625 -0.218801 0.465345 -1.61672 -12.4173 -29.1769 classical
186+0.0883464 0.598962 0.000320383 -276.288 34.4372 2.49603 -5.06451 -0.561964 -0.0269167 -0.592289 -0.0697787 0.175595 0.0768751 4.15498e-13 -0.0768751 -0.175595 0.0697787 0.592289 0.0269167 0.561964 5.06451 -2.49603 -34.4372 classical
187+0.0593687 0.537525 0.000309898 -281.475 34.351 9.4421 -1.20807 -0.488994 0.227364 -0.381411 -0.879197 -1.17093 -0.947488 4.20024e-13 0.947488 1.17093 0.879197 0.381411 -0.227364 0.488994 1.20807 -9.4421 -34.351 classical
188+0.0405273 0.370162 0.00019453 -291.52 28.5079 14.8148 3.79458 -0.58969 -0.963826 -0.693678 -0.902506 -1.21541 -0.958983 4.2377e-13 0.958983 1.21541 0.902506 0.693678 0.963826 0.58969 -3.79458 -14.8148 -28.5079 classical
189+0.0595391 0.596326 0.000200078 -288.927 29.0714 11.1562 0.846625 -0.315252 0.252322 -0.52212 -1.23095 -1.08402 -0.560601 4.22964e-13 0.560601 1.08402 1.23095 0.52212 -0.252322 0.315252 -0.846625 -11.1562 -29.0714 classical
190+0.120779 0.638789 0.000487858 -267.213 31.977 -8.59758 -7.18616 -0.579415 -2.09196 -1.03014 -1.25563 0.332611 0.284034 4.01454e-13 -0.284034 -0.332611 1.25563 1.03014 2.09196 0.579415 7.18616 8.59758 -31.977 classical
191+0.122172 0.628626 0.000295622 -275.5 28.672 -4.73458 -4.71266 0.00492528 -1.02462 0.0732006 -1.15415 -2.24491 -1.95309 4.06301e-13 1.95309 2.24491 1.15415 -0.0732006 1.02462 -0.00492528 4.71266 4.73458 -28.672 classical
192+0.101608 0.496243 0.000562079 -264.854 36.4525 -3.65706 -2.93243 3.61571 0.9382 0.753508 0.620951 2.05162 1.05991 4.02684e-13 -1.05991 -2.05162 -0.620951 -0.753508 -0.9382 -3.61571 2.93243 3.65706 -36.4525 classical
193+0.0786256 0.446343 0.000967042 -259.087 44.5708 1.07491 -0.890098 5.44617 1.5582 -0.498762 -0.649917 0.0885972 -0.646956 4.0333e-13 0.646956 -0.0885972 0.649917 0.498762 -1.5582 -5.44617 0.890098 -1.07491 -44.5708 classical
194+0.083617 0.613717 0.00107708 -259.544 44.0048 -0.076037 -6.91324 -1.81862 1.60773 4.00327 1.28751 -0.133421 -0.866838 4.05104e-13 0.866838 0.133421 -1.28751 -4.00327 -1.60773 1.81862 6.91324 0.076037 -44.0048 classical
195+0.0798642 0.460089 0.000267088 -282.146 30.9418 5.09171 -1.02584 2.61444 1.58905 -0.762682 -0.782432 -0.344011 -0.460543 4.1748e-13 0.460543 0.344011 0.782432 0.762682 -1.58905 -2.61444 1.02584 -5.09171 -30.9418 classical
196+0.11126 0.583998 0.000123178 -291.036 19.6031 -1.41995 -2.66742 1.77053 -0.0970439 -2.18933 -1.53215 -0.463613 -0.426115 4.16128e-13 0.426115 0.463613 1.53215 2.18933 0.0970439 -1.77053 2.66742 1.41995 -19.6031 classical
197+0.102343 0.569626 0.0010371 -252.096 42.1919 -5.14305 -1.53557 4.46281 0.0409608 1.03288 -0.827181 0.680902 0.0333018 3.91506e-13 -0.0333018 -0.680902 0.827181 -1.03288 -0.0409608 -4.46281 1.53557 5.14305 -42.1919 classical
198+0.0798396 0.570818 0.000672945 -266.752 41.4595 3.96967 -3.41225 0.369245 0.899661 -0.406333 -1.97261 -0.317395 0.338831 4.11458e-13 -0.338831 0.317395 1.97261 0.406333 -0.899661 -0.369245 3.41225 -3.96967 -41.4595 classical
199+0.0970668 0.563327 0.00044704 -271.48 33.6239 -0.02259 -1.06098 2.86724 0.967257 1.16499 -0.0676922 0.376385 0.403632 4.07099e-13 -0.403632 -0.376385 0.0676922 -1.16499 -0.967257 -2.86724 1.06098 0.02259 -33.6239 classical
200+0.0767703 0.443199 0.000142791 -292.658 23.4072 7.65593 1.27736 0.497612 -0.0822465 0.0272182 0.496366 0.703275 0.507799 4.21245e-13 -0.507799 -0.703275 -0.496366 -0.0272182 0.0822465 -0.497612 -1.27736 -7.65593 -23.4072 classical
201+0.141396 0.382471 0.00346898 -223.732 36.1445 0.516109 7.13827 3.56564 3.84405 0.864285 0.0907526 0.910287 -0.344154 3.44271e-13 0.344154 -0.910287 -0.0907526 -0.864285 -3.84405 -3.56564 -7.13827 -0.516109 -36.1445 country
202+0.152265 0.567942 0.003027 -217.557 35.5386 -4.97472 4.12396 3.10989 2.70261 0.511928 0.180906 1.54948 -0.477164 3.35971e-13 0.477164 -1.54948 -0.180906 -0.511928 -2.70261 -3.10989 -4.12396 4.97472 -35.5386 country
203+0.128211 0.567478 0.0018836 -244.169 37.9003 3.19682 7.41334 3.83347 3.37953 1.02598 -0.638266 0.997611 -0.945346 3.72571e-13 0.945346 -0.997611 0.638266 -1.02598 -3.37953 -3.83347 -7.41334 -3.19682 -37.9003 country
204+0.105982 0.514032 0.00267332 -230.782 44.2592 -4.05559 2.45769 5.73473 0.838319 0.0547755 -0.578065 2.16532 -1.23372 3.62898e-13 1.23372 -2.16532 0.578065 -0.0547755 -0.838319 -5.73473 -2.45769 4.05559 -44.2592 country
205+0.154946 0.57414 0.0027597 -220.502 34.969 -3.81738 6.1499 3.42686 1.07741 0.303306 -0.461082 1.13037 -0.343416 3.38101e-13 0.343416 -1.13037 0.461082 -0.303306 -1.07741 -3.42686 -6.1499 3.81738 -34.969 country
206+0.151213 0.614504 0.00266214 -220.776 36.4044 -6.48465 2.26227 2.18142 2.32236 1.65342 -0.980219 1.37963 -0.393242 3.41859e-13 0.393242 -1.37963 0.980219 -1.65342 -2.32236 -2.18142 -2.26227 6.48465 -36.4044 country
207+0.138865 0.531242 0.00301111 -221.683 37.9513 -1.40473 4.1859 1.33967 3.04257 0.881489 -1.37997 1.24868 0.821677 3.4567e-13 -0.821677 -1.24868 1.37997 -0.881489 -3.04257 -1.33967 -4.1859 1.40473 -37.9513 country
208+0.145018 0.395324 0.00329869 -220.738 35.3591 -0.983962 6.54417 1.85807 2.53263 2.38784 -0.991148 0.606685 -0.569122 3.38817e-13 0.569122 -0.606685 0.991148 -2.38784 -2.53263 -1.85807 -6.54417 0.983962 -35.3591 country
209+0.13679 0.525774 0.00357891 -216.785 38.4443 -3.96221 3.02373 1.51851 2.66055 2.20524 -0.455654 1.34864 -0.466545 3.38659e-13 0.466545 -1.34864 0.455654 -2.20524 -2.66055 -1.51851 -3.02373 3.96221 -38.4443 country
210+0.174488 0.594914 0.0030485 -212.893 31.2829 -2.95413 5.0116 1.32668 3.13212 -0.208109 -0.130217 1.1745 -0.562377 3.24511e-13 0.562377 -1.1745 0.130217 0.208109 -3.13212 -1.32668 -5.0116 2.95413 -31.2829 country
211+0.0965339 0.556976 0.00120911 -254.125 43.8587 0.0838584 0.114912 3.69167 -1.49215 -1.89548 -0.251034 0.790136 -0.415154 3.94879e-13 0.415154 -0.790136 0.251034 1.89548 1.49215 -3.69167 -0.114912 -0.0838584 -43.8587 country
212+0.132168 0.564686 0.00106647 -256.849 34.9372 3.37959 2.87238 1.29053 0.853032 -1.34578 0.19347 0.267977 -1.96751 3.86164e-13 1.96751 -0.267977 -0.19347 1.34578 -0.853032 -1.29053 -2.87238 -3.37959 -34.9372 country
213+0.0805273 0.56843 0.00157213 -254.321 46.2842 6.34261 2.7955 2.18289 -0.277376 -0.45941 -1.08061 -0.560789 -0.158333 3.97879e-13 0.158333 0.560789 1.08061 0.45941 0.277376 -2.18289 -2.7955 -6.34261 -46.2842 country
214+0.138937 0.641904 0.00100855 -249.077 36.6617 -0.370231 1.79952 1.45228 1.94392 -0.720377 0.0682864 0.265016 -0.563728 3.80308e-13 0.563728 -0.265016 -0.0682864 0.720377 -1.94392 -1.45228 -1.79952 0.370231 -36.6617 country
215+0.165188 0.643187 0.00110121 -247.873 31.9138 2.14977 4.87064 0.633542 3.12518 0.908393 1.3231 -0.44435 -0.627604 3.722e-13 0.627604 0.44435 -1.3231 -0.908393 -3.12518 -0.633542 -4.87064 -2.14977 -31.9138 country
216+0.0997482 0.629264 0.00122745 -256.563 41.1324 3.31621 3.92918 3.56865 0.119253 0.4325 -1.95075 0.00611788 -1.06248 3.9312e-13 1.06248 -0.00611788 1.95075 -0.4325 -0.119253 -3.56865 -3.92918 -3.31621 -41.1324 country
217+0.0705413 0.564226 0.00103612 -263.53 44.1615 6.27703 2.53957 5.04155 -1.50537 -1.80341 -1.27597 -1.28876 0.101688 4.07495e-13 -0.101688 1.28876 1.27597 1.80341 1.50537 -5.04155 -2.53957 -6.27703 -44.1615 country
218+0.0504044 0.482088 0.00123163 -266.811 46.9243 13.9816 2.34953 2.03335 1.39858 -0.464455 -1.2746 -0.981651 -0.794202 4.14861e-13 0.794202 0.981651 1.2746 0.464455 -1.39858 -2.03335 -2.34953 -13.9816 -46.9243 country
219+0.101423 0.52945 0.00117306 -254.475 41.5533 1.39756 -0.257783 3.1228 5.20464 2.91447 -0.0138211 0.466757 0.0744082 3.94914e-13 -0.0744082 -0.466757 0.0138211 -2.91447 -5.20464 -3.1228 0.257783 -1.39756 -41.5533 country
220+0.0509707 0.404734 0.00101919 -272.021 42.4321 10.7384 -0.37327 3.21258 3.28491 0.731962 -0.104806 0.047193 -0.45631 4.17681e-13 0.45631 -0.047193 0.104806 -0.731962 -3.28491 -3.21258 0.37327 -10.7384 -42.4321 country
221+0.125134 0.563245 0.00141722 -251.639 34.6279 4.13147 9.43684 3.7043 0.0483528 3.06827 -0.335625 0.958642 -0.269593 3.76713e-13 0.269593 -0.958642 0.335625 -3.06827 -0.0483528 -3.7043 -9.43684 -4.13147 -34.6279 country
222+0.053789 0.54601 0.00136246 -264.116 47.3525 9.48526 0.141501 4.0577 2.65429 0.118697 -1.12105 -1.12536 -0.621178 4.13262e-13 0.621178 1.12536 1.12105 -0.118697 -2.65429 -4.0577 -0.141501 -9.48526 -47.3525 country
223+0.0941843 0.638261 0.00117175 -257.101 42.4927 3.81755 3.98657 5.76351 0.258253 -3.13582 -2.08641 -0.373363 -1.35025 3.95811e-13 1.35025 0.373363 2.08641 3.13582 -0.258253 -5.76351 -3.98657 -3.81755 -42.4927 country
224+0.0678724 0.311836 0.00052381 -288.649 28.2141 14.9553 8.24321 4.35895 2.92617 1.24109 0.44986 0.79123 0.578936 4.19678e-13 -0.578936 -0.79123 -0.44986 -1.24109 -2.92617 -4.35895 -8.24321 -14.9553 -28.2141 country
225+0.097181 0.538903 0.00125745 -254.511 40.5863 1.09495 2.69503 5.09005 -0.0189358 1.01118 -1.40299 -0.360995 -1.33848 3.89784e-13 1.33848 0.360995 1.40299 -1.01118 0.0189358 -5.09005 -2.69503 -1.09495 -40.5863 country
226+0.0918607 0.484388 0.000959823 -262.347 40.4268 5.42054 2.2208 2.84688 1.19982 1.367 0.00803298 -0.105085 -0.403001 4.01349e-13 0.403001 0.105085 -0.00803298 -1.367 -1.19982 -2.84688 -2.2208 -5.42054 -40.4268 country
227+0.0579371 0.459637 0.00134256 -261.464 47.734 8.17053 -1.17438 2.99677 2.66328 0.474793 -0.324051 0.596808 0.0106163 4.10756e-13 -0.0106163 -0.596808 0.324051 -0.474793 -2.66328 -2.99677 1.17438 -8.17053 -47.734 country
228+0.110235 0.673736 0.00172654 -240.414 45.4159 -4.18612 -0.615056 5.31182 1.45654 -0.400552 0.39769 0.17825 -1.08913 3.795e-13 1.08913 -0.17825 -0.39769 0.400552 -1.45654 -5.31182 0.615056 4.18612 -45.4159 country
229+0.0766441 0.531846 0.00123624 -256.741 46.9672 3.55443 -1.04178 4.49169 1.34422 -0.585076 0.580934 -0.178014 -2.21512 4.01673e-13 2.21512 0.178014 -0.580934 0.585076 -1.34422 -4.49169 1.04178 -3.55443 -46.9672 country
230+0.0639477 0.558909 0.00152523 -257.887 49.5278 6.77073 -0.531978 4.64719 1.24291 -2.31908 -1.43554 -0.421904 -0.813152 4.07492e-13 0.813152 0.421904 1.43554 2.31908 -1.24291 -4.64719 0.531978 -6.77073 -49.5278 country
231+0.0528616 0.335723 0.000865736 -278.175 38.4029 17.2298 7.50383 2.8879 0.41153 -1.11202 -2.06908 -1.58889 -0.815582 4.17411e-13 0.815582 1.58889 2.06908 1.11202 -0.41153 -2.8879 -7.50383 -17.2298 -38.4029 country
232+0.0943084 0.433607 0.00127434 -253.075 43.4561 0.865693 0.784248 4.65461 0.700351 -1.04647 -0.291897 0.538543 -0.873975 3.92954e-13 0.873975 -0.538543 0.291897 1.04647 -0.700351 -4.65461 -0.784248 -0.865693 -43.4561 country
233+0.0918554 0.32765 0.000548881 -275.192 32.9083 6.36916 4.75152 4.52337 0.818366 0.618405 1.17972 1.15354 0.24485 4.0831e-13 -0.24485 -1.15354 -1.17972 -0.618405 -0.818366 -4.52337 -4.75152 -6.36916 -32.9083 country
234+0.118183 0.597894 0.00106837 -256.196 37.3458 1.76059 5.10681 4.4536 -0.946412 0.151274 0.138262 -0.023777 -0.429267 3.87999e-13 0.429267 0.023777 -0.138262 -0.151274 0.946412 -4.4536 -5.10681 -1.76059 -37.3458 country
235+0.128767 0.664311 0.000789791 -260.919 35.1128 2.85527 2.12939 0.647361 1.3423 1.64085 1.27495 0.366218 0.799584 3.94489e-13 -0.799584 -0.366218 -1.27495 -1.64085 -1.3423 -0.647361 -2.12939 -2.85527 -35.1128 country
236+0.112557 0.600153 0.00135872 -246.9 41.4276 0.352087 1.06393 2.82934 1.91202 -2.42427 0.254341 1.76532 -2.09481 3.81559e-13 2.09481 -1.76532 -0.254341 2.42427 -1.91202 -2.82934 -1.06393 -0.352087 -41.4276 country
237+0.0933974 0.439824 0.000354064 -285.264 25.8714 5.3279 4.8403 6.69197 3.03102 1.16845 1.39079 1.50568 0.484069 4.13684e-13 -0.484069 -1.50568 -1.39079 -1.16845 -3.03102 -6.69197 -4.8403 -5.3279 -25.8714 country
238+0.108868 0.476745 0.000849652 -264.561 37.0852 5.76976 3.33477 4.33292 4.31102 0.332947 -0.808417 -0.37794 -0.924084 4.00646e-13 0.924084 0.37794 0.808417 -0.332947 -4.31102 -4.33292 -3.33477 -5.76976 -37.0852 country
239+0.144681 0.64112 0.00113491 -248.184 35.3666 0.299287 4.0864 1.65481 1.5733 0.149034 -0.565758 0.211168 0.353156 3.77301e-13 -0.353156 -0.211168 0.565758 -0.149034 -1.5733 -1.65481 -4.0864 -0.299287 -35.3666 country
240+0.185517 0.732544 0.00112679 -241.472 29.242 -2.87769 7.05297 4.40266 2.00137 -0.0916686 -0.865415 -0.381021 -0.169863 3.59757e-13 0.169863 0.381021 0.865415 0.0916686 -2.00137 -4.40266 -7.05297 2.87769 -29.242 country
241+0.13499 0.643918 0.00124466 -248.01 36.8381 -1.24257 4.22002 5.28699 2.79879 0.0233607 -0.570046 0.00200931 -0.602456 3.78244e-13 0.602456 -0.00200931 0.570046 -0.0233607 -2.79879 -5.28699 -4.22002 1.24257 -36.8381 country
242+0.137892 0.560038 0.00149348 -243.161 35.0367 0.769728 6.39583 5.8276 3.83437 -1.75461 0.762659 0.800336 -1.25969 3.68526e-13 1.25969 -0.800336 -0.762659 1.75461 -3.83437 -5.8276 -6.39583 -0.769728 -35.0367 country
243+0.122427 0.566527 0.00157029 -245.963 37.8325 2.83723 7.9503 5.0898 3.03629 0.833987 0.358826 -0.361023 -1.31433 3.74761e-13 1.31433 0.361023 -0.358826 -0.833987 -3.03629 -5.0898 -7.9503 -2.83723 -37.8325 country
244+0.134745 0.648681 0.00122965 -244.253 38.5426 -4.30771 -0.82412 1.27406 1.39203 1.19468 0.0648692 -0.164161 -0.72562 3.7678e-13 0.72562 0.164161 -0.0648692 -1.19468 -1.39203 -1.27406 0.82412 4.30771 -38.5426 country
245+0.0699616 0.358288 0.00127618 -262.984 41.8849 9.26318 1.2221 1.59664 3.1898 0.314509 0.939559 0.479606 -0.291364 4.04995e-13 0.291364 -0.479606 -0.939559 -0.314509 -3.1898 -1.59664 -1.2221 -9.26318 -41.8849 country
246+0.148956 0.727229 0.00179397 -234.374 36.8017 -2.74765 2.46737 0.988717 1.13019 0.033744 -0.689452 0.0634177 -1.10184 3.59955e-13 1.10184 -0.0634177 0.689452 -0.033744 -1.13019 -0.988717 -2.46737 2.74765 -36.8017 country
247+0.115329 0.663327 0.00138913 -245.934 41.9079 -5.68329 2.86321 11.1023 -0.62782 -0.349301 -1.23022 -0.81286 -0.71826 3.80667e-13 0.71826 0.81286 1.23022 0.349301 0.62782 -11.1023 -2.86321 5.68329 -41.9079 country
248+0.0940363 0.57306 0.00124376 -250.763 44.5412 -3.19511 -0.554768 6.06664 -2.02588 1.24141 1.29587 -0.0232896 -0.336042 3.91085e-13 0.336042 0.0232896 -1.29587 -1.24141 2.02588 -6.06664 0.554768 3.19511 -44.5412 country
249+0.0977324 0.621268 0.00154582 -252.151 41.2165 5.14622 5.20248 4.44855 1.82469 -2.22363 0.138491 0.553288 -2.12677 3.86792e-13 2.12677 -0.553288 -0.138491 2.22363 -1.82469 -4.44855 -5.20248 -5.14622 -41.2165 country
250+0.0782157 0.607349 0.0019513 -247.141 49.9676 3.32118 0.0881036 2.44982 -0.906535 -1.07542 -0.935276 -0.307642 0.130417 3.93964e-13 -0.130417 0.307642 0.935276 1.07542 0.906535 -2.44982 -0.0881036 -3.32118 -49.9676 country
251+0.0865355 0.461138 0.00131534 -255.5 41.3583 2.98517 4.12624 3.52233 0.204041 2.04062 0.182046 1.29809 -0.539882 3.91819e-13 0.539882 -1.29809 -0.182046 -2.04062 -0.204041 -3.52233 -4.12624 -2.98517 -41.3583 country
252+0.0716961 0.372009 0.00128699 -262.268 42.1801 7.50966 6.01059 5.9435 2.46617 1.61051 -0.835994 0.268117 -0.203225 4.02223e-13 0.203225 -0.268117 0.835994 -1.61051 -2.46617 -5.9435 -6.01059 -7.50966 -42.1801 country
253+0.0516072 0.330429 0.000874244 -277.426 36.4581 12.3522 6.61985 5.15496 1.84137 0.904913 1.18973 1.62811 0.733391 4.15097e-13 -0.733391 -1.62811 -1.18973 -0.904913 -1.84137 -5.15496 -6.61985 -12.3522 -36.4581 country
254+0.11883 0.558158 0.00167583 -240.357 39.5252 -0.778534 7.40167 4.0907 -0.395456 2.1582 -2.63963 0.987741 -0.929762 3.68016e-13 0.929762 -0.987741 2.63963 -2.1582 0.395456 -4.0907 -7.40167 0.778534 -39.5252 country
255+0.0805512 0.374402 0.00134013 -258.787 40.1187 5.11796 8.02405 5.91074 0.974973 2.18671 -0.563673 0.634997 0.0293231 3.941e-13 -0.0293231 -0.634997 0.563673 -2.18671 -0.974973 -5.91074 -8.02405 -5.11796 -40.1187 country
256+0.0982262 0.558462 0.00206817 -238.513 45.0366 -0.6426 3.41532 2.32145 0.0786366 2.14197 -2.3727 0.99253 -0.980056 3.73917e-13 0.980056 -0.99253 2.3727 -2.14197 -0.0786366 -2.32145 -3.41532 0.6426 -45.0366 country
257+0.0701852 0.320824 0.00174622 -256.386 41.2302 6.27386 6.67001 4.64913 1.62276 2.56708 0.205357 1.09766 -0.680605 3.92045e-13 0.680605 -1.09766 -0.205357 -2.56708 -1.62276 -4.64913 -6.67001 -6.27386 -41.2302 country
258+0.079802 0.506813 0.00149127 -254.576 44.2846 3.81469 3.56174 4.89747 0.276884 0.583173 0.14934 1.14598 -1.24321 3.93808e-13 1.24321 -1.14598 -0.14934 -0.583173 -0.276884 -4.89747 -3.56174 -3.81469 -44.2846 country
259+0.0864132 0.483732 0.00217817 -245.354 43.3841 4.34237 8.69049 4.12453 -2.25192 0.662588 -1.24887 1.18461 -0.31139 3.78732e-13 0.31139 -1.18461 1.24887 -0.662588 2.25192 -4.12453 -8.69049 -4.34237 -43.3841 country
260+0.0629253 0.374025 0.00147659 -267.396 38.3337 12.621 11.2614 6.19257 1.04002 0.65638 -0.724865 0.724749 -0.049905 4.01804e-13 0.049905 -0.724749 0.724865 -0.65638 -1.04002 -6.19257 -11.2614 -12.621 -38.3337 country
261+0.0620577 0.311594 0.00177383 -260.794 41.5069 9.77028 8.19606 4.30891 0.970039 1.60647 0.0210585 1.79236 0.293201 3.98099e-13 -0.293201 -1.79236 -0.0210585 -1.60647 -0.970039 -4.30891 -8.19606 -9.77028 -41.5069 country
262+0.0713365 0.339535 0.00118816 -264.131 39.9348 9.60228 7.48354 4.49813 1.42551 0.705861 -1.9165 -0.170641 0.339083 4.01839e-13 -0.339083 0.170641 1.9165 -0.705861 -1.42551 -4.49813 -7.48354 -9.60228 -39.9348 country
263+0.111658 0.63066 0.00170673 -242.217 40.9979 0.0604274 5.65721 2.16364 -1.43698 2.10741 -2.06832 0.679328 -0.696309 3.7295e-13 0.696309 -0.679328 2.06832 -2.10741 1.43698 -2.16364 -5.65721 -0.0604274 -40.9979 country
264+0.083517 0.464871 0.00170042 -256.264 39.5507 8.43478 9.16209 3.32069 -0.60606 1.69572 -1.59043 1.43642 0.628418 3.89291e-13 -0.628418 -1.43642 1.59043 -1.69572 0.60606 -3.32069 -9.16209 -8.43478 -39.5507 country
265+0.0766158 0.430277 0.00100185 -263.15 41.2104 6.16131 2.85317 2.74345 0.820066 1.07033 -1.72757 -0.372876 0.321299 4.03757e-13 -0.321299 0.372876 1.72757 -1.07033 -0.820066 -2.74345 -2.85317 -6.16131 -41.2104 country
266+0.0389854 0.3691 0.00134663 -271.987 43.0179 15.0367 5.18837 3.65004 1.46684 1.02689 0.610957 0.210723 -0.313843 4.1563e-13 0.313843 -0.210723 -0.610957 -1.02689 -1.46684 -3.65004 -5.18837 -15.0367 -43.0179 country
267+0.0904836 0.620015 0.00189002 -241.172 49.0483 -4.82301 -3.4228 5.38477 -0.618295 0.174491 -0.553901 1.40623 -1.4975 3.83929e-13 1.4975 -1.40623 0.553901 -0.174491 0.618295 -5.38477 3.4228 4.82301 -49.0483 country
268+0.0493523 0.461782 0.000823041 -278.735 36.8392 13.778 6.10776 4.77932 1.23795 -0.736709 0.445064 1.44019 0.131855 4.16868e-13 -0.131855 -1.44019 -0.445064 0.736709 -1.23795 -4.77932 -6.10776 -13.778 -36.8392 country
269+0.0638598 0.541688 0.00102573 -267.316 43.2237 8.6272 -0.167512 1.31555 1.14508 1.33262 1.19194 1.43583 0.366499 4.12166e-13 -0.366499 -1.43583 -1.19194 -1.33262 -1.14508 -1.31555 0.167512 -8.6272 -43.2237 country
270+0.0702157 0.436383 0.00107155 -263.352 41.1941 1.50413 0.860807 7.31416 2.81415 0.554267 0.0928814 0.418936 -0.0698595 4.04812e-13 0.0698595 -0.418936 -0.0928814 -0.554267 -2.81415 -7.31416 -0.860807 -1.50413 -41.1941 country
271+0.0957562 0.602538 0.00156842 -248.417 44.1718 -0.596769 2.66751 4.81811 -0.532005 2.10893 -0.418658 0.562204 -0.988486 3.85979e-13 0.988486 -0.562204 0.418658 -2.10893 0.532005 -4.81811 -2.66751 0.596769 -44.1718 country
272+0.0662922 0.471346 0.00141625 -258.514 46.0397 7.70937 1.22763 3.13299 0.882683 0.0280376 -0.80112 0.273443 -0.740726 4.02799e-13 0.740726 -0.273443 0.80112 -0.0280376 -0.882683 -3.13299 -1.22763 -7.70937 -46.0397 country
273+0.0895146 0.589421 0.00182203 -246.332 46.2869 0.16115 2.32145 2.99526 -2.80123 -0.138421 -0.737141 1.88072 0.251013 3.86263e-13 -0.251013 -1.88072 0.737141 0.138421 2.80123 -2.99526 -2.32145 -0.16115 -46.2869 country
274+0.0762033 0.470952 0.001155 -260.14 43.0314 4.95063 2.72852 3.75248 0.534658 1.17811 0.452291 1.09375 -0.372568 4.00804e-13 0.372568 -1.09375 -0.452291 -1.17811 -0.534658 -3.75248 -2.72852 -4.95063 -43.0314 country
275+0.0575454 0.386834 0.000482238 -280.388 33.0331 10.0067 3.13321 2.23051 1.23486 1.37454 0.859984 0.459887 -0.392122 4.15391e-13 0.392122 -0.459887 -0.859984 -1.37454 -1.23486 -2.23051 -3.13321 -10.0067 -33.0331 country
276+0.113438 0.594304 0.00215708 -233.983 41.408 -3.16504 3.84572 0.399345 -1.94069 5.8471 0.197635 2.59673 -0.614429 3.62039e-13 0.614429 -2.59673 -0.197635 -5.8471 1.94069 -0.399345 -3.84572 3.16504 -41.408 country
277+0.0725184 0.596467 0.00179039 -251.025 48.1983 2.18161 -0.0659999 5.34743 -0.827759 0.0359457 -0.707835 0.409807 -0.388412 3.95731e-13 0.388412 -0.409807 0.707835 -0.0359457 0.827759 -5.34743 0.0659999 -2.18161 -48.1983 country
278+0.0728157 0.597147 0.00152838 -250.159 50.2672 0.936553 -3.14004 2.4836 -1.18078 -1.17194 0.400537 2.0097 -0.695641 3.978e-13 0.695641 -2.0097 -0.400537 1.17194 1.18078 -2.4836 3.14004 -0.936553 -50.2672 country
279+0.0655432 0.412183 0.000386999 -283.265 31.1981 9.34359 2.51317 1.8099 -0.161706 0.443075 1.35181 1.14582 0.310702 4.1729e-13 -0.310702 -1.14582 -1.35181 -0.443075 0.161706 -1.8099 -2.51317 -9.34359 -31.1981 country
280+0.0469483 0.438759 0.00149128 -264.948 46.0704 14.7149 3.87929 1.43155 -0.167389 0.341766 -0.566788 0.0558883 -0.354725 4.10122e-13 0.354725 -0.0558883 0.566788 -0.341766 0.167389 -1.43155 -3.87929 -14.7149 -46.0704 country
281+0.10381 0.597911 0.00192499 -243.223 41.8726 1.13323 4.9054 4.00425 1.41577 2.49516 -1.24293 1.82164 -1.53735 3.75102e-13 1.53735 -1.82164 1.24293 -2.49516 -1.41577 -4.00425 -4.9054 -1.13323 -41.8726 country
282+0.103026 0.594167 0.00194449 -240.537 43.8568 -1.97799 3.78873 5.14664 0.781438 1.60931 -2.24339 0.815227 -1.47455 3.74809e-13 1.47455 -0.815227 2.24339 -1.60931 -0.781438 -5.14664 -3.78873 1.97799 -43.8568 country
283+0.118434 0.644818 0.00230366 -232.545 42.3915 -3.86891 4.9296 4.97493 0.697511 2.15677 -2.82362 0.748685 -2.5862 3.60979e-13 2.5862 -0.748685 2.82362 -2.15677 -0.697511 -4.97493 -4.9296 3.86891 -42.3915 country
284+0.0624082 0.417695 0.00154208 -258.77 45.4397 6.44927 2.9684 5.73046 2.44389 0.312761 -1.40399 -0.10293 -0.994685 4.0218e-13 0.994685 0.10293 1.40399 -0.312761 -2.44389 -5.73046 -2.9684 -6.44927 -45.4397 country
285+0.0975952 0.551144 0.00201971 -241.298 45.0804 -1.9967 4.69905 7.26356 0.328505 0.545571 -2.49734 0.152704 -1.57682 3.76999e-13 1.57682 -0.152704 2.49734 -0.545571 -0.328505 -7.26356 -4.69905 1.9967 -45.0804 country
286+0.0805416 0.426626 0.00172119 -251.581 44.2543 1.40498 2.85199 6.01757 1.83453 1.1618 -1.01942 0.765294 -1.16567 3.90753e-13 1.16567 -0.765294 1.01942 -1.1618 -1.83453 -6.01757 -2.85199 -1.40498 -44.2543 country
287+0.10117 0.626316 0.00206209 -237.975 45.2286 -2.14858 3.3436 4.02599 0.633828 2.11539 -2.11642 0.681347 -1.64066 3.73136e-13 1.64066 -0.681347 2.11642 -2.11539 -0.633828 -4.02599 -3.3436 2.14858 -45.2286 country
288+0.0780536 0.509228 0.0010061 -262.535 42.0375 4.98187 1.41115 3.22331 0.556919 0.503031 -0.350784 0.181878 -0.997175 4.03032e-13 0.997175 -0.181878 0.350784 -0.503031 -0.556919 -3.22331 -1.41115 -4.98187 -42.0375 country
289+0.0834442 0.515613 0.00210937 -243.979 47.2476 0.406894 3.00172 5.00936 0.257885 0.0558164 -1.8345 0.683645 -1.27639 3.83989e-13 1.27639 -0.683645 1.8345 -0.0558164 -0.257885 -5.00936 -3.00172 -0.406894 -47.2476 country
290+0.0692331 0.481246 0.000921267 -268.336 40.8554 8.99325 2.78357 3.56781 1.39653 -0.303507 -0.268045 0.542976 -0.743256 4.09046e-13 0.743256 -0.542976 0.268045 0.303507 -1.39653 -3.56781 -2.78357 -8.99325 -40.8554 country
291+0.0998453 0.533984 0.00222468 -236.559 45.7925 -3.19352 3.02321 5.47052 0.640555 1.44114 -1.96961 1.13437 -1.83383 3.7173e-13 1.83383 -1.13437 1.96961 -1.44114 -0.640555 -5.47052 -3.02321 3.19352 -45.7925 country
292+0.0803855 0.493746 0.000885114 -264.551 40.7402 4.38341 1.85262 4.57219 -0.0361965 -0.606529 -0.654296 -0.0789596 -0.774002 4.04142e-13 0.774002 0.0789596 0.654296 0.606529 0.0361965 -4.57219 -1.85262 -4.38341 -40.7402 country
293+0.121164 0.586821 0.00241645 -228.145 43.1938 -6.43266 5.43266 6.45871 -1.41416 3.10718 -3.23048 0.622222 -1.75227 3.5579e-13 1.75227 -0.622222 3.23048 -3.10718 1.41416 -6.45871 -5.43266 6.43266 -43.1938 country
294+0.0760324 0.404049 0.00134054 -258.958 45.4404 5.08224 2.31039 5.23939 -1.33083 -2.98423 -0.856791 1.28024 -0.28713 4.02107e-13 0.28713 -1.28024 0.856791 2.98423 1.33083 -5.23939 -2.31039 -5.08224 -45.4404 country
295+0.0840165 0.488617 0.00247283 -243.556 47.0583 0.532322 3.77795 6.27065 0.996127 1.50832 -1.27535 1.46026 -0.825022 3.82954e-13 0.825022 -1.46026 1.27535 -1.50832 -0.996127 -6.27065 -3.77795 -0.532322 -47.0583 country
296+0.0784589 0.463471 0.00234147 -246.238 48.0182 1.78373 2.99372 5.87458 0.559002 0.589766 -1.23606 1.32358 -0.46044 3.88277e-13 0.46044 -1.32358 1.23606 -0.589766 -0.559002 -5.87458 -2.99372 -1.78373 -48.0182 country
297+0.0887174 0.464305 0.00259823 -235.613 49.1701 -3.21491 0.102148 4.81017 1.67168 2.07984 -1.14386 2.08216 -0.862696 3.76481e-13 0.862696 -2.08216 1.14386 -2.07984 -1.67168 -4.81017 -0.102148 3.21491 -49.1701 country
298+0.0724307 0.407724 0.0017913 -254.961 45.6153 4.07076 2.40372 5.7317 1.92393 0.1983 -0.9828 0.585168 -1.41264 3.96894e-13 1.41264 -0.585168 0.9828 -0.1983 -1.92393 -5.7317 -2.40372 -4.07076 -45.6153 country
299+0.068359 0.416314 0.00197312 -251.443 48.7638 3.53479 2.67207 6.69219 1.17838 -0.683569 -1.51619 0.2082 -0.925876 3.96439e-13 0.925876 -0.2082 1.51619 0.683569 -1.17838 -6.69219 -2.67207 -3.53479 -48.7638 country
300+0.111173 0.586725 0.002754 -231.041 42.9167 -2.37299 5.99115 4.56066 -0.207312 2.69154 -1.69825 1.95088 -1.41859 3.59453e-13 1.41859 -1.95088 1.69825 -2.69154 0.207312 -4.56066 -5.99115 2.37299 -42.9167 country
301+0.130037 0.561536 0.00163028 -252.133 34.8032 5.7248 7.61056 1.69665 1.04575 2.56838 0.589474 -0.194301 0.103525 3.79567e-13 -0.103525 0.194301 -0.589474 -2.56838 -1.04575 -1.69665 -7.61056 -5.7248 -34.8032 disco
302+0.166422 0.790447 0.00241474 -222.696 33.8385 -6.36761 2.01013 1.07096 1.78078 3.05401 1.2656 1.74984 -0.787703 3.40532e-13 0.787703 -1.74984 -1.2656 -3.05401 -1.78078 -1.07096 -2.01013 6.36761 -33.8385 disco
303+0.18566 0.626626 0.00203902 -229.013 28.9447 3.39732 6.79285 -0.0619542 5.53705 -0.163381 0.266886 -0.382074 0.132175 3.44475e-13 -0.132175 0.382074 -0.266886 0.163381 -5.53705 0.0619542 -6.79285 -3.39732 -28.9447 disco
304+0.160436 0.620093 0.00262503 -222.739 32.0244 -7.29739 6.2718 5.80651 1.18506 4.33003 -0.0718605 1.85566 -0.455561 3.36291e-13 0.455561 -1.85566 0.0718605 -4.33003 -1.18506 -5.80651 -6.2718 7.29739 -32.0244 disco
305+0.181767 0.686268 0.00124289 -243.089 30.8324 1.30006 5.35866 -1.20494 1.31416 -0.265499 1.20877 0.00563718 0.346831 3.64906e-13 -0.346831 -0.00563718 -1.20877 0.265499 -1.31416 1.20494 -5.35866 -1.30006 -30.8324 disco
306+0.148745 0.652888 0.00277655 -221.1 36.1816 -6.04322 4.17293 3.75579 1.26577 0.939814 -0.61312 2.11251 -0.443749 3.4062e-13 0.443749 -2.11251 0.61312 -0.939814 -1.26577 -3.75579 -4.17293 6.04322 -36.1816 disco
307+0.152125 0.735549 0.0023259 -225.851 36.2817 -7.8361 4.6482 5.29637 -0.319199 2.28101 -0.425304 2.01074 -0.76653 3.45793e-13 0.76653 -2.01074 0.425304 -2.28101 0.319199 -5.29637 -4.6482 7.8361 -36.2817 disco
308+0.164224 0.668035 0.00198415 -230.561 33.2075 -3.86848 6.24651 3.53457 0.654817 1.97805 0.574503 0.595973 -0.209459 3.49239e-13 0.209459 -0.595973 -0.574503 -1.97805 -0.654817 -3.53457 -6.24651 3.86848 -33.2075 disco
309+0.152909 0.798361 0.00247318 -225.124 35.6988 -9.82402 0.586739 3.19475 1.54471 2.43153 -0.52666 1.68359 -0.594209 3.46735e-13 0.594209 -1.68359 0.52666 -2.43153 -1.54471 -3.19475 -0.586739 9.82402 -35.6988 disco
310+0.155742 0.683069 0.00140267 -239.106 34.2869 -5.29817 2.3688 4.42266 3.25712 2.07848 -0.770391 0.193178 -0.102399 3.64356e-13 0.102399 -0.193178 0.770391 -2.07848 -3.25712 -4.42266 -2.3688 5.29817 -34.2869 disco
311+0.155539 0.694374 0.00299523 -219.873 34.3495 -6.42381 3.5424 2.4951 2.05831 2.98846 0.730306 1.79531 -0.233943 3.37396e-13 0.233943 -1.79531 -0.730306 -2.98846 -2.05831 -2.4951 -3.5424 6.42381 -34.3495 disco
312+0.167577 0.672102 0.00250109 -226.218 32.6033 0.917584 6.5448 -0.420592 2.26915 2.61957 0.912803 2.08359 0.895582 3.43603e-13 -0.895582 -2.08359 -0.912803 -2.61957 -2.26915 0.420592 -6.5448 -0.917584 -32.6033 disco
313+0.145358 0.730396 0.00221841 -232.818 35.8178 -5.03685 1.91782 1.79812 2.45642 2.56359 0.135983 1.58886 -0.892255 3.5663e-13 0.892255 -1.58886 -0.135983 -2.56359 -2.45642 -1.79812 -1.91782 5.03685 -35.8178 disco
314+0.182581 0.644631 0.00206272 -228.57 29.0527 0.429337 9.95543 3.02505 1.54656 0.563008 0.209202 -0.0876773 0.0264276 3.41061e-13 -0.0264276 0.0876773 -0.209202 -0.563008 -1.54656 -3.02505 -9.95543 -0.429337 -29.0527 disco
315+0.1628 0.61493 0.00220981 -224.596 33.1832 -3.48045 6.07486 2.50719 0.966909 0.957287 0.379406 1.97487 -0.482791 3.4087e-13 0.482791 -1.97487 -0.379406 -0.957287 -0.966909 -2.50719 -6.07486 3.48045 -33.1832 disco
316+0.110842 0.568104 0.00299148 -232.468 42.8465 8.71154 6.18892 -2.9154 0.76995 0.1661 2.15907 1.032 -0.107983 3.63773e-13 0.107983 -1.032 -2.15907 -0.1661 -0.76995 2.9154 -6.18892 -8.71154 -42.8465 disco
317+0.133289 0.665491 0.00282632 -225.825 39.0772 -3.52344 3.67737 2.94072 1.48979 0.950879 -1.0785 0.978123 -0.198316 3.51282e-13 0.198316 -0.978123 1.0785 -0.950879 -1.48979 -2.94072 -3.67737 3.52344 -39.0772 disco
318+0.132686 0.681458 0.00142537 -245.804 38.1364 3.33182 4.06902 1.33898 1.95752 -0.287295 -0.485595 -0.210484 -0.352652 3.77003e-13 0.352652 0.210484 0.485595 0.287295 -1.95752 -1.33898 -4.06902 -3.33182 -38.1364 disco
319+0.16792 0.741365 0.00147071 -240.535 31.9299 2.28133 4.03608 -3.24434 1.757 2.4388 0.437955 0.656375 -0.631187 3.61748e-13 0.631187 -0.656375 -0.437955 -2.4388 -1.757 3.24434 -4.03608 -2.28133 -31.9299 disco
320+0.0891495 0.580173 0.00154439 -256.929 39.662 5.75243 0.629861 2.88805 6.24535 3.63076 0.628381 0.282218 0.360761 3.95762e-13 -0.360761 -0.282218 -0.628381 -3.63076 -6.24535 -2.88805 -0.629861 -5.75243 -39.662 disco
321+0.107862 0.671558 0.00161694 -242.818 42.5935 -1.09806 4.21396 4.22623 -1.27362 1.7067 -0.907766 0.649774 -0.824695 3.76092e-13 0.824695 -0.649774 0.907766 -1.7067 1.27362 -4.22623 -4.21396 1.09806 -42.5935 disco
322+0.146152 0.670529 0.00132297 -249.127 35.0298 4.1071 2.79763 -1.80774 2.21417 0.240996 1.04965 0.863302 -0.206613 3.78074e-13 0.206613 -0.863302 -1.04965 -0.240996 -2.21417 1.80774 -2.79763 -4.1071 -35.0298 disco
323+0.186814 0.680992 0.00166165 -238.605 27.769 0.628287 9.43682 4.74959 3.96924 0.0400889 0.602644 0.0179407 -0.262235 3.53607e-13 0.262235 -0.0179407 -0.602644 -0.0400889 -3.96924 -4.74959 -9.43682 -0.628287 -27.769 disco
324+0.158203 0.629629 0.00237909 -229.04 33.3694 -0.306989 6.3815 2.00422 2.41595 0.482534 0.0472845 0.64357 -0.518809 3.47844e-13 0.518809 -0.64357 -0.0472845 -0.482534 -2.41595 -2.00422 -6.3815 0.306989 -33.3694 disco
325+0.128468 0.643128 0.00174143 -239.349 40.3164 -0.632945 -0.382888 -0.487121 2.22279 -0.133788 0.34199 1.15014 0.269637 3.73197e-13 -0.269637 -1.15014 -0.34199 0.133788 -2.22279 0.487121 0.382888 0.632945 -40.3164 disco
326+0.121261 0.674186 0.00128441 -252.766 38.3437 3.21022 3.48357 2.04321 1.32337 -0.490761 0.17899 0.149483 -0.516403 3.86188e-13 0.516403 -0.149483 -0.17899 0.490761 -1.32337 -2.04321 -3.48357 -3.21022 -38.3437 disco
327+0.144407 0.666081 0.00188247 -239.262 34.5006 1.88011 6.03494 1.15948 2.75807 1.64342 0.723114 0.75772 -0.505274 3.62846e-13 0.505274 -0.75772 -0.723114 -1.64342 -2.75807 -1.15948 -6.03494 -1.88011 -34.5006 disco
328+0.148357 0.612521 0.0013706 -265.469 25.7304 6.45322 10.3591 5.88287 6.07949 3.28996 1.91493 0.357502 0.279921 3.86652e-13 -0.279921 -0.357502 -1.91493 -3.28996 -6.07949 -5.88287 -10.3591 -6.45322 -25.7304 disco
329+0.195517 0.685017 0.00217404 -223.915 28.0985 0.0394376 5.01961 -0.823631 4.49203 1.51907 0.556553 0.367658 0.467351 3.36813e-13 -0.467351 -0.367658 -0.556553 -1.51907 -4.49203 0.823631 -5.01961 -0.0394376 -28.0985 disco
330+0.154971 0.774661 0.00165832 -235.461 35.2782 -0.960548 2.75705 -0.0591404 2.16909 -0.516585 2.52284 0.705862 -0.538887 3.60419e-13 0.538887 -0.705862 -2.52284 0.516585 -2.16909 0.0591404 -2.75705 0.960548 -35.2782 disco
331+0.16511 0.654435 0.00220666 -227.144 32.4696 -1.81344 5.06462 1.44547 3.9274 1.66146 1.21906 0.446074 0.826238 3.4663e-13 -0.826238 -0.446074 -1.21906 -1.66146 -3.9274 -1.44547 -5.06462 1.81344 -32.4696 disco
332+0.171522 0.731226 0.00160351 -233.819 34.4898 -4.71062 2.33324 1.73664 1.23388 -0.0642772 0.823491 -0.280917 -0.847625 3.57024e-13 0.847625 0.280917 -0.823491 0.0642772 -1.23388 -1.73664 -2.33324 4.71062 -34.4898 disco
333+0.125213 0.721657 0.0015092 -245.793 39.4017 -1.42259 -1.09482 -0.878015 1.44769 2.60363 0.751216 0.563357 -0.289771 3.79863e-13 0.289771 -0.563357 -0.751216 -2.60363 -1.44769 0.878015 1.09482 1.42259 -39.4017 disco
334+0.120957 0.577214 0.00199118 -236.843 40.6082 -2.71653 3.71477 4.4706 1.07332 1.35973 -1.61666 0.427864 -0.670871 3.67122e-13 0.670871 -0.427864 1.61666 -1.35973 -1.07332 -4.4706 -3.71477 2.71653 -40.6082 disco
335+0.203113 0.73328 0.00137681 -235.405 27.171 1.49128 8.05408 0.109376 2.55811 -0.0147447 -0.338058 -0.430496 -0.891012 3.48418e-13 0.891012 0.430496 0.338058 0.0147447 -2.55811 -0.109376 -8.05408 -1.49128 -27.171 disco
336+0.194096 0.744204 0.00195395 -228.845 29.0151 0.175297 5.24919 0.0906951 4.05763 0.433224 0.397056 0.29219 0.74141 3.44698e-13 -0.74141 -0.29219 -0.397056 -0.433224 -4.05763 -0.0906951 -5.24919 -0.175297 -29.0151 disco
337+0.17294 0.687165 0.00217624 -225.687 31.0992 -0.476754 6.94245 0.65909 1.33148 0.842877 0.704773 0.986455 0.0534448 3.40493e-13 -0.0534448 -0.986455 -0.704773 -0.842877 -1.33148 -0.65909 -6.94245 0.476754 -31.0992 disco
338+0.191526 0.683736 0.00225019 -221.097 28.8341 -2.13542 3.79974 -0.193569 5.0278 1.07265 0.868545 0.278337 0.387631 3.34752e-13 -0.387631 -0.278337 -0.868545 -1.07265 -5.0278 0.193569 -3.79974 2.13542 -28.8341 disco
339+0.161681 0.654225 0.00143507 -238.76 34.5856 -2.61086 1.60259 -0.238706 1.2138 -0.964338 1.22576 1.76055 0.961372 3.65132e-13 -0.961372 -1.76055 -1.22576 0.964338 -1.2138 0.238706 -1.60259 2.61086 -34.5856 disco
340+0.115831 0.594453 0.00153729 -244.154 41.6049 -1.32833 2.21229 3.02438 -1.55863 -1.37911 1.11022 1.60044 1.35398 3.79745e-13 -1.35398 -1.60044 -1.11022 1.37911 1.55863 -3.02438 -2.21229 1.32833 -41.6049 disco
341+0.137126 0.745025 0.00175585 -240.639 37.8224 -2.4698 3.787 1.97559 -1.64815 1.40358 2.22722 1.06282 -0.568249 3.67991e-13 0.568249 -1.06282 -2.22722 -1.40358 1.64815 -1.97559 -3.787 2.4698 -37.8224 disco
342+0.0736916 0.421416 0.00221625 -255.279 43.9253 12.6934 7.77653 2.74656 1.88158 -0.275251 -0.132823 -0.242575 0.0115105 3.9501e-13 -0.0115105 0.242575 0.132823 0.275251 -1.88158 -2.74656 -7.77653 -12.6934 -43.9253 disco
343+0.138734 0.613888 0.00210243 -226.179 39.9006 -7.14345 0.0843826 1.18909 -0.290586 -0.299349 -1.96163 0.337472 -0.159365 3.54172e-13 0.159365 -0.337472 1.96163 0.299349 0.290586 -1.18909 -0.0843826 7.14345 -39.9006 disco
344+0.145098 0.705388 0.00230649 -229.842 37.3262 -3.2477 2.72784 2.61457 0.00159053 -0.919744 0.628464 0.353255 -0.684016 3.54382e-13 0.684016 -0.353255 -0.628464 0.919744 -0.00159053 -2.61457 -2.72784 3.2477 -37.3262 disco
345+0.118073 0.685028 0.00195219 -236.282 43.1095 -2.48307 -0.328148 1.47641 0.991005 -1.02094 -0.46913 0.164387 -0.356268 3.71917e-13 0.356268 -0.164387 0.46913 1.02094 -0.991005 -1.47641 0.328148 2.48307 -43.1095 disco
346+0.110721 0.639854 0.00167299 -242.861 42.133 0.3759 1.86401 2.1374 0.310207 0.518133 0.464648 0.660484 0.255771 3.78345e-13 -0.255771 -0.660484 -0.464648 -0.518133 -0.310207 -2.1374 -1.86401 -0.3759 -42.133 disco
347+0.11853 0.737699 0.00130576 -250.067 37.8931 -0.567249 3.71304 2.00591 -0.703506 1.59124 -0.68623 2.02082 -0.794979 3.80066e-13 0.794979 -2.02082 0.68623 -1.59124 0.703506 -2.00591 -3.71304 0.567249 -37.8931 disco
348+0.0882636 0.560995 0.000428304 -279.749 34.3096 10.4583 3.68616 3.53834 0.800391 -1.9615 -2.53144 -1.44817 -1.10362 4.16087e-13 1.10362 1.44817 2.53144 1.9615 -0.800391 -3.53834 -3.68616 -10.4583 -34.3096 disco
349+0.143372 0.710491 0.00133191 -244.68 34.6944 -8.07023 2.96861 6.56349 1.20566 3.50048 -1.5247 1.7868 -0.538804 3.69962e-13 0.538804 -1.7868 1.5247 -3.50048 -1.20566 -6.56349 -2.96861 8.07023 -34.6944 disco
350+0.138437 0.668437 0.00256208 -226.429 37.4419 -5.79553 4.85101 3.54742 -1.51397 2.99296 -1.60418 1.92102 -1.81994 3.46264e-13 1.81994 -1.92102 1.60418 -2.99296 1.51397 -3.54742 -4.85101 5.79553 -37.4419 disco
351+0.126586 0.658239 0.00209023 -230.727 40.0904 -5.64962 2.74904 1.03341 -1.57168 3.81444 -1.44803 2.19789 -1.03897 3.56723e-13 1.03897 -2.19789 1.44803 -3.81444 1.57168 -1.03341 -2.74904 5.64962 -40.0904 disco
352+0.141505 0.671828 0.00136927 -238.412 36.4758 -6.81914 2.98802 1.76343 -1.96776 3.3242 -1.33914 2.00035 -0.913732 3.62609e-13 0.913732 -2.00035 1.33914 -3.3242 1.96776 -1.76343 -2.98802 6.81914 -36.4758 disco
353+0.13699 0.763095 0.00149268 -236.452 38.6215 -7.26057 1.13738 0.934436 -0.898676 3.4078 -3.02956 1.69677 -0.631272 3.64042e-13 0.631272 -1.69677 3.02956 -3.4078 0.898676 -0.934436 -1.13738 7.26057 -38.6215 disco
354+0.188338 0.66527 0.00177947 -259.837 16.9577 5.8418 16.9709 5.60645 4.7637 8.57176 -0.247029 3.76813 0.308649 3.63347e-13 -0.308649 -3.76813 0.247029 -8.57176 -4.7637 -5.60645 -16.9709 -5.8418 -16.9577 disco
355+0.133255 0.65821 0.000678331 -267.551 29.9285 2.98827 8.42149 6.33233 2.01826 0.88585 -0.809576 1.47366 -0.489611 3.93006e-13 0.489611 -1.47366 0.809576 -0.88585 -2.01826 -6.33233 -8.42149 -2.98827 -29.9285 disco
356+0.110063 0.584714 0.00154351 -245.066 38.8845 -4.77039 3.96642 5.67387 -0.0633974 3.53219 -0.121136 1.84588 -0.501778 3.74782e-13 0.501778 -1.84588 0.121136 -3.53219 0.0633974 -5.67387 -3.96642 4.77039 -38.8845 disco
357+0.087823 0.64834 0.000880493 -264.005 38.9935 4.72298 2.45724 2.0952 1.05419 2.30585 0.197061 0.877949 -0.186018 4.01489e-13 0.186018 -0.877949 -0.197061 -2.30585 -1.05419 -2.0952 -2.45724 -4.72298 -38.9935 disco
358+0.102327 0.646789 0.00100577 -254.034 41.7848 0.449609 0.575245 -0.846407 -2.25711 1.34768 -0.804535 0.582502 -1.04468 3.91105e-13 1.04468 -0.582502 0.804535 -1.34768 2.25711 0.846407 -0.575245 -0.449609 -41.7848 disco
359+0.121147 0.660377 0.0015703 -244.849 37.543 -1.96608 5.196 3.87049 0.465269 3.2549 -1.35246 1.31593 -1.19191 3.72141e-13 1.19191 -1.31593 1.35246 -3.2549 -0.465269 -3.87049 -5.196 1.96608 -37.543 disco
360+0.123209 0.701793 0.00156475 -243.857 38.5516 -1.53891 1.2593 -1.89542 -2.01614 1.63708 -1.34964 2.00538 -0.328107 3.73739e-13 0.328107 -2.00538 1.34964 -1.63708 2.01614 1.89542 -1.2593 1.53891 -38.5516 disco
361+0.101458 0.553029 0.00139405 -249.656 39.5813 -0.541711 4.05169 4.21405 1.15634 3.5869 -0.108682 1.64116 -0.448984 3.82115e-13 0.448984 -1.64116 0.108682 -3.5869 -1.15634 -4.21405 -4.05169 0.541711 -39.5813 disco
362+0.148637 0.783988 0.00214544 -236.603 34.0422 3.81456 9.79728 1.09478 -0.812716 1.63258 -2.45772 2.40925 -1.09311 3.54548e-13 1.09311 -2.40925 2.45772 -1.63258 0.812716 -1.09478 -9.79728 -3.81456 -34.0422 disco
363+0.123015 0.701021 0.00189271 -243.59 37.6247 -5.91 2.40399 3.95586 0.543943 3.96711 -0.863126 2.35698 0.118057 3.72525e-13 -0.118057 -2.35698 0.863126 -3.96711 -0.543943 -3.95586 -2.40399 5.91 -37.6247 disco
364+0.130655 0.682501 0.00376111 -231.989 34.0981 -1.85877 9.64105 5.91601 2.80001 5.39079 -0.160697 3.3735 -0.427473 3.49634e-13 0.427473 -3.3735 0.160697 -5.39079 -2.80001 -5.91601 -9.64105 1.85877 -34.0981 disco
365+0.104554 0.582759 0.00122606 -256.058 36.7437 0.779622 3.95445 2.77635 1.42478 4.62892 0.977728 2.09475 -0.672787 3.86787e-13 0.672787 -2.09475 -0.977728 -4.62892 -1.42478 -2.77635 -3.95445 -0.779622 -36.7437 disco
366+0.0844396 0.556356 0.00218556 -252.751 39.2166 5.57878 9.02433 3.93637 1.28102 5.18606 -0.972174 1.10694 0.115131 3.84217e-13 -0.115131 -1.10694 0.972174 -5.18606 -1.28102 -3.93637 -9.02433 -5.57878 -39.2166 disco
367+0.136001 0.740964 0.00198691 -234.316 36.7978 -4.05218 4.48711 2.54815 -0.391537 3.32808 -1.40234 2.25956 -1.15826 3.56985e-13 1.15826 -2.25956 1.40234 -3.32808 0.391537 -2.54815 -4.48711 4.05218 -36.7978 disco
368+0.142446 0.671878 0.00139846 -235.339 38.3098 -8.68353 1.4454 1.94359 -2.48947 2.12106 -2.77753 0.890051 -1.05465 3.61629e-13 1.05465 -0.890051 2.77753 -2.12106 2.48947 -1.94359 -1.4454 8.68353 -38.3098 disco
369+0.154849 0.69711 0.00146007 -235.084 34.4432 -6.13529 4.8189 2.7771 -0.484161 2.74908 -1.61195 2.23392 -0.897673 3.55527e-13 0.897673 -2.23392 1.61195 -2.74908 0.484161 -2.7771 -4.8189 6.13529 -34.4432 disco
370+0.106013 0.567209 0.00141353 -251.629 38.7609 1.73797 7.27822 2.17108 -2.06868 3.34747 -1.56913 -0.38029 -1.21769 3.81567e-13 1.21769 0.38029 1.56913 -3.34747 2.06868 -2.17108 -7.27822 -1.73797 -38.7609 disco
371+0.130775 0.655936 0.00143425 -240.234 38.1191 -4.50998 3.52046 1.56108 -1.27237 3.41248 -1.13731 1.92526 -0.861378 3.67094e-13 0.861378 -1.92526 1.13731 -3.41248 1.27237 -1.56108 -3.52046 4.50998 -38.1191 disco
372+0.149755 0.67689 0.00124292 -244.047 33.0653 -3.34608 5.87097 2.15905 0.144012 2.74921 -2.34683 2.14683 -0.555233 3.65873e-13 0.555233 -2.14683 2.34683 -2.74921 -0.144012 -2.15905 -5.87097 3.34608 -33.0653 disco
373+0.153344 0.719561 0.00110844 -245.662 32.3708 -6.40124 4.28157 3.6553 -0.741514 3.35736 0.315131 1.62534 -1.43273 3.66784e-13 1.43273 -1.62534 -0.315131 -3.35736 0.741514 -3.6553 -4.28157 6.40124 -32.3708 disco
374+0.145973 0.646813 0.00120481 -240.756 34.989 -4.73203 3.81757 1.49641 0.114903 2.76006 -2.73978 1.92037 -0.901378 3.6439e-13 0.901378 -1.92037 2.73978 -2.76006 -0.114903 -1.49641 -3.81757 4.73203 -34.989 disco
375+0.145981 0.655152 0.00216065 -228.163 36.5026 -5.12109 4.94697 1.39157 -1.42487 2.86367 -2.71016 2.10498 -1.34041 3.47999e-13 1.34041 -2.10498 2.71016 -2.86367 1.42487 -1.39157 -4.94697 5.12109 -36.5026 disco
376+0.142653 0.697861 0.00147078 -239.113 35.699 -4.39779 5.50997 2.39709 -0.547291 4.18996 -1.2201 2.19545 -0.884491 3.61905e-13 0.884491 -2.19545 1.2201 -4.18996 0.547291 -2.39709 -5.50997 4.39779 -35.699 disco
377+0.124489 0.694198 0.00148967 -239.456 39.9577 -6.15771 0.493355 0.735065 -2.71429 1.13237 -2.53094 1.62489 -1.38578 3.68851e-13 1.38578 -1.62489 2.53094 -1.13237 2.71429 -0.735065 -0.493355 6.15771 -39.9577 disco
378+0.11936 0.598513 0.00248204 -232.269 39.7242 -4.83738 4.13289 4.62464 1.19885 4.65145 -2.2216 2.06094 0.419771 3.59738e-13 -0.419771 -2.06094 2.2216 -4.65145 -1.19885 -4.62464 -4.13289 4.83738 -39.7242 disco
379+0.117254 0.618378 0.000756188 -266.24 35.6346 6.24595 1.8753 -2.38484 -1.02846 -0.581734 -2.03108 1.35132 -0.764482 3.99706e-13 0.764482 -1.35132 2.03108 0.581734 1.02846 2.38484 -1.8753 -6.24595 -35.6346 disco
380+0.125518 0.631477 0.00106452 -256.937 33.2154 1.01047 6.56119 3.50218 1.08905 3.48188 -0.764749 1.68553 -0.315154 3.83203e-13 0.315154 -1.68553 0.764749 -3.48188 -1.08905 -3.50218 -6.56119 -1.01047 -33.2154 disco
381+0.108704 0.56226 0.000735104 -270.619 31.8333 7.13296 9.66394 5.35728 1.4874 1.29766 -1.51235 0.857964 0.148123 3.99321e-13 -0.148123 -0.857964 1.51235 -1.29766 -1.4874 -5.35728 -9.66394 -7.13296 -31.8333 disco
382+0.115766 0.710653 0.00107674 -256.937 36.0949 -0.194298 3.93137 4.70265 2.70832 2.08822 -1.06466 1.75891 -0.0518205 3.88651e-13 0.0518205 -1.75891 1.06466 -2.08822 -2.70832 -4.70265 -3.93137 0.194298 -36.0949 disco
383+0.134656 0.672034 0.00231928 -231.126 37.56 -1.95137 5.42389 0.84897 -1.5498 4.09343 -2.67082 1.79992 -0.39762 3.53584e-13 0.39762 -1.79992 2.67082 -4.09343 1.5498 -0.84897 -5.42389 1.95137 -37.56 disco
384+0.098579 0.551503 0.00117758 -259.691 37.7867 6.3873 8.80182 3.82314 0.302165 1.89461 -0.924108 1.13007 -0.0264017 3.91833e-13 0.0264017 -1.13007 0.924108 -1.89461 -0.302165 -3.82314 -8.80182 -6.3873 -37.7867 disco
385+0.133675 0.711107 0.000665774 -271.152 27.8465 -1.22604 2.02229 3.57745 1.52055 2.17944 -0.1828 0.955485 -0.455445 3.97605e-13 0.455445 -0.955485 0.1828 -2.17944 -1.52055 -3.57745 -2.02229 1.22604 -27.8465 disco
386+0.174458 0.831932 0.00106083 -261.448 24.8753 3.33753 10.7217 1.71347 1.05538 4.14102 -1.47273 2.07057 0.0357946 3.77654e-13 -0.0357946 -2.07057 1.47273 -4.14102 -1.05538 -1.71347 -10.7217 -3.33753 -24.8753 disco
387+0.0929259 0.665505 0.00216515 -242.339 45.6722 -0.895818 2.3 4.73644 -0.680871 3.52238 0.915858 1.023 -1.2697 3.79134e-13 1.2697 -1.023 -0.915858 -3.52238 0.680871 -4.73644 -2.3 0.895818 -45.6722 disco
388+0.102113 0.719622 0.00158303 -248.074 43.4554 2.46692 3.22529 1.62138 1.09899 1.95662 -1.21678 1.70152 -1.17059 3.84605e-13 1.17059 -1.70152 1.21678 -1.95662 -1.09899 -1.62138 -3.22529 -2.46692 -43.4554 disco
389+0.120533 0.638876 0.00146929 -241.255 40.5776 -7.83958 1.48813 4.87075 -1.25975 3.13988 -0.786868 1.36087 -0.865723 3.72312e-13 0.865723 -1.36087 0.786868 -3.13988 1.25975 -4.87075 -1.48813 7.83958 -40.5776 disco
390+0.111038 0.603316 0.00124934 -247.21 39.5561 -2.41222 3.09837 3.62632 0.270643 2.90759 -0.385794 1.68433 -0.606557 3.78949e-13 0.606557 -1.68433 0.385794 -2.90759 -0.270643 -3.62632 -3.09837 2.41222 -39.5561 disco
391+0.150996 0.684569 0.000931259 -251.799 32.3357 -4.08886 5.03672 3.09979 0.81835 4.02264 -1.45509 1.35053 -0.267506 3.76204e-13 0.267506 -1.35053 1.45509 -4.02264 -0.81835 -3.09979 -5.03672 4.08886 -32.3357 disco
392+0.112213 0.623195 0.00236745 -237.474 41.0141 -6.0482 0.973686 4.77071 1.16356 4.02517 0.804443 2.59516 -0.561821 3.6846e-13 0.561821 -2.59516 -0.804443 -4.02517 -1.16356 -4.77071 -0.973686 6.0482 -41.0141 disco
393+0.125701 0.583193 0.00129167 -251.108 35.6992 1.45059 8.31224 3.56686 -1.14603 2.56739 -0.538678 1.8101 -0.888373 3.7665e-13 0.888373 -1.8101 0.538678 -2.56739 1.14603 -3.56686 -8.31224 -1.45059 -35.6992 disco
394+0.143231 0.679655 0.00218596 -229.674 36.3094 -6.59919 5.03454 6.66343 1.71546 2.00952 -1.81123 2.74542 -1.04207 3.50762e-13 1.04207 -2.74542 1.81123 -2.00952 -1.71546 -6.66343 -5.03454 6.59919 -36.3094 disco
395+0.119998 0.570222 0.00126109 -250.003 35.954 0.0861511 8.55279 4.44985 -0.374398 3.94076 -1.12612 1.51278 -0.0295993 3.76414e-13 0.0295993 -1.51278 1.12612 -3.94076 0.374398 -4.44985 -8.55279 -0.0861511 -35.954 disco
396+0.118905 0.632566 0.00120797 -255.935 34.8892 -1.46448 4.42266 6.46869 1.8962 2.24213 -0.794735 1.45971 -0.322061 3.8506e-13 0.322061 -1.45971 0.794735 -2.24213 -1.8962 -6.46869 -4.42266 1.46448 -34.8892 disco
397+0.124589 0.728366 0.00102064 -251.241 36.3007 -4.86448 4.72054 5.99587 -2.01941 2.59218 -1.33741 0.580306 -0.542112 3.79333e-13 0.542112 -0.580306 1.33741 -2.59218 2.01941 -5.99587 -4.72054 4.86448 -36.3007 disco
398+0.147612 0.637228 0.00133151 -245.882 32.2497 -1.27163 6.51247 2.31508 1.84596 4.4581 -0.117237 1.98306 -0.0645461 3.67916e-13 0.0645461 -1.98306 0.117237 -4.4581 -1.84596 -2.31508 -6.51247 1.27163 -32.2497 disco
399+0.123747 0.674206 0.00163138 -241.533 38.0924 0.482577 6.93491 2.35315 -0.581412 2.13913 -1.92014 1.66408 -1.44436 3.67221e-13 1.44436 -1.66408 1.92014 -2.13913 0.581412 -2.35315 -6.93491 -0.482577 -38.0924 disco
400+0.123747 0.673412 0.00163138 -241.533 38.0924 0.482577 6.93491 2.35315 -0.581412 2.13913 -1.92014 1.66408 -1.44436 3.67221e-13 1.44436 -1.66408 1.92014 -2.13913 0.581412 -2.35315 -6.93491 -0.482577 -38.0924 disco
401+0.139197 0.735477 0.00187392 -232.284 38.3388 -7.71067 2.97049 3.17273 -2.45235 1.80239 -2.97461 1.09745 -1.68097 3.56249e-13 1.68097 -1.09745 2.97461 -1.80239 2.45235 -3.17273 -2.97049 7.71067 -38.3388 hiphop
402+0.141834 0.611887 0.00371537 -231.3 33.0245 -5.10974 8.63998 9.70451 3.82446 5.24107 0.126786 3.51974 -0.619353 3.477e-13 0.619353 -3.51974 -0.126786 -5.24107 -3.82446 -9.70451 -8.63998 5.10974 -33.0245 hiphop
403+0.0781045 0.737106 0.00123458 -265.054 39.8938 9.64195 6.98239 3.52272 -0.351651 0.0456942 -1.54631 0.236077 -0.121252 4.02102e-13 0.121252 -0.236077 1.54631 -0.0456942 0.351651 -3.52272 -6.98239 -9.64195 -39.8938 hiphop
404+0.12301 0.683749 0.00333157 -229.726 39.2134 -3.17335 5.69654 3.6748 -0.27258 3.8285 -0.693718 2.99634 0.418264 3.54495e-13 -0.418264 -2.99634 0.693718 -3.8285 0.27258 -3.6748 -5.69654 3.17335 -39.2134 hiphop
405+0.113963 0.60826 0.00249006 -253.446 32.2952 2.84331 7.59909 4.12319 3.34502 5.3189 0.358642 2.31038 -0.021879 3.77452e-13 0.021879 -2.31038 -0.358642 -5.3189 -3.34502 -4.12319 -7.59909 -2.84331 -32.2952 hiphop
406+0.149292 0.62877 0.00321874 -222.375 34.327 -3.84781 8.84118 4.0716 -0.391213 5.33948 -2.98489 2.05767 -0.538009 3.36625e-13 0.538009 -2.05767 2.98489 -5.33948 0.391213 -4.0716 -8.84118 3.84781 -34.327 hiphop
407+0.15629 0.719345 0.00314738 -236.073 27.2465 0.432262 12.0303 5.2057 2.04815 4.8041 -0.610874 2.18949 -0.675605 3.45695e-13 0.675605 -2.18949 0.610874 -4.8041 -2.04815 -5.2057 -12.0303 -0.432262 -27.2465 hiphop
408+0.101424 0.643972 0.00337699 -233.95 44.9516 -1.41709 4.4164 3.84567 -0.748527 0.11459 -2.43179 1.97778 -1.10443 3.66855e-13 1.10443 -1.97778 2.43179 -0.11459 0.748527 -3.84567 -4.4164 1.41709 -44.9516 hiphop
409+0.166817 0.683611 0.00181871 -246.066 29.2501 -3.73705 9.35798 5.8335 -2.01449 2.39717 -2.00749 1.65667 -0.979542 3.61354e-13 0.979542 -1.65667 2.00749 -2.39717 2.01449 -5.8335 -9.35798 3.73705 -29.2501 hiphop
410+0.158267 0.824303 0.00180928 -241.879 31.7975 -4.82211 6.52407 3.96272 -1.22723 2.69317 -2.06806 1.79487 -0.774004 3.60494e-13 0.774004 -1.79487 2.06806 -2.69317 1.22723 -3.96272 -6.52407 4.82211 -31.7975 hiphop
411+0.129275 0.785325 0.00203351 -238.295 38.9399 -7.19029 0.776225 1.14202 0.432322 6.33901 -0.55413 1.25667 -0.982376 3.66933e-13 0.982376 -1.25667 0.55413 -6.33901 -0.432322 -1.14202 -0.776225 7.19029 -38.9399 hiphop
412+0.11114 0.657928 0.00272452 -236.674 41.0287 -0.832958 7.14041 4.83611 0.966988 3.09977 -1.58063 2.40303 -0.752708 3.6499e-13 0.752708 -2.40303 1.58063 -3.09977 -0.966988 -4.83611 -7.14041 0.832958 -41.0287 hiphop
413+0.107446 0.732753 0.00247334 -235.279 44.2546 -1.64831 4.49237 2.43293 -1.91802 1.89651 -2.94404 0.874992 -0.680391 3.67927e-13 0.680391 -0.874992 2.94404 -1.89651 1.91802 -2.43293 -4.49237 1.64831 -44.2546 hiphop
414+0.13147 0.763224 0.00198651 -234.815 38.2793 -2.12573 6.81634 3.34237 -0.24034 3.08928 -2.80626 2.2759 -0.0260971 3.5966e-13 0.0260971 -2.2759 2.80626 -3.08928 0.24034 -3.34237 -6.81634 2.12573 -38.2793 hiphop
415+0.130671 0.623491 0.00260853 -228.041 38.9444 -6.31658 7.64194 8.3986 -0.685101 3.63858 -2.57995 2.30427 -0.361163 3.50346e-13 0.361163 -2.30427 2.57995 -3.63858 0.685101 -8.3986 -7.64194 6.31658 -38.9444 hiphop
416+0.133057 0.747782 0.00193686 -235.62 37.8639 -3.47407 5.54279 3.14509 -0.674897 2.19741 -3.32288 0.560742 -1.01007 3.60442e-13 1.01007 -0.560742 3.32288 -2.19741 0.674897 -3.14509 -5.54279 3.47407 -37.8639 hiphop
417+0.130365 0.741238 0.00266577 -239.109 37.5225 -3.08942 6.84747 5.41253 -0.542882 2.34148 -1.64475 2.45982 0.231833 3.64559e-13 -0.231833 -2.45982 1.64475 -2.34148 0.542882 -5.41253 -6.84747 3.08942 -37.5225 hiphop
418+0.111094 0.665732 0.00241928 -241.351 38.8059 0.179509 8.88686 4.85578 0.40489 4.14921 -0.237687 2.46886 -0.840929 3.6742e-13 0.840929 -2.46886 0.237687 -4.14921 -0.40489 -4.85578 -8.88686 -0.179509 -38.8059 hiphop
419+0.145593 0.878396 0.00221546 -241.941 33.828 -1.67763 9.21407 5.67057 0.377519 2.85408 -2.1678 1.28189 -0.44048 3.62954e-13 0.44048 -1.28189 2.1678 -2.85408 -0.377519 -5.67057 -9.21407 1.67763 -33.828 hiphop
420+0.144253 0.856579 0.0022698 -237.203 36.0754 -4.34594 4.84683 4.05981 -0.201504 3.03919 -1.02847 1.5308 -0.740293 3.60528e-13 0.740293 -1.5308 1.02847 -3.03919 0.201504 -4.05981 -4.84683 4.34594 -36.0754 hiphop
421+0.134041 0.515826 0.00263023 -240.374 34.1854 -7.01661 8.22669 10.3843 1.53043 6.08495 -0.270794 2.05196 -0.392658 3.61215e-13 0.392658 -2.05196 0.270794 -6.08495 -1.53043 -10.3843 -8.22669 7.01661 -34.1854 hiphop
422+0.130611 0.728586 0.00315723 -224.518 39.8513 -4.04868 5.89044 3.26295 -1.18819 2.89426 -3.13539 2.05763 -0.551991 3.47504e-13 0.551991 -2.05763 3.13539 -2.89426 1.18819 -3.26295 -5.89044 4.04868 -39.8513 hiphop
423+0.103743 0.682831 0.00238888 -239.303 42.3018 0.969062 6.94764 2.85611 -1.80284 1.7486 -1.20452 1.87088 -0.902004 3.6944e-13 0.902004 -1.87088 1.20452 -1.7486 1.80284 -2.85611 -6.94764 -0.969062 -42.3018 hiphop
424+0.12235 0.637125 0.00267989 -227.545 41.8912 -5.02648 5.27387 4.98537 0.216077 3.86101 -2.7133 1.66825 -0.486495 3.54801e-13 0.486495 -1.66825 2.7133 -3.86101 -0.216077 -4.98537 -5.27387 5.02648 -41.8912 hiphop
425+0.136811 0.835351 0.00237883 -232.556 38.3876 -7.95326 1.93291 4.19191 -1.15849 3.086 -1.46872 1.81949 -0.82276 3.57743e-13 0.82276 -1.81949 1.46872 -3.086 1.15849 -4.19191 -1.93291 7.95326 -38.3876 hiphop
426+0.122283 0.613624 0.00323151 -230.459 39.1145 -5.38019 5.70806 5.32028 -0.440835 4.42222 -1.06966 2.71776 -0.301777 3.54583e-13 0.301777 -2.71776 1.06966 -4.42222 0.440835 -5.32028 -5.70806 5.38019 -39.1145 hiphop
427+0.190628 0.749302 0.00222014 -237.1 24.0367 -0.254558 11.8726 7.19938 4.21151 -0.110229 0.921018 1.30402 -0.266647 3.45652e-13 0.266647 -1.30402 -0.921018 0.110229 -4.21151 -7.19938 -11.8726 0.254558 -24.0367 hiphop
428+0.150505 0.752735 0.00171189 -246.812 32.3578 1.91039 7.89417 3.25549 1.81274 2.24155 -0.906333 -0.079632 -0.357844 3.69325e-13 0.357844 0.079632 0.906333 -2.24155 -1.81274 -3.25549 -7.89417 -1.91039 -32.3578 hiphop
429+0.1435 0.752022 0.00207459 -233.683 36.8284 -2.45021 4.25562 4.67786 3.52349 -0.0766291 0.0147338 2.37697 -0.882237 3.58393e-13 0.882237 -2.37697 -0.0147338 0.0766291 -3.52349 -4.67786 -4.25562 2.45021 -36.8284 hiphop
430+0.162587 0.629591 0.00207746 -237.351 30.8774 -1.64821 7.20552 3.62638 2.46316 2.17733 0.473407 1.28984 -0.051177 3.55474e-13 0.051177 -1.28984 -0.473407 -2.17733 -2.46316 -3.62638 -7.20552 1.64821 -30.8774 hiphop
431+0.204259 0.646021 0.00250841 -222.916 23.9704 1.04113 12.6906 3.21453 2.43845 3.39414 0.835493 1.13974 -0.164855 3.25428e-13 0.164855 -1.13974 -0.835493 -3.39414 -2.43845 -3.21453 -12.6906 -1.04113 -23.9704 hiphop
432+0.152115 0.660145 0.00270898 -224.551 35.0313 -2.94977 3.09597 0.960811 2.81561 0.3408 2.56465 1.10801 -0.948465 3.45022e-13 0.948465 -1.10801 -2.56465 -0.3408 -2.81561 -0.960811 -3.09597 2.94977 -35.0313 hiphop
433+0.106636 0.705232 0.00180891 -256.162 37.2411 3.25478 5.30715 6.04313 5.68356 2.5566 -0.180097 1.2075 0.714002 3.90241e-13 -0.714002 -1.2075 0.180097 -2.5566 -5.68356 -6.04313 -5.30715 -3.25478 -37.2411 hiphop
434+0.177041 0.782014 0.00262066 -226.41 28.3902 -2.60389 7.01603 3.3908 4.74231 2.91677 -1.14261 0.558412 0.220495 3.39108e-13 -0.220495 -0.558412 1.14261 -2.91677 -4.74231 -3.3908 -7.01603 2.60389 -28.3902 hiphop
435+0.170711 0.788073 0.00309528 -215.864 32.1982 -5.55683 6.42143 2.59131 -1.09427 1.90598 0.165063 0.950455 -0.45647 3.27416e-13 0.45647 -0.950455 -0.165063 -1.90598 1.09427 -2.59131 -6.42143 5.55683 -32.1982 hiphop
436+0.151064 0.669509 0.0023695 -244.494 30.9411 2.14117 8.69737 3.44862 3.73684 2.75825 -0.562425 1.5077 0.352632 3.64954e-13 -0.352632 -1.5077 0.562425 -2.75825 -3.73684 -3.44862 -8.69737 -2.14117 -30.9411 hiphop
437+0.155005 0.70922 0.000424981 -291.365 17.3171 0.519289 1.60858 3.26456 1.21354 1.33539 0.664608 -0.114457 -0.358918 4.12032e-13 0.358918 0.114457 -0.664608 -1.33539 -1.21354 -3.26456 -1.60858 -0.519289 -17.3171 hiphop
438+0.186914 0.822743 0.00183392 -240.746 29.6062 -4.72312 2.74293 1.46856 -0.867035 -0.760267 -0.875057 -0.0439419 -0.748845 3.59247e-13 0.748845 0.0439419 0.875057 0.760267 0.867035 -1.46856 -2.74293 4.72312 -29.6062 hiphop
439+0.232928 0.496148 0.00208728 -256.563 26.8803 -3.074 3.18543 4.31257 1.47438 0.742401 -0.344484 0.576827 -0.597164 3.76913e-13 0.597164 -0.576827 0.344484 -0.742401 -1.47438 -4.31257 -3.18543 3.074 -26.8803 hiphop
440+0.157456 0.735627 0.00141392 -259.675 30.1997 7.24243 6.57428 -0.958623 0.598326 0.130716 1.09615 -0.797161 -0.348781 3.84522e-13 0.348781 0.797161 -1.09615 -0.130716 -0.598326 0.958623 -6.57428 -7.24243 -30.1997 hiphop
441+0.104634 0.423947 0.000952586 -271.739 34.2496 12.5653 6.25134 1.08303 -0.528377 -3.43282 -1.05806 -0.20623 -1.24085 4.03928e-13 1.24085 0.20623 1.05806 3.43282 0.528377 -1.08303 -6.25134 -12.5653 -34.2496 hiphop
442+0.134872 0.790706 0.00187957 -246.703 36.2747 0.431744 4.12172 1.90564 -0.14777 -0.816527 -0.397123 -0.314478 -0.300039 3.75454e-13 0.300039 0.314478 0.397123 0.816527 0.14777 -1.90564 -4.12172 -0.431744 -36.2747 hiphop
443+0.148194 0.562921 0.00299972 -235.538 31.87 0.465082 10.3449 5.95835 1.8618 2.15404 0.423419 1.17857 0.329474 3.53024e-13 -0.329474 -1.17857 -0.423419 -2.15404 -1.8618 -5.95835 -10.3449 -0.465082 -31.87 hiphop
444+0.091898 0.58514 0.0011367 -262.064 40.8612 7.38056 0.448321 -0.279649 0.957577 0.292448 0.341203 0.469996 -0.161972 4.02337e-13 0.161972 -0.469996 -0.341203 -0.292448 -0.957577 0.279649 -0.448321 -7.38056 -40.8612 hiphop
445+0.161222 0.834236 0.000249273 -285.599 21.2215 -3.0276 -1.74975 3.53119 -0.768585 -2.9399 -0.205001 0.0325673 -2.10496 4.08727e-13 2.10496 -0.0325673 0.205001 2.9399 0.768585 -3.53119 1.74975 3.0276 -21.2215 hiphop
446+0.157456 0.735627 0.00141392 -259.675 30.1997 7.24243 6.57428 -0.958623 0.598326 0.130716 1.09615 -0.797161 -0.348781 3.84522e-13 0.348781 0.797161 -1.09615 -0.130716 -0.598326 0.958623 -6.57428 -7.24243 -30.1997 hiphop
447+0.117472 0.759626 0.00282828 -244.789 37.8844 5.66694 7.83118 3.63564 3.01204 0.911649 -0.00329789 -0.0972437 0.821653 3.75036e-13 -0.821653 0.0972437 0.00329789 -0.911649 -3.01204 -3.63564 -7.83118 -5.66694 -37.8844 hiphop
448+0.176915 0.694127 0.00295353 -235.319 27.861 5.37117 11.6869 2.6222 3.52059 0.44408 0.463742 -0.708286 0.113976 3.48817e-13 -0.113976 0.708286 -0.463742 -0.44408 -3.52059 -2.6222 -11.6869 -5.37117 -27.861 hiphop
449+0.095763 0.504761 0.00233262 -257.36 34.2376 7.91518 11.9588 8.22989 4.50377 3.68803 1.77665 1.28036 0.29029 3.84412e-13 -0.29029 -1.28036 -1.77665 -3.68803 -4.50377 -8.22989 -11.9588 -7.91518 -34.2376 hiphop
450+0.167062 0.6835 0.00375776 -226.979 27.6345 0.579339 13.9471 7.77106 4.26461 2.29581 1.56021 0.873998 0.606978 3.36453e-13 -0.606978 -0.873998 -1.56021 -2.29581 -4.26461 -7.77106 -13.9471 -0.579339 -27.6345 hiphop
451+0.07966 0.611391 0.00357655 -245.741 43.7531 10.2058 8.19244 4.67758 3.93104 -0.975137 0.602361 -0.904433 0.445182 3.83655e-13 -0.445182 0.904433 -0.602361 0.975137 -3.93104 -4.67758 -8.19244 -10.2058 -43.7531 hiphop
452+0.118206 0.662386 0.00339842 -241.217 35.0229 8.19049 14.698 5.72365 1.32625 1.78964 -0.532391 -0.242612 0.0502582 3.62632e-13 -0.0502582 0.242612 0.532391 -1.78964 -1.32625 -5.72365 -14.698 -8.19049 -35.0229 hiphop
453+0.113672 0.572179 0.00137791 -260.139 33.1968 7.42923 8.88993 3.96627 2.51181 2.24334 1.942 1.33087 0.583112 3.88048e-13 -0.583112 -1.33087 -1.942 -2.24334 -2.51181 -3.96627 -8.88993 -7.42923 -33.1968 hiphop
454+0.154114 0.666452 0.00130775 -254.172 28.2299 4.92224 9.90162 3.58812 2.40524 0.0680098 1.85932 1.30465 0.537512 3.74272e-13 -0.537512 -1.30465 -1.85932 -0.0680098 -2.40524 -3.58812 -9.90162 -4.92224 -28.2299 hiphop
455+0.169915 0.800227 0.00159413 -244.065 30.8536 4.71981 7.22754 -0.821033 3.03048 0.787243 1.50988 -0.361041 -0.201152 3.65419e-13 0.201152 0.361041 -1.50988 -0.787243 -3.03048 0.821033 -7.22754 -4.71981 -30.8536 hiphop
456+0.0924402 0.527201 0.00171823 -254.276 42.3008 -1.00711 1.63917 7.03653 2.81855 1.90567 1.16544 1.1696 0.25642 3.94e-13 -0.25642 -1.1696 -1.16544 -1.90567 -2.81855 -7.03653 -1.63917 1.00711 -42.3008 hiphop
457+0.124148 0.580438 0.00213204 -244.38 36.2842 -1.63582 8.11198 6.33583 1.55261 4.99701 1.76414 2.62054 0.388609 3.70093e-13 -0.388609 -2.62054 -1.76414 -4.99701 -1.55261 -6.33583 -8.11198 1.63582 -36.2842 hiphop
458+0.089406 0.541235 0.00292899 -249.216 40.8399 1.95265 8.48678 9.78221 4.21506 3.36375 1.25844 1.29429 0.660715 3.83466e-13 -0.660715 -1.29429 -1.25844 -3.36375 -4.21506 -9.78221 -8.48678 -1.95265 -40.8399 hiphop
459+0.140623 0.744159 0.0015939 -248.835 33.3968 -3.83946 5.65116 6.67768 1.95384 4.28385 1.9455 2.14301 0.120031 3.73557e-13 -0.120031 -2.14301 -1.9455 -4.28385 -1.95384 -6.67768 -5.65116 3.83946 -33.3968 hiphop
460+0.117744 0.606619 0.00189594 -250.181 36.3363 -0.211424 6.68208 8.37235 4.01827 2.85356 2.16359 1.67929 -0.366893 3.78985e-13 0.366893 -1.67929 -2.16359 -2.85356 -4.01827 -8.37235 -6.68208 0.211424 -36.3363 hiphop
461+0.0832366 0.470177 0.00244319 -257.41 38.4852 1.88148 8.39183 11.2287 3.86815 4.27516 3.53062 2.92514 1.24219 3.91053e-13 -1.24219 -2.92514 -3.53062 -4.27516 -3.86815 -11.2287 -8.39183 -1.88148 -38.4852 hiphop
462+0.0934878 0.648732 0.00202251 -252.435 41.2926 -0.0338664 3.05852 6.26639 4.09315 4.7432 2.22435 0.605028 0.595856 3.90464e-13 -0.595856 -0.605028 -2.22435 -4.7432 -4.09315 -6.26639 -3.05852 0.0338664 -41.2926 hiphop
463+0.128186 0.731215 0.00244279 -252.221 33.8881 3.96779 6.9967 3.55035 2.45857 2.52287 0.862723 0.732699 -0.00689194 3.78789e-13 0.00689194 -0.732699 -0.862723 -2.52287 -2.45857 -3.55035 -6.9967 -3.96779 -33.8881 hiphop
464+0.156787 0.794321 0.00222118 -241.802 32.9608 -2.25655 6.05438 4.2011 1.47045 2.85768 -0.303493 -0.409839 -0.339619 3.64135e-13 0.339619 0.409839 0.303493 -2.85768 -1.47045 -4.2011 -6.05438 2.25655 -32.9608 hiphop
465+0.13423 0.737177 0.00293818 -236.407 36.9967 0.915853 9.99035 6.14554 0.484049 2.01826 -0.742697 -0.181051 0.013462 3.60248e-13 -0.013462 0.181051 0.742697 -2.01826 -0.484049 -6.14554 -9.99035 -0.915853 -36.9967 hiphop
466+0.133015 0.724545 0.00264503 -249.292 32.908 8.70101 11.675 4.01433 3.31746 0.966692 -0.154394 0.0419047 0.510884 3.73145e-13 -0.510884 -0.0419047 0.154394 -0.966692 -3.31746 -4.01433 -11.675 -8.70101 -32.908 hiphop
467+0.110826 0.568837 0.00260473 -244.602 39.5217 4.15588 7.68866 3.62559 -0.289137 0.510852 0.0340493 1.80375 0.615492 3.74813e-13 -0.615492 -1.80375 -0.0340493 -0.510852 0.289137 -3.62559 -7.68866 -4.15588 -39.5217 hiphop
468+0.167717 0.718949 0.00289123 -234.589 30.5128 1.32197 8.43461 3.32318 3.51493 0.458872 0.874202 -0.583842 0.0516903 3.52331e-13 -0.0516903 0.583842 -0.874202 -0.458872 -3.51493 -3.32318 -8.43461 -1.32197 -30.5128 hiphop
469+0.134579 0.663828 0.00315395 -234.074 33.8225 2.22535 11.4337 6.24029 3.1942 3.09124 0.583466 0.558966 -0.23147 3.53058e-13 0.23147 -0.558966 -0.583466 -3.09124 -3.1942 -6.24029 -11.4337 -2.22535 -33.8225 hiphop
470+0.177241 0.652043 0.00362161 -228.72 25.4609 2.42576 15.7602 7.13779 3.08195 1.76728 1.19425 0.461857 0.209685 3.34813e-13 -0.209685 -0.461857 -1.19425 -1.76728 -3.08195 -7.13779 -15.7602 -2.42576 -25.4609 hiphop
471+0.137232 0.579598 0.00372068 -233.731 31.5339 8.14033 14.0868 3.8471 3.31236 1.47653 1.78998 0.785304 0.408795 3.49641e-13 -0.408795 -0.785304 -1.78998 -1.47653 -3.31236 -3.8471 -14.0868 -8.14033 -31.5339 hiphop
472+0.175333 0.579663 0.00307086 -235.395 25.4444 6.47456 13.6792 4.56276 6.25462 0.794848 0.597425 0.662448 0.24959 3.45617e-13 -0.24959 -0.662448 -0.597425 -0.794848 -6.25462 -4.56276 -13.6792 -6.47456 -25.4444 hiphop
473+0.0836498 0.557226 0.00359907 -251.833 39.5027 9.1313 9.41559 7.66408 6.62201 0.464274 2.02432 0.187676 0.582036 3.865e-13 -0.582036 -0.187676 -2.02432 -0.464274 -6.62201 -7.66408 -9.41559 -9.1313 -39.5027 hiphop
474+0.152049 0.662139 0.00353071 -238.368 31.0387 6.44589 12.3592 3.85942 3.24751 0.970658 0.504028 -0.506955 0.186927 3.56184e-13 -0.186927 0.506955 -0.504028 -0.970658 -3.24751 -3.85942 -12.3592 -6.44589 -31.0387 hiphop
475+0.145065 0.590238 0.00280006 -234.93 32.8094 0.608415 13.0951 6.25629 -0.183751 2.51061 -1.66825 1.30032 -0.275021 3.50909e-13 0.275021 -1.30032 1.66825 -2.51061 0.183751 -6.25629 -13.0951 -0.608415 -32.8094 hiphop
476+0.157753 0.756559 0.00249182 -241.415 30.7673 2.50928 11.0866 4.89237 1.68864 0.531371 0.128988 -0.209064 0.009992 3.59722e-13 -0.009992 0.209064 -0.128988 -0.531371 -1.68864 -4.89237 -11.0866 -2.50928 -30.7673 hiphop
477+0.113908 0.72161 0.00308998 -244.363 40.3745 4.44991 4.06282 2.44354 2.39666 -1.66442 0.402146 0.690029 -0.894086 3.77235e-13 0.894086 -0.690029 -0.402146 1.66442 -2.39666 -2.44354 -4.06282 -4.44991 -40.3745 hiphop
478+0.147835 0.773601 0.00308037 -224.057 35.7146 -0.57813 6.17386 1.86638 0.921795 0.52749 0.8231 -0.293921 -0.387583 3.44125e-13 0.387583 0.293921 -0.8231 -0.52749 -0.921795 -1.86638 -6.17386 0.57813 -35.7146 hiphop
479+0.113908 0.718768 0.00308998 -244.363 40.3745 4.44991 4.06282 2.44354 2.39666 -1.66442 0.402146 0.690029 -0.894086 3.77235e-13 0.894086 -0.690029 -0.402146 1.66442 -2.39666 -2.44354 -4.06282 -4.44991 -40.3745 hiphop
480+0.171156 0.868139 0.00199641 -236.955 31.0055 -2.82251 2.75948 4.45398 3.89632 -1.92174 -0.652977 -0.1741 -1.32535 3.56994e-13 1.32535 0.1741 0.652977 1.92174 -3.89632 -4.45398 -2.75948 2.82251 -31.0055 hiphop
481+0.178659 0.856143 0.00191538 -231.314 31.5209 -1.59792 7.48286 4.06265 2.15767 -0.690084 0.0717208 -0.533984 -0.206405 3.49049e-13 0.206405 0.533984 -0.0717208 0.690084 -2.15767 -4.06265 -7.48286 1.59792 -31.5209 hiphop
482+0.0729749 0.553895 0.00106638 -273.843 34.2019 9.1603 6.74317 4.57498 2.91115 2.79919 0.743041 1.50447 0.040419 4.07322e-13 -0.040419 -1.50447 -0.743041 -2.79919 -2.91115 -4.57498 -6.74317 -9.1603 -34.2019 hiphop
483+0.121035 0.763176 0.0013288 -250.228 38.8224 -2.50666 4.78847 3.68339 -1.97209 2.01382 -1.32129 0.506943 -0.00223101 3.81868e-13 0.00223101 -0.506943 1.32129 -2.01382 1.97209 -3.68339 -4.78847 2.50666 -38.8224 hiphop
484+0.120929 0.716777 0.00157534 -246.495 37.6694 -3.46322 3.91845 3.75888 1.73069 3.53996 -1.67938 1.686 -0.367484 3.76146e-13 0.367484 -1.686 1.67938 -3.53996 -1.73069 -3.75888 -3.91845 3.46322 -37.6694 hiphop
485+0.0956475 0.764795 0.000786264 -272.593 33.7675 2.68638 2.03207 5.42461 2.49603 0.665357 -0.954812 -0.365372 -0.547565 4.07321e-13 0.547565 0.365372 0.954812 -0.665357 -2.49603 -5.42461 -2.03207 -2.68638 -33.7675 hiphop
486+0.143502 0.725537 0.00144385 -244.581 34.8411 -4.34308 6.66671 3.58704 -1.05992 3.08785 -2.35655 1.62399 -0.794664 3.67931e-13 0.794664 -1.62399 2.35655 -3.08785 1.05992 -3.58704 -6.66671 4.34308 -34.8411 hiphop
487+0.106588 0.591305 0.000937946 -270.092 32.5483 2.5812 4.31728 4.47959 2.58931 4.92408 2.22228 2.16349 1.26907 4.02126e-13 -1.26907 -2.16349 -2.22228 -4.92408 -2.58931 -4.47959 -4.31728 -2.5812 -32.5483 hiphop
488+0.132766 0.66223 0.00136209 -258.643 30.1237 -1.81228 9.0156 8.55522 3.19937 4.34094 1.14176 3.09384 0.884757 3.82022e-13 -0.884757 -3.09384 -1.14176 -4.34094 -3.19937 -8.55522 -9.0156 1.81228 -30.1237 hiphop
489+0.14312 0.80399 0.00156769 -240.743 34.9559 -4.43827 5.89743 2.91775 -0.216475 4.41722 -1.8475 1.67144 -1.27383 3.62868e-13 1.27383 -1.67144 1.8475 -4.41722 0.216475 -2.91775 -5.89743 4.43827 -34.9559 hiphop
490+0.136826 0.6962 0.00156091 -243.894 35.8008 -4.82462 5.2917 4.45142 -0.199514 3.14266 -1.71142 0.295731 -1.47974 3.68764e-13 1.47974 -0.295731 1.71142 -3.14266 0.199514 -4.45142 -5.2917 4.82462 -35.8008 hiphop
491+0.12533 0.731914 0.00139717 -246.613 37.5788 -3.01845 3.42082 1.72388 0.574061 3.16533 -1.14677 2.11761 -0.584684 3.75811e-13 0.584684 -2.11761 1.14677 -3.16533 -0.574061 -1.72388 -3.42082 3.01845 -37.5788 hiphop
492+0.149463 0.755909 0.00156076 -241.035 33.6027 -6.08012 6.76446 5.05597 -0.57822 3.82557 -2.23647 1.5967 -1.0246 3.61436e-13 1.0246 -1.5967 2.23647 -3.82557 0.57822 -5.05597 -6.76446 6.08012 -33.6027 hiphop
493+0.11836 0.635568 0.00164362 -254.35 33.7437 3.66136 8.94762 3.57086 4.12267 5.24565 -1.02461 1.508 -1.0211 3.7973e-13 1.0211 -1.508 1.02461 -5.24565 -4.12267 -3.57086 -8.94762 -3.66136 -33.7437 hiphop
494+0.1693 0.689817 0.000931426 -257.916 25.6026 -2.1434 11.8489 7.12679 1.38863 5.71191 -0.603617 1.34368 -0.79428 3.72792e-13 0.79428 -1.34368 0.603617 -5.71191 -1.38863 -7.12679 -11.8489 2.1434 -25.6026 hiphop
495+0.0992144 0.666193 0.00135457 -258.583 38.3999 2.77303 4.03884 3.37243 2.82993 2.74946 -1.50879 1.02742 -0.227079 3.9356e-13 0.227079 -1.02742 1.50879 -2.74946 -2.82993 -3.37243 -4.03884 -2.77303 -38.3999 hiphop
496+0.15349 0.757334 0.00146533 -239.264 33.3135 -8.44714 5.66719 6.02275 0.0364095 4.9186 -1.30019 2.69411 -0.220803 3.59568e-13 0.220803 -2.69411 1.30019 -4.9186 -0.0364095 -6.02275 -5.66719 8.44714 -33.3135 hiphop
497+0.0976051 0.82846 0.00147275 -250.41 43.8491 -1.8169 1.47401 4.11468 -1.59162 0.857633 -0.574168 1.29448 0.52387 3.8978e-13 -0.52387 -1.29448 0.574168 -0.857633 1.59162 -4.11468 -1.47401 1.8169 -43.8491 hiphop
498+0.127321 0.696533 0.00168698 -245.224 35.9904 0.15467 8.4446 2.69958 -0.491206 3.61466 -1.38347 1.59285 -0.878736 3.69478e-13 0.878736 -1.59285 1.38347 -3.61466 0.491206 -2.69958 -8.4446 -0.15467 -35.9904 hiphop
499+0.140466 0.620189 0.00146198 -252.694 30.5042 -5.51149 8.34694 8.96083 3.55216 6.26137 0.111183 2.54834 -0.0585452 3.74084e-13 0.0585452 -2.54834 -0.111183 -6.26137 -3.55216 -8.96083 -8.34694 5.51149 -30.5042 hiphop
500+0.0975958 0.764314 0.00192829 -248.871 43.9138 -0.181223 0.969217 2.98619 0.181604 0.613411 -1.74303 0.849861 -0.900511 3.8741e-13 0.900511 -0.849861 1.74303 -0.613411 -0.181604 -2.98619 -0.969217 0.181223 -43.9138 hiphop
501+0.0914936 0.645289 0.000477584 -272.702 34.8661 4.2465 -2.172 -0.299251 0.475481 0.570235 0.294654 -0.029053 -0.415707 4.09828e-13 0.415707 0.029053 -0.294654 -0.570235 -0.475481 0.299251 2.172 -4.2465 -34.8661 jazz
502+0.0735984 0.490958 0.000362569 -279.215 34.0687 8.89683 1.32972 1.07115 0.409891 0.425203 0.465438 -0.121775 -0.498423 4.15845e-13 0.498423 0.121775 -0.465438 -0.425203 -0.409891 -1.07115 -1.32972 -8.89683 -34.0687 jazz
503+0.0509411 0.370415 0.000982696 -266.207 46.1145 8.90399 -1.68323 2.7772 2.216 0.560242 0.248684 0.219667 -0.0117622 4.15114e-13 0.0117622 -0.219667 -0.248684 -0.560242 -2.216 -2.7772 1.68323 -8.90399 -46.1145 jazz
504+0.0571216 0.415306 0.00110092 -267.87 45.0434 11.8374 0.0461885 -0.082598 1.7745 0.963786 -1.19518 -0.11482 0.47216 4.15839e-13 -0.47216 0.11482 1.19518 -0.963786 -1.7745 0.082598 -0.0461885 -11.8374 -45.0434 jazz
505+0.0491752 0.317662 0.00115695 -269.198 45.4583 14.0878 2.73546 0.649845 -2.39606 -2.32862 -0.334926 0.587679 -0.00208399 4.15303e-13 0.00208399 -0.587679 0.334926 2.32862 2.39606 -0.649845 -2.73546 -14.0878 -45.4583 jazz
506+0.0924531 0.585245 0.00172204 -248.864 45.1751 2.12461 2.78639 0.259877 -1.72349 2.04527 -0.690349 0.960234 -0.662539 3.87797e-13 0.662539 -0.960234 0.690349 -2.04527 1.72349 -0.259877 -2.78639 -2.12461 -45.1751 jazz
507+0.0618278 0.486938 0.0012517 -262.573 43.8656 6.75061 2.87955 5.56293 1.11848 -0.00546517 -0.298782 1.24684 0.719812 4.0601e-13 -0.719812 -1.24684 0.298782 0.00546517 -1.11848 -5.56293 -2.87955 -6.75061 -43.8656 jazz
508+0.0602318 0.37301 0.00109087 -266.223 44.1358 7.87451 -1.74354 -1.78905 -3.35878 -0.0536101 0.831373 -0.148616 0.00232995 4.11444e-13 -0.00232995 0.148616 -0.831373 0.0536101 3.35878 1.78905 1.74354 -7.87451 -44.1358 jazz
509+0.0664979 0.504228 0.00146235 -260.644 44.4263 4.48523 1.37335 6.40295 4.4878 3.52118 1.77167 1.46987 0.0296409 4.04761e-13 -0.0296409 -1.46987 -1.77167 -3.52118 -4.4878 -6.40295 -1.37335 -4.48523 -44.4263 jazz
510+0.0426605 0.323596 0.00119172 -271.639 46.6524 18.7882 2.55201 -2.5981 -1.64121 0.945353 1.72047 1.75046 1.11446 4.20414e-13 -1.11446 -1.75046 -1.72047 -0.945353 1.64121 2.5981 -2.55201 -18.7882 -46.6524 jazz
511+0.0404367 0.33942 0.000728364 -280.16 35.0045 11.4411 4.03514 5.56086 4.50013 2.00923 0.0979394 -0.00410167 0.00564352 4.18418e-13 -0.00564352 0.00410167 -0.0979394 -2.00923 -4.50013 -5.56086 -4.03514 -11.4411 -35.0045 jazz
512+0.0934652 0.512988 0.00109821 -255.835 43.1601 0.952704 0.397092 1.80716 -0.145325 0.856448 -1.77766 -0.140823 -0.319357 3.96748e-13 0.319357 0.140823 1.77766 -0.856448 0.145325 -1.80716 -0.397092 -0.952704 -43.1601 jazz
513+0.0845881 0.482221 0.000487161 -276.718 34.5852 8.21086 2.99552 2.68638 1.21289 0.480748 -0.747802 0.0446123 0.194732 4.1341e-13 -0.194732 -0.0446123 0.747802 -0.480748 -1.21289 -2.68638 -2.99552 -8.21086 -34.5852 jazz
514+0.0949963 0.562522 0.000689893 -269.555 37.0609 7.76383 5.17188 2.07571 -0.254599 -0.489458 -2.07267 0.152519 -0.141278 4.05627e-13 0.141278 -0.152519 2.07267 0.489458 0.254599 -2.07571 -5.17188 -7.76383 -37.0609 jazz
515+0.0733984 0.387277 0.000547595 -273.077 35.549 2.44095 -2.9389 1.85572 0.133437 -0.791063 -0.947425 -0.556778 -0.589897 4.11385e-13 0.589897 0.556778 0.947425 0.791063 -0.133437 -1.85572 2.9389 -2.44095 -35.549 jazz
516+0.092912 0.616799 0.000778186 -267.108 38.2918 4.9045 2.3708 2.60514 1.11866 0.855996 -1.14669 0.296948 0.00254836 4.0534e-13 -0.00254836 -0.296948 1.14669 -0.855996 -1.11866 -2.60514 -2.3708 -4.9045 -38.2918 jazz
517+0.0717749 0.362608 0.000833058 -266.847 42.5576 6.87865 -0.907511 0.982133 -0.0544725 -0.396567 -1.31432 -0.39499 0.222459 4.11423e-13 -0.222459 0.39499 1.31432 0.396567 0.0544725 -0.982133 0.907511 -6.87865 -42.5576 jazz
518+0.0973431 0.649205 0.000794078 -264.925 38.9631 1.77683 -0.204447 2.33795 0.324461 0.555104 -0.948566 -0.231159 -0.399036 4.03913e-13 0.399036 0.231159 0.948566 -0.555104 -0.324461 -2.33795 0.204447 -1.77683 -38.9631 jazz
519+0.105047 0.545899 0.000720281 -262.456 39.0698 0.285224 0.471683 2.6044 0.70156 1.83219 0.0691502 0.408543 -0.358512 4.00464e-13 0.358512 -0.408543 -0.0691502 -1.83219 -0.70156 -2.6044 -0.471683 -0.285224 -39.0698 jazz
520+0.0696878 0.387736 0.000711626 -268.712 41.9064 6.66361 -1.98866 0.267514 -0.0189988 0.507854 0.00534112 -0.434699 -0.314324 4.12936e-13 0.314324 0.434699 -0.00534112 -0.507854 0.0189988 -0.267514 1.98866 -6.66361 -41.9064 jazz
521+0.056313 0.41625 0.000342772 -292.049 26.0069 12.5382 6.43113 5.40335 3.95722 1.94523 0.640781 0.393877 0.313118 4.22281e-13 -0.313118 -0.393877 -0.640781 -1.94523 -3.95722 -5.40335 -6.43113 -12.5382 -26.0069 jazz
522+0.15782 0.644985 0.000613164 -260.343 30.2547 -3.15566 6.5049 3.875 -1.59531 1.10745 -1.86596 1.40001 -0.447001 3.83805e-13 0.447001 -1.40001 1.86596 -1.10745 1.59531 -3.875 -6.5049 3.15566 -30.2547 jazz
523+0.0808142 0.371334 0.000531454 -279.142 35.2043 11.4662 2.51809 -0.622943 -0.785736 0.598501 0.116865 0.18819 0.0485206 4.16637e-13 -0.0485206 -0.18819 -0.116865 -0.598501 0.785736 0.622943 -2.51809 -11.4662 -35.2043 jazz
524+0.104595 0.45846 0.00102586 -256.603 41.0385 -1.20668 -0.27298 0.135257 -3.21355 -0.221749 -2.29937 -0.84222 -0.309044 3.94983e-13 0.309044 0.84222 2.29937 0.221749 3.21355 -0.135257 0.27298 1.20668 -41.0385 jazz
525+0.122536 0.580608 0.000712305 -262.168 35.8547 -0.822582 2.6119 2.8417 -0.317381 1.94339 -0.542232 0.644148 0.0325329 3.95376e-13 -0.0325329 -0.644148 0.542232 -1.94339 0.317381 -2.8417 -2.6119 0.822582 -35.8547 jazz
526+0.0828811 0.519127 0.000620882 -278.178 34.1609 11.2201 6.38999 3.07811 0.122969 0.375688 0.317273 1.12697 0.452106 4.12979e-13 -0.452106 -1.12697 -0.317273 -0.375688 -0.122969 -3.07811 -6.38999 -11.2201 -34.1609 jazz
527+0.0591493 0.155857 0.000448281 -287.11 31.8656 14.7645 4.33004 1.26573 0.757409 0.598713 0.0110071 -0.453247 -0.315526 4.2251e-13 0.315526 0.453247 -0.0110071 -0.598713 -0.757409 -1.26573 -4.33004 -14.7645 -31.8656 jazz
528+0.0962548 0.65759 0.000493987 -274.122 34.2207 4.79166 3.53604 5.47166 0.12205 -1.56989 0.584086 1.98677 -0.156515 4.08296e-13 0.156515 -1.98677 -0.584086 1.56989 -0.12205 -5.47166 -3.53604 -4.79166 -34.2207 jazz
529+0.0983873 0.481603 0.000672084 -265.384 39.3303 3.33121 1.25924 2.58269 -0.589574 -1.28948 -1.12093 0.674577 -0.60095 4.03814e-13 0.60095 -0.674577 1.12093 1.28948 0.589574 -2.58269 -1.25924 -3.33121 -39.3303 jazz
530+0.118728 0.619428 0.000451909 -270.918 33.9976 2.42318 3.38148 5.0072 -0.0851645 -1.64785 -0.369356 1.32747 -0.899393 4.03535e-13 0.899393 -1.32747 0.369356 1.64785 0.0851645 -5.0072 -3.38148 -2.42318 -33.9976 jazz
531+0.082317 0.314278 0.000420272 -278.339 34.229 8.30712 3.85658 4.77383 -0.418056 -2.55324 -0.797267 -0.0432728 -0.881946 4.13524e-13 0.881946 0.0432728 0.797267 2.55324 0.418056 -4.77383 -3.85658 -8.30712 -34.229 jazz
532+0.0943241 0.616065 0.000608427 -267.343 38.3616 2.05562 -0.546298 2.3498 -0.0996792 0.0995288 -0.771583 -0.202448 0.241711 4.06985e-13 -0.241711 0.202448 0.771583 -0.0995288 0.0996792 -2.3498 0.546298 -2.05562 -38.3616 jazz
533+0.0760357 0.546508 0.000524273 -282.28 32.6648 11.4104 3.87042 1.46659 0.355397 0.938319 0.842705 1.03927 0.72419 4.17777e-13 -0.72419 -1.03927 -0.842705 -0.938319 -0.355397 -1.46659 -3.87042 -11.4104 -32.6648 jazz
534+0.0570943 0.49499 0.000878807 -275.443 37.6543 10.6928 4.63605 4.66175 1.6121 1.32563 1.22685 0.532634 -0.0273464 4.14253e-13 0.0273464 -0.532634 -1.22685 -1.32563 -1.6121 -4.66175 -4.63605 -10.6928 -37.6543 jazz
535+0.100245 0.702318 0.00157972 -247.374 42.1603 -3.99873 -0.179601 4.79739 -0.850899 2.4173 0.457796 1.43621 -0.103595 3.83576e-13 0.103595 -1.43621 -0.457796 -2.4173 0.850899 -4.79739 0.179601 3.99873 -42.1603 jazz
536+0.0391418 0.455911 0.00115305 -270.401 45.5123 14.2438 2.64568 3.47969 1.20801 -0.572806 0.5417 0.080117 -1.32358 4.16715e-13 1.32358 -0.080117 -0.5417 0.572806 -1.20801 -3.47969 -2.64568 -14.2438 -45.5123 jazz
537+0.082197 0.773493 0.00104045 -256.056 45.057 -3.13718 -5.18001 6.31428 1.54689 -0.305207 -0.300611 -0.187461 -1.21334 4.00917e-13 1.21334 0.187461 0.300611 0.305207 -1.54689 -6.31428 5.18001 3.13718 -45.057 jazz
538+0.0623069 0.500267 0.00130677 -263.418 47.0588 9.2984 -1.54365 -1.06047 -0.838183 0.802418 0.688339 0.224818 -0.410209 4.11352e-13 0.410209 -0.224818 -0.688339 -0.802418 0.838183 1.06047 1.54365 -9.2984 -47.0588 jazz
539+0.0784533 0.515552 0.00141215 -254.395 46.6654 2.81388 1.65488 4.61086 0.0873251 0.502537 0.238405 1.0072 -0.0491764 3.98366e-13 0.0491764 -1.0072 -0.238405 -0.502537 -0.0873251 -4.61086 -1.65488 -2.81388 -46.6654 jazz
540+0.0818444 0.601223 0.00117674 -255.63 45.0015 -0.0497581 1.40582 6.35942 -2.77264 -0.0267673 -0.582504 -1.76132 1.28795 3.9932e-13 -1.28795 1.76132 0.582504 0.0267673 2.77264 -6.35942 -1.40582 0.0497581 -45.0015 jazz
541+0.0685184 0.674027 0.00181065 -253.266 50.3289 4.80739 1.67954 3.97269 -4.33175 -1.88798 -0.0735282 -1.21643 -0.88366 3.99978e-13 0.88366 1.21643 0.0735282 1.88798 4.33175 -3.97269 -1.67954 -4.80739 -50.3289 jazz
542+0.0938908 0.684022 0.00128423 -247.412 46.2029 -6.69519 -2.42005 8.18566 -2.98878 -0.419216 0.570178 0.693557 1.09455 3.90262e-13 -1.09455 -0.693557 -0.570178 0.419216 2.98878 -8.18566 2.42005 6.69519 -46.2029 jazz
543+0.0668834 0.51308 0.0013772 -258.716 45.7561 7.47202 3.71532 3.3074 -4.26908 0.0297361 0.283843 -1.19117 -1.36425 3.99956e-13 1.36425 1.19117 -0.283843 -0.0297361 4.26908 -3.3074 -3.71532 -7.47202 -45.7561 jazz
544+0.0912095 0.585796 0.00160291 -248.763 46.9483 -2.7678 -3.32129 2.61401 -1.78856 -0.0325569 -0.125081 1.42189 -0.616321 3.92025e-13 0.616321 -1.42189 0.125081 0.0325569 1.78856 -2.61401 3.32129 2.7678 -46.9483 jazz
545+0.0485207 0.476631 0.0012184 -266.598 45.762 10.5468 -1.49666 -0.461967 0.319598 1.32277 0.838139 0.13002 -0.516423 4.14053e-13 0.516423 -0.13002 -0.838139 -1.32277 -0.319598 0.461967 1.49666 -10.5468 -45.762 jazz
546+0.0464872 0.461808 0.00131048 -263.867 49.1508 11.202 0.0503898 3.38917 1.53334 -0.404701 0.178045 -0.213034 -1.22532 4.13877e-13 1.22532 0.213034 -0.178045 0.404701 -1.53334 -3.38917 -0.0503898 -11.202 -49.1508 jazz
547+0.0727999 0.644795 0.00141455 -253.828 48.3549 2.486 0.233835 4.50766 -2.45693 0.401416 1.28921 -0.729542 -1.50816 3.98451e-13 1.50816 0.729542 -1.28921 -0.401416 2.45693 -4.50766 -0.233835 -2.486 -48.3549 jazz
548+0.118506 0.506935 0.000608887 -269.114 33.9395 1.32316 2.39602 3.36752 0.198154 0.478054 -0.395612 1.08587 0.305092 4.02611e-13 -0.305092 -1.08587 0.395612 -0.478054 -0.198154 -3.36752 -2.39602 -1.32316 -33.9395 jazz
549+0.08951 0.494928 0.000710687 -265.639 39.8002 3.58488 0.777602 2.9323 0.775124 0.931748 0.252761 0.626828 -0.268809 4.05337e-13 0.268809 -0.626828 -0.252761 -0.931748 -0.775124 -2.9323 -0.777602 -3.58488 -39.8002 jazz
550+0.118396 0.574804 0.00246748 -244.169 41.5737 7.89454 9.43612 1.25924 -1.12445 -0.0301384 -4.05479 -0.919153 -2.72862 3.73579e-13 2.72862 0.919153 4.05479 0.0301384 1.12445 -1.25924 -9.43612 -7.89454 -41.5737 jazz
551+0.12383 0.538333 0.00248241 -236.896 37.6475 1.31335 7.14114 3.01207 3.30969 2.19722 0.689803 2.56263 0.845905 3.63848e-13 -0.845905 -2.56263 -0.689803 -2.19722 -3.30969 -3.01207 -7.14114 -1.31335 -37.6475 jazz
552+0.0582535 0.495173 0.000878854 -275.411 37.6474 10.6782 4.63591 4.65743 1.62017 1.3183 1.22812 0.541842 -0.0337012 4.14199e-13 0.0337012 -0.541842 -1.22812 -1.3183 -1.62017 -4.65743 -4.63591 -10.6782 -37.6474 jazz
553+0.102686 0.37824 0.00278867 -236.251 42.5851 0.633626 7.41266 4.89161 -1.35196 1.81033 -0.997838 1.4645 0.97266 3.67475e-13 -0.97266 -1.4645 0.997838 -1.81033 1.35196 -4.89161 -7.41266 -0.633626 -42.5851 jazz
554+0.10296 0.701492 0.00158021 -247.142 41.8852 -3.85846 -0.15908 4.65124 -0.651759 2.23665 0.579336 1.37564 -0.0829915 3.83092e-13 0.0829915 -1.37564 -0.579336 -2.23665 0.651759 -4.65124 0.15908 3.85846 -41.8852 jazz
555+0.128564 0.48014 0.000772032 -264.372 35.6206 0.277621 -1.17831 -0.282843 -0.6332 0.17524 -0.194123 0.155119 -0.227773 3.99536e-13 0.227773 -0.155119 0.194123 -0.17524 0.6332 0.282843 1.17831 -0.277621 -35.6206 jazz
556+0.0402185 0.458375 0.00115304 -270.39 45.5064 14.2384 2.64847 3.47895 1.21232 -0.575829 0.541922 0.0814141 -1.32644 4.16692e-13 1.32644 -0.0814141 -0.541922 0.575829 -1.21232 -3.47895 -2.64847 -14.2384 -45.5064 jazz
557+0.152104 0.578616 0.00253427 -228.49 34.4623 0.882101 7.06451 1.31345 2.33039 0.971143 0.681924 1.59194 0.559797 3.4883e-13 -0.559797 -1.59194 -0.681924 -0.971143 -2.33039 -1.31345 -7.06451 -0.882101 -34.4623 jazz
558+0.0591154 0.366411 0.00147335 -262.26 48.3495 11.2967 2.01659 2.32623 -0.581781 -1.419 -0.30153 0.331313 0.448683 4.11036e-13 -0.448683 -0.331313 0.30153 1.419 0.581781 -2.32623 -2.01659 -11.2967 -48.3495 jazz
559+0.0852707 0.773656 0.00104047 -255.958 44.9471 -3.09724 -5.14401 6.23003 1.63366 -0.362119 -0.28505 -0.173586 -1.22977 4.00673e-13 1.22977 0.173586 0.28505 0.362119 -1.63366 -6.23003 5.14401 3.09724 -44.9471 jazz
560+0.061378 0.379296 0.00266399 -255.373 47.0082 9.95219 5.15229 3.04006 0.707347 1.61248 0.0811801 0.0118493 -0.711569 3.9832e-13 0.711569 -0.0118493 -0.0811801 -1.61248 -0.707347 -3.04006 -5.15229 -9.95219 -47.0082 jazz
561+0.0691243 0.499775 0.00130688 -263.034 46.6354 9.45428 -1.44871 -1.30445 -0.561992 0.587024 0.808027 0.18291 -0.406255 4.10486e-13 0.406255 -0.18291 -0.808027 -0.587024 0.561992 1.30445 1.44871 -9.45428 -46.6354 jazz
562+0.12764 0.482291 0.00320482 -221.413 40.5206 -2.8368 4.72925 2.45825 1.13705 1.26959 -0.40405 1.42121 -0.170994 3.46575e-13 0.170994 -1.42121 0.40405 -1.26959 -1.13705 -2.45825 -4.72925 2.8368 -40.5206 jazz
563+0.0858773 0.514111 0.00141233 -253.726 45.887 3.17368 1.7722 4.15038 0.650422 0.0562424 0.470286 0.952776 -0.0652131 3.96836e-13 0.0652131 -0.952776 -0.470286 -0.0562424 -0.650422 -4.15038 -1.7722 -3.17368 -45.887 jazz
564+0.126082 0.562699 0.00213505 -235.069 39.5535 1.5669 6.5106 1.01706 0.57457 0.532951 -0.0483144 0.856319 0.43658 3.63641e-13 -0.43658 -0.856319 0.0483144 -0.532951 -0.57457 -1.01706 -6.5106 -1.5669 -39.5535 jazz
565+0.089483 0.522359 0.00270867 -237.964 46.0421 2.19961 5.29421 3.18287 1.41895 0.420442 -1.12939 1.77532 -1.28162 3.73886e-13 1.28162 -1.77532 1.12939 -0.420442 -1.41895 -3.18287 -5.29421 -2.19961 -46.0421 jazz
566+0.0829383 0.600424 0.00117673 -255.605 44.9731 -0.0410311 1.4174 6.33676 -2.74915 -0.0415294 -0.583536 -1.75217 1.28075 3.99251e-13 -1.28075 1.75217 0.583536 0.0415294 2.74915 -6.33676 -1.4174 0.0410311 -44.9731 jazz
567+0.0826623 0.50597 0.0022197 -239.136 50.4915 -1.66595 -1.68936 2.38379 -1.04499 0.707604 -1.08113 -0.183568 0.418204 3.84767e-13 -0.418204 0.183568 1.08113 -0.707604 1.04499 -2.38379 1.68936 1.66595 -50.4915 jazz
568+0.0702528 0.671537 0.00181067 -253.19 50.2465 4.83304 1.70674 3.91405 -4.27062 -1.92121 -0.0779196 -1.19114 -0.903889 3.99773e-13 0.903889 1.19114 0.0779196 1.92121 4.27062 -3.91405 -1.70674 -4.83304 -50.2465 jazz
569+0.0685622 0.510746 0.00137722 -258.643 45.6782 7.4994 3.73282 3.25524 -4.20394 -0.0202619 0.306168 -1.19356 -1.36797 3.99796e-13 1.36797 1.19356 -0.306168 0.0202619 4.20394 -3.25524 -3.73282 -7.4994 -45.6782 jazz
570+0.100649 0.585888 0.00160313 -247.81 45.8096 -2.16901 -3.26473 2.02037 -0.925011 -0.883879 0.528428 1.02168 -0.437948 3.90229e-13 0.437948 -1.02168 -0.528428 0.883879 0.925011 -2.02037 3.26473 2.16901 -45.8096 jazz
571+0.0536911 0.476756 0.00121844 -266.324 45.462 10.6563 -1.43656 -0.618503 0.509359 1.15134 0.954718 0.0722604 -0.496929 4.13468e-13 0.496929 -0.0722604 -0.954718 -1.15134 -0.509359 0.618503 1.43656 -10.6563 -45.462 jazz
572+0.0479461 0.461786 0.00131049 -263.841 49.1256 11.2059 0.0615326 3.37157 1.55071 -0.415807 0.179305 -0.206739 -1.23163 4.13811e-13 1.23163 0.206739 -0.179305 0.415807 -1.55071 -3.37157 -0.0615326 -11.2059 -49.1256 jazz
573+0.0743557 0.644734 0.00141456 -253.782 48.3071 2.49896 0.24996 4.47438 -2.41952 0.375507 1.29447 -0.72206 -1.51606 3.98339e-13 1.51606 0.72206 -1.29447 -0.375507 2.41952 -4.47438 -0.24996 -2.49896 -48.3071 jazz
574+0.155235 0.637123 0.00154909 -238.756 35.2365 -1.27897 4.94818 2.63995 1.67073 -1.65958 -0.444714 0.222387 0.525793 3.64903e-13 -0.525793 -0.222387 0.444714 1.65958 -1.67073 -2.63995 -4.94818 1.27897 -35.2365 jazz
575+0.111993 0.44623 0.00131117 -254.976 39.7352 3.38983 4.23249 3.11075 0.146821 0.290225 0.3051 0.529701 -0.179948 3.90054e-13 0.179948 -0.529701 -0.3051 -0.290225 -0.146821 -3.11075 -4.23249 -3.38983 -39.7352 jazz
576+0.156995 0.54098 0.00214961 -228.671 37.419 -2.93894 3.29644 0.698361 -0.160121 -2.52428 -1.0892 -0.857437 -0.352479 3.53977e-13 0.352479 0.857437 1.0892 2.52428 0.160121 -0.698361 -3.29644 2.93894 -37.419 jazz
577+0.0861733 0.372261 0.00143704 -253.767 46.8397 3.28023 -1.20251 1.90081 0.671481 1.09039 0.834955 0.919255 0.634136 3.99678e-13 -0.634136 -0.919255 -0.834955 -1.09039 -0.671481 -1.90081 1.20251 -3.28023 -46.8397 jazz
578+0.142332 0.556043 0.00230668 -226.373 38.6782 -6.49963 1.15894 2.20629 0.909478 0.438461 -2.26424 -1.14493 -0.981651 3.52513e-13 0.981651 1.14493 2.26424 -0.438461 -0.909478 -2.20629 -1.15894 6.49963 -38.6782 jazz
579+0.122221 0.428767 0.0015289 -248.55 40.0365 -0.62924 3.75593 6.01242 0.139623 -2.78064 -2.27947 0.387998 0.290863 3.82969e-13 -0.290863 -0.387998 2.27947 2.78064 -0.139623 -6.01242 -3.75593 0.62924 -40.0365 jazz
580+0.138279 0.524325 0.000924672 -252.101 36.3085 -2.47535 3.35359 4.34611 0.90712 -0.321184 0.234016 0.245829 0.131286 3.83527e-13 -0.131286 -0.245829 -0.234016 0.321184 -0.90712 -4.34611 -3.35359 2.47535 -36.3085 jazz
581+0.168079 0.621651 0.00109708 -241.234 32.4452 -4.52496 5.34918 3.85794 0.843409 -0.414687 0.990544 1.14979 0.936681 3.64364e-13 -0.936681 -1.14979 -0.990544 0.414687 -0.843409 -3.85794 -5.34918 4.52496 -32.4452 jazz
582+0.161496 0.492757 0.000477148 -279.865 23.2524 10.2211 9.8293 3.69008 4.41206 0.986618 1.05688 0.688971 0.693707 4.0282e-13 -0.693707 -0.688971 -1.05688 -0.986618 -4.41206 -3.69008 -9.8293 -10.2211 -23.2524 jazz
583+0.227298 0.59444 0.000599657 -254.312 23.2235 2.53 7.31153 -0.197984 2.92281 0.0110138 1.35442 0.244672 0.319314 3.70099e-13 -0.319314 -0.244672 -1.35442 -0.0110138 -2.92281 0.197984 -7.31153 -2.53 -23.2235 jazz
584+0.198573 0.545588 0.00100055 -247.306 25.8422 2.72971 11.6786 1.52359 0.0337082 0.148538 0.245453 0.0244192 0.110595 3.61149e-13 -0.110595 -0.0244192 -0.245453 -0.148538 -0.0337082 -1.52359 -11.6786 -2.72971 -25.8422 jazz
585+0.149399 0.44485 0.000653071 -265.003 31.0438 1.5255 4.88231 3.32433 1.27042 0.513125 -0.382392 -0.361123 0.395811 3.93903e-13 -0.395811 0.361123 0.382392 -0.513125 -1.27042 -3.32433 -4.88231 -1.5255 -31.0438 jazz
586+0.156137 0.504455 0.000873117 -249.034 34.3014 -6.52514 1.64005 2.83779 -1.4617 -0.102255 -0.926602 -0.780439 0.0542431 3.77265e-13 -0.0542431 0.780439 0.926602 0.102255 1.4617 -2.83779 -1.64005 6.52514 -34.3014 jazz
587+0.21509 0.507155 0.000683914 -246.593 23.1523 -4.73221 5.82761 1.38908 0.488113 -0.217591 0.274326 -2.16856 0.284938 3.60579e-13 -0.284938 2.16856 -0.274326 0.217591 -0.488113 -1.38908 -5.82761 4.73221 -23.1523 jazz
588+0.0780243 0.368896 0.000544528 -299.057 20.3834 15.2066 11.6219 8.2292 6.15088 4.65069 3.33962 1.96654 0.885569 4.23004e-13 -0.885569 -1.96654 -3.33962 -4.65069 -6.15088 -8.2292 -11.6219 -15.2066 -20.3834 jazz
589+0.110398 0.299846 0.00148691 -250.459 43.6996 6.27578 -0.012181 -1.87848 2.51362 0.553819 2.66346 0.0384616 -0.933317 3.91029e-13 0.933317 -0.0384616 -2.66346 -0.553819 -2.51362 1.87848 0.012181 -6.27578 -43.6996 jazz
590+0.0854394 0.32469 0.000460506 -286.466 29.2916 11.0418 5.70051 6.21486 3.86979 -0.183823 -2.0996 -1.48212 -0.495402 4.19356e-13 0.495402 1.48212 2.0996 0.183823 -3.86979 -6.21486 -5.70051 -11.0418 -29.2916 jazz
591+0.0897365 0.388906 0.000842748 -266.412 40.3894 10.4835 5.7398 3.3993 -0.22601 -2.81939 -0.866033 0.418164 0.319174 4.05825e-13 -0.319174 -0.418164 0.866033 2.81939 0.22601 -3.3993 -5.7398 -10.4835 -40.3894 jazz
592+0.141911 0.346163 0.00050574 -276.939 23.7604 6.08996 4.84873 2.47756 0.925241 -1.11709 -2.76376 -1.4535 0.968074 4.01313e-13 -0.968074 1.4535 2.76376 1.11709 -0.925241 -2.47756 -4.84873 -6.08996 -23.7604 jazz
593+0.0826558 0.293532 0.000812116 -278.154 35.6907 14.4671 8.23823 4.88446 0.65201 -2.43677 -1.83031 0.22297 0.932787 4.15193e-13 -0.932787 -0.22297 1.83031 2.43677 -0.65201 -4.88446 -8.23823 -14.4671 -35.6907 jazz
594+0.107525 0.432898 0.000539244 -271.342 36.7879 8.07791 1.05173 0.354064 2.05492 0.723948 0.607323 -0.107495 -0.626692 4.09501e-13 0.626692 0.107495 -0.607323 -0.723948 -2.05492 -0.354064 -1.05173 -8.07791 -36.7879 jazz
595+0.0520317 0.364306 0.00049348 -284.284 33.7858 14.5765 4.80842 2.68001 1.63588 0.128111 -0.741152 -0.116559 0.386929 4.21784e-13 -0.386929 0.116559 0.741152 -0.128111 -1.63588 -2.68001 -4.80842 -14.5765 -33.7858 jazz
596+0.106499 0.433561 0.000924667 -260.625 39.2537 1.97673 1.99834 2.45561 1.93898 2.18751 -1.32051 0.616947 0.0760991 3.98343e-13 -0.0760991 -0.616947 1.32051 -2.18751 -1.93898 -2.45561 -1.99834 -1.97673 -39.2537 jazz
597+0.107579 0.413575 0.000647954 -261.796 40.005 0.272768 -2.77699 0.206265 1.34334 1.09398 -1.21439 0.930425 -0.146906 4.02278e-13 0.146906 -0.930425 1.21439 -1.09398 -1.34334 -0.206265 2.77699 -0.272768 -40.005 jazz
598+0.0561988 0.295752 0.000285538 -292.958 26.9005 15.2699 6.6341 2.43021 0.639738 -0.449235 -1.34051 -1.53504 -0.9987 4.23127e-13 0.9987 1.53504 1.34051 0.449235 -0.639738 -2.43021 -6.6341 -15.2699 -26.9005 jazz
599+0.100686 0.498172 0.000772789 -268.56 35.6417 5.9258 5.61872 3.58951 1.39094 2.24914 -0.446487 1.08878 1.18366 4.03544e-13 -1.18366 -1.08878 0.446487 -2.24914 -1.39094 -3.58951 -5.61872 -5.9258 -35.6417 jazz
600+0.0791504 0.41938 0.000523978 -278.766 35.0816 9.71246 1.45573 0.987022 0.773142 -0.270703 -1.65517 -0.928454 -0.302712 4.17051e-13 0.302712 0.928454 1.65517 0.270703 -0.773142 -0.987022 -1.45573 -9.71246 -35.0816 jazz
601+0.166433 0.579362 0.00147009 -232.841 32.0134 -8.89895 5.93007 8.20919 1.68797 1.35358 -0.0705193 -0.407475 -0.500087 3.51457e-13 0.500087 0.407475 0.0705193 -1.35358 -1.68797 -8.20919 -5.93007 8.89895 -32.0134 metal
602+0.15526 0.648761 0.00138336 -236.372 33.0965 -7.11652 4.851 4.86094 2.08848 2.32648 -0.21179 2.17679 1.60781 3.59077e-13 -1.60781 -2.17679 0.21179 -2.32648 -2.08848 -4.86094 -4.851 7.11652 -33.0965 metal
603+0.121161 0.69854 0.00179632 -233.814 43.2287 -8.5977 0.987505 5.10014 -1.52404 2.74289 -2.34576 0.733736 -0.520119 3.66291e-13 0.520119 -0.733736 2.34576 -2.74289 1.52404 -5.10014 -0.987505 8.5977 -43.2287 metal
604+0.158087 0.738518 0.00188484 -227.838 34.0557 -10.3666 4.43311 4.54117 -1.20116 4.73372 -1.51115 3.35517 -0.414384 3.44997e-13 0.414384 -3.35517 1.51115 -4.73372 1.20116 -4.54117 -4.43311 10.3666 -34.0557 metal
605+0.180739 0.678494 0.000818756 -246.335 27.5834 -6.38818 4.76828 4.23278 3.47478 1.18547 -0.451546 0.90568 0.41607 3.65698e-13 -0.41607 -0.90568 0.451546 -1.18547 -3.47478 -4.23278 -4.76828 6.38818 -27.5834 metal
606+0.131851 0.634732 0.00163278 -238.546 38.8428 -5.43978 6.37654 7.13354 -1.23036 2.92448 -0.622393 1.86488 -0.096932 3.65206e-13 0.096932 -1.86488 0.622393 -2.92448 1.23036 -7.13354 -6.37654 5.43978 -38.8428 metal
607+0.162587 0.609351 0.000641348 -252.574 32.2181 -6.36008 3.42342 3.48999 -1.80634 -0.481263 -1.23943 0.67791 0.676356 3.78753e-13 -0.676356 -0.67791 1.23943 0.481263 1.80634 -3.48999 -3.42342 6.36008 -32.2181 metal
608+0.152718 0.6755 0.000912061 -248.342 32.7782 -6.89223 5.14162 7.15949 2.46701 1.43454 -0.79651 1.74365 0.610337 3.73813e-13 -0.610337 -1.74365 0.79651 -1.43454 -2.46701 -7.15949 -5.14162 6.89223 -32.7782 metal
609+0.15983 0.512116 0.00077542 -253.097 31.4507 -1.50901 3.58894 2.831 2.30739 -0.21724 1.47444 1.03563 0.33336 3.79332e-13 -0.33336 -1.03563 -1.47444 0.21724 -2.30739 -2.831 -3.58894 1.50901 -31.4507 metal
610+0.128401 0.646925 0.00389654 -219.707 38.2014 -2.53462 11.655 5.5462 -4.34902 4.22808 -1.74008 2.04179 -1.05131 3.34967e-13 1.05131 -2.04179 1.74008 -4.22808 4.34902 -5.5462 -11.655 2.53462 -38.2014 metal
611+0.164079 0.647606 0.00156536 -233.858 31.8787 -6.90649 10.7318 8.60767 -1.72102 3.16797 -2.54436 2.13625 -0.206098 3.48393e-13 0.206098 -2.13625 2.54436 -3.16797 1.72102 -8.60767 -10.7318 6.90649 -31.8787 metal
612+0.147143 0.642916 0.00316484 -214.064 37.2404 -8.65817 6.83636 6.97143 -1.59662 0.789459 -3.75876 3.59493 -0.29854 3.29827e-13 0.29854 -3.59493 3.75876 -0.789459 1.59662 -6.97143 -6.83636 8.65817 -37.2404 metal
613+0.157962 0.629858 0.001457 -235.905 32.8326 -12.2737 4.90498 8.97904 1.49789 4.71911 -2.04449 2.56049 -0.0901632 3.55479e-13 0.0901632 -2.56049 2.04449 -4.71911 -1.49789 -8.97904 -4.90498 12.2737 -32.8326 metal
614+0.166776 0.689924 0.00112979 -238.88 31.2837 -11.4798 4.69016 6.86776 0.742673 3.40594 -2.91535 2.15326 -0.266511 3.57677e-13 0.266511 -2.15326 2.91535 -3.40594 -0.742673 -6.86776 -4.69016 11.4798 -31.2837 metal
615+0.159422 0.572662 0.00102422 -243.816 32.8447 -12.6535 3.39069 8.64238 1.11791 4.53526 -0.982986 2.19338 0.238968 3.67014e-13 -0.238968 -2.19338 0.982986 -4.53526 -1.11791 -8.64238 -3.39069 12.6535 -32.8447 metal
616+0.173937 0.651723 0.00147207 -234.554 29.7162 -6.20295 11.6333 8.75471 -0.326622 3.07015 -3.05096 1.84296 -0.498212 3.46675e-13 0.498212 -1.84296 3.05096 -3.07015 0.326622 -8.75471 -11.6333 6.20295 -29.7162 metal
617+0.154749 0.719818 0.00340177 -211.11 36.3535 -13.4349 1.54476 4.53263 -1.25835 3.64621 -3.80359 3.2219 -0.717275 3.26362e-13 0.717275 -3.2219 3.80359 -3.64621 1.25835 -4.53263 -1.54476 13.4349 -36.3535 metal
618+0.151362 0.671971 0.00142465 -239.361 32.7543 -6.55301 9.20911 8.05439 0.58987 4.1356 -2.15934 2.05887 -0.965776 3.57416e-13 0.965776 -2.05887 2.15934 -4.1356 -0.58987 -8.05439 -9.20911 6.55301 -32.7543 metal
619+0.124827 0.673337 0.00155773 -238.281 42.7695 -14.1187 -2.47933 10.4008 -2.34905 2.67887 -0.65793 0.116847 -0.283491 3.72753e-13 0.283491 -0.116847 0.65793 -2.67887 2.34905 -10.4008 2.47933 14.1187 -42.7695 metal
620+0.148731 0.64642 0.00105409 -248.757 31.5646 -5.5621 7.47563 8.48045 1.11085 2.39913 -1.38185 1.71566 -0.797508 3.69716e-13 0.797508 -1.71566 1.38185 -2.39913 -1.11085 -8.48045 -7.47563 5.5621 -31.5646 metal
621+0.156067 0.714837 0.00158066 -234.512 32.9963 -6.80354 8.43561 6.83913 0.428842 3.86873 -2.60635 2.10337 -1.14038 3.51392e-13 1.14038 -2.10337 2.60635 -3.86873 -0.428842 -6.83913 -8.43561 6.80354 -32.9963 metal
622+0.169041 0.661443 0.0013567 -236.728 30.6946 -9.16835 6.54928 5.8778 -0.0268666 4.95165 -0.955033 3.50261 -0.135997 3.52508e-13 0.135997 -3.50261 0.955033 -4.95165 0.0268666 -5.8778 -6.54928 9.16835 -30.6946 metal
623+0.124429 0.605454 0.00259348 -227.215 40.1629 -3.5093 9.71865 5.80787 -2.93063 1.56699 -5.08203 2.88611 -0.616709 3.49101e-13 0.616709 -2.88611 5.08203 -1.56699 2.93063 -5.80787 -9.71865 3.5093 -40.1629 metal
624+0.139492 0.60163 0.00257038 -227.974 38.1178 -11.195 6.58433 11.9599 -3.87992 5.94163 0.15309 2.71661 1.32101 3.49385e-13 -1.32101 -2.71661 -0.15309 -5.94163 3.87992 -11.9599 -6.58433 11.195 -38.1178 metal
625+0.123528 0.590559 0.00305936 -223.733 40.5486 -5.95978 5.26692 3.85059 -0.909645 4.68497 -1.44364 3.37721 -0.0191684 3.47499e-13 0.0191684 -3.37721 1.44364 -4.68497 0.909645 -3.85059 -5.26692 5.95978 -40.5486 metal
626+0.117228 0.544168 0.00129592 -251.698 36.9588 -4.0729 5.45018 10.6296 3.98526 3.58979 0.18908 2.03868 -0.0695023 3.82111e-13 0.0695023 -2.03868 -0.18908 -3.58979 -3.98526 -10.6296 -5.45018 4.0729 -36.9588 metal
627+0.163129 0.728078 0.00189623 -228.828 33.016 -13.9363 6.49466 11.3255 -2.9852 7.56615 -2.24882 1.65507 1.14296 3.44699e-13 -1.14296 -1.65507 2.24882 -7.56615 2.9852 -11.3255 -6.49466 13.9363 -33.016 metal
628+0.128782 0.753137 0.00216764 -230.222 39.4304 -6.11574 4.9562 4.2226 0.0796241 4.14787 -2.16776 2.26665 -0.786365 3.55027e-13 0.786365 -2.26665 2.16776 -4.14787 -0.0796241 -4.2226 -4.9562 6.11574 -39.4304 metal
629+0.154192 0.684711 0.00191155 -224.891 36.2939 -9.0012 3.72028 3.36542 -1.1961 2.7391 -3.57831 1.62071 -1.72491 3.43739e-13 1.72491 -1.62071 3.57831 -2.7391 1.1961 -3.36542 -3.72028 9.0012 -36.2939 metal
630+0.156242 0.665197 0.00108431 -245.027 32.9685 -2.99065 8.10217 3.07802 -2.65369 2.49048 -1.43283 2.40004 0.0955813 3.65772e-13 -0.0955813 -2.40004 1.43283 -2.49048 2.65369 -3.07802 -8.10217 2.99065 -32.9685 metal
631+0.0696181 0.447859 0.00293372 -244.915 47.9857 1.87119 4.66603 7.32175 2.46227 3.57638 0.00151458 0.621248 -0.144219 3.8666e-13 0.144219 -0.621248 -0.00151458 -3.57638 -2.46227 -7.32175 -4.66603 -1.87119 -47.9857 metal
632+0.144308 0.634528 0.0027729 -220.954 36.8038 -5.11849 7.27165 4.33017 -0.51608 3.8183 -1.9623 2.39742 -1.9903 3.37162e-13 1.9903 -2.39742 1.9623 -3.8183 0.51608 -4.33017 -7.27165 5.11849 -36.8038 metal
633+0.139992 0.633526 0.00181794 -231.01 38.8716 -8.32934 4.09155 5.3904 -2.1814 2.68242 -0.779551 3.36852 -0.855635 3.54649e-13 0.855635 -3.36852 0.779551 -2.68242 2.1814 -5.3904 -4.09155 8.32934 -38.8716 metal
634+0.103087 0.55144 0.00349138 -230.678 43.8311 -6.58355 7.53297 12.587 -1.35085 5.52329 0.533111 1.26577 1.00765 3.60743e-13 -1.00765 -1.26577 -0.533111 -5.52329 1.35085 -12.587 -7.53297 6.58355 -43.8311 metal
635+0.142878 0.697675 0.00109897 -245.09 36.77 -6.52942 3.9012 4.37936 -2.97726 1.48464 -1.81757 0.961717 -0.51488 3.71998e-13 0.51488 -0.961717 1.81757 -1.48464 2.97726 -4.37936 -3.9012 6.52942 -36.77 metal
636+0.150719 0.630273 0.00292404 -221.318 34.785 -8.99538 5.55068 7.95475 0.890696 6.37501 -1.27615 1.83675 0.238654 3.37976e-13 -0.238654 -1.83675 1.27615 -6.37501 -0.890696 -7.95475 -5.55068 8.99538 -34.785 metal
637+0.155766 0.707949 0.00120212 -238.511 33.205 -7.85593 5.41725 4.54198 0.184577 3.21611 -2.44013 1.86825 -0.615746 3.58917e-13 0.615746 -1.86825 2.44013 -3.21611 -0.184577 -4.54198 -5.41725 7.85593 -33.205 metal
638+0.123754 0.655146 0.00153871 -237.908 41.3589 -4.5288 3.18254 1.10453 -2.72605 3.63071 -1.51464 2.08887 -0.105936 3.68182e-13 0.105936 -2.08887 1.51464 -3.63071 2.72605 -1.10453 -3.18254 4.5288 -41.3589 metal
639+0.120451 0.593551 0.00129528 -253.628 35.1251 -5.58018 2.37417 11.4206 5.1886 2.89193 -1.25777 0.396654 -0.15911 3.84368e-13 0.15911 -0.396654 1.25777 -2.89193 -5.1886 -11.4206 -2.37417 5.58018 -35.1251 metal
640+0.12949 0.416483 0.00189321 -236.308 40.2862 -5.6959 7.09558 6.61757 -3.71668 4.69259 0.46343 1.93662 -0.388749 3.62291e-13 0.388749 -1.93662 -0.46343 -4.69259 3.71668 -6.61757 -7.09558 5.6959 -40.2862 metal
641+0.141388 0.723388 0.00140999 -238.075 37.2795 -10.3261 1.63538 5.97875 0.503244 3.71999 0.434712 3.79828 0.0517728 3.64634e-13 -0.0517728 -3.79828 -0.434712 -3.71999 -0.503244 -5.97875 -1.63538 10.3261 -37.2795 metal
642+0.123065 0.589955 0.0012793 -243.888 40.2125 -7.37034 1.36584 7.19391 1.56455 2.90526 0.362837 2.78999 -0.576885 3.76046e-13 0.576885 -2.78999 -0.362837 -2.90526 -1.56455 -7.19391 -1.36584 7.37034 -40.2125 metal
643+0.137511 0.670425 0.00121766 -241.159 38.4458 -9.34428 0.844812 4.53923 0.45427 3.55502 -0.855414 2.35135 -0.604872 3.70399e-13 0.604872 -2.35135 0.855414 -3.55502 -0.45427 -4.53923 -0.844812 9.34428 -38.4458 metal
644+0.150916 0.708013 0.00111111 -247.059 33.5414 -7.60312 2.48229 5.33676 0.252451 1.76465 -1.00289 2.32222 -0.532864 3.71742e-13 0.532864 -2.32222 1.00289 -1.76465 -0.252451 -5.33676 -2.48229 7.60312 -33.5414 metal
645+0.146765 0.634671 0.00124715 -240.423 35.3719 -8.39756 3.38797 5.94018 1.5124 3.84984 0.158632 3.40552 -0.0621104 3.65124e-13 0.0621104 -3.40552 -0.158632 -3.84984 -1.5124 -5.94018 -3.38797 8.39756 -35.3719 metal
646+0.127728 0.460021 0.00112006 -246.555 38.1386 -6.67704 4.80263 8.74611 1.34372 2.38453 0.0444633 2.59352 -0.44585 3.76015e-13 0.44585 -2.59352 -0.0444633 -2.38453 -1.34372 -8.74611 -4.80263 6.67704 -38.1386 metal
647+0.159953 0.657568 0.00272198 -216.745 33.8423 -8.24325 7.40931 5.53114 -0.983455 3.78931 -3.50339 1.59482 -1.48254 3.28473e-13 1.48254 -1.59482 3.50339 -3.78931 0.983455 -5.53114 -7.40931 8.24325 -33.8423 metal
648+0.164421 0.709661 0.00293191 -215.243 34.2077 -8.96295 7.32403 6.07972 -2.61374 2.97343 -3.29147 1.13845 -1.94368 3.26178e-13 1.94368 -1.13845 3.29147 -2.97343 2.61374 -6.07972 -7.32403 8.96295 -34.2077 metal
649+0.164586 0.660577 0.00306585 -211.531 33.4194 -8.58886 6.33573 3.88274 -2.14103 3.2433 -1.91777 2.53382 -1.00854 3.21324e-13 1.00854 -2.53382 1.91777 -3.2433 2.14103 -3.88274 -6.33573 8.58886 -33.4194 metal
650+0.165115 0.646835 0.00285809 -214.829 33.432 -9.3156 7.74719 6.23675 -2.69758 3.65275 -2.8357 1.76231 -1.57924 3.24517e-13 1.57924 -1.76231 2.8357 -3.65275 2.69758 -6.23675 -7.74719 9.3156 -33.432 metal
651+0.16239 0.67454 0.00330779 -211.323 34.2211 -8.71723 7.46964 5.735 -2.37393 3.67612 -2.51335 1.59867 -1.69152 3.20985e-13 1.69152 -1.59867 2.51335 -3.67612 2.37393 -5.735 -7.46964 8.71723 -34.2211 metal
652+0.186477 0.638559 0.00294535 -212.369 28.102 -9.36029 8.49599 5.7262 -1.42184 4.72371 -1.90795 1.88095 -1.33282 3.14968e-13 1.33282 -1.88095 1.90795 -4.72371 1.42184 -5.7262 -8.49599 9.36029 -28.102 metal
653+0.165926 0.69947 0.00318312 -210.941 33.7693 -10.4568 5.22501 5.02375 -1.81597 4.0392 -2.0461 1.75571 -1.24359 3.21367e-13 1.24359 -1.75571 2.0461 -4.0392 1.81597 -5.02375 -5.22501 10.4568 -33.7693 metal
654+0.157967 0.666317 0.0028422 -216.759 34.8087 -8.35829 7.24544 5.459 -2.58885 2.90499 -2.3805 1.54979 -1.58397 3.29278e-13 1.58397 -1.54979 2.3805 -2.90499 2.58885 -5.459 -7.24544 8.35829 -34.8087 metal
655+0.173252 0.651617 0.00275724 -214.742 31.3309 -8.54973 7.93213 5.3392 -1.52626 4.55534 -2.60142 1.69269 -1.47838 3.22194e-13 1.47838 -1.69269 2.60142 -4.55534 1.52626 -5.3392 -7.93213 8.54973 -31.3309 metal
656+0.170041 0.6583 0.00297195 -213.195 32.4262 -9.00216 7.50972 5.56059 -2.13904 3.57603 -2.67996 1.19079 -1.6257 3.21624e-13 1.6257 -1.19079 2.67996 -3.57603 2.13904 -5.56059 -7.50972 9.00216 -32.4262 metal
657+0.158614 0.664141 0.00319204 -213.724 35.3891 -8.60005 7.20657 5.61454 -3.10423 3.08386 -2.61735 1.36878 -1.80789 3.25535e-13 1.80789 -1.36878 2.61735 -3.08386 3.10423 -5.61454 -7.20657 8.60005 -35.3891 metal
658+0.142586 0.485264 0.00261376 -227.204 35.252 -8.79127 7.17696 10.299 0.752347 4.55785 -0.518586 1.72452 -0.979086 3.44919e-13 0.979086 -1.72452 0.518586 -4.55785 -0.752347 -10.299 -7.17696 8.79127 -35.252 metal
659+0.138236 0.727428 0.0024456 -222.033 39.2127 -6.80054 4.26109 2.73218 -1.25152 2.90572 -3.37144 2.64123 -1.45919 3.43061e-13 1.45919 -2.64123 3.37144 -2.90572 1.25152 -2.73218 -4.26109 6.80054 -39.2127 metal
660+0.13351 0.590849 0.00223876 -225.522 40.1 -8.38512 4.70217 5.83652 -1.12742 3.28415 -3.1248 2.42664 -0.826073 3.49172e-13 0.826073 -2.42664 3.1248 -3.28415 1.12742 -5.83652 -4.70217 8.38512 -40.1 metal
661+0.133311 0.647887 0.00155383 -234.936 39.6249 -8.83895 3.6649 5.79707 -1.53714 3.53238 -2.22569 1.94037 -0.576287 3.61812e-13 0.576287 -1.94037 2.22569 -3.53238 1.53714 -5.79707 -3.6649 8.83895 -39.6249 metal
662+0.141388 0.723581 0.00140999 -238.075 37.2795 -10.3261 1.63538 5.97875 0.503244 3.71999 0.434712 3.79828 0.0517728 3.64634e-13 -0.0517728 -3.79828 -0.434712 -3.71999 -0.503244 -5.97875 -1.63538 10.3261 -37.2795 metal
663+0.123065 0.589955 0.0012793 -243.888 40.2125 -7.37034 1.36584 7.19391 1.56455 2.90526 0.362837 2.78999 -0.576885 3.76046e-13 0.576885 -2.78999 -0.362837 -2.90526 -1.56455 -7.19391 -1.36584 7.37034 -40.2125 metal
664+0.137511 0.670425 0.00121766 -241.159 38.4458 -9.34428 0.844812 4.53923 0.45427 3.55502 -0.855414 2.35135 -0.604872 3.70399e-13 0.604872 -2.35135 0.855414 -3.55502 -0.45427 -4.53923 -0.844812 9.34428 -38.4458 metal
665+0.150916 0.708013 0.00111111 -247.059 33.5414 -7.60312 2.48229 5.33676 0.252451 1.76465 -1.00289 2.32222 -0.532864 3.71742e-13 0.532864 -2.32222 1.00289 -1.76465 -0.252451 -5.33676 -2.48229 7.60312 -33.5414 metal
666+0.146765 0.634671 0.00124715 -240.423 35.3719 -8.39756 3.38797 5.94018 1.5124 3.84984 0.158632 3.40552 -0.0621104 3.65124e-13 0.0621104 -3.40552 -0.158632 -3.84984 -1.5124 -5.94018 -3.38797 8.39756 -35.3719 metal
667+0.127728 0.460021 0.00112006 -246.555 38.1386 -6.67704 4.80263 8.74611 1.34372 2.38453 0.0444633 2.59352 -0.44585 3.76015e-13 0.44585 -2.59352 -0.0444633 -2.38453 -1.34372 -8.74611 -4.80263 6.67704 -38.1386 metal
668+0.12071 0.618627 0.00179979 -239.434 40.2945 -6.76854 5.18456 10.1846 1.55271 1.57604 -1.96354 1.26386 -0.707323 3.69257e-13 0.707323 -1.26386 1.96354 -1.57604 -1.55271 -10.1846 -5.18456 6.76854 -40.2945 metal
669+0.130263 0.648462 0.00117227 -248.179 35.955 -6.03343 3.0244 4.74987 -0.86834 2.64042 -0.515717 1.88064 0.0555465 3.76151e-13 -0.0555465 -1.88064 0.515717 -2.64042 0.86834 -4.74987 -3.0244 6.03343 -35.955 metal
670+0.0910448 0.603247 0.00235731 -248.112 39.66 0.459217 10.0046 8.91488 1.5705 3.73663 -0.306647 1.53334 -0.610737 3.77808e-13 0.610737 -1.53334 0.306647 -3.73663 -1.5705 -8.91488 -10.0046 -0.459217 -39.66 metal
671+0.162059 0.755992 0.000479418 -268.936 27.4885 -1.25582 4.8951 4.64582 1.54437 0.71537 -1.67111 -0.507972 -2.03602 3.9256e-13 2.03602 0.507972 1.67111 -0.71537 -1.54437 -4.64582 -4.8951 1.25582 -27.4885 metal
672+0.157827 0.69011 0.00135956 -242.599 32.5166 -5.07689 6.68066 4.03484 -1.41609 2.95577 -2.29856 1.50188 -1.06087 3.62037e-13 1.06087 -1.50188 2.29856 -2.95577 1.41609 -4.03484 -6.68066 5.07689 -32.5166 metal
673+0.12878 0.629985 0.00259917 -227.553 40.415 -7.46052 6.32335 7.54055 -0.359833 4.50274 -2.03181 2.55793 -0.192781 3.52212e-13 0.192781 -2.55793 2.03181 -4.50274 0.359833 -7.54055 -6.32335 7.46052 -40.415 metal
674+0.146158 0.574929 0.00372439 -215.797 35.7777 -4.97356 7.8202 5.38576 1.37826 4.57982 -1.74318 3.21171 -0.351867 3.30543e-13 0.351867 -3.21171 1.74318 -4.57982 -1.37826 -5.38576 -7.8202 4.97356 -35.7777 metal
675+0.142786 0.599399 0.00047281 -269.829 27.0034 -2.30558 8.19985 9.37905 1.74503 2.95135 0.635965 0.905027 0.231601 3.93133e-13 -0.231601 -0.905027 -0.635965 -2.95135 -1.74503 -9.37905 -8.19985 2.30558 -27.0034 metal
676+0.131579 0.577882 0.00407332 -216.159 39.0411 -5.70981 6.15701 6.20089 1.68811 3.80087 -1.91648 2.93372 -0.272565 3.36002e-13 0.272565 -2.93372 1.91648 -3.80087 -1.68811 -6.20089 -6.15701 5.70981 -39.0411 metal
677+0.144395 0.643361 0.000904916 -250.614 34.3771 -8.22955 5.09796 9.77341 -1.24717 2.11094 -0.222002 0.905064 0.569783 3.77281e-13 -0.569783 -0.905064 0.222002 -2.11094 1.24717 -9.77341 -5.09796 8.22955 -34.3771 metal
678+0.15696 0.669838 0.001987 -226.327 35.0303 -8.78519 6.53077 5.29417 -2.98833 4.60793 -2.1747 2.39423 -0.684353 3.42687e-13 0.684353 -2.39423 2.1747 -4.60793 2.98833 -5.29417 -6.53077 8.78519 -35.0303 metal
679+0.145224 0.576106 0.00334748 -221.968 33.9403 -5.42408 9.09188 7.20028 2.24662 6.36125 -0.972286 3.48742 -0.242019 3.36023e-13 0.242019 -3.48742 0.972286 -6.36125 -2.24662 -7.20028 -9.09188 5.42408 -33.9403 metal
680+0.14633 0.616781 0.00160856 -237.193 35.6637 -7.44459 4.79854 5.43828 0.860897 5.14232 -0.903995 2.41005 -0.403478 3.60195e-13 0.403478 -2.41005 0.903995 -5.14232 -0.860897 -5.43828 -4.79854 7.44459 -35.6637 metal
681+0.162905 0.688727 0.00142147 -241.208 30.2041 -4.19182 8.27443 4.94857 2.34264 5.66383 -2.24711 2.18094 -0.41792 3.57985e-13 0.41792 -2.18094 2.24711 -5.66383 -2.34264 -4.94857 -8.27443 4.19182 -30.2041 metal
682+0.11765 0.587414 0.00260442 -224.806 44.0674 -7.99803 1.87733 3.05388 -2.00524 3.73413 -2.07008 3.27937 -0.749076 3.53639e-13 0.749076 -3.27937 2.07008 -3.73413 2.00524 -3.05388 -1.87733 7.99803 -44.0674 metal
683+0.129649 0.65222 0.00160455 -237.11 39.7369 -7.50518 4.73401 5.6701 -2.3496 4.18465 -1.06124 1.78613 0.168605 3.64826e-13 -0.168605 -1.78613 1.06124 -4.18465 2.3496 -5.6701 -4.73401 7.50518 -39.7369 metal
684+0.122911 0.553137 0.00279878 -223.971 43.2487 -6.35959 5.79401 7.16057 -2.34766 2.50985 -3.47916 1.04664 -0.422204 3.50871e-13 0.422204 -1.04664 3.47916 -2.50985 2.34766 -7.16057 -5.79401 6.35959 -43.2487 metal
685+0.138778 0.672541 0.00292931 -219.241 38.9592 -8.54766 4.20882 4.70525 -1.75682 3.69709 -2.15837 1.75419 -1.21947 3.39221e-13 1.21947 -1.75419 2.15837 -3.69709 1.75682 -4.70525 -4.20882 8.54766 -38.9592 metal
686+0.144617 0.689706 0.00170003 -233.12 37.4132 -7.92194 5.13893 5.29843 -2.2188 4.81374 -1.40138 0.694467 -0.674236 3.56071e-13 0.674236 -0.694467 1.40138 -4.81374 2.2188 -5.29843 -5.13893 7.92194 -37.4132 metal
687+0.145425 0.6537 0.0011047 -243.789 35.1731 -5.75253 5.63006 4.63316 -1.57683 2.87697 -1.65987 1.27342 -1.09351 3.67296e-13 1.09351 -1.27342 1.65987 -2.87697 1.57683 -4.63316 -5.63006 5.75253 -35.1731 metal
688+0.180575 0.665525 0.00358471 -207.214 29.153 -5.37275 9.25695 3.66229 -0.667085 3.3702 -3.26733 2.6819 -0.634223 3.09838e-13 0.634223 -2.6819 3.26733 -3.3702 0.667085 -3.66229 -9.25695 5.37275 -29.153 metal
689+0.108195 0.595925 0.00164305 -250.25 38.4311 -2.79536 7.12881 9.46261 1.29757 3.59934 -0.585566 0.269819 -0.459183 3.80736e-13 0.459183 -0.269819 0.585566 -3.59934 -1.29757 -9.46261 -7.12881 2.79536 -38.4311 metal
690+0.0700977 0.393089 0.00373815 -244.739 46.294 -1.79039 6.4671 12.603 3.53662 5.60702 1.77227 1.06945 0.687302 3.84289e-13 -0.687302 -1.06945 -1.77227 -5.60702 -3.53662 -12.603 -6.4671 1.79039 -46.294 metal
691+0.0958152 0.471719 0.00186713 -247.697 41.3346 -0.0224892 6.6458 5.18413 1.58448 5.37104 1.36518 3.21456 0.952008 3.8146e-13 -0.952008 -3.21456 -1.36518 -5.37104 -1.58448 -5.18413 -6.6458 0.0224892 -41.3346 metal
692+0.127333 0.647576 0.00180192 -232.848 40.2974 -6.18398 4.60325 3.11557 -3.9609 4.3389 -1.48516 2.11136 0.286885 3.593e-13 -0.286885 -2.11136 1.48516 -4.3389 3.9609 -3.11557 -4.60325 6.18398 -40.2974 metal
693+0.109546 0.623159 0.00229098 -234.09 46.2946 -4.1864 4.51424 5.66463 -2.31824 3.01104 -0.937709 1.16262 -0.657883 3.68379e-13 0.657883 -1.16262 0.937709 -3.01104 2.31824 -5.66463 -4.51424 4.1864 -46.2946 metal
694+0.148817 0.642516 0.0012151 -244.045 34.5493 -7.45193 7.9218 8.72234 -1.02434 4.22631 -0.0422153 2.47563 0.536231 3.67032e-13 -0.536231 -2.47563 0.0422153 -4.22631 1.02434 -8.72234 -7.9218 7.45193 -34.5493 metal
695+0.142878 0.697492 0.00109897 -245.09 36.77 -6.52942 3.9012 4.37936 -2.97726 1.48464 -1.81757 0.961717 -0.51488 3.71998e-13 0.51488 -0.961717 1.81757 -1.48464 2.97726 -4.37936 -3.9012 6.52942 -36.77 metal
696+0.135906 0.595477 0.00253464 -225.019 37.6443 -5.73749 5.45193 2.3454 -1.89821 3.62683 -1.11813 3.88294 0.421502 3.45767e-13 -0.421502 -3.88294 1.11813 -3.62683 1.89821 -2.3454 -5.45193 5.73749 -37.6443 metal
697+0.15306 0.641043 0.00219483 -234.167 31.7999 -6.30872 9.58343 8.26919 1.62665 5.31793 -1.42195 2.5918 -0.345183 3.49712e-13 0.345183 -2.5918 1.42195 -5.31793 -1.62665 -8.26919 -9.58343 6.30872 -31.7999 metal
698+0.0844905 0.450399 0.00212841 -253.776 37.6057 2.24038 10.4946 10.1767 2.14368 3.35443 -0.291963 1.07144 -0.426714 3.82965e-13 0.426714 -1.07144 0.291963 -3.35443 -2.14368 -10.1767 -10.4946 -2.24038 -37.6057 metal
699+0.130452 0.576056 0.00174798 -239.231 38.1776 -7.95721 3.53593 6.68411 0.975471 3.49779 -1.19645 2.08268 -0.258422 3.66936e-13 0.258422 -2.08268 1.19645 -3.49779 -0.975471 -6.68411 -3.53593 7.95721 -38.1776 metal
700+0.132644 0.759989 0.00194246 -239.358 36.4638 -5.02187 4.67347 3.8331 -0.853612 3.92602 -1.38332 2.12977 0.177268 3.64235e-13 -0.177268 -2.12977 1.38332 -3.92602 0.853612 -3.8331 -4.67347 5.02187 -36.4638 metal
701+0.186118 0.562876 0.00205289 -239.233 28.4917 5.89657 8.73371 1.39002 5.04199 -2.03955 1.79853 -0.341687 -0.676425 3.56085e-13 0.676425 0.341687 -1.79853 2.03955 -5.04199 -1.39002 -8.73371 -5.89657 -28.4917 pop
702+0.198763 0.715671 0.00335096 -229.085 24.9217 8.3346 11.1701 0.587553 4.84997 -0.751963 0.826353 0.61334 0.340898 3.37335e-13 -0.340898 -0.61334 -0.826353 0.751963 -4.84997 -0.587553 -11.1701 -8.3346 -24.9217 pop
703+0.162818 0.633686 0.00284395 -233.175 30.255 6.70279 10.7853 0.785547 2.43166 0.110924 2.38527 1.23435 0.044746 3.48195e-13 -0.044746 -1.23435 -2.38527 -0.110924 -2.43166 -0.785547 -10.7853 -6.70279 -30.255 pop
704+0.103649 0.585501 0.00158603 -248.103 41.823 0.33586 -0.211724 4.63994 4.63066 -0.389527 1.49027 1.09312 -0.987839 3.85873e-13 0.987839 -1.09312 -1.49027 0.389527 -4.63066 -4.63994 0.211724 -0.33586 -41.823 pop
705+0.133846 0.590682 0.00257036 -229.29 38.5104 1.63579 4.4343 0.0193699 2.07543 -0.572248 0.570595 0.505386 -0.00700505 3.55859e-13 0.00700505 -0.505386 -0.570595 0.572248 -2.07543 -0.0193699 -4.4343 -1.63579 -38.5104 pop
706+0.0951813 0.475303 0.000642502 -277.04 30.8489 10.6998 8.2524 4.37514 1.14839 0.530225 -0.19493 -0.0375058 0.223791 4.07286e-13 -0.223791 0.0375058 0.19493 -0.530225 -1.14839 -4.37514 -8.2524 -10.6998 -30.8489 pop
707+0.10071 0.461201 0.000993029 -267.301 34.8378 7.97085 7.29394 3.88235 2.34206 2.99703 2.08865 1.59848 0.836826 3.99999e-13 -0.836826 -1.59848 -2.08865 -2.99703 -2.34206 -3.88235 -7.29394 -7.97085 -34.8378 pop
708+0.109971 0.57102 0.00107533 -264.708 37.5805 4.6361 0.758203 1.45451 0.616731 -1.45942 -0.699294 0.527054 0.418334 4.0245e-13 -0.418334 -0.527054 0.699294 1.45942 -0.616731 -1.45451 -0.758203 -4.6361 -37.5805 pop
709+0.130708 0.494447 0.00242164 -238.5 35.5433 5.06409 7.44248 1.4984 4.08867 0.594582 1.06329 0.451668 -0.129967 3.63609e-13 0.129967 -0.451668 -1.06329 -0.594582 -4.08867 -1.4984 -7.44248 -5.06409 -35.5433 pop
710+0.185302 0.731592 0.0015598 -235.666 29.2094 0.490929 7.29433 0.761753 1.92996 0.254699 -0.609217 -0.135332 -0.172086 3.51792e-13 0.172086 0.135332 0.609217 -0.254699 -1.92996 -0.761753 -7.29433 -0.490929 -29.2094 pop
711+0.0945086 0.451705 0.00227115 -246.213 40.8723 3.74669 5.50235 4.7105 3.49516 2.15403 0.927489 0.296449 -0.267562 3.80195e-13 0.267562 -0.296449 -0.927489 -2.15403 -3.49516 -4.7105 -5.50235 -3.74669 -40.8723 pop
712+0.0998531 0.472381 0.000576212 -272.718 37.0782 11.4625 2.51091 -1.24592 -1.6096 -1.92519 1.19146 0.835565 -0.0989613 4.10321e-13 0.0989613 -0.835565 -1.19146 1.92519 1.6096 1.24592 -2.51091 -11.4625 -37.0782 pop
713+0.130645 0.601698 0.00186957 -236.06 39.3011 -1.23842 2.60947 2.23775 3.15569 0.375887 0.176157 1.27161 -0.525077 3.65873e-13 0.525077 -1.27161 -0.176157 -0.375887 -3.15569 -2.23775 -2.60947 1.23842 -39.3011 pop
714+0.093547 0.336812 0.00217072 -257.84 34.8659 11.7316 11.7344 4.45948 4.86964 2.75242 0.862914 0.862367 -0.574334 3.85604e-13 0.574334 -0.862367 -0.862914 -2.75242 -4.86964 -4.45948 -11.7344 -11.7316 -34.8659 pop
715+0.100763 0.629022 0.001044 -256.385 41.0831 1.99393 1.675 2.96871 1.7478 1.15317 -0.62685 -0.0536993 -0.377296 3.94969e-13 0.377296 0.0536993 0.62685 -1.15317 -1.7478 -2.96871 -1.675 -1.99393 -41.0831 pop
716+0.164387 0.695279 0.00241452 -231.351 33.1371 3.21483 6.61484 -0.101948 1.95749 -1.79216 0.923659 -0.765221 0.276171 3.52126e-13 -0.276171 0.765221 -0.923659 1.79216 -1.95749 0.101948 -6.61484 -3.21483 -33.1371 pop
717+0.207071 0.597845 0.000759972 -251.685 26.3799 0.636933 7.93674 1.81758 1.84401 -0.509161 1.8598 -0.172104 -0.369774 3.69516e-13 0.369774 0.172104 -1.8598 0.509161 -1.84401 -1.81758 -7.93674 -0.636933 -26.3799 pop
718+0.147185 0.539155 0.00183512 -237.963 33.8616 3.36459 8.01684 1.17295 2.43318 0.235005 -1.00623 0.726369 -0.146765 3.59993e-13 0.146765 -0.726369 1.00623 -0.235005 -2.43318 -1.17295 -8.01684 -3.36459 -33.8616 pop
719+0.161947 0.692292 0.00279746 -231.059 32.3374 7.19945 8.19054 -1.31085 3.08168 -0.0157212 0.703668 0.376747 -0.701412 3.48694e-13 0.701412 -0.376747 -0.703668 0.0157212 -3.08168 1.31085 -8.19054 -7.19945 -32.3374 pop
720+0.159158 0.731175 0.00247625 -228.607 35.3594 1.85228 5.08402 0.0271585 1.52619 -0.418383 1.58833 -0.309816 -0.604691 3.50334e-13 0.604691 0.309816 -1.58833 0.418383 -1.52619 -0.0271585 -5.08402 -1.85228 -35.3594 pop
721+0.187067 0.733769 0.00281841 -218.3 30.6814 -0.139327 3.63428 -1.9255 2.8317 -0.831956 0.887844 -0.0801222 0.115701 3.32717e-13 -0.115701 0.0801222 -0.887844 0.831956 -2.8317 1.9255 -3.63428 0.139327 -30.6814 pop
722+0.181856 0.659074 0.0022043 -231.149 29.179 -2.51892 5.50255 1.19999 1.62276 0.616731 0.193645 -0.315346 0.213749 3.46758e-13 -0.213749 0.315346 -0.193645 -0.616731 -1.62276 -1.19999 -5.50255 2.51892 -29.179 pop
723+0.16296 0.685955 0.00241274 -231.617 33.3319 3.185 6.54254 -0.0753179 1.95522 -1.83622 0.947718 -0.779677 0.258208 3.52744e-13 -0.258208 0.779677 -0.947718 1.83622 -1.95522 0.0753179 -6.54254 -3.185 -33.3319 pop
724+0.195956 0.749508 0.00230326 -230.62 27.4607 3.05765 8.40566 1.09144 2.73453 -0.641518 1.41027 -0.410755 -0.697209 3.42427e-13 0.697209 0.410755 -1.41027 0.641518 -2.73453 -1.09144 -8.40566 -3.05765 -27.4607 pop
725+0.173335 0.668491 0.00229402 -234.713 30.1817 3.00468 6.78332 0.0161086 2.98948 -0.53103 2.00289 0.13786 0.0746019 3.52583e-13 -0.0746019 -0.13786 -2.00289 0.53103 -2.98948 -0.0161086 -6.78332 -3.00468 -30.1817 pop
726+0.141077 0.593989 0.00238518 -242.736 34.9511 9.904 8.27977 -0.464222 2.12329 -0.566934 1.76091 0.0377631 -0.548277 3.6723e-13 0.548277 -0.0377631 -1.76091 0.566934 -2.12329 0.464222 -8.27977 -9.904 -34.9511 pop
727+0.14206 0.702345 0.00173322 -245.119 38.1044 7.62533 4.11289 -3.62306 0.30678 -0.821756 1.32754 -1.27298 -1.60618 3.74982e-13 1.60618 1.27298 -1.32754 0.821756 -0.30678 3.62306 -4.11289 -7.62533 -38.1044 pop
728+0.142354 0.719231 0.00179354 -241.827 36.1944 4.62283 4.8895 0.450152 3.57439 0.723029 1.91882 -0.771493 -0.446797 3.69754e-13 0.446797 0.771493 -1.91882 -0.723029 -3.57439 -0.450152 -4.8895 -4.62283 -36.1944 pop
729+0.150729 0.699279 0.00233558 -231.872 36.0353 1.63347 5.35159 -0.101027 0.900314 -0.383169 0.798104 0.349324 0.766495 3.56279e-13 -0.766495 -0.349324 -0.798104 0.383169 -0.900314 0.101027 -5.35159 -1.63347 -36.0353 pop
730+0.149165 0.654577 0.00281043 -230.584 34.6795 4.8313 6.53925 -0.638062 2.62993 0.236856 0.593749 0.632448 -0.0375076 3.51914e-13 0.0375076 -0.632448 -0.593749 -0.236856 -2.62993 0.638062 -6.53925 -4.8313 -34.6795 pop
731+0.14542 0.64358 0.0022732 -230.423 37.6801 -0.00283145 1.44235 -2.19672 0.821731 -1.50726 0.194099 -0.836623 -0.30568 3.57521e-13 0.30568 0.836623 -0.194099 1.50726 -0.821731 2.19672 -1.44235 0.00283145 -37.6801 pop
732+0.148019 0.665702 0.00221091 -230.41 37.1652 -0.0464324 1.53791 -2.19672 0.899947 -1.43763 0.211868 -0.772756 -0.322577 3.56815e-13 0.322577 0.772756 -0.211868 1.43763 -0.899947 2.19672 -1.53791 0.0464324 -37.1652 pop
733+0.22194 0.762281 0.00106595 -250.873 22.5744 5.32095 7.92722 1.00234 4.97578 -0.834414 1.17489 -0.905668 -0.239456 3.6492e-13 0.239456 0.905668 -1.17489 0.834414 -4.97578 -1.00234 -7.92722 -5.32095 -22.5744 pop
734+0.148269 0.656755 0.00199502 -230.595 36.5703 -1.64042 2.85298 -1.17799 0.335832 1.03512 0.950366 -0.0389732 -0.0311613 3.55318e-13 0.0311613 0.0389732 -0.950366 -1.03512 -0.335832 1.17799 -2.85298 1.64042 -36.5703 pop
735+0.14781 0.622489 0.00235671 -233.864 37.1639 7.19756 4.64757 -3.37341 1.76595 -1.99986 1.11171 -0.257105 0.157612 3.60713e-13 -0.157612 0.257105 -1.11171 1.99986 -1.76595 3.37341 -4.64757 -7.19756 -37.1639 pop
736+0.157742 0.72747 0.00297533 -221.754 35.1623 -0.573504 2.15816 -2.32498 1.34143 -1.05697 1.44575 0.223799 0.13609 3.42841e-13 -0.13609 -0.223799 -1.44575 1.05697 -1.34143 2.32498 -2.15816 0.573504 -35.1623 pop
737+0.149444 0.678357 0.00290463 -233.927 33.025 6.03736 6.97887 1.10095 5.0755 -0.290774 1.10253 -0.472511 -0.599258 3.54869e-13 0.599258 0.472511 -1.10253 0.290774 -5.0755 -1.10095 -6.97887 -6.03736 -33.025 pop
738+0.168749 0.714392 0.00316061 -215.4 32.7234 -3.09147 3.76135 -0.363371 1.2217 -0.0146916 1.16333 -0.544773 0.0307304 3.30774e-13 -0.0307304 0.544773 -1.16333 0.0146916 -1.2217 0.363371 -3.76135 3.09147 -32.7234 pop
739+0.164242 0.696046 0.00286059 -223.408 34.6958 0.0998172 4.43812 -0.52431 1.82982 -0.94158 0.454519 -0.390518 -0.110589 3.43656e-13 0.110589 0.390518 -0.454519 0.94158 -1.82982 0.52431 -4.43812 -0.0998172 -34.6958 pop
740+0.192578 0.567229 0.00297035 -226.334 24.8316 8.76483 11.8469 0.497994 3.95838 -1.22268 2.30574 0.679921 -0.956514 3.31863e-13 0.956514 -0.679921 -2.30574 1.22268 -3.95838 -0.497994 -11.8469 -8.76483 -24.8316 pop
741+0.0912586 0.502946 0.00170131 -249.974 44.7218 3.38118 0.206961 2.72375 2.6075 -0.430491 -0.00176496 -0.0858083 -0.529255 3.91781e-13 0.529255 0.0858083 0.00176496 0.430491 -2.6075 -2.72375 -0.206961 -3.38118 -44.7218 pop
742+0.101138 0.534865 0.000950848 -263.833 38.8048 10.1828 4.7989 -0.809878 0.497162 0.936721 -1.86207 -0.668647 0.760529 4.01591e-13 -0.760529 0.668647 1.86207 -0.936721 -0.497162 0.809878 -4.7989 -10.1828 -38.8048 pop
743+0.164626 0.751239 0.00248261 -228.001 33.7301 -0.424189 5.03346 1.18175 1.86028 -0.9759 0.794037 -0.00904292 -0.588181 3.47698e-13 0.588181 0.00904292 -0.794037 0.9759 -1.86028 -1.18175 -5.03346 0.424189 -33.7301 pop
744+0.129821 0.587715 0.0034149 -232.086 36.2515 0.0720311 8.31243 4.26616 1.75328 2.64664 0.946778 1.56316 0.155921 3.54299e-13 -0.155921 -1.56316 -0.946778 -2.64664 -1.75328 -4.26616 -8.31243 -0.0720311 -36.2515 pop
745+0.158521 0.741423 0.00296043 -228.542 32.5438 -2.80104 4.40612 3.1828 4.04929 0.161918 3.15175 0.882097 -0.15066 3.48019e-13 0.15066 -0.882097 -3.15175 -0.161918 -4.04929 -3.1828 -4.40612 2.80104 -32.5438 pop
746+0.12047 0.71807 0.00239639 -244.977 37.1739 9.01234 5.54727 0.20871 3.2228 -0.84492 2.01537 0.406797 0.411818 3.75065e-13 -0.411818 -0.406797 -2.01537 0.84492 -3.2228 -0.20871 -5.54727 -9.01234 -37.1739 pop
747+0.120709 0.708931 0.00239837 -245.104 37.1679 9.13665 5.60819 0.233378 3.47407 -0.891843 2.06314 0.453703 0.347194 3.75232e-13 -0.347194 -0.453703 -2.06314 0.891843 -3.47407 -0.233378 -5.60819 -9.13665 -37.1679 pop
748+0.162158 0.66244 0.0029085 -224.553 33.1763 1.53132 5.63813 -0.0804214 3.01658 -0.92122 1.9645 -0.207289 0.460263 3.43806e-13 -0.460263 0.207289 -1.9645 0.92122 -3.01658 0.0804214 -5.63813 -1.53132 -33.1763 pop
749+0.178739 0.741433 0.00199825 -228.806 30.6815 -1.58882 2.87305 -1.26349 2.05746 -0.491657 3.26735 0.65185 -0.342095 3.46139e-13 0.342095 -0.65185 -3.26735 0.491657 -2.05746 1.26349 -2.87305 1.58882 -30.6815 pop
750+0.120395 0.628098 0.00148283 -250.427 38.536 5.11888 3.40414 1.57085 0.192645 -2.68024 0.638364 -0.239462 -1.71735 3.82143e-13 1.71735 0.239462 -0.638364 2.68024 -0.192645 -1.57085 -3.40414 -5.11888 -38.536 pop
751+0.154285 0.666287 0.00235863 -242.784 30.9504 3.89281 7.87883 2.70966 3.57115 0.126256 2.68395 0.758973 -0.476893 3.62968e-13 0.476893 -0.758973 -2.68395 -0.126256 -3.57115 -2.70966 -7.87883 -3.89281 -30.9504 pop
752+0.192503 0.691738 0.00255243 -221.596 28.9084 2.94899 5.88813 -1.34081 3.19851 -2.38033 3.19218 -0.166697 0.320521 3.34723e-13 -0.320521 0.166697 -3.19218 2.38033 -3.19851 1.34081 -5.88813 -2.94899 -28.9084 pop
753+0.188975 0.75882 0.00403926 -224.29 26.4739 0.23352 7.45272 2.04833 4.35028 0.955616 2.94732 1.3056 -0.181045 3.33423e-13 0.181045 -1.3056 -2.94732 -0.955616 -4.35028 -2.04833 -7.45272 -0.23352 -26.4739 pop
754+0.128052 0.783331 0.00283864 -232.387 43.6373 1.57155 0.841911 -1.47998 -1.80885 -2.33232 2.54138 -0.0407595 -2.00081 3.64777e-13 2.00081 0.0407595 -2.54138 2.33232 1.80885 1.47998 -0.841911 -1.57155 -43.6373 pop
755+0.178935 0.633426 0.00349238 -223.906 30.0635 6.47906 8.81015 -0.717876 2.51884 -1.93964 1.37385 0.915883 0.112309 3.36851e-13 -0.112309 -0.915883 -1.37385 1.93964 -2.51884 0.717876 -8.81015 -6.47906 -30.0635 pop
756+0.206089 0.740403 0.0030242 -228.419 26.2178 3.25821 6.03384 -2.53746 3.29464 0.239672 1.82794 0.113929 -0.272722 3.39315e-13 0.272722 -0.113929 -1.82794 -0.239672 -3.29464 2.53746 -6.03384 -3.25821 -26.2178 pop
757+0.166692 0.657605 0.00367397 -230.381 30.5938 2.15438 8.30932 3.93009 5.50835 1.09187 2.66075 0.206912 0.354634 3.47434e-13 -0.354634 -0.206912 -2.66075 -1.09187 -5.50835 -3.93009 -8.30932 -2.15438 -30.5938 pop
758+0.193185 0.752613 0.00405682 -222.997 26.126 0.568125 7.97403 2.2036 4.29003 0.804754 3.02475 1.22952 -0.0883272 3.3118e-13 0.0883272 -1.22952 -3.02475 -0.804754 -4.29003 -2.2036 -7.97403 -0.568125 -26.126 pop
759+0.159155 0.699052 0.00184642 -246.384 32.766 1.72237 6.70889 4.0511 2.26923 0.430538 1.27085 -0.0839092 -0.310598 3.70241e-13 0.310598 0.0839092 -1.27085 -0.430538 -2.26923 -4.0511 -6.70889 -1.72237 -32.766 pop
760+0.170252 0.653765 0.00360333 -230.072 30.0497 2.15193 8.69079 4.06058 5.36786 0.932763 2.6163 0.180497 0.229125 3.46077e-13 -0.229125 -0.180497 -2.6163 -0.932763 -5.36786 -4.06058 -8.69079 -2.15193 -30.0497 pop
761+0.178935 0.633519 0.00349238 -223.906 30.0635 6.47906 8.81015 -0.717876 2.51884 -1.93964 1.37385 0.915883 0.112309 3.36851e-13 -0.112309 -0.915883 -1.37385 1.93964 -2.51884 0.717876 -8.81015 -6.47906 -30.0635 pop
762+0.146551 0.671422 0.00290772 -234.154 34.7386 0.532073 6.17774 5.58966 5.55356 -0.118993 2.51709 0.935083 -1.18124 3.56713e-13 1.18124 -0.935083 -2.51709 0.118993 -5.55356 -5.58966 -6.17774 -0.532073 -34.7386 pop
763+0.132896 0.818637 0.00481269 -212.956 40.784 -1.5753 4.78023 0.848096 -0.581933 0.703635 -0.141992 0.77004 -1.77327 3.33744e-13 1.77327 -0.77004 0.141992 -0.703635 0.581933 -0.848096 -4.78023 1.5753 -40.784 pop
764+0.0884614 0.580123 0.00157465 -250.76 46.1408 4.98195 0.181361 -1.30473 -0.710421 -0.133228 -0.18774 0.000494325 -0.514036 3.93531e-13 0.514036 -0.000494325 0.18774 0.133228 0.710421 1.30473 -0.181361 -4.98195 -46.1408 pop
765+0.190651 0.827366 0.00192097 -234.476 30.045 -2.99614 2.58512 -1.47411 -0.0250393 -0.672227 -0.254061 1.79366 -0.247321 3.51781e-13 0.247321 -1.79366 0.254061 0.672227 0.0250393 1.47411 -2.58512 2.99614 -30.045 pop
766+0.130179 0.620193 0.00161023 -246.816 37.2662 1.7765 3.65718 1.08571 1.84365 1.75837 0.13031 -0.750138 -0.713344 3.77044e-13 0.713344 0.750138 -0.13031 -1.75837 -1.84365 -1.08571 -3.65718 -1.7765 -37.2662 pop
767+0.139955 0.520867 0.00291701 -232.653 34.7246 8.10477 9.14744 -1.03814 1.24065 -1.18265 1.16427 0.096883 -0.68575 3.53061e-13 0.68575 -0.096883 -1.16427 1.18265 -1.24065 1.03814 -9.14744 -8.10477 -34.7246 pop
768+0.202371 0.6639 0.00258149 -222.374 26.4357 0.724167 7.83313 1.6831 4.57525 -0.592388 0.36738 0.482815 -0.560542 3.30895e-13 0.560542 -0.482815 -0.36738 0.592388 -4.57525 -1.6831 -7.83313 -0.724167 -26.4357 pop
769+0.168639 0.782482 0.00304942 -225.63 33.9126 -1.01657 5.92356 2.55255 2.32565 -0.646936 0.994706 0.529224 -0.428513 3.44471e-13 0.428513 -0.529224 -0.994706 0.646936 -2.32565 -2.55255 -5.92356 1.01657 -33.9126 pop
770+0.124171 0.687766 0.00276762 -229.571 39.7148 -3.51614 4.86109 4.06213 1.18769 1.63273 -0.436649 0.517045 0.401059 3.57178e-13 -0.401059 -0.517045 0.436649 -1.63273 -1.18769 -4.06213 -4.86109 3.51614 -39.7148 pop
771+0.141875 0.598411 0.00194851 -247.636 30.3905 5.27129 7.47594 1.40784 1.69886 -1.17638 -0.144313 -0.40917 -0.0126687 3.69087e-13 0.0126687 0.40917 0.144313 1.17638 -1.69886 -1.40784 -7.47594 -5.27129 -30.3905 pop
772+0.202371 0.666958 0.00258149 -222.374 26.4357 0.724167 7.83313 1.6831 4.57525 -0.592388 0.36738 0.482815 -0.560542 3.30895e-13 0.560542 -0.482815 -0.36738 0.592388 -4.57525 -1.6831 -7.83313 -0.724167 -26.4357 pop
773+0.153293 0.671999 0.00265451 -217.522 36.7096 -4.12913 2.24293 -0.717791 0.76053 0.381133 0.510503 1.1254 -0.0910521 3.38114e-13 0.0910521 -1.1254 -0.510503 -0.381133 -0.76053 0.717791 -2.24293 4.12913 -36.7096 pop
774+0.181128 0.670082 0.00250548 -225.177 30.3638 0.683408 6.0763 -0.00249462 2.16667 -0.466321 1.37965 1.65691 0.284339 3.39684e-13 -0.284339 -1.65691 -1.37965 0.466321 -2.16667 0.00249462 -6.0763 -0.683408 -30.3638 pop
775+0.182269 0.710282 0.00271628 -235.926 30.3899 7.89417 8.21308 -0.382279 4.3648 -1.77696 1.20245 -0.298172 -0.894337 3.53568e-13 0.894337 0.298172 -1.20245 1.77696 -4.3648 0.382279 -8.21308 -7.89417 -30.3899 pop
776+0.17213 0.67241 0.0024119 -228.687 30.9087 -1.36553 8.02179 4.63554 3.35574 -0.761071 0.83004 0.67417 -0.439685 3.4437e-13 0.439685 -0.67417 -0.83004 0.761071 -3.35574 -4.63554 -8.02179 1.36553 -30.9087 pop
777+0.187304 0.630608 0.00287194 -230.485 24.9173 2.14298 9.77891 3.63858 5.44945 1.72124 3.11909 1.12054 0.729317 3.39972e-13 -0.729317 -1.12054 -3.11909 -1.72124 -5.44945 -3.63858 -9.77891 -2.14298 -24.9173 pop
778+0.222685 0.815196 0.00224232 -228.951 23.2439 -0.202584 6.10205 0.282917 3.50517 -0.873759 2.63267 0.972046 -0.377608 3.36222e-13 0.377608 -0.972046 -2.63267 0.873759 -3.50517 -0.282917 -6.10205 0.202584 -23.2439 pop
779+0.161724 0.727247 0.00284307 -230.141 32.3238 -0.00524955 6.96482 4.28023 3.76189 -0.662678 1.24929 0.687155 -0.887408 3.47997e-13 0.887408 -0.687155 -1.24929 0.662678 -3.76189 -4.28023 -6.96482 0.00524955 -32.3238 pop
780+0.11192 0.611822 0.000537268 -278.927 30.6966 10.3372 7.93741 5.80318 2.47734 -0.936673 -0.965771 -0.22786 -0.813531 4.09432e-13 0.813531 0.22786 0.965771 0.936673 -2.47734 -5.80318 -7.93741 -10.3372 -30.6966 pop
781+0.163521 0.658539 0.00283887 -224.732 32.8649 1.71869 5.85198 -0.0193287 3.14905 -0.953009 1.99671 -0.225496 0.447955 3.43627e-13 -0.447955 0.225496 -1.99671 0.953009 -3.14905 0.0193287 -5.85198 -1.71869 -32.8649 pop
782+0.117414 0.559109 0.00116342 -253.303 36.7435 6.2562 6.95494 1.14012 0.838064 0.16215 0.731789 -0.657136 0.16731 3.84433e-13 -0.16731 0.657136 -0.731789 -0.16215 -0.838064 -1.14012 -6.95494 -6.2562 -36.7435 pop
783+0.138378 0.504758 0.00195104 -244.783 33.6225 6.45631 7.97394 2.48915 5.20727 -0.373826 1.66714 -0.05694 -0.00176162 3.70205e-13 0.00176162 0.05694 -1.66714 0.373826 -5.20727 -2.48915 -7.97394 -6.45631 -33.6225 pop
784+0.120769 0.505498 0.00135539 -246.882 40.0336 2.66766 4.10942 -0.0195159 -2.55095 -1.29436 0.508169 0.841864 0.67368 3.80058e-13 -0.67368 -0.841864 -0.508169 1.29436 2.55095 0.0195159 -4.10942 -2.66766 -40.0336 pop
785+0.191372 0.731908 0.0024023 -234.556 27.6481 3.40499 7.15041 1.16181 4.95735 -0.769651 3.05811 -0.51957 -0.281342 3.4974e-13 0.281342 0.51957 -3.05811 0.769651 -4.95735 -1.16181 -7.15041 -3.40499 -27.6481 pop
786+0.12391 0.851394 0.00262465 -235.85 39.8951 -6.50472 -1.02827 3.33943 0.721805 2.32935 0.470723 -0.148997 0.181509 3.67598e-13 -0.181509 0.148997 -0.470723 -2.32935 -0.721805 -3.33943 1.02827 6.50472 -39.8951 pop
787+0.18735 0.676857 0.00159059 -230.207 29.8642 -1.04084 6.42995 0.315786 0.21813 -1.84026 0.549524 0.127649 -0.0310222 3.45594e-13 0.0310222 -0.127649 -0.549524 1.84026 -0.21813 -0.315786 -6.42995 1.04084 -29.8642 pop
788+0.171184 0.557606 0.00237817 -227.843 32.1689 3.58826 7.48043 1.09763 3.97251 0.0753049 1.3865 0.430658 0.00841143 3.45514e-13 -0.00841143 -0.430658 -1.3865 -0.0753049 -3.97251 -1.09763 -7.48043 -3.58826 -32.1689 pop
789+0.182012 0.793904 0.00240043 -236.402 27.1427 -1.63498 6.0118 2.46935 0.766705 -0.744174 1.627 -0.103875 0.0299042 3.50572e-13 -0.0299042 0.103875 -1.627 0.744174 -0.766705 -2.46935 -6.0118 1.63498 -27.1427 pop
790+0.178674 0.716682 0.00298961 -219.108 30.3621 -0.157339 7.74434 1.83349 1.78332 -0.843211 0.850536 0.306206 -0.105684 3.30978e-13 0.105684 -0.306206 -0.850536 0.843211 -1.78332 -1.83349 -7.74434 0.157339 -30.3621 pop
791+0.171799 0.546154 0.00243268 -227.161 32.17 3.52565 7.39697 1.06386 3.97029 0.0109285 1.4263 0.422064 -0.0381624 3.44608e-13 0.0381624 -0.422064 -1.4263 -0.0109285 -3.97029 -1.06386 -7.39697 -3.52565 -32.17 pop
792+0.19396 0.71143 0.00331578 -217.66 28.8076 0.380093 6.66643 0.982835 4.38759 0.282144 1.81868 0.107136 -0.225319 3.28312e-13 0.225319 -0.107136 -1.81868 -0.282144 -4.38759 -0.982835 -6.66643 -0.380093 -28.8076 pop
793+0.181915 0.725822 0.00253964 -227.236 29.6336 0.948066 7.36133 1.80851 3.94557 0.799754 1.08792 -0.121864 0.112049 3.41903e-13 -0.112049 0.121864 -1.08792 -0.799754 -3.94557 -1.80851 -7.36133 -0.948066 -29.6336 pop
794+0.169863 0.667244 0.00300816 -223.25 31.2144 2.14778 8.86604 0.561985 2.59002 2.48503 0.916567 0.557536 -0.186993 3.36699e-13 0.186993 -0.557536 -0.916567 -2.48503 -2.59002 -0.561985 -8.86604 -2.14778 -31.2144 pop
795+0.154222 0.573462 0.00184249 -231.413 36.8843 -1.19831 2.56328 1.38952 2.62612 -1.26763 0.707906 -0.323369 0.229062 3.58238e-13 -0.229062 0.323369 -0.707906 1.26763 -2.62612 -1.38952 -2.56328 1.19831 -36.8843 pop
796+0.159329 0.58039 0.00366929 -225.018 32.726 7.73798 10.3699 0.724989 2.54393 -0.681661 2.96223 0.467382 -0.572807 3.40299e-13 0.572807 -0.467382 -2.96223 0.681661 -2.54393 -0.724989 -10.3699 -7.73798 -32.726 pop
797+0.15206 0.465761 0.00305163 -234 31.3757 4.93627 10.7549 4.02414 4.53031 1.08783 2.4195 0.452218 0.92692 3.52308e-13 -0.92692 -0.452218 -2.4195 -1.08783 -4.53031 -4.02414 -10.7549 -4.93627 -31.3757 pop
798+0.17767 0.548387 0.0027583 -243.364 26.9873 8.12679 9.73084 1.36714 5.12356 -0.181134 2.55072 0.813627 -0.901842 3.58227e-13 0.901842 -0.813627 -2.55072 0.181134 -5.12356 -1.36714 -9.73084 -8.12679 -26.9873 pop
799+0.193794 0.72736 0.00253019 -224.743 28.3735 -0.579777 5.5173 -1.28566 1.67467 1.07442 1.31915 0.586659 -0.346382 3.36376e-13 0.346382 -0.586659 -1.31915 -1.07442 -1.67467 1.28566 -5.5173 0.579777 -28.3735 pop
800+0.132115 0.580573 0.00179934 -241.826 35.83 5.07785 5.38738 0.127399 2.46344 -1.27466 1.865 0.351636 -1.57381 3.67569e-13 1.57381 -0.351636 -1.865 1.27466 -2.46344 -0.127399 -5.38738 -5.07785 -35.83 pop
801+0.11126 0.644977 0.00123693 -252.463 38.208 1.22417 3.70704 0.585317 -0.67597 3.20177 -2.32909 0.0786428 -0.408895 3.84368e-13 0.408895 -0.0786428 2.32909 -3.20177 0.67597 -0.585317 -3.70704 -1.22417 -38.208 reggae
802+0.0871253 0.507124 0.00108075 -261.354 40.7888 5.36248 3.45594 2.27745 0.328587 2.54596 1.22247 0.941625 -0.513651 3.99201e-13 0.513651 -0.941625 -1.22247 -2.54596 -0.328587 -2.27745 -3.45594 -5.36248 -40.7888 reggae
803+0.0896819 0.674395 0.00118352 -263.563 36.8267 5.07851 6.88611 5.68643 1.21294 1.06434 -1.38741 0.321524 -0.305763 3.96773e-13 0.305763 -0.321524 1.38741 -1.06434 -1.21294 -5.68643 -6.88611 -5.07851 -36.8267 reggae
804+0.0990623 0.556531 0.00121589 -260.818 37.1345 -0.103552 1.42554 5.26877 2.99681 2.2564 1.37206 1.97692 -1.29734 3.94684e-13 1.29734 -1.97692 -1.37206 -2.2564 -2.99681 -5.26877 -1.42554 0.103552 -37.1345 reggae
805+0.0940692 0.701924 0.0011846 -262.983 37.519 4.27934 1.97071 1.31 0.969895 2.69297 -0.20551 0.481655 -0.133553 3.98622e-13 0.133553 -0.481655 0.20551 -2.69297 -0.969895 -1.31 -1.97071 -4.27934 -37.519 reggae
806+0.0902761 0.651388 0.00132056 -259.972 39.0968 2.96576 3.24586 3.81184 0.747987 2.44448 0.44228 0.858303 -0.714154 3.95328e-13 0.714154 -0.858303 -0.44228 -2.44448 -0.747987 -3.81184 -3.24586 -2.96576 -39.0968 reggae
807+0.0735807 0.489701 0.00150471 -263.199 40.5774 7.51749 5.95119 4.68627 1.76307 2.43635 -0.515829 0.337964 -0.0193276 4.01361e-13 0.0193276 -0.337964 0.515829 -2.43635 -1.76307 -4.68627 -5.95119 -7.51749 -40.5774 reggae
808+0.0996633 0.690108 0.00117314 -257.681 40.2261 3.41328 2.86306 1.40216 0.598493 2.26164 -1.59872 0.0205963 -0.642284 3.94311e-13 0.642284 -0.0205963 1.59872 -2.26164 -0.598493 -1.40216 -2.86306 -3.41328 -40.2261 reggae
809+0.0913312 0.656571 0.00133426 -258.27 38.6725 1.58989 5.02709 6.23485 1.518 1.72935 -0.567169 0.698085 -0.173751 3.92856e-13 0.173751 -0.698085 0.567169 -1.72935 -1.518 -6.23485 -5.02709 -1.58989 -38.6725 reggae
810+0.0812854 0.593512 0.00112374 -270.003 36.6137 10.6977 4.65669 1.33261 2.62282 2.55292 -0.632304 0.267514 -0.61873 4.05714e-13 0.61873 -0.267514 0.632304 -2.55292 -2.62282 -1.33261 -4.65669 -10.6977 -36.6137 reggae
811+0.110788 0.558191 0.000816336 -264.089 35.0034 2.06368 4.20869 4.16605 -0.362691 2.19414 -0.821815 -1.01157 -1.32396 3.95164e-13 1.32396 1.01157 0.821815 -2.19414 0.362691 -4.16605 -4.20869 -2.06368 -35.0034 reggae
812+0.104118 0.673571 0.000957454 -266.523 35.4132 5.13612 3.26389 1.4754 1.20309 1.73293 -0.270821 1.7144 0.444964 4.00622e-13 -0.444964 -1.7144 0.270821 -1.73293 -1.20309 -1.4754 -3.26389 -5.13612 -35.4132 reggae
813+0.128579 0.749025 0.000664387 -268.582 31.7335 0.731646 0.407439 0.216552 0.155688 1.40204 -1.0943 -0.200593 -0.825582 3.99338e-13 0.825582 0.200593 1.0943 -1.40204 -0.155688 -0.216552 -0.407439 -0.731646 -31.7335 reggae
814+0.0789556 0.679958 0.0013763 -262.482 40.4406 7.35719 3.60651 2.69456 2.83845 2.92352 -0.505652 0.429656 -0.275297 4.01217e-13 0.275297 -0.429656 0.505652 -2.92352 -2.83845 -2.69456 -3.60651 -7.35719 -40.4406 reggae
815+0.0864471 0.536703 0.0014372 -269.712 34.7153 9.10506 7.03832 4.31261 3.46357 3.3065 -0.470814 -0.0391094 0.0758948 4.03083e-13 -0.0758948 0.0391094 0.470814 -3.3065 -3.46357 -4.31261 -7.03832 -9.10506 -34.7153 reggae
816+0.0876259 0.629639 0.00171772 -256.102 39.965 8.23459 7.32715 2.48229 1.74003 3.18437 -1.19455 0.494494 -0.4432 3.9027e-13 0.4432 -0.494494 1.19455 -3.18437 -1.74003 -2.48229 -7.32715 -8.23459 -39.965 reggae
817+0.106942 0.566015 0.00255359 -233.435 42.0827 -2.82641 4.98511 3.33278 -0.889562 3.5513 -1.01932 2.00988 -0.618276 3.62443e-13 0.618276 -2.00988 1.01932 -3.5513 0.889562 -3.33278 -4.98511 2.82641 -42.0827 reggae
818+0.0819196 0.635856 0.00187797 -253.159 43.0562 1.15981 0.527266 2.10599 1.38424 4.13279 -0.125102 0.581892 -0.250783 3.92782e-13 0.250783 -0.581892 0.125102 -4.13279 -1.38424 -2.10599 -0.527266 -1.15981 -43.0562 reggae
819+0.095778 0.595784 0.00128347 -262.402 36.4676 5.10829 6.55819 4.37823 1.98046 3.11761 -0.525681 0.660044 -0.293487 3.94875e-13 0.293487 -0.660044 0.525681 -3.11761 -1.98046 -4.37823 -6.55819 -5.10829 -36.4676 reggae
820+0.0815589 0.586357 0.00176672 -262.637 36.7854 6.22635 5.14414 4.33734 3.74267 4.31605 1.11895 1.74625 0.0253971 3.96303e-13 -0.0253971 -1.74625 -1.11895 -4.31605 -3.74267 -4.33734 -5.14414 -6.22635 -36.7854 reggae
821+0.0799876 0.577895 0.00172383 -258.245 40.7344 6.62001 5.2939 2.64353 1.74447 3.90241 -0.272083 0.421347 -0.49603 3.94711e-13 0.49603 -0.421347 0.272083 -3.90241 -1.74447 -2.64353 -5.2939 -6.62001 -40.7344 reggae
822+0.111361 0.665619 0.00194869 -238.691 42.5875 -4.16127 2.81749 3.11457 -0.898015 2.88586 -1.08486 1.68827 -0.887311 3.7089e-13 0.887311 -1.68827 1.08486 -2.88586 0.898015 -3.11457 -2.81749 4.16127 -42.5875 reggae
823+0.103372 0.569899 0.00252495 -236.796 43.8656 -3.68106 2.68345 4.21118 0.916776 3.20688 -1.51908 1.66572 -0.713576 3.70611e-13 0.713576 -1.66572 1.51908 -3.20688 -0.916776 -4.21118 -2.68345 3.68106 -43.8656 reggae
824+0.116887 0.607991 0.00140209 -255.035 35.2429 -1.92717 3.14114 5.29102 3.40918 3.20692 0.38268 2.33096 -0.85187 3.84529e-13 0.85187 -2.33096 -0.38268 -3.20692 -3.40918 -5.29102 -3.14114 1.92717 -35.2429 reggae
825+0.0840201 0.578855 0.00157717 -256.933 41.4852 5.6243 4.73434 3.53441 1.29014 2.23513 -1.80003 -0.961586 -1.299 3.93852e-13 1.299 0.961586 1.80003 -2.23513 -1.29014 -3.53441 -4.73434 -5.6243 -41.4852 reggae
826+0.0826388 0.607502 0.00163163 -261.674 38.3159 4.1881 4.22548 5.08985 2.30563 3.34659 0.157865 0.716258 -0.111302 3.97121e-13 0.111302 -0.716258 -0.157865 -3.34659 -2.30563 -5.08985 -4.22548 -4.1881 -38.3159 reggae
827+0.0896963 0.571931 0.00174704 -255.484 38.9333 3.64257 5.11644 3.7317 0.586057 3.3432 0.559727 0.645625 -1.06374 3.88047e-13 1.06374 -0.645625 -0.559727 -3.3432 -0.586057 -3.7317 -5.11644 -3.64257 -38.9333 reggae
828+0.112572 0.697588 0.00160229 -259.705 34.4849 4.89903 7.72947 4.23423 1.89283 2.65144 -0.257121 0.903597 -0.741721 3.8806e-13 0.741721 -0.903597 0.257121 -2.65144 -1.89283 -4.23423 -7.72947 -4.89903 -34.4849 reggae
829+0.0874603 0.535618 0.000845771 -285.636 23.806 6.69467 8.747 9.25525 6.02779 4.80974 3.11527 2.53518 0.703229 4.10463e-13 -0.703229 -2.53518 -3.11527 -4.80974 -6.02779 -9.25525 -8.747 -6.69467 -23.806 reggae
830+0.0856879 0.521512 0.00130532 -264.221 36.6957 5.26458 7.1873 6.30723 3.23104 3.14478 -0.261756 1.29804 0.768345 3.98446e-13 -0.768345 -1.29804 0.261756 -3.14478 -3.23104 -6.30723 -7.1873 -5.26458 -36.6957 reggae
831+0.0887521 0.577647 0.00098962 -268.03 34.9385 6.99916 5.56742 2.55208 1.15622 3.79594 1.47075 1.22913 -0.136901 4.00365e-13 0.136901 -1.22913 -1.47075 -3.79594 -1.15622 -2.55208 -5.56742 -6.99916 -34.9385 reggae
832+0.0764752 0.524131 0.0011153 -274.623 31.8988 7.64962 6.74522 5.94441 4.7962 5.28439 3.06009 2.41787 0.388912 4.05875e-13 -0.388912 -2.41787 -3.06009 -5.28439 -4.7962 -5.94441 -6.74522 -7.64962 -31.8988 reggae
833+0.0838821 0.585225 0.000674339 -271.48 35.8457 2.15514 0.513537 5.68727 2.91026 1.81317 1.28883 1.0855 0.82763 4.09702e-13 -0.82763 -1.0855 -1.28883 -1.81317 -2.91026 -5.68727 -0.513537 -2.15514 -35.8457 reggae
834+0.0824421 0.557696 0.000904306 -272.739 34.4888 7.46725 5.17185 3.50081 1.79099 2.80967 1.17196 1.5607 0.568615 4.0702e-13 -0.568615 -1.5607 -1.17196 -2.80967 -1.79099 -3.50081 -5.17185 -7.46725 -34.4888 reggae
835+0.0649537 0.529915 0.000989859 -274.65 35.1786 9.2086 5.09409 5.0132 2.8957 2.21043 1.83963 2.17977 0.613128 4.10458e-13 -0.613128 -2.17977 -1.83963 -2.21043 -2.8957 -5.0132 -5.09409 -9.2086 -35.1786 reggae
836+0.0804474 0.576615 0.000920533 -271.162 35.5312 7.21522 4.80586 3.99029 1.799 2.63404 1.23832 1.04782 0.0475242 4.06013e-13 -0.0475242 -1.04782 -1.23832 -2.63404 -1.799 -3.99029 -4.80586 -7.21522 -35.5312 reggae
837+0.0951813 0.469475 0.000990418 -272.394 31.9542 6.50443 7.56909 5.36266 2.37077 3.20266 1.41446 1.67941 0.228941 4.02405e-13 -0.228941 -1.67941 -1.41446 -3.20266 -2.37077 -5.36266 -7.56909 -6.50443 -31.9542 reggae
838+0.0854052 0.5754 0.00105771 -278.006 28.494 6.47987 6.65622 5.77559 3.97205 4.58112 2.57188 2.53828 1.14069 4.06765e-13 -1.14069 -2.53828 -2.57188 -4.58112 -3.97205 -5.77559 -6.65622 -6.47987 -28.494 reggae
839+0.0915995 0.56719 0.00101912 -263.212 39.1856 3.51469 2.3693 2.77418 0.539123 1.26931 -0.0765906 0.913788 -0.249122 4.00645e-13 0.249122 -0.913788 0.0765906 -1.26931 -0.539123 -2.77418 -2.3693 -3.51469 -39.1856 reggae
840+0.0618665 0.438139 0.00101782 -285.387 28.7675 16.0268 12.1791 5.84297 3.44246 2.48423 -0.30913 0.628273 0.41008 4.14442e-13 -0.41008 -0.628273 0.30913 -2.48423 -3.44246 -5.84297 -12.1791 -16.0268 -28.7675 reggae
841+0.115068 0.620782 0.000379109 -283.647 24.0706 3.91124 3.42747 2.40149 -0.767231 0.3694 -0.313499 0.123215 -0.120107 4.08836e-13 0.120107 -0.123215 0.313499 -0.3694 0.767231 -2.40149 -3.42747 -3.91124 -24.0706 reggae
842+0.09682 0.571996 0.00150778 -262.058 35.1513 3.15863 9.51144 10.4688 2.60798 2.15014 0.268402 0.832822 0.307639 3.92369e-13 -0.307639 -0.832822 -0.268402 -2.15014 -2.60798 -10.4688 -9.51144 -3.15863 -35.1513 reggae
843+0.121317 0.647829 0.000922047 -261.134 35.5852 -1.0239 -0.818969 3.20891 4.24371 3.27623 2.12686 1.12822 0.401384 3.96499e-13 -0.401384 -1.12822 -2.12686 -3.27623 -4.24371 -3.20891 0.818969 1.0239 -35.5852 reggae
844+0.0747305 0.578977 0.00134015 -256.973 46.4538 0.91514 -2.57978 6.73552 2.9548 -0.304 -0.498297 0.654906 1.02038 4.05062e-13 -1.02038 -0.654906 0.498297 0.304 -2.9548 -6.73552 2.57978 -0.91514 -46.4538 reggae
845+0.123615 0.621171 0.0018918 -246.996 36.1507 3.65283 7.19293 3.80383 2.62008 0.665363 1.42885 0.369515 0.365219 3.75573e-13 -0.365219 -0.369515 -1.42885 -0.665363 -2.62008 -3.80383 -7.19293 -3.65283 -36.1507 reggae
846+0.207288 0.686546 0.00121074 -239.093 24.1544 -4.15169 8.87256 4.86168 1.82703 1.50453 -0.350987 -0.455385 -0.69074 3.48946e-13 0.69074 0.455385 0.350987 -1.50453 -1.82703 -4.86168 -8.87256 4.15169 -24.1544 reggae
847+0.122236 0.594476 0.00122832 -257.593 35.4099 4.65448 9.99834 6.18296 1.29544 1.61411 -0.808932 -1.91665 -0.812671 3.86522e-13 0.812671 1.91665 0.808932 -1.61411 -1.29544 -6.18296 -9.99834 -4.65448 -35.4099 reggae
848+0.133619 0.71801 0.00135018 -249.85 36.2977 -3.04355 6.18259 8.13854 0.777038 0.753923 -1.93805 -0.657521 -0.504651 3.78586e-13 0.504651 0.657521 1.93805 -0.753923 -0.777038 -8.13854 -6.18259 3.04355 -36.2977 reggae
849+0.133505 0.64342 0.00166057 -244.677 34.8807 -0.767847 7.55295 4.74263 0.897031 3.0961 -1.48946 0.196736 -1.0445 3.68465e-13 1.0445 -0.196736 1.48946 -3.0961 -0.897031 -4.74263 -7.55295 0.767847 -34.8807 reggae
850+0.125215 0.551241 0.00167315 -248.923 36.6061 5.60545 8.36839 3.97117 2.80192 -1.4237 0.91601 0.730854 0.552615 3.78672e-13 -0.552615 -0.730854 -0.91601 1.4237 -2.80192 -3.97117 -8.36839 -5.60545 -36.6061 reggae
851+0.142649 0.681711 0.00162625 -245.725 34.2421 0.196868 3.79068 2.77113 2.01308 0.962388 0.426092 0.0696372 0.207745 3.72505e-13 -0.207745 -0.0696372 -0.426092 -0.962388 -2.01308 -2.77113 -3.79068 -0.196868 -34.2421 reggae
852+0.231731 0.829306 0.0013827 -256.043 12.6293 -2.38886 12.4219 5.01757 2.2117 4.29869 3.85812 2.99124 1.26886 3.56433e-13 -1.26886 -2.99124 -3.85812 -4.29869 -2.2117 -5.01757 -12.4219 2.38886 -12.6293 reggae
853+0.164917 0.705879 0.00243532 -238.607 29.8062 5.09458 9.00392 1.45936 3.73805 0.53276 1.29806 0.600574 0.531521 3.5659e-13 -0.531521 -0.600574 -1.29806 -0.53276 -3.73805 -1.45936 -9.00392 -5.09458 -29.8062 reggae
854+0.0974778 0.604164 0.000731442 -282.352 26.8856 9.80449 6.75066 5.08519 4.34471 2.31244 1.74359 1.44507 -0.112139 4.10027e-13 0.112139 -1.44507 -1.74359 -2.31244 -4.34471 -5.08519 -6.75066 -9.80449 -26.8856 reggae
855+0.120997 0.549557 0.00128864 -258.223 34.2603 1.1046 1.85138 4.38339 4.39112 1.28942 2.36504 1.40844 -0.960587 3.88863e-13 0.960587 -1.40844 -2.36504 -1.28942 -4.39112 -4.38339 -1.85138 -1.1046 -34.2603 reggae
856+0.133406 0.636017 0.00147739 -250.782 33.4856 5.10871 8.48825 2.83953 2.22021 1.51719 0.496457 -0.86946 -0.750837 3.75933e-13 0.750837 0.86946 -0.496457 -1.51719 -2.22021 -2.83953 -8.48825 -5.10871 -33.4856 reggae
857+0.107226 0.646836 0.00132923 -258.199 36.6324 4.26822 3.36616 2.88043 2.22897 1.19087 1.1193 0.21017 -0.573443 3.91116e-13 0.573443 -0.21017 -1.1193 -1.19087 -2.22897 -2.88043 -3.36616 -4.26822 -36.6324 reggae
858+0.111255 0.654942 0.00134559 -256.276 35.8566 3.11336 5.22695 5.01023 3.16229 0.436986 0.400832 0.138672 0.0370722 3.8803e-13 -0.0370722 -0.138672 -0.400832 -0.436986 -3.16229 -5.01023 -5.22695 -3.11336 -35.8566 reggae
859+0.124963 0.702547 0.00112449 -258.606 34.7974 5.80455 3.77515 0.944562 3.31842 1.89787 0.451933 -0.117842 -0.389253 3.89919e-13 0.389253 0.117842 -0.451933 -1.89787 -3.31842 -0.944562 -3.77515 -5.80455 -34.7974 reggae
860+0.144435 0.707719 0.0016508 -238.686 37.2309 -0.285381 3.93056 0.501571 0.664346 1.24184 -0.530602 -0.340698 -0.429529 3.6604e-13 0.429529 0.340698 0.530602 -1.24184 -0.664346 -0.501571 -3.93056 0.285381 -37.2309 reggae
861+0.120599 0.558516 0.000330704 -280.318 27.1783 3.7117 2.78284 2.57102 0.185857 0.996585 -0.286822 -1.31374 -1.10151 4.08344e-13 1.10151 1.31374 0.286822 -0.996585 -0.185857 -2.57102 -2.78284 -3.7117 -27.1783 reggae
862+0.157428 0.702913 0.00241317 -235.233 33.6972 0.313167 7.33613 5.58184 4.42534 0.092711 0.395659 0.640212 0.182186 3.57343e-13 -0.182186 -0.640212 -0.395659 -0.092711 -4.42534 -5.58184 -7.33613 -0.313167 -33.6972 reggae
863+0.0994657 0.507377 0.000736009 -277.523 29.2352 6.83551 4.41686 4.86862 5.16781 3.12381 2.42656 1.85462 0.935994 4.08584e-13 -0.935994 -1.85462 -2.42656 -3.12381 -5.16781 -4.86862 -4.41686 -6.83551 -29.2352 reggae
864+0.0941547 0.592915 0.00119243 -258.788 40.7615 0.334515 0.698762 6.62008 2.37739 -0.695181 -0.07722 -0.0505043 -0.472885 3.98297e-13 0.472885 0.0505043 0.07722 0.695181 -2.37739 -6.62008 -0.698762 -0.334515 -40.7615 reggae
865+0.15558 0.495169 0.00356346 -231.358 30.9768 3.06218 8.55613 4.01071 7.33381 2.99387 0.842036 -0.502022 0.119196 3.49341e-13 -0.119196 0.502022 -0.842036 -2.99387 -7.33381 -4.01071 -8.55613 -3.06218 -30.9768 reggae
866+0.0943665 0.60424 0.00372965 -237.793 45.0209 1.72411 2.20108 4.68471 2.13028 0.167846 1.01273 1.91545 0.523052 3.75177e-13 -0.523052 -1.91545 -1.01273 -0.167846 -2.13028 -4.68471 -2.20108 -1.72411 -45.0209 reggae
867+0.083086 0.63358 0.00162296 -253.76 44.8658 2.32408 0.859299 3.80657 1.15289 0.829412 -0.762696 0.66759 1.09065 3.97179e-13 -1.09065 -0.66759 0.762696 -0.829412 -1.15289 -3.80657 -0.859299 -2.32408 -44.8658 reggae
868+0.0894121 0.614636 0.0018396 -251.962 43.6023 4.52738 2.23069 3.87048 4.06409 -0.609658 0.136123 0.0557309 -0.321018 3.93015e-13 0.321018 -0.0557309 -0.136123 0.609658 -4.06409 -3.87048 -2.23069 -4.52738 -43.6023 reggae
869+0.104852 0.613721 0.00124884 -261.052 36.8073 3.36359 4.31492 2.89031 0.65985 2.84773 0.88457 0.288705 0.0491175 3.94582e-13 -0.0491175 -0.288705 -0.88457 -2.84773 -0.65985 -2.89031 -4.31492 -3.36359 -36.8073 reggae
870+0.12414 0.592957 0.00161561 -252.308 33.9894 4.49648 8.9149 4.70973 1.56183 1.31314 -1.46997 0.581791 2.50261 3.80486e-13 -2.50261 -0.581791 1.46997 -1.31314 -1.56183 -4.70973 -8.9149 -4.49648 -33.9894 reggae
871+0.12064 0.578276 0.00203655 -244.211 39.3446 2.05958 5.69849 3.1382 2.43094 2.7452 0.263287 0.393785 0.333197 3.75907e-13 -0.333197 -0.393785 -0.263287 -2.7452 -2.43094 -3.1382 -5.69849 -2.05958 -39.3446 reggae
872+0.155557 0.587819 0.00202927 -243.884 28.5703 1.06322 9.72394 6.47751 4.92175 3.3078 -0.549928 0.667687 0.544607 3.61476e-13 -0.544607 -0.667687 0.549928 -3.3078 -4.92175 -6.47751 -9.72394 -1.06322 -28.5703 reggae
873+0.155565 0.687289 0.00184034 -242.398 33.1386 2.70884 4.63244 0.887112 4.19598 0.969769 -0.18178 0.175192 0.484734 3.67504e-13 -0.484734 -0.175192 0.18178 -0.969769 -4.19598 -0.887112 -4.63244 -2.70884 -33.1386 reggae
874+0.102736 0.548539 0.00259743 -243.52 41.023 3.81874 7.07113 1.86762 0.160049 2.29729 0.801791 1.18584 0.110632 3.75349e-13 -0.110632 -1.18584 -0.801791 -2.29729 -0.160049 -1.86762 -7.07113 -3.81874 -41.023 reggae
875+0.102052 0.55361 0.00260107 -243.468 41.2038 3.81311 6.97354 1.78768 0.0931694 2.24131 0.784286 1.18046 0.136979 3.75554e-13 -0.136979 -1.18046 -0.784286 -2.24131 -0.0931694 -1.78768 -6.97354 -3.81311 -41.2038 reggae
876+0.132642 0.665634 0.00169274 -240.44 38.0825 -4.62565 1.46896 3.75463 0.791547 1.71124 -0.999702 0.53803 0.103928 3.70248e-13 -0.103928 -0.53803 0.999702 -1.71124 -0.791547 -3.75463 -1.46896 4.62565 -38.0825 reggae
877+0.114385 0.531715 0.00255713 -249.536 35.3544 7.61464 10.1574 3.99994 0.766774 2.3614 0.692352 0.420271 -0.573671 3.74573e-13 0.573671 -0.420271 -0.692352 -2.3614 -0.766774 -3.99994 -10.1574 -7.61464 -35.3544 reggae
878+0.0896939 0.578723 0.00143687 -259.052 40.1624 2.78417 5.04895 7.63636 2.30534 1.74818 2.03828 1.41206 0.548857 3.96337e-13 -0.548857 -1.41206 -2.03828 -1.74818 -2.30534 -7.63636 -5.04895 -2.78417 -40.1624 reggae
879+0.12067 0.661753 0.00116696 -255.702 33.9758 -2.14807 4.91855 8.18895 2.80858 3.79418 1.75051 0.90799 -0.77089 3.83327e-13 0.77089 -0.90799 -1.75051 -3.79418 -2.80858 -8.18895 -4.91855 2.14807 -33.9758 reggae
880+0.160418 0.688628 0.00086822 -258.146 29.5759 -6.85823 1.06536 1.96436 -4.62015 0.777906 0.161634 -0.981723 -0.349664 3.82112e-13 0.349664 0.981723 -0.161634 -0.777906 4.62015 -1.96436 -1.06536 6.85823 -29.5759 reggae
881+0.126587 0.647377 0.00243484 -244.041 35.8692 -0.343609 5.25785 4.07928 1.74893 1.3296 1.42976 2.20467 -0.0553546 3.70575e-13 0.0553546 -2.20467 -1.42976 -1.3296 -1.74893 -4.07928 -5.25785 0.343609 -35.8692 reggae
882+0.128802 0.648519 0.00229773 -245.005 35.36 -0.344848 5.13234 4.15821 1.77526 1.27175 1.41249 2.17041 -0.454427 3.709e-13 0.454427 -2.17041 -1.41249 -1.27175 -1.77526 -4.15821 -5.13234 0.344848 -35.36 reggae
883+0.128802 0.64815 0.00229773 -245.005 35.36 -0.344848 5.13234 4.15821 1.77526 1.27175 1.41249 2.17041 -0.454427 3.709e-13 0.454427 -2.17041 -1.41249 -1.27175 -1.77526 -4.15821 -5.13234 0.344848 -35.36 reggae
884+0.0679863 0.486347 0.000471539 -278.694 34.959 11.2354 3.12488 0.17976 -2.66382 -0.676782 0.24788 -0.0242482 0.0139711 4.1501e-13 -0.0139711 0.0242482 -0.24788 0.676782 2.66382 -0.17976 -3.12488 -11.2354 -34.959 reggae
885+0.0996246 0.662114 0.00147065 -251.193 41.085 1.44421 5.2651 5.62071 -0.134623 1.13574 0.0477713 0.40101 -0.171381 3.86028e-13 0.171381 -0.40101 -0.0477713 -1.13574 0.134623 -5.62071 -5.2651 -1.44421 -41.085 reggae
886+0.09294 0.581444 0.00140616 -260.66 38.3738 -2.30583 1.80168 11.5677 1.14057 1.25255 1.86922 1.39141 0.547468 3.96732e-13 -0.547468 -1.39141 -1.86922 -1.25255 -1.14057 -11.5677 -1.80168 2.30583 -38.3738 reggae
887+0.130127 0.622628 0.00270044 -238.213 36.64 0.0380214 -1.46979 3.33716 4.90155 2.32736 2.28347 1.0947 0.675671 3.67825e-13 -0.675671 -1.0947 -2.28347 -2.32736 -4.90155 -3.33716 1.46979 -0.0380214 -36.64 reggae
888+0.160868 0.629807 0.00244845 -240.565 33.1524 5.70061 9.43391 0.898807 -0.321387 -0.142132 1.31754 -0.34903 -0.849565 3.60797e-13 0.849565 0.34903 -1.31754 0.142132 0.321387 -0.898807 -9.43391 -5.70061 -33.1524 reggae
889+0.205571 0.781193 0.00146201 -232.914 27.6291 0.818643 5.4926 -2.17506 1.96566 -0.579926 0.856928 -0.146692 0.220877 3.47641e-13 -0.220877 0.146692 -0.856928 0.579926 -1.96566 2.17506 -5.4926 -0.818643 -27.6291 reggae
890+0.0478369 0.549119 0.00198948 -265.731 44.8973 10.7227 3.15871 4.44928 1.78199 1.70413 0.880631 0.424626 0.187572 4.10957e-13 -0.187572 -0.424626 -0.880631 -1.70413 -1.78199 -4.44928 -3.15871 -10.7227 -44.8973 reggae
891+0.152264 0.637339 0.00162168 -253.105 29.5107 1.99779 7.65722 3.28603 2.33262 3.92528 -0.385457 0.067312 0.824233 3.7522e-13 -0.824233 -0.067312 0.385457 -3.92528 -2.33262 -3.28603 -7.65722 -1.99779 -29.5107 reggae
892+0.125071 0.636893 0.000788882 -261.103 34.2216 -2.64304 2.52302 5.52468 1.13927 1.85003 -0.378878 0.428466 0.236896 3.92671e-13 -0.236896 -0.428466 0.378878 -1.85003 -1.13927 -5.52468 -2.52302 2.64304 -34.2216 reggae
893+0.115972 0.632603 0.00106625 -254.982 37.0532 -3.80211 2.52123 6.09085 0.486693 2.15777 -0.81743 0.65073 0.164434 3.87554e-13 -0.164434 -0.65073 0.81743 -2.15777 -0.486693 -6.09085 -2.52123 3.80211 -37.0532 reggae
894+0.105617 0.6781 0.00127634 -257.067 39.5314 6.10712 0.676745 1.9468 4.92288 -0.52155 0.76828 0.131159 -1.7045 3.94253e-13 1.7045 -0.131159 -0.76828 0.52155 -4.92288 -1.9468 -0.676745 -6.10712 -39.5314 reggae
895+0.101307 0.641125 0.00165577 -245.573 44.8671 -1.51671 -0.912692 4.01439 2.61598 1.53792 0.519393 1.00342 -0.884675 3.85631e-13 0.884675 -1.00342 -0.519393 -1.53792 -2.61598 -4.01439 0.912692 1.51671 -44.8671 reggae
896+0.135227 0.674168 0.00194412 -238.963 36.6552 0.75822 8.01191 3.82401 0.827912 1.30495 0.708684 0.478858 -0.0841976 3.64164e-13 0.0841976 -0.478858 -0.708684 -1.30495 -0.827912 -3.82401 -8.01191 -0.75822 -36.6552 reggae
897+0.0849089 0.554523 0.00215204 -256.555 40.0104 -1.74334 3.90393 12.5769 2.40911 3.50543 2.11302 1.30542 0.930411 3.93011e-13 -0.930411 -1.30542 -2.11302 -3.50543 -2.40911 -12.5769 -3.90393 1.74334 -40.0104 reggae
898+0.103058 0.542801 0.00129408 -251.851 42.4262 -0.672191 3.54925 6.80333 -1.66708 0.00897169 0.236436 -0.386691 -0.132771 3.89078e-13 0.132771 0.386691 -0.236436 -0.00897169 1.66708 -6.80333 -3.54925 0.672191 -42.4262 reggae
899+0.100619 0.52994 0.001962 -251.959 38.1689 2.12482 6.7439 5.5859 1.52635 3.04847 1.03358 1.36058 0.463832 3.83534e-13 -0.463832 -1.36058 -1.03358 -3.04847 -1.52635 -5.5859 -6.7439 -2.12482 -38.1689 reggae
900+0.131149 0.646545 0.00217069 -234.708 38.6292 -10.3516 2.69016 7.64626 -1.39448 7.20136 0.347003 1.15956 -0.394643 3.60376e-13 0.394643 -1.15956 -0.347003 -7.20136 1.39448 -7.64626 -2.69016 10.3516 -38.6292 reggae
901+0.115394 0.505339 0.00269376 -228.241 41.917 -2.32618 6.92994 3.89038 -0.342593 3.94019 -1.99071 1.64259 -1.23517 3.54252e-13 1.23517 -1.64259 1.99071 -3.94019 0.342593 -3.89038 -6.92994 2.32618 -41.917 rock
902+0.0771678 0.472413 0.00279188 -240.318 50.1787 -0.815872 2.50268 5.734 -0.404808 4.10404 0.477381 0.486604 0.494683 3.83761e-13 -0.494683 -0.486604 -0.477381 -4.10404 0.404808 -5.734 -2.50268 0.815872 -50.1787 rock
903+0.0949557 0.586069 0.00196888 -248.415 43.3157 -0.202454 1.49408 3.88374 -0.210079 0.908581 -1.33942 1.1783 -0.24649 3.86078e-13 0.24649 -1.1783 1.33942 -0.908581 0.210079 -3.88374 -1.49408 0.202454 -43.3157 rock
904+0.0695027 0.466889 0.00191072 -259.389 42.0207 8.9517 6.43383 3.19289 2.12482 3.57067 0.736272 2.04057 0.120506 3.97447e-13 -0.120506 -2.04057 -0.736272 -3.57067 -2.12482 -3.19289 -6.43383 -8.9517 -42.0207 rock
905+0.0639106 0.46121 0.00247718 -257.187 42.6588 9.56059 10.2837 6.6496 2.1036 3.70903 0.0624509 0.505097 -0.092395 3.94034e-13 0.092395 -0.505097 -0.0624509 -3.70903 -2.1036 -6.6496 -10.2837 -9.56059 -42.6588 rock
906+0.0838541 0.522192 0.00257308 -235.084 51.6506 -2.15098 -0.955176 2.14514 -0.0993779 2.79636 -3.12139 0.259757 0.0669084 3.80006e-13 -0.0669084 -0.259757 3.12139 -2.79636 0.0993779 -2.14514 0.955176 2.15098 -51.6506 rock
907+0.0863479 0.560898 0.00221369 -243.678 48.9742 -0.793165 1.021 7.00217 0.237247 0.928618 -1.17288 1.08054 0.237821 3.87272e-13 -0.237821 -1.08054 1.17288 -0.928618 -0.237247 -7.00217 -1.021 0.793165 -48.9742 rock
908+0.0578842 0.473115 0.00160946 -260.063 46.3445 9.17756 4.37364 4.28094 2.11047 1.14149 -1.04123 0.406101 0.21995 4.05245e-13 -0.21995 -0.406101 1.04123 -1.14149 -2.11047 -4.28094 -4.37364 -9.17756 -46.3445 rock
909+0.0937348 0.63184 0.00357993 -222.364 50.1271 -4.23296 1.23842 0.189161 -1.97273 4.52616 -2.7932 1.60883 -1.08779 3.58238e-13 1.08779 -1.60883 2.7932 -4.52616 1.97273 -0.189161 -1.23842 4.23296 -50.1271 rock
910+0.0575156 0.42445 0.00153181 -262.356 46.0584 11.518 2.37942 0.0885641 0.0306133 2.39283 1.57273 1.81504 0.892042 4.07933e-13 -0.892042 -1.81504 -1.57273 -2.39283 -0.0306133 -0.0885641 -2.37942 -11.518 -46.0584 rock
911+0.0900231 0.614121 0.00185872 -250.778 41.7761 4.31807 7.15833 4.83811 1.49469 2.44727 -1.32824 1.56668 -0.25616 3.85388e-13 0.25616 -1.56668 1.32824 -2.44727 -1.49469 -4.83811 -7.15833 -4.31807 -41.7761 rock
912+0.0866642 0.570147 0.00153723 -255.603 41.6257 5.90659 6.12824 3.88884 1.42409 2.1598 -0.406226 2.00757 0.260078 3.92295e-13 -0.260078 -2.00757 0.406226 -2.1598 -1.42409 -3.88884 -6.12824 -5.90659 -41.6257 rock
913+0.107393 0.61347 0.000937072 -265.892 33.9853 4.28418 7.15309 6.33565 3.06497 3.75099 0.534862 1.31761 0.592491 3.97089e-13 -0.592491 -1.31761 -0.534862 -3.75099 -3.06497 -6.33565 -7.15309 -4.28418 -33.9853 rock
914+0.0898061 0.522729 0.00175381 -261.069 35.1918 8.79707 13.4134 6.24832 0.692359 2.15468 -0.858894 0.883923 -0.83154 3.88004e-13 0.83154 -0.883923 0.858894 -2.15468 -0.692359 -6.24832 -13.4134 -8.79707 -35.1918 rock
915+0.114097 0.650359 0.000656647 -273.031 30.3652 4.8748 7.25361 6.13748 2.10507 2.87651 -0.00664851 0.52493 0.279255 4.01793e-13 -0.279255 -0.52493 0.00664851 -2.87651 -2.10507 -6.13748 -7.25361 -4.8748 -30.3652 rock
916+0.108312 0.668697 0.00114493 -257.795 39.7438 3.04744 3.86563 4.47266 0.486479 0.684916 -1.4536 0.222029 -0.35309 3.93674e-13 0.35309 -0.222029 1.4536 -0.684916 -0.486479 -4.47266 -3.86563 -3.04744 -39.7438 rock
917+0.138236 0.728806 0.0024456 -222.033 39.2127 -6.80054 4.26109 2.73218 -1.25152 2.90572 -3.37144 2.64123 -1.45919 3.43061e-13 1.45919 -2.64123 3.37144 -2.90572 1.25152 -2.73218 -4.26109 6.80054 -39.2127 rock
918+0.12469 0.627143 0.0021059 -229.762 42.7274 -7.35288 2.07846 4.37759 -0.427688 3.41518 -1.67048 2.31258 -1.29964 3.58889e-13 1.29964 -2.31258 1.67048 -3.41518 0.427688 -4.37759 -2.07846 7.35288 -42.7274 rock
919+0.128168 0.686183 0.00185707 -236.653 39.2709 -4.20491 4.93736 4.85936 0.803709 3.2801 -1.88039 1.6938 -1.37426 3.63294e-13 1.37426 -1.6938 1.88039 -3.2801 -0.803709 -4.85936 -4.93736 4.20491 -39.2709 rock
920+0.12809 0.600517 0.0011528 -243.006 39.6615 -5.19006 2.19346 2.9475 -1.16222 2.79371 -1.59852 1.48547 -0.597214 3.73545e-13 0.597214 -1.48547 1.59852 -2.79371 1.16222 -2.9475 -2.19346 5.19006 -39.6615 rock
921+0.117649 0.611515 0.00197066 -234.888 41.8914 -2.99101 3.59043 2.82973 -1.2428 2.09838 -2.07359 1.80223 -1.67801 3.63745e-13 1.67801 -1.80223 2.07359 -2.09838 1.2428 -2.82973 -3.59043 2.99101 -41.8914 rock
922+0.116793 0.674755 0.00193321 -233.448 43.2192 -5.32847 2.5045 3.42269 -2.6107 1.02509 -1.75916 2.69103 -2.02488 3.6295e-13 2.02488 -2.69103 1.75916 -1.02509 2.6107 -3.42269 -2.5045 5.32847 -43.2192 rock
923+0.129563 0.697967 0.00231633 -226.791 42.1678 -7.55005 1.23542 1.46039 -3.50114 1.9045 -2.22061 2.55805 -1.80438 3.53265e-13 1.80438 -2.55805 2.22061 -1.9045 3.50114 -1.46039 -1.23542 7.55005 -42.1678 rock
924+0.147341 0.539296 0.00193063 -228.52 36.5978 -3.38116 6.92712 2.14109 -2.57839 3.15486 -2.83052 2.63396 -0.83845 3.47473e-13 0.83845 -2.63396 2.83052 -3.15486 2.57839 -2.14109 -6.92712 3.38116 -36.5978 rock
925+0.133357 0.585803 0.0018847 -231.341 40.3546 -11.3215 0.982953 5.59232 -2.31889 2.84084 -1.84204 2.47653 -0.931419 3.58219e-13 0.931419 -2.47653 1.84204 -2.84084 2.31889 -5.59232 -0.982953 11.3215 -40.3546 rock
926+0.138318 0.705442 0.00184098 -230.119 39.7165 -7.94233 3.4046 3.76504 -2.86104 1.59256 -1.98326 3.01506 -1.95328 3.53824e-13 1.95328 -3.01506 1.98326 -1.59256 2.86104 -3.76504 -3.4046 7.94233 -39.7165 rock
927+0.122135 0.600333 0.00195683 -233.674 41.0847 -4.24655 4.7161 3.56113 -1.1174 3.18721 -1.66475 2.39755 -1.10903 3.61031e-13 1.10903 -2.39755 1.66475 -3.18721 1.1174 -3.56113 -4.7161 4.24655 -41.0847 rock
928+0.147936 0.596168 0.00111443 -243.351 34.0495 -4.64346 5.27076 3.29902 0.633072 3.73978 -1.09626 1.98871 -0.724774 3.66313e-13 0.724774 -1.98871 1.09626 -3.73978 -0.633072 -3.29902 -5.27076 4.64346 -34.0495 rock
929+0.104992 0.556548 0.00176089 -242.294 43.5941 -5.59232 0.812833 7.75718 2.64188 3.66005 1.85228 1.74734 -0.184101 3.79187e-13 0.184101 -1.74734 -1.85228 -3.66005 -2.64188 -7.75718 -0.812833 5.59232 -43.5941 rock
930+0.1332 0.571131 0.00218749 -231.578 38.9959 -3.67729 6.47918 4.40311 -0.647478 2.78879 -1.32408 0.852324 -0.633337 3.56315e-13 0.633337 -0.852324 1.32408 -2.78879 0.647478 -4.40311 -6.47918 3.67729 -38.9959 rock
931+0.151342 0.542693 0.00134439 -249.466 31.4365 3.49807 11.8942 3.7488 0.160408 3.32206 -0.682842 1.3329 -0.0989993 3.69213e-13 0.0989993 -1.3329 0.682842 -3.32206 -0.160408 -3.7488 -11.8942 -3.49807 -31.4365 rock
932+0.140848 0.650817 0.00129773 -248.194 36.9226 -0.574127 4.00852 3.50227 -0.772045 -1.37767 -0.466636 0.895298 -0.288499 3.77568e-13 0.288499 -0.895298 0.466636 1.37767 0.772045 -3.50227 -4.00852 0.574127 -36.9226 rock
933+0.122361 0.624069 0.00299309 -224.75 42.8697 -5.67411 2.07667 4.20202 0.970299 1.46663 -0.83662 0.165802 -0.314666 3.55006e-13 0.314666 -0.165802 0.83662 -1.46663 -0.970299 -4.20202 -2.07667 5.67411 -42.8697 rock
934+0.084956 0.528159 0.00144017 -249.91 49.1074 1.09297 -2.51435 2.92587 1.56263 0.147498 -2.8047 -1.27192 0.244251 3.98627e-13 -0.244251 1.27192 2.8047 -0.147498 -1.56263 -2.92587 2.51435 -1.09297 -49.1074 rock
935+0.144808 0.59649 0.00237065 -226.672 36.9791 -4.87508 4.15971 3.50822 2.85196 3.07286 0.178266 1.70252 -0.589772 3.49302e-13 0.589772 -1.70252 -0.178266 -3.07286 -2.85196 -3.50822 -4.15971 4.87508 -36.9791 rock
936+0.0886447 0.467075 0.00176168 -251.282 42.4449 3.82625 4.13287 3.47964 1.5763 1.69185 2.07786 1.88498 1.32668 3.89773e-13 -1.32668 -1.88498 -2.07786 -1.69185 -1.5763 -3.47964 -4.13287 -3.82625 -42.4449 rock
937+0.147649 0.624524 0.00279869 -219.928 36.8268 -4.18424 3.21086 1.91362 2.5856 1.6721 -1.63876 1.11439 -0.488222 3.40831e-13 0.488222 -1.11439 1.63876 -1.6721 -2.5856 -1.91362 -3.21086 4.18424 -36.8268 rock
938+0.136444 0.7029 0.001484 -239.753 38.145 -6.36433 2.51869 6.57195 0.977282 -0.022339 -0.23426 1.79085 -0.180399 3.68658e-13 0.180399 -1.79085 0.23426 0.022339 -0.977282 -6.57195 -2.51869 6.36433 -38.145 rock
939+0.153063 0.637838 0.00301582 -219.428 35.0354 -5.32939 2.32806 0.384394 1.37925 1.99615 0.748736 1.87585 0.488439 3.38734e-13 -0.488439 -1.87585 -0.748736 -1.99615 -1.37925 -0.384394 -2.32806 5.32939 -35.0354 rock
940+0.143462 0.574356 0.00171777 -236.549 37.8585 -3.85117 -0.363598 2.00514 7.02896 1.85416 1.62515 0.506732 0.875983 3.68929e-13 -0.875983 -0.506732 -1.62515 -1.85416 -7.02896 -2.00514 0.363598 3.85117 -37.8585 rock
941+0.157788 0.647187 0.00195806 -232.653 34.2408 -5.4133 4.85026 4.37584 2.04944 3.14377 0.958294 0.314434 0.350264 3.54801e-13 -0.350264 -0.314434 -0.958294 -3.14377 -2.04944 -4.37584 -4.85026 5.4133 -34.2408 rock
942+0.146861 0.644805 0.00225076 -225.976 38.1949 -5.11802 -0.582239 -0.252162 3.1539 0.860116 1.54218 0.0897964 0.515444 3.54092e-13 -0.515444 -0.0897964 -1.54218 -0.860116 -3.1539 0.252162 0.582239 5.11802 -38.1949 rock
943+0.142376 0.602271 0.00160905 -239.128 36.3539 -1.92068 4.69822 4.73851 2.59285 0.590927 0.477508 -0.235609 -0.520184 3.65799e-13 0.520184 0.235609 -0.477508 -0.590927 -2.59285 -4.73851 -4.69822 1.92068 -36.3539 rock
944+0.154401 0.634748 0.0016841 -236.319 35.2709 -5.49908 1.67016 3.02194 0.478534 0.591941 1.57692 -0.471061 -0.267766 3.61669e-13 0.267766 0.471061 -1.57692 -0.591941 -0.478534 -3.02194 -1.67016 5.49908 -35.2709 rock
945+0.0855334 0.460385 0.00161556 -250.943 44.0661 4.48539 2.83327 2.76925 0.792742 0.53978 0.606497 0.641876 0.563065 3.91275e-13 -0.563065 -0.641876 -0.606497 -0.53978 -0.792742 -2.76925 -2.83327 -4.48539 -44.0661 rock
946+0.0773527 0.435659 0.00117813 -259.154 43.0893 0.207452 2.82832 11.3831 1.84227 0.569678 1.41105 -0.119626 -0.615835 3.99979e-13 0.615835 0.119626 -1.41105 -0.569678 -1.84227 -11.3831 -2.82832 -0.207452 -43.0893 rock
947+0.135853 0.669056 0.00188786 -232.86 40.0148 -3.33274 0.562014 0.0793653 1.02395 1.99133 0.513071 -0.295783 -0.762635 3.62766e-13 0.762635 0.295783 -0.513071 -1.99133 -1.02395 -0.0793653 -0.562014 3.33274 -40.0148 rock
948+0.157265 0.615825 0.00179514 -233.977 34.6651 -5.74267 4.11756 5.19653 2.43298 0.37934 0.558842 0.54899 0.0635085 3.5756e-13 -0.0635085 -0.54899 -0.558842 -0.37934 -2.43298 -5.19653 -4.11756 5.74267 -34.6651 rock
949+0.0865004 0.537124 0.00196231 -241.532 49.8791 -3.26768 -0.507636 5.17309 -0.501246 2.69368 0.131718 1.05157 0.467291 3.86157e-13 -0.467291 -1.05157 -0.131718 -2.69368 0.501246 -5.17309 0.507636 3.26768 -49.8791 rock
950+0.0543928 0.426954 0.000738257 -272.313 41.5003 10.4537 0.751055 2.33121 1.0591 -0.842993 -0.77362 0.831672 1.51558 4.17708e-13 -1.51558 -0.831672 0.77362 0.842993 -1.0591 -2.33121 -0.751055 -10.4537 -41.5003 rock
951+0.100632 0.534799 0.00217827 -246.418 40.8623 5.45073 6.4737 2.63559 0.761379 0.361585 1.50209 0.861335 -0.0247017 3.7957e-13 0.0247017 -0.861335 -1.50209 -0.361585 -0.761379 -2.63559 -6.4737 -5.45073 -40.8623 rock
952+0.160866 0.573048 0.00202263 -232.533 32.8127 1.96342 9.2283 1.24975 -0.382642 -0.128703 0.547211 0.469218 -0.409988 3.50082e-13 0.409988 -0.469218 -0.547211 0.128703 0.382642 -1.24975 -9.2283 -1.96342 -32.8127 rock
953+0.0976949 0.570991 0.00227858 -241.804 46.7247 4.43788 2.45262 3.80427 2.86487 -2.35058 0.886194 0.44385 -1.83891 3.81565e-13 1.83891 -0.44385 -0.886194 2.35058 -2.86487 -3.80427 -2.45262 -4.43788 -46.7247 rock
954+0.181495 0.643254 0.00236625 -217.59 30.333 -5.88948 3.65922 1.98336 3.81083 1.10284 0.988782 0.601748 0.315929 3.31408e-13 -0.315929 -0.601748 -0.988782 -1.10284 -3.81083 -1.98336 -3.65922 5.88948 -30.333 rock
955+0.145849 0.592031 0.000846489 -251.545 36.2229 -1.19875 0.22562 0.974302 2.28955 1.26541 1.25198 0.168464 0.240984 3.84276e-13 -0.240984 -0.168464 -1.25198 -1.26541 -2.28955 -0.974302 -0.22562 1.19875 -36.2229 rock
956+0.0873735 0.606147 0.00180645 -247.898 45.425 5.68689 2.55091 0.957446 1.46658 -0.246072 -0.42078 0.459736 -0.116632 3.88884e-13 0.116632 -0.459736 0.42078 0.246072 -1.46658 -0.957446 -2.55091 -5.68689 -45.425 rock
957+0.174393 0.596255 0.00218861 -223.128 30.5017 -2.94344 7.39168 2.79673 1.60556 1.31632 -0.34583 0.154298 0.574358 3.36959e-13 -0.574358 -0.154298 0.34583 -1.31632 -1.60556 -2.79673 -7.39168 2.94344 -30.5017 rock
958+0.173593 0.659156 0.0016521 -231.839 32.1769 1.74274 4.1068 -2.78131 2.02604 0.664663 0.800745 -0.0304939 0.616124 3.52348e-13 -0.616124 0.0304939 -0.800745 -0.664663 -2.02604 2.78131 -4.1068 -1.74274 -32.1769 rock
959+0.135913 0.531859 0.0012108 -247.959 37.5871 5.97172 4.42126 -2.37224 0.0274939 -0.0120651 0.0997242 0.833387 -0.248468 3.78188e-13 0.248468 -0.833387 -0.0997242 0.0120651 -0.0274939 2.37224 -4.42126 -5.97172 -37.5871 rock
960+0.109743 0.461183 0.000744436 -267.383 36.1584 11.2235 5.30243 -0.880353 0.440825 0.43125 1.00557 0.532961 0.0583297 4.01904e-13 -0.0583297 -0.532961 -1.00557 -0.43125 -0.440825 0.880353 -5.30243 -11.2235 -36.1584 rock
961+0.143444 0.676505 0.00138932 -240.018 37.6056 0.60571 1.37894 -1.61868 1.63998 0.34244 1.13945 -0.314846 0.136334 3.70407e-13 -0.136334 0.314846 -1.13945 -0.34244 -1.63998 1.61868 -1.37894 -0.60571 -37.6056 rock
962+0.111036 0.5484 0.00122655 -256.901 39.025 9.5161 7.31026 0.593187 0.304728 0.0100846 -0.600269 -0.996822 -0.592672 3.90824e-13 0.592672 0.996822 0.600269 -0.0100846 -0.304728 -0.593187 -7.31026 -9.5161 -39.025 rock
963+0.155673 0.580359 0.000843309 -262.031 31.5428 7.4204 7.25855 0.0665211 0.839485 -0.59472 -0.165795 -0.427788 0.0413431 3.8942e-13 -0.0413431 0.427788 0.165795 0.59472 -0.839485 -0.0665211 -7.25855 -7.4204 -31.5428 rock
964+0.0705121 0.354909 0.000632901 -283.118 31.2359 16.8039 9.73823 4.26077 2.84412 0.110238 -0.833941 -0.404831 -0.207328 4.15282e-13 0.207328 0.404831 0.833941 -0.110238 -2.84412 -4.26077 -9.73823 -16.8039 -31.2359 rock
965+0.123573 0.632349 0.00114685 -252.87 37.523 -0.760858 4.03578 1.82456 1.462 5.62379 -0.519481 1.93237 0.23678 3.84453e-13 -0.23678 -1.93237 0.519481 -5.62379 -1.462 -1.82456 -4.03578 0.760858 -37.523 rock
966+0.127223 0.629105 0.0013768 -242.09 38.6869 -5.49032 3.96117 4.00773 -1.89255 3.20924 -1.53321 1.80694 -0.345614 3.7024e-13 0.345614 -1.80694 1.53321 -3.20924 1.89255 -4.00773 -3.96117 5.49032 -38.6869 rock
967+0.120327 0.566241 0.000248604 -288.118 23.014 5.80002 5.63047 5.40609 2.84553 0.675202 -1.53339 -0.361779 0.163441 4.14099e-13 -0.163441 0.361779 1.53339 -0.675202 -2.84553 -5.40609 -5.63047 -5.80002 -23.014 rock
968+0.138235 0.684858 0.00113687 -245.495 36.4391 -4.03438 4.59572 4.14612 0.280895 1.67021 -2.94677 1.45845 -0.729933 3.72523e-13 0.729933 -1.45845 2.94677 -1.67021 -0.280895 -4.14612 -4.59572 4.03438 -36.4391 rock
969+0.134063 0.617065 0.00116902 -245.976 36.046 -2.90312 6.74412 4.43534 0.337093 3.10616 -1.69968 2.16542 -0.740374 3.71461e-13 0.740374 -2.16542 1.69968 -3.10616 -0.337093 -4.43534 -6.74412 2.90312 -36.046 rock
970+0.128136 0.59611 0.000555128 -263.54 33.6042 0.886999 5.90614 4.84936 0.0298679 0.335137 -2.30606 0.327465 -0.430153 3.93061e-13 0.430153 -0.327465 2.30606 -0.335137 -0.0298679 -4.84936 -5.90614 -0.886999 -33.6042 rock
971+0.134385 0.652554 0.000747227 -257.421 33.7186 -3.42034 5.9306 6.99343 0.405514 3.12438 -1.57704 -0.192035 -0.539963 3.84943e-13 0.539963 0.192035 1.57704 -3.12438 -0.405514 -6.99343 -5.9306 3.42034 -33.7186 rock
972+0.113778 0.602095 0.00193527 -241.248 39.545 -1.99576 6.41045 4.03269 -1.08547 3.73102 -0.855391 1.5893 -0.378517 3.6945e-13 0.378517 -1.5893 0.855391 -3.73102 1.08547 -4.03269 -6.41045 1.99576 -39.545 rock
973+0.0988421 0.534451 0.00200322 -246.342 40.6528 3.24602 8.13597 3.6737 0.0510291 3.3559 -1.21747 1.10622 -0.806515 3.76942e-13 0.806515 -1.10622 1.21747 -3.3559 -0.0510291 -3.6737 -8.13597 -3.24602 -40.6528 rock
974+0.117297 0.590023 0.00227608 -233.377 40.7166 -2.36016 6.14506 2.9235 -0.789289 4.47111 -1.63489 1.93008 -0.633565 3.60177e-13 0.633565 -1.93008 1.63489 -4.47111 0.789289 -2.9235 -6.14506 2.36016 -40.7166 rock
975+0.110498 0.531522 0.00199852 -240.51 41.1504 -1.71302 7.49374 5.04634 -2.23989 3.88249 -0.991341 0.433522 -0.627064 3.69704e-13 0.627064 -0.433522 0.991341 -3.88249 2.23989 -5.04634 -7.49374 1.71302 -41.1504 rock
976+0.12102 0.599793 0.0015629 -246.312 36.9199 -0.253734 7.52945 3.98577 -0.490891 4.55324 -0.884816 0.971402 -0.912161 3.72253e-13 0.912161 -0.971402 0.884816 -4.55324 0.490891 -3.98577 -7.52945 0.253734 -36.9199 rock
977+0.0954557 0.529532 0.0019229 -247.156 42.1775 2.06243 5.88733 4.75835 0.119684 3.16203 -1.15551 0.507807 -0.401265 3.81216e-13 0.401265 -0.507807 1.15551 -3.16203 -0.119684 -4.75835 -5.88733 -2.06243 -42.1775 rock
978+0.114518 0.539076 0.00155598 -249.668 36.6287 1.37462 7.579 3.90695 1.25223 3.36756 -0.768772 2.65533 -0.278618 3.77119e-13 0.278618 -2.65533 0.768772 -3.36756 -1.25223 -3.90695 -7.579 -1.37462 -36.6287 rock
979+0.094156 0.453308 0.00161848 -255.716 39.6854 6.76289 7.91676 2.6201 0.0120129 4.70203 0.810675 0.737197 -0.725741 3.88141e-13 0.725741 -0.737197 -0.810675 -4.70203 -0.0120129 -2.6201 -7.91676 -6.76289 -39.6854 rock
980+0.112084 0.641497 0.00146989 -243.1 42.2222 -2.03793 4.13984 3.35082 -1.5029 2.80479 -1.36579 0.863655 -0.578422 3.76069e-13 0.578422 -0.863655 1.36579 -2.80479 1.5029 -3.35082 -4.13984 2.03793 -42.2222 rock
981+0.13429 0.632706 0.00124824 -240.92 37.8832 -5.76493 3.66054 2.68868 -2.67114 2.37475 -1.78802 1.07592 -1.78546 3.66697e-13 1.78546 -1.07592 1.78802 -2.37475 2.67114 -2.68868 -3.66054 5.76493 -37.8832 rock
982+0.152947 0.635659 0.0010401 -249.629 33.6116 -4.64965 4.28175 2.96822 -2.06659 1.7795 -2.18071 0.323634 -1.64073 3.73457e-13 1.64073 -0.323634 2.18071 -1.7795 2.06659 -2.96822 -4.28175 4.64965 -33.6116 rock
983+0.15861 0.665271 0.00110826 -243.515 32.2345 -5.73138 4.82718 2.35547 -1.95534 2.39647 -1.74952 2.01009 -1.63754 3.62891e-13 1.63754 -2.01009 1.74952 -2.39647 1.95534 -2.35547 -4.82718 5.73138 -32.2345 rock
984+0.113076 0.551105 0.00132872 -248.055 39.2637 0.0761555 7.48816 5.22091 0.148666 2.27333 -1.83701 0.969586 -1.09005 3.77835e-13 1.09005 -0.969586 1.83701 -2.27333 -0.148666 -5.22091 -7.48816 -0.0761555 -39.2637 rock
985+0.137163 0.603479 0.00133472 -241.648 36.7693 -2.0066 5.73858 2.5403 -0.2338 2.80044 -2.60093 0.643024 -1.52138 3.66597e-13 1.52138 -0.643024 2.60093 -2.80044 0.2338 -2.5403 -5.73858 2.0066 -36.7693 rock
986+0.124401 0.574221 0.000543053 -265.261 33.8581 -0.397174 1.66079 2.84629 -0.396966 0.766069 -0.525266 0.542438 -0.287652 3.97144e-13 0.287652 -0.542438 0.525266 -0.766069 0.396966 -2.84629 -1.66079 0.397174 -33.8581 rock
987+0.136891 0.682171 0.00146378 -237.999 39.2607 -8.24119 1.68717 4.91554 -0.737712 2.80452 -2.23633 0.201973 -1.16025 3.6664e-13 1.16025 -0.201973 2.23633 -2.80452 0.737712 -4.91554 -1.68717 8.24119 -39.2607 rock
988+0.122686 0.617131 0.00211737 -230.419 41.5376 -5.86112 2.58527 3.29315 1.12069 3.23174 -2.8721 2.40276 -0.991595 3.58987e-13 0.991595 -2.40276 2.8721 -3.23174 -1.12069 -3.29315 -2.58527 5.86112 -41.5376 rock
989+0.138027 0.623409 0.00104434 -247.621 36.9439 -8.88485 -0.597965 3.40569 -1.45942 2.22497 -1.57927 0.578077 -0.225215 3.78145e-13 0.225215 -0.578077 1.57927 -2.22497 1.45942 -3.40569 0.597965 8.88485 -36.9439 rock
990+0.0807171 0.538055 0.00126745 -257.276 43.3786 2.9635 1.90889 3.21005 -0.112955 2.03614 0.671825 1.13208 0.322296 3.98158e-13 -0.322296 -1.13208 -0.671825 -2.03614 0.112955 -3.21005 -1.90889 -2.9635 -43.3786 rock
991+0.14625 0.636927 0.00146492 -239.884 36.6069 -4.03836 6.67797 3.12355 -3.97631 2.95547 -2.43981 1.51598 -0.0320681 3.63437e-13 0.0320681 -1.51598 2.43981 -2.95547 3.97631 -3.12355 -6.67797 4.03836 -36.6069 rock
992+0.133894 0.603083 0.00141486 -236.849 39.7073 -6.72475 2.35293 3.79891 -0.761122 2.17569 -1.50215 2.28587 -1.46787 3.64515e-13 1.46787 -2.28587 1.50215 -2.17569 0.761122 -3.79891 -2.35293 6.72475 -39.7073 rock
993+0.132126 0.620745 0.00134912 -237.468 40.8549 -8.32371 1.73306 4.5545 -0.391353 2.51712 -2.21706 1.42998 -1.30131 3.67575e-13 1.30131 -1.42998 2.21706 -2.51712 0.391353 -4.5545 -1.73306 8.32371 -40.8549 rock
994+0.0989053 0.516714 0.00137439 -246.452 46.1055 -3.28948 -0.509182 4.9196 0.870979 1.00866 -0.964509 1.14892 -0.541831 3.87898e-13 0.541831 -1.14892 0.964509 -1.00866 -0.870979 -4.9196 0.509182 3.28948 -46.1055 rock
995+0.141747 0.505424 0.00152927 -234.32 39.0936 -10.6591 1.3182 5.65535 1.37615 4.51862 -0.96036 2.78813 -0.567454 3.61959e-13 0.567454 -2.78813 0.96036 -4.51862 -1.37615 -5.65535 -1.3182 10.6591 -39.0936 rock
996+0.104858 0.474224 0.000894387 -257.282 40.3755 0.630119 3.20409 5.57718 1.27987 0.0222821 -1.52561 0.198128 -1.10505 3.93848e-13 1.10505 -0.198128 1.52561 -0.0222821 -1.27987 -5.57718 -3.20409 -0.630119 -40.3755 rock
997+0.101611 0.434367 0.000685883 -263.839 37.0731 2.1907 3.02942 4.06306 1.70956 1.19553 -1.05966 1.04912 0.461206 3.99707e-13 -0.461206 -1.04912 1.05966 -1.19553 -1.70956 -4.06306 -3.02942 -2.1907 -37.0731 rock
998+0.0983492 0.545506 0.000963054 -255.357 41.4589 -1.55913 2.21569 6.4681 0.886297 1.24589 0.0749153 1.03098 0.490922 3.93923e-13 -0.490922 -1.03098 -0.0749153 -1.24589 -0.886297 -6.4681 -2.21569 1.55913 -41.4589 rock
999+0.0706691 0.441445 0.00126853 -262.965 41.96 5.26274 4.36084 8.18109 5.05453 2.3438 -0.470763 -0.571053 -1.3644 4.03437e-13 1.3644 0.571053 0.470763 -2.3438 -5.05453 -8.18109 -4.36084 -5.26274 -41.96 rock
1000+0.0801609 0.347525 0.000721008 -268.113 35.709 3.18429 1.57404 4.13285 2.97524 3.6099 0.989195 1.10961 0.0294553 4.03696e-13 -0.0294553 -1.10961 -0.989195 -3.6099 -2.97524 -4.13285 -1.57404 -3.18429 -35.709 rock
examples/ai/genre-classify/feature-extract.ck+212−0
@@ -0,0 +1,212 @@
1+//---------------------------------------------------------------------
2+// name: feature-extract.ck
3+// desc: sets up automated extraction over a training dataset
4+// this example can be adapted to other labeled audio dataset
5+//
6+// version: need chuck version 1.4.2.1 or higher
7+// sorting: part of ChAI (ChucK for AI)
8+//
9+// DATA: by default, this uses the GTZAN dataset:
10+// download and unzip updated version:
11+// https://chuck.stanford.edu/chai/data/gtzan/
12+//
13+// USAGE: this is purely for feature extraction on training data, so...
14+// run chuck in non-real-time mode (this actually can be much
15+// faster than real-time mode, since it doesn't synch to audio):
16+//
17+// extract and print
18+// > chuck --silent 2-extract.ck
19+//
20+// extract and write to FILE
21+// > chuck --silent 2-extract.ck:FILE
22+//
23+// date: Spring 2023
24+// authors: Ge Wang (https://ccrma.stanford.edu/~ge/)
25+// Yikai Li
26+//---------------------------------------------------------------------
27+
28+
29+// output file (if empty, will print to console)
30+"" => string OUTPUT_FILE;
31+// get from arguments
32+if( me.args() > 0 ) me.arg(0) => OUTPUT_FILE;
33+
34+// check
35+if( Machine.silent() == false )
36+{
37+ // print helpful message
38+ <<< "-----------------", "" >>>;
39+ <<< "[feature-extract]: chuck is currently running in REAL-TIME mode;", "" >>>;
40+ <<< "[feature-extract]: this step has no audio; may run much faster in SILENT mode!", "" >>>;
41+ <<< "[feature-extract]: to run in SILENT mode, restart chuck with --silent flag", "" >>>;
42+ <<< "-----------------", "" >>>;
43+}
44+
45+
46+//---------------------------------------------------------------------
47+// analysis network -- this determines which feature will be extracted
48+//---------------------------------------------------------------------
49+// audio input into a FFT
50+SndBuf audioFile => FFT fft;
51+// a thing for collecting multiple features into one vector
52+FeatureCollector combo => blackhole;
53+// add spectral feature: Centroid
54+fft =^ Centroid centroid =^ combo;
55+// add spectral feature: Flux
56+fft =^ Flux flux =^ combo;
57+// add spectral feature: RMS
58+fft =^ RMS rms =^ combo;
59+// add spectral feature: MFCC
60+fft =^ MFCC mfcc =^ combo;
61+
62+
63+//---------------------------------------------------------------------
64+// setting analysis parameters -- important for tuning your extraction
65+//---------------------------------------------------------------------
66+// set number of coefficients in MFCC (how many we get out)
67+// 13 is a commonly used value; using less here for printing
68+20 => mfcc.numCoeffs;
69+// set number of mel filters in MFCC
70+10 => mfcc.numFilters;
71+
72+// do one .upchuck() so FeatureCollector knows how many total dimension
73+combo.upchuck();
74+// get number of total feature dimensions
75+combo.fvals().size() => int NUM_DIMENSIONS;
76+
77+// set FFT size
78+2048 => fft.size;
79+// set window type and size
80+Windowing.hann(fft.size()) => fft.window;
81+// our hop size (how often to perform analysis)
82+2048::samp => dur HOP;
83+
84+
85+//---------------------------------------------------------------------
86+// training data -- preparation specific to a train dataset
87+//---------------------------------------------------------------------
88+// labels (and filename roots)
89+["blues", "classical", "country", "disco", "hiphop",
90+ "jazz", "metal", "pop", "reggae", "rock"] @=> string labels[];
91+// how many per label
92+100 => int NUM_EXAMPLES_PER_LABEL;
93+// how much time to aggregate features for each file
94+10::second => dur EXTRACT_TIME;
95+// given EXTRACT_TIME and HOP, how many frames per file?
96+(EXTRACT_TIME / HOP) $ int => int numFrames;
97+// relative path
98+"data/gtzan/genres_original/" => string PATH;
99+
100+// a feature frame
101+float featureFrame[NUM_DIMENSIONS];
102+// how many input files
103+0 => int NUM_FILES;
104+
105+// output reference, default is error stream (cherr)
106+cherr @=> IO @ theOut;
107+// instantiate
108+FileIO fout;
109+// output file
110+if( OUTPUT_FILE != "" )
111+{
112+ // print
113+ <<< "opening file for output:", OUTPUT_FILE >>>;
114+ // open
115+ fout.open( OUTPUT_FILE, FileIO.WRITE );
116+ // test
117+ if( !fout.good() )
118+ {
119+ <<< "cannot open file for writing...", "" >>>;
120+ me.exit();
121+ }
122+ // override
123+ fout @=> theOut;
124+}
125+
126+
127+//---------------------------------------------------------------------
128+// extraction -- iterating over entire training dataset
129+//---------------------------------------------------------------------
130+
131+// filename
132+string filename;
133+// loop over labels
134+for( int i; i < labels.cap(); i++)
135+{
136+ // get current label
137+ labels[i] => string label;
138+ // loop over examples under each label
139+ for( int j; j < NUM_EXAMPLES_PER_LABEL; j++ )
140+ {
141+ // construct filepath
142+ me.dir() + PATH + label + "/" + label + ".000" + (j<10?"0":"") + j + ".wav" => filename;
143+ // extract the file
144+ if( !extractFeatures( filename, label, theOut ) )
145+ {
146+ // issue warning
147+ cherr <= "PROBLEM during extraction: " <= filename <= IO.newline();
148+ // bail out
149+ me.exit();
150+ }
151+ }
152+}
153+
154+
155+//---------------------------------------------------------------------
156+// function: extract and print features from a single file
157+//---------------------------------------------------------------------
158+fun int extractFeatures( string inputFilePath, string label, IO out )
159+{
160+ // increment
161+ NUM_FILES++;
162+ // log
163+ cherr <= "[" <= NUM_FILES <= "] extracting features: " <= inputFilePath <= IO.newline();
164+
165+ // load by block to speed up IO
166+ 2048 => audioFile.chunks;
167+ // read the audio file
168+ inputFilePath => audioFile.read;
169+ // zero out
170+ featureFrame.zero();
171+
172+ // let one FFT-size of time pass (to buffer)
173+ fft.size()::samp => now;
174+ // loop over frames
175+ for( int i; i < numFrames; i++ )
176+ {
177+ //-------------------------------------------------------------
178+ // a single upchuck() will trigger analysis on everything
179+ // connected upstream from combo via the upchuck operator (=^)
180+ // the total number of output dimensions is the sum of
181+ // dimensions of all the connected unit analyzers
182+ //-------------------------------------------------------------
183+ combo.upchuck();
184+ // for each dimension
185+ for( int d; d < NUM_DIMENSIONS; d++ )
186+ {
187+ // copy
188+ combo.fval(d) +=> featureFrame[d];
189+ }
190+ // advance time
191+ HOP => now;
192+ }
193+
194+ //-------------------------------------------------------------
195+ // average into a single feature vector per file
196+ // NOTE: this can be easily modified to N feature vectors
197+ // spread out over the length of an audio file; for now
198+ // we will just do one feature vector per file
199+ //-------------------------------------------------------------
200+ for( int d; d < NUM_DIMENSIONS; d++ )
201+ {
202+ // average by total number of frames
203+ numFrames /=> featureFrame[d];
204+ // print the MFCC results
205+ out <= featureFrame[d] <= " ";
206+ }
207+ // print label name and endline
208+ out <= label <= IO.newline();
209+
210+ // done
211+ return true;
212+}
examples/ai/genre-classify/genre-classify.ck+338−0
@@ -0,0 +1,338 @@
1+//------------------------------------------------------------------------------
2+// name: genre-classify.ck
3+// desc: a real-time genre-classifier using the features extracted using
4+// GTZAN dataset + features-extract.ck
5+//
6+// version: need chuck version 1.4.2.1 or higher
7+// sorting: part of ChAI (ChucK for AI)
8+//
9+// USAGE: run in any real-time mode (default)
10+// > chuck classify-genres.ck
11+//
12+// uncomment the next line to learn more about the KNN2 object:
13+// KNN2.help();
14+//
15+// date: Spring 2023
16+// authors: Ge Wang (https://ccrma.stanford.edu/~ge/)
17+// Yikai Li
18+//------------------------------------------------------------------------------
19+
20+// input: pre-extracted features file with labels
21+me.dir() + "data/gtzan-23.txt" => string FEATURES_FILE;
22+// if have arguments, override filename
23+if( me.args() > 0 ) me.arg(0) => FEATURES_FILE;
24+//------------------------------------------------------------------------------
25+// expected features file format:
26+//------------------------------------------------------------------------------
27+// VALUE VALUE ... VALUE LABEL
28+// VALUE VALUE ... VALUE LABEL
29+// ... ... ... ... LABEL
30+// VALUE VALUE ... VALUE LABEL
31+//------------------------------------------------------------------------------
32+
33+
34+//------------------------------------------------------------------------------
35+// unit analyzer network: this must match the features in the features file
36+//------------------------------------------------------------------------------
37+// audio input into a FFT
38+adc => FFT fft;
39+// a thing for collecting multiple features into one vector
40+FeatureCollector combo => blackhole;
41+// add spectral feature: Centroid
42+fft =^ Centroid centroid =^ combo;
43+// add spectral feature: Flux
44+fft =^ Flux flux =^ combo;
45+// add spectral feature: RMS
46+fft =^ RMS rms =^ combo;
47+// add spectral feature: MFCC
48+fft =^ MFCC mfcc =^ combo;
49+
50+
51+//-----------------------------------------------------------------------------
52+// setting analysis parameters -- also should match what was used during extration
53+//-----------------------------------------------------------------------------
54+// set number of coefficients in MFCC (how many we get out)
55+// 13 is a commonly used value; using less here for printing
56+20 => mfcc.numCoeffs;
57+// set number of mel filters in MFCC
58+10 => mfcc.numFilters;
59+
60+// do one .upchuck() so FeatureCollector knows how many total dimension
61+combo.upchuck();
62+// get number of total feature dimensions
63+combo.fvals().size() => int NUM_DIMENSIONS;
64+
65+// set FFT size
66+2048 => fft.size;
67+// set window type and size
68+Windowing.hann(fft.size()) => fft.window;
69+// our hop size (how often to perform analysis)
70+2048::samp => dur HOP;
71+
72+
73+//------------------------------------------------------------------------------
74+// load feature data; read important global values like numPoints and numCoeffs
75+//------------------------------------------------------------------------------
76+// values to be read from file
77+0 => int numPoints; // number of points in data
78+0 => int numCoeffs; // number of dimensions in data
79+// file read PART 1: read over the file to get numPoints and numCoeffs
80+loadFile( FEATURES_FILE ) @=> FileIO @ fin;
81+// check
82+if( !fin.good() ) me.exit();
83+// check dimension
84+if( numCoeffs != NUM_DIMENSIONS )
85+{
86+ // error
87+ <<< "[error] expecting:", NUM_DIMENSIONS, "dimensions; but features file has:", numCoeffs >>>;
88+ // stop
89+ me.exit();
90+}
91+
92+// labels of all data points
93+string inLabels[numPoints];
94+// label indices of all data points
95+int inLabelsInt[inLabels.size()];
96+// feature vectors of data points
97+float inFeatures[numPoints][numCoeffs];
98+// keys
99+string labels[0];
100+// use as map: labels to numbers
101+int label2int[0];
102+
103+//------------------------------------------------------------------------------
104+// array for storing features
105+//------------------------------------------------------------------------------
106+// how much time to aggregate features for each file
107+// (this does not need to match extraction; might play with this number)
108+.5::second => dur EXTRACT_TIME;
109+// given EXTRACT_TIME and HOP, how many frames per file?
110+(EXTRACT_TIME / HOP) $ int => int numFrames;
111+
112+// use this for new input
113+float features[numFrames][numCoeffs];
114+// average values of coefficients across frames
115+float featureMean[numCoeffs];
116+// for printing
117+int lengths[0];
118+// for printing (how much to indent)
119+int indents[0];
120+
121+
122+//------------------------------------------------------------------------------
123+// read the data
124+//------------------------------------------------------------------------------
125+readData( fin );
126+
127+
128+//------------------------------------------------------------------------------
129+// set up our KNN object to use for classification
130+// (KNN2 is a fancier version of the KNN object)
131+// -- run KNN2.help(); in a separate program to see its available functions --
132+//------------------------------------------------------------------------------
133+KNN2 knn;
134+// k nearest neighbors
135+10 => int K;
136+// results vector
137+float knnResult[labels.size()];
138+// knn train
139+knn.train( inFeatures, inLabelsInt );
140+
141+
142+
143+
144+//------------------------------------------------------------------------------
145+// real-time classification loop
146+//------------------------------------------------------------------------------
147+while( true )
148+{
149+ // aggregate features over a period of time
150+ for( int frame; frame < numFrames; frame++ )
151+ {
152+ //-------------------------------------------------------------
153+ // a single upchuck() will trigger analysis on everything
154+ // connected upstream from combo via the upchuck operator (=^)
155+ // the total number of output dimensions is the sum of
156+ // dimensions of all the connected unit analyzers
157+ //-------------------------------------------------------------
158+ combo.upchuck();
159+ // get features
160+ for( int d; d < NUM_DIMENSIONS; d++)
161+ {
162+ // store them in current frame
163+ combo.fval(d) => features[frame][d];
164+ }
165+ // advance time
166+ HOP => now;
167+ }
168+
169+ // compute means for each coefficient across frames
170+ for( int d; d < NUM_DIMENSIONS; d++ )
171+ {
172+ // zero out
173+ 0.0 => featureMean[d];
174+ // loop over frames
175+ for( int j; j < numFrames; j++ )
176+ {
177+ // add
178+ features[j][d] +=> featureMean[d];
179+ }
180+ // average
181+ numFrames /=> featureMean[d];
182+ }
183+
184+ //-------------------------------------------------
185+ // predict using KNN2; results filled in knnResults
186+ //-------------------------------------------------
187+ knn.predict( featureMean, K, knnResult );
188+
189+ // print results
190+ chout <= "-------------------------------------------------" <= IO.newline();
191+ // print for each label
192+ for( int i; i < knnResult.size(); i++ )
193+ {
194+ // print label
195+ chout <= labels[i] <= ":";
196+ // print indentatation
197+ for( int ii; ii < indents[i]; ii++ ) { chout <= " "; }
198+ // print probability
199+ chout <= knnResult[i] <= IO.newline();
200+ }
201+}
202+//------------------------------------------------------------------------------
203+// end of real-time classification loop
204+//------------------------------------------------------------------------------
205+
206+
207+
208+
209+//------------------------------------------------------------------------------
210+// function: load data file
211+//------------------------------------------------------------------------------
212+fun FileIO loadFile( string filepath )
213+{
214+ // reset
215+ 0 => numPoints;
216+ 0 => numCoeffs;
217+
218+ // load data
219+ FileIO fio;
220+ if( !fio.open( filepath, FileIO.READ ) )
221+ {
222+ // error
223+ <<< "cannot open file:", filepath >>>;
224+ // close
225+ fio.close();
226+ // return
227+ return fio;
228+ }
229+
230+ string str;
231+ string line;
232+ // read file int array
233+ while( fio.more() )
234+ {
235+ // read each line
236+ fio.readLine().trim() => str;
237+ // check if empty line
238+ if( str != "" )
239+ {
240+ numPoints++;
241+ str => line;
242+ }
243+ }
244+
245+ // a string tokenizer
246+ StringTokenizer tokenizer;
247+ // set to last non-empty line
248+ tokenizer.set( line );
249+ // -1 (to account for label)
250+ -1 => numCoeffs;
251+ // see how many, including label name
252+ while( tokenizer.more() )
253+ {
254+ tokenizer.next();
255+ numCoeffs++;
256+ }
257+
258+ // check
259+ if( numPoints == 0 || numCoeffs <= 0 )
260+ {
261+ <<< "no data in file:", filepath >>>;
262+ fio.close();
263+ return fio;
264+ }
265+
266+ // print
267+ <<< "# of data points:", numPoints, "dimensions:", numCoeffs >>>;
268+
269+ // done for now
270+ return fio;
271+}
272+
273+
274+//------------------------------------------------------------------------------
275+// function: read the data
276+//------------------------------------------------------------------------------
277+fun void readData( FileIO fio )
278+{
279+ // rewind the file reader
280+ fio.seek( 0 );
281+
282+ // read file int array
283+ string str;
284+ int ci, ri;
285+ while( fio => str )
286+ {
287+ // check for last
288+ if( (ci != 0) && ((ci % numCoeffs) == 0) )
289+ {
290+ // read in label
291+ str => inLabels[ri];
292+ // set in map
293+ 1 => label2int[str];
294+ // increment row
295+ ri++;
296+ // reset column
297+ 0 => ci;
298+ }
299+ else
300+ {
301+ // store feature value
302+ Std.atof(str) => inFeatures[ri][ci];
303+ // increment column
304+ ci++;
305+ }
306+ }
307+
308+ // get keys from map
309+ label2int.getKeys( labels );
310+ // assign index
311+ for( int i; i < labels.size(); i++ )
312+ { i => label2int[labels[i]]; }
313+ // convert in labels to ints
314+ for( int i; i < inLabels.size(); i++ )
315+ {
316+ // get index as int
317+ label2int[inLabels[i]] => inLabelsInt[i];
318+ }
319+
320+ // max length
321+ 0 => int maxLength;
322+ // get lengths of label names for printing
323+ for( int i; i < labels.size(); i++ )
324+ {
325+ // compare with max length
326+ if( labels[i].length() > maxLength )
327+ labels[i].length() => maxLength;
328+ // append to array
329+ lengths << labels[i].length();
330+ }
331+
332+ // get lengths of label names for printing
333+ for( int i; i < lengths.size(); i++ )
334+ {
335+ // get indent for length
336+ indents << (maxLength + 1 ) - lengths[i];
337+ }
338+}
examples/ai/genre-classify/x-validate.ck+323−0
@@ -0,0 +1,323 @@
1+//------------------------------------------------------------------------------
2+// name: x-validate.ck
3+// desc: a cross validation example using extracted features
4+//
5+// version: need chuck version 1.4.2.1 or higher
6+// sorting: part of ChAI (ChucK for AI)
7+//
8+// USAGE: this is purely for cross validation on extracted features, so ...
9+// run chuck in non-real-time mode (this actually can be much
10+// faster than real-time mode, since it doesn't synch to audio):
11+//
12+// cross validation from FILE
13+// > chuck --silent x-validate.ck:FILE
14+//
15+// date: Spring 2023
16+// authors: Yikai Li
17+// Ge Wang (https://ccrma.stanford.edu/~ge/)
18+//------------------------------------------------------------------------------
19+
20+// input: pre-extracted features file with labels
21+"" => string FEATURES_FILE;
22+// if have arguments, override filename
23+if( me.args() > 0 ) me.arg(0) => FEATURES_FILE;
24+else
25+{ <<< "[usage]: chuck --silent x-validate:FILE", "" >>>; me.exit();}
26+//------------------------------------------------------------------------------
27+// expected features file format:
28+//------------------------------------------------------------------------------
29+// VALUE VALUE ... VALUE LABEL
30+// VALUE VALUE ... VALUE LABEL
31+// ... ... ... ... LABEL
32+// VALUE VALUE ... VALUE LABEL
33+//------------------------------------------------------------------------------
34+
35+
36+//------------------------------------------------------------------------------
37+// load feature data; read important global values like numPoints and numCoeffs
38+//------------------------------------------------------------------------------
39+// values to be read from file
40+0 => int numPoints; // number of points in data
41+0 => int numCoeffs; // number of dimensions in data
42+// file read PART 1: read over the file to get numPoints and numCoeffs
43+loadFile( FEATURES_FILE ) @=> FileIO @ fin;
44+// check
45+if( !fin.good() ) me.exit();
46+
47+// labels of all data points
48+string inLabels[numPoints];
49+// label indices of all data points
50+int inLabelsInt[inLabels.size()];
51+// feature vectors of data points
52+float inFeatures[numPoints][numCoeffs];
53+// keys
54+string labels[0];
55+// use as map: labels to numbers
56+int label2int[0];
57+
58+
59+//------------------------------------------------------------------------------
60+// read the data
61+//------------------------------------------------------------------------------
62+readData( fin );
63+
64+
65+//------------------------------------------------------------------------------
66+// set up our KNN object to use for classification
67+// (KNN2 is a fancier version of the KNN object)
68+// -- run KNN2.help(); in a separate program to see its available functions --
69+//------------------------------------------------------------------------------
70+KNN2 knn;
71+// k nearest neighbors
72+10 => int K;
73+// results vector
74+float knnResult[labels.size()];
75+
76+
77+//------------------------------------------------------------------------------
78+// cross validation
79+//------------------------------------------------------------------------------
80+// number of folds
81+20 => int numFolds;
82+// number of folds to use for testing
83+4 => int numTestFolds;
84+// number of folds to use for training
85+numFolds - numTestFolds => int numTrainFolds;
86+// number of points in each fold
87+(numPoints / numFolds) $ int => int numPointsPerFold;
88+// feature vectors of training data
89+float trainFeatures[numTrainFolds * numPointsPerFold][numCoeffs];
90+// labels of training data
91+int trainLabelsInt[numTrainFolds * numPointsPerFold];
92+// feature vectors of testing data
93+float testFeatures[numTestFolds * numPointsPerFold][numCoeffs];
94+// labels of testing data
95+int testLabelsInt[numTestFolds * numPointsPerFold];
96+// normalize the data
97+normalizeData();
98+// shuffle the data
99+shuffleData();
100+// cross validation
101+for( 0 => int i; i < numFolds / numTestFolds; i++)
102+{
103+ // prepare training and testing data
104+ prepareData( i );
105+ // train
106+ knn.train( trainFeatures, trainLabelsInt );
107+ // test
108+ 0.0 => float accuracy;
109+ for( 0 => int j; j < testLabelsInt.size(); j++ )
110+ {
111+ // predict
112+ knn.predict( testFeatures[j], K, knnResult );
113+ // aggregate accuracy
114+ knnResult[ testLabelsInt[j] ] +=> accuracy;
115+ }
116+ // print accuracy
117+ chout <= "fold " + i + " accuracy: " + ( accuracy / testLabelsInt.size() ) <= IO.newline();
118+}
119+
120+
121+//------------------------------------------------------------------------------
122+// function: normalizeData()
123+//------------------------------------------------------------------------------
124+fun void normalizeData()
125+{
126+ // for each dimension
127+ for( 0 => int i; i < numCoeffs; i++ )
128+ {
129+ // find min and max
130+ inFeatures[0][i] => float min;
131+ inFeatures[0][i] => float max;
132+ for( 1 => int j; j < numPoints; j++ )
133+ {
134+ if( inFeatures[j][i] < min ) inFeatures[j][i] => min;
135+ if( inFeatures[j][i] > max ) inFeatures[j][i] => max;
136+ }
137+ max - min => float range;
138+ // normalize
139+ for( 0 => int j; j < numPoints; j++ )
140+ (inFeatures[j][i] - min) / range => inFeatures[j][i];
141+ }
142+}
143+
144+
145+//------------------------------------------------------------------------------
146+// function: shuffleData()
147+//------------------------------------------------------------------------------
148+fun void shuffleData()
149+{
150+ // prepare swap data
151+ float swapFeatures[numCoeffs];
152+ int swapLabelInt;
153+ // shuffle the data
154+ for( numPoints - 1 => int i; i > 0; i-- )
155+ {
156+ // random index
157+ Math.random2( 0, i ) => int j;
158+ // swap features
159+ for( 0 => int k; k < numCoeffs; k++ )
160+ {
161+ inFeatures[i][k] => swapFeatures[k];
162+ inFeatures[j][k] => inFeatures[i][k];
163+ swapFeatures[k] => inFeatures[j][k];
164+ }
165+ // swap labels
166+ inLabelsInt[i] => swapLabelInt;
167+ inLabelsInt[j] => inLabelsInt[i];
168+ swapLabelInt => inLabelsInt[j];
169+ }
170+}
171+
172+
173+//------------------------------------------------------------------------------
174+// function: prepareData( int fold )
175+//------------------------------------------------------------------------------
176+fun void prepareData( int fold )
177+{
178+ // test indices
179+ fold * numTestFolds * numPointsPerFold => int testStart;
180+ testStart + numTestFolds * numPointsPerFold => int testEnd;
181+ // index
182+ 0 => int train_i;
183+ 0 => int test_i;
184+ // prepare training and testing data
185+ for( 0 => int i; i < numPoints; i++ )
186+ {
187+ // test
188+ if( i >= testStart && i < testEnd )
189+ {
190+ // copy features
191+ for( 0 => int j; j < numCoeffs; j++ )
192+ inFeatures[i][j] => testFeatures[test_i][j];
193+ // copy label
194+ inLabelsInt[i] => testLabelsInt[test_i];
195+ // increment
196+ test_i++;
197+ }
198+ // train
199+ else
200+ {
201+ // copy features
202+ for( 0 => int j; j < numCoeffs; j++ )
203+ inFeatures[i][j] => trainFeatures[train_i][j];
204+ // copy label
205+ inLabelsInt[i] => trainLabelsInt[train_i];
206+ // increment
207+ train_i++;
208+ }
209+ }
210+}
211+
212+
213+//------------------------------------------------------------------------------
214+// function: load data file
215+//------------------------------------------------------------------------------
216+fun FileIO loadFile( string filepath )
217+{
218+ // reset
219+ 0 => numPoints;
220+ 0 => numCoeffs;
221+
222+ // load data
223+ FileIO fio;
224+ if( !fio.open( filepath, FileIO.READ ) )
225+ {
226+ // error
227+ <<< "cannot open file:", filepath >>>;
228+ // close
229+ fio.close();
230+ // return
231+ return fio;
232+ }
233+
234+ string str;
235+ string line;
236+ // read file int array
237+ while( fio.more() )
238+ {
239+ // read each line
240+ fio.readLine().trim() => str;
241+ // check if empty line
242+ if( str != "" )
243+ {
244+ numPoints++;
245+ str => line;
246+ }
247+ }
248+
249+ // a string tokenizer
250+ StringTokenizer tokenizer;
251+ // set to last non-empty line
252+ tokenizer.set( line );
253+ // -1 (to account for label)
254+ -1 => numCoeffs;
255+ // see how many, including label name
256+ while( tokenizer.more() )
257+ {
258+ tokenizer.next();
259+ numCoeffs++;
260+ }
261+
262+ // check
263+ if( numPoints == 0 || numCoeffs <= 0 )
264+ {
265+ <<< "no data in file:", filepath >>>;
266+ fio.close();
267+ return fio;
268+ }
269+
270+ // print
271+ <<< "# of data points:", numPoints, "dimensions:", numCoeffs >>>;
272+
273+ // done for now
274+ return fio;
275+}
276+
277+
278+//------------------------------------------------------------------------------
279+// function: read the data
280+//------------------------------------------------------------------------------
281+fun void readData( FileIO fio )
282+{
283+ // rewind the file reader
284+ fio.seek( 0 );
285+
286+ // read file int array
287+ string str;
288+ int ci, ri;
289+ while( fio => str )
290+ {
291+ // check for last
292+ if( (ci != 0) && ((ci % numCoeffs) == 0) )
293+ {
294+ // read in label
295+ str => inLabels[ri];
296+ // set in map
297+ 1 => label2int[str];
298+ // increment row
299+ ri++;
300+ // reset column
301+ 0 => ci;
302+ }
303+ else
304+ {
305+ // store feature value
306+ Std.atof(str) => inFeatures[ri][ci];
307+ // increment column
308+ ci++;
309+ }
310+ }
311+
312+ // get keys from map
313+ label2int.getKeys( labels );
314+ // assign index
315+ for( int i; i < labels.size(); i++ )
316+ { i => label2int[labels[i]]; }
317+ // convert in labels to ints
318+ for( int i; i < inLabels.size(); i++ )
319+ {
320+ // get index as int
321+ label2int[inLabels[i]] => inLabelsInt[i];
322+ }
323+}
examples/ai/hmm/hmm-load.ck+37−0
@@ -0,0 +1,37 @@
1+//------------------------------------------------------------------------------
2+// name: hmm-load.ck
3+// desc: basic hidden markov model (HMM) usage example (using load)
4+//
5+// version: need chuck version 1.4.2.0 or higher
6+// sorting: part of ChAI (ChucK for AI) [BETA]
7+//
8+// uncomment the next line to learn more about the KNN object:
9+// HMM.help();
10+//
11+// author: Yikai Li
12+// date: Spring 2023
13+//------------------------------------------------------------------------------
14+
15+// init
16+HMM hmm;
17+
18+// load
19+[0.6, 0.2, 0.2] @=> float initial[];
20+[[0.8, 0.1, 0.1],
21+ [0.2, 0.7, 0.1],
22+ [0.1, 0.3, 0.6]] @=> float transition[][];
23+[[0.7, 0.0, 0.3],
24+ [0.1, 0.9, 0.0],
25+ [0.0, 0.2, 0.8]] @=> float emission[][];
26+hmm.load( initial, transition, emission );
27+
28+// generate
29+int observations[30];
30+hmm.generate( 30, observations );
31+
32+// output
33+for ( 0 => int i; i < observations.size(); i++ )
34+{
35+ chout <= observations[i] <= " ";
36+}
37+chout <= IO.newline();
examples/ai/hmm/hmm-train.ck+31−0
@@ -0,0 +1,31 @@
1+//------------------------------------------------------------------------------
2+// name: hmm-train.ck
3+// desc: basic hidden markov model (HMM) usage example (using train)
4+//
5+// version: need chuck version 1.4.2.0 or higher
6+// sorting: part of ChAI (ChucK for AI) [BETA]
7+//
8+// uncomment the next line to learn more about the KNN object:
9+// HMM.help();
10+//
11+// author: Yikai Li
12+// date: Spring 2023
13+//------------------------------------------------------------------------------
14+
15+// init
16+HMM hmm;
17+
18+// train
19+[0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2] @=> int observations[];
20+hmm.train( 2, 3, observations );
21+
22+// generate
23+int results[30];
24+hmm.generate( 30, results );
25+
26+// output
27+for ( 0 => int i; i < results.size(); i++ )
28+{
29+ chout <= results[i] <= " ";
30+}
31+chout <= IO.newline();
examples/ai/knn/knn-search.ck+38−0
@@ -0,0 +1,38 @@
1+//------------------------------------------------------------------------------
2+// name: knn2-search.ck
3+// desc: basic k-nearest-neighbor (k-NN) search example;
4+//
5+// version: need chuck version 1.4.2.1 or higher
6+// sorting: part of ChAI (ChucK for AI) [BETA]
7+//
8+// uncomment the next line to learn more about the KNN object:
9+// KNN.help();
10+//
11+// author: Yikai Li and Ge Wang
12+// date: Spring 2023
13+//------------------------------------------------------------------------------
14+
15+// create a KNN object
16+KNN knn;
17+
18+// prepare data: using 2-dimensional feature space for this example;
19+// in general, the feature space could be much higher
20+[[0.0, 0.0],
21+ [1.0, 1.0],
22+ [2.0, 2.0]] @=> float features[][];
23+// train the model
24+knn.train( features );
25+// optional: weigh feature dimensions
26+[1.0, 1.0] @=> float weights[];
27+// optional: set the weights across dimensions
28+knn.weigh( weights );
29+
30+// provide a test query
31+[0.5, 0.5] @=> float q[];
32+
33+// corresponding indices
34+int neighbor_indices[0];
35+
36+// search
37+knn.search( q, 2 , neighbor_indices );
38+chout <= "query = ("+ q[0]+","+q[1]+"); k=2: ["+ neighbor_indices[0]+","+neighbor_indices[1]+"]" <= IO.newline();
examples/ai/knn/knn2-classify.ck+64−0
@@ -0,0 +1,64 @@
1+//------------------------------------------------------------------------------
2+// name: knn2-classify.ck
3+// desc: k-nearest-neighbor (k-NN) classification example; it simulates a
4+// simplified musical genre classification task where three labeled
5+// categories are given respective locations in a 2D feature space.
6+//
7+// version: need chuck version 1.4.2.1 or higher
8+// sorting: part of ChAI (ChucK for AI) [BETA]
9+//
10+// uncomment the next line to learn more about the KNN2 object:
11+// KNN2.help();
12+//
13+// author: Yikai Li and Ge Wang
14+// date: Spring 2023
15+//------------------------------------------------------------------------------
16+
17+// create a k-NN classifier
18+KNN2 knn;
19+
20+// prepare data: labels
21+["classical", "pop", "rock"] @=> string labelNames[];
22+// prepare data: using 2-dimensional feature space for this example;
23+// in general, the feature space could be much higher
24+[[0.0, 0.0],
25+ [1.0, 1.0],
26+ [2.0, 2.0]] @=> float features[][];
27+// prepare data: corresponding IDs between labels and features
28+[0, 1, 2] @=> int labels[];
29+// number of labels
30+labels.size() => int NUM_LABELS;
31+// train the model
32+knn.train( features, labels );
33+// optional: weigh the feature dimensions
34+[1.0, 1.0] @=> float weights[];
35+// optional: set the weights across feature dimensions
36+knn.weigh( weights );
37+
38+// provide an unlabeled test query
39+[0.5, 0.5] @=> float q[];
40+
41+// predict with new query and k=1
42+predict( q, 1 );
43+// predict with the same query and k=2
44+predict( q, 2 );
45+
46+// based on a new unlabeled test query and its distance to its
47+// k nearest neighbors, predict and print the probabilities of
48+// class membership NOTE: for the sake of the example, this
49+// function assumes query has 2 dimensions
50+fun void predict( float query[], int k )
51+{
52+ // how we get the data back
53+ float prob[NUM_LABELS];
54+
55+ // predict with k nearest neighbors
56+ knn.predict( query, k, prob );
57+ // print
58+ chout <= "query=(" + query[0] + "," + query[1] + "); k=" + k + ":" <= IO.newline();
59+ for( 0 => int i; i < 3; i++ )
60+ {
61+ chout <= labelNames[i] + ": " + prob[i] <= IO.newline();
62+ }
63+ chout <= IO.newline();
64+}
examples/ai/knn/knn2-search.ck+68−0
@@ -0,0 +1,68 @@
1+//------------------------------------------------------------------------------
2+// name: knn2-search.ck
3+// desc: basic k-nearest-neighbor (k-NN) search example; it simulates a
4+// simplified musical genre classification task where three labeled
5+// categories are given respective locations in a 2D feature space.
6+//
7+// version: need chuck version 1.4.2.1 or higher
8+// sorting: part of ChAI (ChucK for AI) [BETA]
9+//
10+// uncomment the next line to learn more about the KNN2 object:
11+// KNN2.help();
12+//
13+// author: Yikai Li and Ge Wang
14+// date: Spring 2023
15+//------------------------------------------------------------------------------
16+
17+// create a k-NN object
18+KNN2 knn;
19+
20+// prepare data: labels
21+["classical", "pop", "rock"] @=> string labelNames[];
22+// prepare data: using 2-dimensional feature space for this example;
23+// in general, the feature space could be much higher
24+[[0.0, 0.0],
25+ [1.0, 1.0],
26+ [2.0, 2.0]] @=> float features[][];
27+// prepare data: corresponding IDs between labels and features
28+[0, 1, 2] @=> int labels[];
29+// number of labels
30+labels.size() => int NUM_LABELS;
31+// train the model
32+knn.train( features, labels );
33+// optional: weigh the feature dimensions
34+[1.0, 1.0] @=> float weights[];
35+// optional: set the weights across feature dimensions
36+knn.weigh( weights );
37+
38+// provide an unlabled test query
39+[0.5, 0.5] @=> float q[];
40+
41+// search for nearest neighbor label
42+int neighbor_labels[0];
43+// corresponding indices
44+int neighbor_indices[0];
45+
46+// search type #1: get labels
47+knn.search( q, 1 , neighbor_labels );
48+chout <= "query=(" + q[0] + ", " + q[1] + "); k=1:\n" + labelNames[neighbor_labels[0]] <= IO.newline();
49+
50+// search type #2: get labels and indices
51+knn.search( q, 2 , neighbor_labels, neighbor_indices );
52+chout <= "\n" <= "query=(" + q[0] + ", " + q[1] + "); k=2:\n";
53+for (int i; i < 2; i++)
54+{
55+ chout <= labelNames[neighbor_labels[i]] + " [" + neighbor_indices[i] + "]" <= IO.newline();
56+}
57+
58+// search for nearest neighbor label and feature
59+float neighbor_features[2][2];
60+knn.search( q, 2 , neighbor_labels, neighbor_indices, neighbor_features );
61+chout <= "\n" <= "query=(" + q[0] + ", " + q[1] + "); k=2:\n";
62+for (int i; i < 2; i++)
63+{
64+ chout <= labelNames[neighbor_labels[i]] + " [" + neighbor_indices[i] + "]" +
65+ " (" + neighbor_features[i][0] + ", " + neighbor_features[i][1] + ")" <= IO.newline();
66+}
67+
68+
examples/ai/mlp/mlp-manual.ck+164−0
@@ -0,0 +1,164 @@
1+//---------------------------------------------------------------------
2+// name: mlp-manual.ck
3+// desc: training (step-by-step) a multilayer perception (MLP):
4+// (for a less manaul example, see mlp.ck)
5+//
6+// version: need chuck version 1.4.2.1 or higher
7+// sorting: part of ChAI (ChucK for AI)
8+//
9+// uncomment for MLP API:
10+// MLP.help();
11+//
12+// author: Yikai Li
13+// Ge Wang (https://ccrma.stanford.edu/~ge/)
14+// date: Winter 2023
15+//---------------------------------------------------------------------
16+// delay for each epoch (change for print speed)
17+// (or run with --silent for no print delay)
18+100::ms => dur T_PRINT;
19+// learning rate
20+0.01 => float learningRate;
21+// number of epochs
22+100 => int epochs;
23+
24+// instantiate a multilayer perception (a basic neural network)
25+MLP mlp;
26+
27+// neurons per layer: input, [hidden layer(s)], output
28+[3, 5, 5, 2] @=> int nodesPerLayer[];
29+// initialize with the # of neurons per layer
30+mlp.init( nodesPerLayer );
31+
32+// input observations
33+[[0.1, 0.2, 0.3], [0.4, 0.5, 0.6]] @=> float X[][];
34+// output observations
35+[[0.1, 0.2], [0.3, 0.4]] @=> float Y[][];
36+// input and output array references
37+float x[], y[];
38+
39+
40+//---------------------------------------------------------------------
41+// train the neural network epoch by epoch
42+// this is a more "manual" alternative to simply calling MLP.train()
43+// intended for education and curiosity
44+//---------------------------------------------------------------------
45+for( int i; i < epochs; i++ )
46+{
47+ // shuffle the observations
48+ MLP.shuffle( X, Y );
49+
50+ // train over all observations
51+ for( int j; j < X.size(); j++ )
52+ {
53+ // print weights and biases
54+ chout <= IO.newline() <= "--- WEIGHTS AND BIASES |"
55+ <= " EPOCH:" <= i+1 <= " OBSERVATION:" <= j+1 <= " ---" <= IO.newline();
56+ visWeightsBiases();
57+
58+ // forward propagation
59+ chout <= IO.newline() <= "--- FORWARD-PROPAGATION |"
60+ <= " EPOCH:" <= i+1 <= " OBSERVATION:" <= j+1 <= " ---" <= IO.newline();
61+ mlp.forward( X[j] );
62+ visActivations();
63+
64+ // backpropagation
65+ chout <= IO.newline() <= "--- BACKPROPAGATION |"
66+ <= " EPOCH:" <= i+1 <= " OBSERVATION:" <= j+1 <= " ---" <= IO.newline();
67+ mlp.backprop( Y[j], learningRate );
68+ visGradients();
69+ }
70+
71+ // print
72+ chout <= IO.newline();
73+ chout <= "********************************************" <= IO.newline();
74+ chout <= "*** LEARNING-RATE:" <= learningRate <= " | EPOCH:" <= i+1 <= " DONE" <= IO.newline();
75+ chout <= "********************************************" <= IO.newline();
76+
77+ // pause for print
78+ T_PRINT => now;
79+}
80+
81+// print weights and biases
82+chout <= IO.newline() <= "--- FINAL WEIGHTS AND BIASES |"
83+ <= " EPOCH:" <= epochs <= " ---" <= IO.newline();
84+visWeightsBiases();
85+chout <= IO.newline();
86+
87+// print
88+chout <= "********************************************" <= IO.newline();
89+chout <= "************* TRAINING DONE ****************" <= IO.newline();
90+chout <= "********************************************" <= IO.newline();
91+chout <= IO.newline();
92+
93+
94+//---------------------------------------------------------------------
95+// visualize activations
96+//---------------------------------------------------------------------
97+fun void visActivations()
98+{
99+ // chout <= "[activations]" <= IO.newline();
100+ for ( 0 => int k; k < nodesPerLayer.size(); k++ )
101+ {
102+ // activations
103+ chout <= "layer " <= k <= " ACTIVATIONS" <= IO.newline();
104+ float a[nodesPerLayer[k]];
105+ mlp.getActivations(k, a);
106+ for ( 0 => int l; l < nodesPerLayer[k]; l++ )
107+ chout <= a[l] <= " ";
108+ chout <= IO.newline();
109+ }
110+}
111+
112+
113+//---------------------------------------------------------------------
114+// visualize weights and biases
115+//---------------------------------------------------------------------
116+fun void visWeightsBiases()
117+{
118+ // chout <= "[weights]" <= IO.newline();
119+ for ( 0 => int k; k < nodesPerLayer.size() - 1; k++ )
120+ {
121+ // weights
122+ chout <= "layer " <= k <= " WEIGHTS" <= IO.newline();
123+ float w[nodesPerLayer[k]][nodesPerLayer[k+1]];
124+ mlp.getWeights(k, w);
125+ for ( 0 => int l; l < nodesPerLayer[k]; l++ )
126+ {
127+ for ( 0 => int m; m < nodesPerLayer[k+1]; m++ )
128+ chout <= w[l][m] <= " ";
129+ chout <= IO.newline();
130+ }
131+ }
132+
133+ chout <= "---" <= IO.newline();
134+ // chout <= "[biases]" <= IO.newline();
135+ for ( 0 => int k; k < nodesPerLayer.size() - 1; k++ )
136+ {
137+ // biases
138+ chout <= "layer " <= k <= " BIASES" <= IO.newline();
139+ float b[nodesPerLayer[k+1]];
140+ mlp.getBiases(k, b);
141+ for ( 0 => int l; l < nodesPerLayer[k+1]; l++ )
142+ chout <= b[l] <= " ";
143+ chout <= IO.newline();
144+ }
145+}
146+
147+
148+//---------------------------------------------------------------------
149+// visualize gradients
150+//---------------------------------------------------------------------
151+fun void visGradients()
152+{
153+ // chout <= "[gradients]" <= IO.newline();
154+ for ( 0 => int k; k < nodesPerLayer.size(); k++ )
155+ {
156+ // gradients
157+ chout <= "layer " <= k <= " GRADIENTS" <= IO.newline();
158+ float g[nodesPerLayer[k]];
159+ mlp.getGradients(k, g);
160+ for ( 0 => int l; l < nodesPerLayer[k]; l++ )
161+ chout <= g[l] <= " ";
162+ chout <= IO.newline();
163+ }
164+}
examples/ai/mlp/mlp.ck+62−0
@@ -0,0 +1,62 @@
1+//---------------------------------------------------------------------
2+// name: mlp.ck
3+// desc: training a multilayer perception (MLP),
4+// a basic artificial neural network
5+// (for a step-by-step example, see mlp-manual.ck)
6+//
7+// version: need chuck version 1.4.2.1 or higher
8+// sorting: part of ChAI (ChucK for AI)
9+//
10+// uncomment for MLP API:
11+// MLP.help();
12+//
13+// author: Yikai Li
14+// Ge Wang (https://ccrma.stanford.edu/~ge/)
15+// date: Winter 2023
16+//---------------------------------------------------------------------
17+
18+// instantiate a multilayer perception
19+MLP mlp;
20+// learning rate
21+0.01 => float learningRate;
22+// number of epochs
23+100 => int epochs;
24+
25+// nodes per layer: input, [hidden layer(s)], output
26+[3, 5, 5, 2] @=> int nodesPerLayer[];
27+
28+// initialize with the units per layer with default activation function
29+// default: AI.Sigmoid for all layers except output layer;
30+// default: AI.Linear for output layer
31+mlp.init( nodesPerLayer );
32+
33+// (ALTERNATE #1) initialize with activation function
34+// mlp.init( nodesPerLayer, AI.Sigmoid );
35+
36+// (ALTERNATE #2) specify activation function per layer
37+// [AI.ReLU, AI.Tanh, AI.Softmax] @=> int activationPerLayer[];
38+// (ALTERNATE #2) initialize with activation function per layer
39+// mlp.init( nodesPerLayer, activationPerLayer );
40+
41+// input observations
42+[[0.1, 0.2, 0.3], [0.4, 0.5, 0.6]] @=> float X[][];
43+// output observations
44+[[0.1, 0.2], [0.3, 0.4]] @=> float Y[][];
45+// print
46+<<< "training model...", "" >>>;
47+// train the network
48+mlp.train( X, Y, learningRate, epochs );
49+// ALTERNATE: train with default learning_rate=0.01, epochs=100
50+// mlp.train(X, Y);
51+
52+// save the network into a model file, which can loaded later
53+// mlp.save( me.dir() + "model.txt" );
54+
55+// predict given a new input
56+[0.7, 0.8, 0.9] @=> float x[];
57+// array to how output
58+float y[2];
59+// predict output given input
60+mlp.predict(x, y);
61+// print the output
62+<<< "predicted output:", y[0], y[1] >>>;
examples/ai/mlp/model-load.ck+34−0
@@ -0,0 +1,34 @@
1+//---------------------------------------------------------------------
2+// name: mlp-load.ck
3+// desc: loading an MLP model from file (created by MLP.save())
4+//
5+// version: need chuck version 1.4.2.1 or higher
6+// sorting: part of ChAI (ChucK for AI)
7+//
8+// uncomment for MLP API:
9+// MLP.help();
10+//
11+// author: Yikai Li
12+// Ge Wang (https://ccrma.stanford.edu/~ge/)
13+// date: Winter 2023
14+//---------------------------------------------------------------------
15+
16+// instantiate a multilayer perception
17+MLP mlp;
18+
19+// file name
20+"model.txt" => string filename;
21+// print
22+<<< "loading model from file:", filename >>>;
23+// load the model into network (created by MLP.save() elsewhere)
24+if( !mlp.load( me.dir() + filename ) ) me.exit();
25+
26+// predict given a new input
27+[0.7, 0.8, 0.9] @=> float x[];
28+// array to how output
29+float y[2];
30+
31+// predict output given input
32+mlp.predict(x, y);
33+// print the output
34+<<< y[0], y[1] >>>;
examples/ai/mlp/model-save.ck+54−0
@@ -0,0 +1,54 @@
1+//---------------------------------------------------------------------
2+// name: model-save.ck
3+// desc: training a basic artificial neural network and save the
4+// parameters to a model file, which can later be loaded
5+// using MLP.load()
6+//
7+// version: need chuck version 1.4.2.1 or higher
8+// sorting: part of ChAI (ChucK for AI)
9+//
10+// uncomment for MLP API:
11+// MLP.help();
12+//
13+// author: Yikai Li
14+// Ge Wang (https://ccrma.stanford.edu/~ge/)
15+// date: Winter 2023
16+//---------------------------------------------------------------------
17+
18+// instantiate a multilayer perception
19+MLP mlp;
20+
21+// nodes per layer: input, [hidden layer(s)], output
22+[3, 5, 2] @=> int nodesPerLayer[];
23+// initialize with the units per layer with default activation function
24+// default: AI.Sigmoid for all layers except output layer;
25+// default: AI.Linear for output layer
26+mlp.init( nodesPerLayer );
27+
28+// (ALTERNATE #1) initialize with activation function
29+// mlp.init( nodesPerLayer, AI.Sigmoid );
30+
31+// (ALTERNATE #2) specify activation function per layer
32+// [AI.ReLU, AI.Tanh, AI.Softmax] @=> int activationPerLayer[];
33+// (ALTERNATE #2) initialize with activation function per layer
34+// mlp.init( nodesPerLayer, activationPerLayer );
35+
36+// input observations
37+[[0.1, 0.2, 0.3], [0.4, 0.5, 0.6]] @=> float X[][];
38+// output observations
39+[[0.1, 0.2], [0.3, 0.4]] @=> float Y[][];
40+// learning rate
41+0.001 => float learningRate;
42+// number of epochs
43+100 => int epochs;
44+// train the network
45+mlp.train( X, Y, learningRate, epochs );
46+// ALTERNATE: train with default learning_rate=0.001, epochs=100
47+// mlp.train(X, Y);
48+
49+// file name
50+"model2.txt" => string filename;
51+// save the network
52+mlp.save( me.dir() + filename );
53+// print
54+<<< "saved model to file:", filename >>>;
examples/ai/mlp/model.txt+15−0
@@ -0,0 +1,15 @@
1+# layers
2+3 5 2
3+# activation functions (0=Linear, 1=Sigmoid, 2=ReLU, 3=Tanh, 4=Softmax)
4+1 0
5+# weights
6+0.47885 0.897433 0.700238
7+0.271321 0.804914 0.75141
8+0.101633 0.697392 0.144179
9+0.20334 0.204955 0.0650653
10+0.220385 0.228439 0.646953
11+0.435727 0.606756 -0.0535573 0.382353 0.141568
12+0.0211301 -0.0718241 0.458108 0.296374 0.23014
13+# biases
14+0.097886 0.202725 0.195579 0.927591 0.262946
15+-0.167411 0.269795
examples/ai/pca/pca.ck+41−0
@@ -0,0 +1,41 @@
1+//---------------------------------------------------------------------
2+// name: pca.ck
3+// desc: principle component analysis utility
4+//
5+// version: need chuck version 1.4.2.1 or higher
6+// sorting: part of ChAI (ChucK for AI)
7+//
8+// uncomment for PCA API:
9+// PCA.help();
10+//
11+// author: Yikai Li
12+// Ge Wang (https://ccrma.stanford.edu/~ge/)
13+// date: Winter 2023
14+//---------------------------------------------------------------------
15+
16+// prepare
17+float input[10][10], output[10][3];
18+for( 0 => int i; i < 10; i++ )
19+{
20+ for( 0 => int j; j < 10; j++ )
21+ {
22+ // put noise in
23+ Math.randomf() => input[i][j];
24+ }
25+}
26+
27+// dimension reduce input (e.g., 10x10) to output (e.g., 10x3)
28+// PCA.reduce() is a static method...
29+// can be called with or without PCA instance
30+PCA.reduce( input, 3, output );
31+
32+// print
33+for ( 0 => int i; i < 10; i++ )
34+{
35+ for ( 0 => int j; j < 3; j++ )
36+ {
37+ // prin t
38+ chout <= output[i][j] <= ",";
39+ }
40+ chout <= IO.newline();
41+}
examples/ai/svm/svm-basic.ck+34−0
@@ -0,0 +1,34 @@
1+//------------------------------------------------------------------------------
2+// name: svm-basic.ck
3+// desc: basic support vector machine example (SVM)
4+//
5+// version: need chuck version 1.4.2.0 or higher
6+// sorting: part of ChAI (ChucK for AI) [BETA]
7+//
8+// uncomment the next line to learn more about the KNN object:
9+// HMM.help();
10+//
11+// author: Yikai Li
12+// date: Spring 2023
13+//------------------------------------------------------------------------------
14+
15+// instance
16+SVM svm;
17+
18+// prepare data
19+[[1.0, 1.0],
20+ [2.0, 2.0],
21+ [3.0, 3.0]] @=> float x[][];
22+[[1.0],
23+ [2.0],
24+ [3.0]] @=> float y[][];
25+
26+// train
27+// <<< "training...", "" >>>;
28+svm.train(x, y);
29+
30+// test
31+float res[1];
32+// <<< "predicting...", "" >>>;
33+svm.predict([1.5, 1.5], res);
34+<<< res[0] >>>;
examples/ai/wekinator/currentData.arff+19−0
@@ -0,0 +1,19 @@
1+@relation dataset
2+@attribute ID numeric@attribute Time date 'yyyy/MM/dd HH:mm:ss:SSS'@attribute 'Training round' numeric
3+@attribute inputs-1 numeric
4+@attribute inputs-2 numeric
5+@attribute inputs-3 numeric
6+@attribute outputs-1 numeric
7+@attribute outputs-2 numeric
8+
9+@data
10+0, 2023/01/01 00:00:00:000, 0, 0.1, 0.1, 0.1, 48, 60
11+1, 2023/01/01 00:00:00:000, 0, 0.1, 0.1, 0.1, 48, 60
12+2, 2023/01/01 00:00:00:000, 0, 0.1, 0.1, 0.1, 48, 60
13+3, 2023/01/01 00:00:00:000, 0, 0.1, 0.1, 0.1, 48, 60
14+4, 2023/01/01 00:00:00:000, 0, 0.1, 0.1, 0.1, 48, 60
15+5, 2023/01/01 00:00:00:000, 0, 0.8, 0.8, 0.8, 5, 8
16+6, 2023/01/01 00:00:00:000, 0, 0.8, 0.8, 0.8, 5, 8
17+7, 2023/01/01 00:00:00:000, 0, 0.8, 0.8, 0.8, 5, 8
18+8, 2023/01/01 00:00:00:000, 0, 0.8, 0.8, 0.8, 5, 8
19+9, 2023/01/01 00:00:00:000, 0, 0.8, 0.8, 0.8, 5, 8
examples/ai/wekinator/wekinator-basic.ck+121−0
@@ -0,0 +1,121 @@
1+//---------------------------------------------------------------------
2+// name: wekinator-basic.ck
3+// desc: basic example using the built-in Wekinator object in ChucK,
4+// based on Rebecca Fiebrink's Wekinator framework;
5+// This example adds two groups of 3-2 input-output
6+// observations, trains, and predicts output based on new input.
7+// default task: regression
8+// default model: MLPs (one hidden layer with same # of nodes as input)
9+//
10+// version: need chuck version 1.4.2.1 or higher
11+// sorting: part of ChAI (ChucK for AI)
12+//
13+// uncomment for Wekinator API:
14+// Wekinator.help();
15+//
16+// authors: Yikai Li
17+// Ge Wang (https://ccrma.stanford.edu/~ge/)
18+// Rebecca Fiebrink (original Wekinator framework)
19+// date: Winter 2023
20+//---------------------------------------------------------------------
21+
22+// instantiate a global Wekinator, so other files can access
23+global Wekinator wek;
24+
25+// clear training observations
26+wek.clear();
27+
28+// group count
29+1 => int groupNum;
30+
31+cherr <= "-----------" <= IO.newline();
32+// add a group of data
33+addGroup( [0.1, 0.1, 0.1], [48.0, 60.0], 20 );
34+addGroup( [0.4, 0.4, 0.4], [5.0, 8.0], 20 );
35+addGroup( [0.8, 0.0, 0.4], [30.0, 30.0], 20 );
36+cherr <= "-----------" <= IO.newline();
37+
38+// (optional) set model type; MLP is default
39+// AI.MLP => wek.modelType;
40+// (optional) set task type; regression is default
41+AI.Regression => wek.taskType;
42+// print
43+<<< "modelType:", wek.modelTypeName(),
44+ "| taskType:", wek.taskTypeName() >>>;
45+
46+// (optional) set properties to your liking
47+// <<< "changing Wekinator MLP properties...", "" >>>;
48+// wek.setProperty( AI.MLP, "hiddenLayers", 1 );
49+// note: 0 nodesPerHiddenLayer means "same as input layer"
50+// wek.setProperty( AI.MLP, "nodesPerHiddenLayer", 0 );
51+// wek.setProperty( AI.MLP, "learningRate", 0.01 );
52+// wek.setProperty( AI.MLP, "epochs", 100 );
53+
54+ // print model properties
55+<<< "Wekinator MLP hiddenLayers:", wek.getPropertyInt( AI.MLP, "hiddenLayers" ) >>>;
56+<<< "Wekinator MLP nodesPerHiddenLayer:", wek.getPropertyInt( AI.MLP, "nodesPerHiddenLayer" ) >>>;
57+<<< "Wekinator MLP learningRate", wek.getPropertyFloat( AI.MLP, "learningRate" ) >>>;
58+<<< "Wekinator MLP epochs:", wek.getPropertyInt( AI.MLP, "epochs" ) >>>;
59+// (optional) save the observations for loading later
60+// wek.exportObs( me.dir() + "currentData.arff" );
61+
62+// print
63+cherr <= "-----------" <= IO.newline();
64+cherr <= "training..." <= IO.newline();
65+cherr <= "-----------" <= IO.newline();
66+// train using current training set
67+wek.train();
68+
69+// new input
70+float x[];
71+// to hold predicted output
72+float y[2];
73+
74+cherr <= "given new input, predict output..." <= IO.newline();
75+// predict and print
76+predict( [0.101, 0.1, 0.1], y );
77+predict( [0.401, 0.4, 0.4], y );
78+predict( [0.801, 0.0, 0.4], y );
79+
80+// test run
81+repeat( 20 )
82+{
83+ // generate random input
84+ [Math.random2f(0,1), Math.random2f(0,1), Math.random2f(0,1)] @=> x;
85+ // predict and print
86+ predict( x, y );
87+ // advance time (just for effect)
88+ 50::ms => now;
89+}
90+
91+
92+// add a group of training observations
93+fun void addGroup( float inputs[], float outputs[], int N )
94+{
95+ // print
96+ cherr <= "adding group " <= groupNum++;
97+ // collect data
98+ repeat( N )
99+ {
100+ // input and output (could be set in another file)
101+ wek.input( inputs ); wek.output( outputs );
102+ // add current input and output (typically these are different)
103+ wek.add();
104+ // print
105+ cherr <= ".";
106+ // advance time (delay on purpose to visualize the process)
107+ (300.0/N)::ms => now;
108+ }
109+ // print
110+ cherr <= IO.newline();
111+}
112+
113+// predict and print
114+fun void predict( float inputs[], float outputs[] )
115+{
116+ // predict output based on input; 3 inputs -> 2 outputs
117+ wek.predict(inputs, outputs);
118+ // print
119+ cherr <= "(" <= inputs[0] <= ","<= inputs[1] <= ","<= inputs[2] <= ") -> ("
120+ <= outputs[0] <= ", " <= outputs[1] <= ")" <= IO.newline();
121+}
examples/ai/wekinator/wekinator-customize.ck+232−0
@@ -0,0 +1,232 @@
1+//---------------------------------------------------------------------
2+// name: wekinator-customize.ck
3+// desc: a more extensive example of working with the Wekinator object,
4+// with many options including per-output-channel configurations.
5+//
6+// achievement trophy to Yikai Li for the adaptation from Wekinator
7+// system and source, and redesigning the API with Ge into Wekinator
8+// chuck object; Yikai generated over 6000 lines of C++ code in this
9+// substantial adaption effort
10+//
11+// lifetime achievement award to Rebecca Fiebrink from making Wekinator,
12+// and showing us a humanistic and playful way forward in an AI-drenched
13+// world...
14+//
15+// version: need chuck version 1.4.2.1 or higher
16+// sorting: part of ChAI (ChucK for AI)
17+//
18+// uncomment for Wekinator API:
19+// Wekinator.help();
20+//
21+// authors: Yikai Li
22+// Ge Wang (https://ccrma.stanford.edu/~ge/)
23+// Rebecca Fiebrink (original Wekinator framework)
24+// date: Winter 2023
25+//---------------------------------------------------------------------
26+
27+// Wekinator instance
28+global Wekinator wek;
29+
30+<<< "---------------", "" >>>;
31+// set number of expect inputs
32+// (if different than exisxting, this will clear all current observations)
33+wek.inputDims(2);
34+<<< "# input channels:", wek.inputDims() >>>;
35+// set number of expect outputs
36+// (if different than exisxting, this will clear all current observations)
37+wek.outputDims(3);
38+<<< "# output channels:", wek.outputDims() >>>;
39+// set the type of task for Wekinator to do
40+// current options: AI.Classification, AI.Regression
41+wek.taskType( AI.Regression );
42+// print including taskType name
43+<<< "task ID:", wek.taskType(), "==", wek.taskTypeName() >>>;
44+
45+// set regression-related attributes
46+wek.setProperty( AI.Regression, "min", 0 );
47+wek.setProperty( AI.Regression, "max", 1 );
48+// how to handle values outside [min,max]? 0 = none, 1 = soft, 2 = hard
49+wek.setProperty( AI.Regression, "limit", false );
50+// set classification-related attributes
51+wek.setProperty( AI.Classification, "classes", 5 );
52+// set (global) MLP attributes
53+// NOTE: these will overwrite the corresponding output channel-specific properties
54+wek.setProperty( AI.MLP, "hiddenLayers", 1 );
55+wek.setProperty( AI.MLP, "nodesPerHiddenLayer", 0 ); // 0 = same as number of inputs
56+wek.setProperty( AI.MLP, "learningRate", 0.01 );
57+wek.setProperty( AI.MLP, "epochs", 100 );
58+// set (global) KNN attributes
59+// this is the default unless a more local attribute is set for a given output channel
60+wek.setProperty(AI.KNN, "k", 5);
61+<<< "---------------", "" >>>;
62+// how to get properties; NOTE that each numeric property is associatd with int or float type
63+<<< "regression min:", wek.getPropertyFloat(AI.Regression, "min") >>>;
64+<<< "regression max:", wek.getPropertyFloat(AI.Regression, "max") >>>;
65+<<< "regression limit type:", wek.getPropertyInt(AI.Regression, "limit") >>>;
66+<<< "MLP hiddenLayers:", wek.getPropertyInt(AI.MLP, "hiddenLayers") >>>;
67+<<< "MLP nodesPerHiddenLayer:", wek.getPropertyInt(AI.MLP, "nodesPerHiddenLayer") >>>;
68+<<< "MLP learningRate:", wek.getPropertyFloat(AI.MLP, "learningRate") >>>;
69+<<< "MLP epochs:", wek.getPropertyInt(AI.MLP, "epochs") >>>;
70+<<< "classification # classes:", wek.getPropertyInt(AI.Classification, "classes") >>>;
71+<<< "KNN k:", wek.getPropertyInt(AI.KNN, "k") >>>;
72+<<< "---------------", "" >>>;
73+
74+// set the type of underlying algorithm used
75+// options: AI.Regression: AI.MLP, AI.LR (currently not implemented)
76+// options: AI.Classification: AI.KNN, AI.SVM, AI.DT (current not implemented)
77+wek.modelType(AI.MLP);
78+// print including modelType name
79+<<< "modelType ID:", wek.modelType(), "==", wek.modelTypeName() >>>;
80+
81+// set any output channel-specific attributes, which locally
82+// overrides the global attributes set in wek.setProperty()
83+wek.setOutputProperty(0, "taskType", AI.Regression); // AI.Classification, AI.Regression
84+wek.setOutputProperty(0, "modelType", AI.MLP); // AI.Regression: AI.MLP, AI.LR; AI.Classification: AI.KNN, AI.SVM, AI.DT
85+wek.setOutputProperty(0, AI.Regression, "min", 0);
86+wek.setOutputProperty(0, AI.Regression, "max", 1);
87+wek.setOutputProperty(0, AI.Regression, "limit", false); // true: limit to [min,max]; false: no limit
88+wek.setOutputProperty(0, AI.MLP, "hiddenLayers", 1);
89+wek.setOutputProperty(0, AI.MLP, "nodesPerHiddenLayer", 0); // 0 = same as number of inputs
90+wek.setOutputProperty(0, AI.MLP, "learningRate", 0.01);
91+wek.setOutputProperty(0, AI.MLP, "epochs", 100);
92+wek.setOutputProperty(0, AI.Classification, "classes", 5);
93+wek.setOutputProperty(0, AI.KNN, "k", 5);
94+wek.setOutputProperty(0, "connectedInputs", [0, 1]); // sets which input to incorporate into the model
95+
96+<<< "---------------", "" >>>;
97+// get output channel-specific attributes
98+<<< "taskType | output channel 0:", wek.getOutputPropertyInt(0, "taskType") >>>;
99+<<< "modelType | output channel 0:", wek.getOutputPropertyInt(0, "modelType") >>>;
100+<<< "regression min | output channel 0:", wek.getOutputPropertyFloat(0, AI.Regression, "min") >>>;
101+<<< "regression max | output channel 0:", wek.getOutputPropertyFloat(0, AI.Regression, "max") >>>;
102+<<< "regression limit type | output channel 0:", wek.getOutputPropertyInt(0, AI.Regression, "limit") >>>;
103+<<< "MLP hiddenLayers | output channel 0:", wek.getOutputPropertyInt(0, AI.MLP, "hiddenLayers") >>>;
104+<<< "MLP nodesPerHiddenLayer | output channel 0:", wek.getOutputPropertyInt(0, AI.MLP, "nodesPerHiddenLayer") >>>;
105+<<< "MLP learningRate | output channel 0:", wek.getOutputPropertyFloat(0, AI.MLP, "learningRate") >>>;
106+<<< "MLP epochs | output channel 0:", wek.getOutputPropertyInt(0, AI.MLP, "epochs") >>>;
107+<<< "classification # classes | output channel 0:", wek.getOutputPropertyInt(0, AI.Classification, "classes") >>>;
108+<<< "KNN k | output channel 0:", wek.getOutputPropertyInt(0, AI.KNN, "k") >>>;
109+<<< "---------------", "" >>>;
110+
111+int indices[1];
112+// get indices of input channels connected to a particular output
113+wek.getOutputProperty(0, "connectedInputs", indices);
114+// print
115+cherr <= "connected inputs | output channel 0: ";
116+for( int i; i < indices.size(); i++ ) cherr <= indices[i] <= " ";
117+cherr <= IO.newline();
118+
119+// set as the current input
120+wek.input([0.5, 0.5]);
121+
122+// randomize output for each channel between that channels min and max
123+wek.randomizeOutputs();
124+// set as the current output
125+wek.output([0.5, 0.5, 0.5]);
126+
127+// add an observation from the current input to output
128+wek.add();
129+// increments the training round number
130+// a round consists of one or more added observations
131+wek.nextRound();
132+// add an observation explicitly from input and output
133+wek.add([1.0, 1.0], [1.0, 1.0, 1.0]);
134+// add an observation explicitly from input and output, for channel 0
135+wek.add(0, [2.0, 2.0], [2.0, 2.0, 2.0]);
136+
137+// train on all the observations so far
138+wek.train();
139+
140+// array to hold predictions
141+float outputs[1];
142+// predict output given new input
143+wek.predict([3.0, 3.0], outputs);
144+// print output
145+cherr <= "prediction: ";
146+for( int i; i < outputs.size(); i++ ) cherr <= outputs[i] <= ", ";
147+cherr <= IO.newline();
148+
149+// get the number of observations (globally)
150+<<< "number of observations (total):", wek.numObs() >>>;
151+// get the number of observations for a specific output channel
152+<<< "number of observations for output channel 0:", wek.numObs(0) >>>;
153+
154+<<< "---------------", "" >>>;
155+// array to hold observations
156+// due to a current ChucK language limitation, need to pre-allocate array to obs size
157+float obs[wek.numObs()][0];
158+// retrieve current observations
159+wek.getObs(obs);
160+// print what we got
161+<<< "ID, time, recording round, Input-0, Input-1, Output-0, Output-1, Output-2", "" >>>;
162+for( 0 => int i; i < obs.size(); i++ )
163+{
164+ for( 0 => int j; j < obs[i].size(); j++ )
165+ {
166+ cherr <= obs[i][j] <= ", ";
167+ }
168+ cherr <= IO.newline();
169+}
170+
171+// array to hold observations
172+// due to a current ChucK language limitation, need to pre-allocate array to obs size
173+float obs1[wek.numObs(0)][0];
174+// retrieve current observations for a specific channel
175+wek.getObs(0, obs1);
176+// print what we got
177+<<< "ID, time, recording round, Input-0, Input-1, Output-0, Output-1, Output-2", "" >>>;
178+for( 0 => int i; i < obs1.size(); i++ )
179+{
180+ for( 0 => int j; j < obs1[i].size(); j++ )
181+ {
182+ cherr <= obs1[i][j] <= ", ";
183+ }
184+ cherr <= IO.newline();
185+}
186+
187+// delete the last round of observations (since the last wek.nextRound())
188+wek.deleteLastRound();
189+
190+// clear observations by ID in the given range lo to hi
191+wek.clearObs( 0, 1 );
192+// clear observations by ID in the given range lo to hi, for a specific channel
193+wek.clearObs( 0, 0, 1 );
194+
195+// save everything for this Wekinator (observations, model parameters, configurations)
196+wek.save("./tmp.txt");
197+// load Wekinator state from file
198+wek.load("./tmp.txt");
199+
200+// export observations only (no model or configurations)
201+wek.exportObs("./tmp.arff");
202+// export observations only (no model or configurations), for a specific channel
203+wek.exportObs(0, "./tmp0.arff");
204+// import observations (NOTE: this replaces existing observations,
205+// reset the round number, and will be associated with all output channels)
206+wek.importObs("./tmp.arff");
207+
208+// clear all observations
209+wek.clearAllObs();
210+// clear all observations on a given channel
211+wek.clearAllObs(0);
212+
213+<<< "---------------", "" >>>;
214+// set whether Wekinator.add() should be associated with output channels (all)
215+wek.setAllRecordStatus( false );
216+// set whether Wekinator.add() should be associated with a specific output channel
217+wek.setOutputRecordStatus( 0, true );
218+// print
219+<<< "record status | output channel 0:", wek.getOutputRecordStatus( 0 ) >>>;
220+
221+// setting this to false will "mask" out all output channels; will predict 0s
222+wek.setAllRunStatus( false );
223+// <<< wek.getAllRunStatus() >>>;
224+// setting this to false will "mask" out a specific output channels
225+// that particular output channel will predict 0s
226+wek.setOutputRunStatus(0, true);
227+<<< "run status | output channel 0:", wek.getOutputRunStatus(0) >>>;
228+
229+// clear all observations, round number, model (parameters and local properties)
230+// NOTE: the global properties will remain unchanged
231+wek.clear();
232+<<< "---------------", "" >>>;
examples/ai/wekinator/wekinator-import.ck+48−0
@@ -0,0 +1,48 @@
1+//---------------------------------------------------------------------
2+// name: wekinator-import.ck
3+// desc: this examples imports training data from an .arff file,
4+// (which can be saved either from the Wekinator app or
5+// using Wekinator.exportObs())
6+//
7+// version: need chuck version 1.4.2.1 or higher
8+// sorting: part of ChAI (ChucK for AI)
9+//
10+// uncomment for Wekinator API:
11+// Wekinator.help();
12+//
13+// authors: Yikai Li
14+// Ge Wang (https://ccrma.stanford.edu/~ge/)
15+// Rebecca Fiebrink (original Wekinator framework)
16+// date: Winter 2023
17+//---------------------------------------------------------------------
18+
19+// instantiate a global Wekinator, so other files can easily use
20+global Wekinator wek;
21+
22+// print
23+cherr <= "loading observations from file..." <= IO.newline();
24+// load an ARFF data file containing input-output observations
25+// (generated either from Wekinator.exportObs() or Wekinator app)
26+// NOTE: Wekinator.importObs() clears existing training data,
27+// and uses the inputDims and outputDims inferred from file
28+// NOTE: it is possible to add additional observations after
29+wek.importObs( me.dir() + "currentData.arff" );
30+
31+// print what we loaded
32+cherr <= "inputDims: " <= wek.inputDims() <= " "
33+<= "outputDims: " <= wek.outputDims() <= " "
34+<= "numObs: " <= wek.numObs() <= IO.newline();
35+
36+// train using current observations
37+wek.train();
38+
39+// input (dimensions should match inputDims)
40+[0.3, 0.25, 0.4] @=> float x[];
41+// output (dimensions should match outputDims)
42+float y[wek.outputDims()];
43+// predict output based on input
44+wek.predict( x, y );
45+
46+// print
47+for( int i; i < y.size(); i++ ) { cherr <= y[i] <= " "; }
48+cherr <= IO.newline();
examples/ai/word2vec/poem-i-feel.ck+195−0
@@ -0,0 +1,195 @@
1+//------------------------------------------------------------------------------
2+// name: poem-i-feel.ck
3+// desc: a sus poem made with chAI and word2vec
4+// sorting: part of chAI (ChucK for AI)
5+//
6+// "i feel"
7+// -- a stream of unconsciousness poem generator
8+//
9+// NOTE: need a pre-trained word vector model, e.g., from
10+// https://chuck.stanford.edu/chai/data/glove/
11+// glove-wiki-gigaword-50-tsne-2.txt (400000 words x 2 dimensions)
12+//
13+// author: Ge Wang
14+// date: Spring 2023
15+//------------------------------------------------------------------------------
16+
17+// random seed (if set, sequence can be reproduce)
18+// Math.srandom( 515 );
19+
20+// instantiate
21+Word2Vec model;
22+// pre-trained model to load
23+me.dir() + "glove-wiki-gigaword-50-tsne-2.txt" => string filepath;
24+// load pre-trained model (see URLs above for download)
25+if( !model.load( filepath ) )
26+{
27+ <<< "cannot load model:", filepath >>>;
28+ me.exit();
29+}
30+
31+// starter "i feel" emotion words with positive connotations
32+["fine", "joy", "excited", "inspired", "included",
33+"understood", "artful", "playful", "free", "myself",
34+"grateful", "optimistic" ] @=> string positives[];
35+
36+// starter "i feel" emotion words with negative connotations
37+["sad", "bored", "meh", "spent", "worried",
38+"afraid", "marginalized", "misunderstood", "powerless",
39+"undone", "small", "guilt", "cringe", "dread" ] @=> string negatives[];
40+
41+// starter "i feel" emotion words with other connotations
42+["numb", "nothing", "weird", "meh", "disjointed", "scattered",
43+"complicated", "sus" ] @=> string others[];
44+
45+// conditions
46+3 => int LINES_PER_STANZA;
47+3 => int NUM_SECTIONS; // here each section is a fixed stanzas format
48+
49+// number of nearest words to retrieve for each word
50+// higher this number the higher the variance per word
51+10 => int K_NEAREST;
52+
53+// timing
54+400::ms => dur T_WORD; // duration per word
55+false => int shouldScaleTimeToWordLength; // longer words take longer?
56+T_WORD => dur T_LINE_PAUSE; // a little pause after each line
57+T_WORD * 2 => dur T_STANZA_PAUSE; // pause after each stanza
58+
59+// sound
60+ModalBar crystal => Gain left => dac.left;
61+crystal => Gain right => dac.right;
62+1 => crystal.preset;
63+// feedback delay for echos
64+left => DelayL DL => left; .5 => DL.gain; T_WORD*1.5 => DL.max => DL.delay;
65+right => DelayL DR => right; .3 => DR.gain; T_WORD*2 => DR.max => DR.delay;
66+
67+// current word
68+string feeling;
69+// word vector
70+float vec[model.dim()];
71+// search results
72+string words[K_NEAREST];
73+
74+// line break
75+chout <= IO.newline(); chout.flush();
76+
77+// loop over stanzas
78+for( int s; s < NUM_SECTIONS; s++ )
79+{
80+ // grab a word out of the "good" bag
81+ positives[Math.random2(0,positives.size()-1)] => feeling;
82+ // print a stanza
83+ stanza( feeling, LINES_PER_STANZA, 48, 64 );
84+
85+ // grab a word out of the "bad" bag
86+ negatives[Math.random2(0,negatives.size()-1)] => feeling;
87+ // print a stanza
88+ stanza( feeling, LINES_PER_STANZA, 48, 63 );
89+
90+ // grab a word out of the "other" bag
91+ others[Math.random2(0,others.size()-1)] => feeling;
92+ // print a stanza
93+ stanza( feeling, LINES_PER_STANZA, 36, Math.random2(33,36)*2 );
94+
95+ endStanza();
96+ chout <= IO.newline() <= IO.newline(); chout.flush();
97+ // pause at end of line
98+ T_STANZA_PAUSE => now;
99+}
100+
101+// print at the end
102+chout <= "\"i feel\"" <= IO.newline();
103+chout <= "-- a stream of unconsciousness poem" <= IO.newline();
104+chout.flush();
105+
106+// print a stanza from a starter feeling word
107+fun void stanza( string feeling, int numLines, int pitch1, int pitch2 )
108+{
109+ // loop over lines in a stanza
110+ for( int n; n < numLines; n++ )
111+ {
112+ // a line
113+ say("i"); play(pitch1); wait();
114+ say("feel"); wait();
115+ say(feeling); play(pitch2); wait();
116+ endl(); wait();
117+
118+ // get similar words
119+ model.getSimilar( feeling, words.size(), words );
120+ // choose one at random
121+ words[Math.random2(0,words.size()-1)] => feeling;
122+ }
123+ // next line!
124+ chout <= IO.newline(); chout.flush();
125+ // pause at end of line
126+ T_LINE_PAUSE => now;
127+}
128+
129+fun void endStanza()
130+{
131+ // stanza break; no new sound for now
132+ say("one"); wait();
133+ say("day"); wait();
134+ say("ends"); wait();
135+ say("as"); wait();
136+ say("another"); wait();
137+ say("day"); wait();
138+ say("dawns..."); wait();
139+}
140+
141+// say a word with space after
142+fun void say( string word )
143+{
144+ say( word, " " );
145+}
146+
147+// say a word
148+fun void say( string word, string append )
149+{
150+ // print it
151+ chout <= word <= append; chout.flush();
152+}
153+
154+// sonify
155+fun void play( int pitch )
156+{
157+ play( pitch, Math.random2f(.8,1) );
158+}
159+
160+// sonify
161+fun void play( int pitch, float velocity )
162+{
163+ // convert pitch to frequency and set it
164+ pitch => Std.mtof => crystal.freq;
165+ // note on
166+ velocity => crystal.noteOn;
167+}
168+
169+// wait
170+fun void wait()
171+{
172+ wait( T_WORD );
173+}
174+
175+// wait
176+fun void wait( dur T )
177+{
178+ // let time pass, let sound...sound
179+ T => now;
180+}
181+
182+// new line with timing
183+fun void endl()
184+{
185+ endl( T_WORD );
186+}
187+
188+// new line with timing
189+fun void endl( dur T )
190+{
191+ // new line
192+ chout <= IO.newline(); chout.flush();
193+ // let time pass
194+ T => now;
195+}
examples/ai/word2vec/poem-randomwalk.ck+122−0
@@ -0,0 +1,122 @@
1+//------------------------------------------------------------------------------
2+// name: poem-randomwalk.ck
3+// desc: another sus poem made with chAI and word2vec
4+// sorting: part of chAI (ChucK for AI)
5+//
6+// "Random Walk"
7+// -- another stream of unconsciousness poem generator
8+//
9+// NOTE: need a pre-trained word vector model, e.g., from
10+// https://chuck.stanford.edu/chai/data/glove/
11+// glove-wiki-gigaword-50-tsne-2.txt (400000 words x 2 dimensions)
12+//
13+// author: Ge Wang
14+// date: Spring 2023
15+//------------------------------------------------------------------------------
16+
17+// default starting word
18+"love" => string STARTING_WORD;
19+// check arguments, set new starting word if present
20+if( me.args() > 0 ) me.arg(0) => STARTING_WORD;
21+
22+// random seed (if set, sequence can be reproduce)
23+// Math.srandom( 515 );
24+
25+// instantiate
26+Word2Vec model;
27+// pre-trained model to load
28+me.dir() + "glove-wiki-gigaword-50-tsne-2.txt" => string filepath;
29+// load a pre-trained model (see URLs above for download)
30+// this could take a few seconds, depending on model size
31+if( !model.load( filepath ) )
32+{
33+ <<< "cannot load model:", filepath >>>;
34+ me.exit();
35+}
36+
37+// conditions
38+7 => int WORDS_PER_LINE;
39+4 => int LINES_PER_STANZA;
40+3 => int NUM_STANZAS;
41+
42+// number of nearest words to retrieve for each word
43+// higher this number the higher the variance per word
44+100 => int K_NEAREST;
45+
46+// timing
47+200::ms => dur T_WORD; // duration per word
48+false => int shouldScaleTimeToWordLength; // longer words take longer?
49+250::ms => dur T_LINE_PAUSE; // a little pause after each line
50+750::ms => dur T_STANZA_PAUSE; // pause after each stanza
51+
52+// ranges for each dimension (for sound mapping)
53+float mins[0], maxs[0];
54+// get bounds for each dimension
55+model.minMax( mins, maxs );
56+
57+// sound
58+ModalBar bar => NRev reverb => dac;
59+// reverb wet/dry mix
60+.1 => reverb.mix;
61+// which preset
62+7 => bar.preset;
63+
64+// current word
65+STARTING_WORD => string word;
66+// word vector
67+float vec[model.dim()];
68+// similarity search results from word2vec
69+string words[K_NEAREST];
70+// used for scaling up word timing to word length
71+dur addTime;
72+
73+// line break
74+chout <= IO.newline(); chout.flush();
75+
76+// loop over stanzas
77+for( int s; s < NUM_STANZAS; s++ )
78+{
79+ // loop over lines in a stanza
80+ for( int n; n < LINES_PER_STANZA; n++ )
81+ {
82+ // loop over words
83+ for( int w; w < WORDS_PER_LINE; w++ )
84+ {
85+ // print the word, with a space
86+ chout <= word <= " "; chout.flush();
87+ // get word vector (for sonification)
88+ model.getVector( word, vec );
89+ // sonify from word vector (see mapping possibilities of ModalBar)
90+ // https://chuck.stanford.edu/doc/program/ugen_full.html#ModalBar
91+ // feel free to experiement with what parameters to control with the vector
92+ Math.remap( vec[0], mins[0], maxs[0], 24, 84 ) => Std.mtof => bar.freq;
93+ // use pow to expand/compress the dimensions to affect mapping sensitivity
94+ Math.pow(Math.remap( vec[1], mins[1], maxs[1],0,1), 1.1) => bar.stickHardness;
95+ // ding!
96+ Math.random2f(.5,1) => bar.noteOn;
97+ // if scale time with word length
98+ if( shouldScaleTimeToWordLength )
99+ word.length() * T_WORD/20 => addTime;
100+ // let time pass, let sound...sound
101+ T_WORD + addTime => now;
102+ // get similar words
103+ model.getSimilar( word, words.size(), words );
104+ // choose one at random
105+ words[Math.random2(0,words.size()-1)] => word;
106+ }
107+ // next line!
108+ chout <= IO.newline(); chout.flush();
109+ // pause at end of line
110+ T_LINE_PAUSE => now;
111+ }
112+
113+ // stanza break!
114+ chout <= IO.newline(); chout.flush();
115+ // pause at end of line
116+ T_STANZA_PAUSE => now;
117+}
118+
119+// print at the end
120+chout <= "\"Random Walk\"" <= IO.newline();
121+chout <= "-- a stream of unconsciousness poem" <= IO.newline();
122+chout.flush();
examples/ai/word2vec/poem-spew.ck+109−0
@@ -0,0 +1,109 @@
1+//------------------------------------------------------------------------------
2+// name: poem-spew.ck
3+// desc: yet another sus poem made with chAI and word2vec
4+// sorting: part of ChAI (ChucK for AI) [BETA]
5+//
6+// "Spew"
7+// -- yet another stream of unconsciousness poem generator
8+//
9+// NOTE: need a pre-trained word vector model, e.g., from
10+// https://chuck.stanford.edu/chai/data/glove/
11+// glove-wiki-gigaword-50-tsne-2.txt (400000 words x 2 dimensions)
12+//
13+// author: Ge Wang
14+// date: Spring 2023
15+//------------------------------------------------------------------------------
16+
17+// default starting word
18+"love" => string STARTING_WORD;
19+// check arguments, set new starting word if present
20+if( me.args() > 0 ) me.arg(0) => STARTING_WORD;
21+
22+// random seed (if set, sequence can be reproduce)
23+// Math.srandom( 515 );
24+
25+// instantiate
26+Word2Vec model;
27+// pre-trained model to load
28+me.dir() + "glove-wiki-gigaword-50-tsne-2.txt" => string filepath;
29+// load a pre-trained model (see URLs above for download)
30+// this could take a few seconds, depending on model size
31+if( !model.load( filepath ) )
32+{
33+ <<< "cannot load model:", filepath >>>;
34+ me.exit();
35+}
36+
37+// conditions
38+2500 => int TOTAL_WORDS; // to spew
39+1000 => int K_NEAREST; // number of nearest words to retrieve for each word
40+
41+// timing
42+40::ms => dur T_WORD; // duration per word
43+40::ms => dur T_LINE_PAUSE; // a little pause after each line
44+
45+// ranges for each dimension (for sound mapping)
46+float mins[0], maxs[0];
47+// get bounds for each dimension
48+model.minMax( mins, maxs );
49+
50+// sound
51+ModalBar bar => NRev reverb => dac;
52+// reverb wet/dry mix
53+.1 => reverb.mix;
54+// which preset
55+7 => bar.preset;
56+
57+// current word
58+STARTING_WORD => string word;
59+// word vector
60+float vec[model.dim()];
61+// similarity search results from word2vec
62+string words[K_NEAREST];
63+// total number of words spewed
64+0 => int spew;
65+// words to go on current line
66+0 => int lineWords;
67+
68+// go
69+while( spew < TOTAL_WORDS )
70+{
71+ if( lineWords <= 0 )
72+ {
73+ // line break
74+ chout <= IO.newline(); chout.flush();
75+ // generate how many words in next line
76+ Math.random2( 5, 12 ) => lineWords;
77+ // a little pause after each line
78+ 25::ms => dur T_LINE_PAUSE;
79+ }
80+
81+ // print the word, with a space
82+ chout <= word <= " "; chout.flush();
83+ // get word vector
84+ model.getVector( word, vec );
85+ // sonify from word vector (see mapping possibilities of ModalBar)
86+ // https://chuck.stanford.edu/doc/program/ugen_full.html#ModalBar
87+ // feel free to experiement with what parameters to control with the vector
88+ Math.remap( vec[0], mins[0], maxs[0], 24, 96 ) => Std.mtof => bar.freq;
89+ // use pow to expand/compress the dimensions to affect mapping sensitivity
90+ Math.pow(Math.remap( vec[1], mins[1], maxs[1], 0, 1), .72) => bar.stickHardness;
91+ // ding!
92+ Math.random2f(.5,1) => bar.noteOn;
93+ // let time pass, let sound...sound
94+ T_WORD => now;
95+ // get similar words
96+ model.getSimilar( word, words.size(), words );
97+ // choose one of the farthest one
98+ words[Math.random2((words.size()-1*.8)$int,words.size()-1)] => word;
99+
100+ // count
101+ spew++;
102+ // count line
103+ lineWords--;
104+}
105+
106+// print at the end
107+chout <= "\"Spew\"" <= IO.newline();
108+chout <= "-- another stream of unconsciousness poem" <= IO.newline();
109+chout.flush();
examples/ai/word2vec/poem-ungenerate.ck+284−0
@@ -0,0 +1,284 @@
1+//------------------------------------------------------------------------------
2+// name: poem-ungenerate.ck
3+// desc: they just keep coming; more sus poem word2vec examples
4+// sorting: part of chAI (ChucK for AI)
5+//
6+// NOTE: because this example needs ConsoleInput, it needs to
7+// run command line chuck
8+// > chuck poem-ungenerate.ck
9+//
10+// "Degenerate"
11+// -- a stream of unconsciousness poem generator
12+//
13+// this example prompts for a line of text
14+// (e.g., roses are red) and a number of iterations,
15+// and outputs a series of lines that use word2vec to
16+// change one word to an adjacent word from the previous
17+// iteration, while generating unsettling descending
18+// shepard tones
19+//
20+// NOTE: need a pre-trained word vector model, e.g., from
21+// https://chuck.stanford.edu/chai/data/glove/
22+// glove-wiki-gigaword-50-tsne-2.txt (400000 words x 2 dimensions)
23+//
24+// author: Ge Wang
25+// date: Spring 2023
26+//------------------------------------------------------------------------------
27+
28+// random seed (if set, sequence can be reproduce)
29+// Math.srandom( 515 );
30+
31+// instantiate
32+Word2Vec model;
33+// pre-trained model to load
34+me.dir() + "glove-wiki-gigaword-50-tsne-2.txt" => string filepath;
35+// load pre-trained model (see URLs above for download)
36+if( !model.load( filepath ) )
37+{
38+ <<< "cannot load model:", filepath >>>;
39+ me.exit();
40+}
41+
42+// conditions
43+3 => int LINES_PER_STANZA;
44+3 => int NUM_SECTIONS; // here each section is a fixed stanzas format
45+
46+// number of nearest words to retrieve for each word
47+// higher this number the higher the variance per word
48+10 => int K_NEAREST;
49+
50+// timing
51+100::ms => dur T_WORD; // duration per word
52+false => int shouldScaleTimeToWordLength; // longer words take longer?
53+T_WORD => dur T_LINE_PAUSE; // a little pause after each line
54+T_WORD * 2 => dur T_STANZA_PAUSE; // pause after each stanza
55+
56+// make a ConsoleInput
57+ConsoleInput in;
58+// tokenizer
59+StringTokenizer tok;
60+// line
61+string line[0];
62+
63+// ------------ audio: shepard tone generator ---------
64+// starting pitches (in MIDI note numbers, octaves apart)
65+[ 12.0, 24, 36, 48, 60, 72, 84, 96, 108 ] @=> float pitches[];
66+// number of tones
67+pitches.size() => int N;
68+// bank of tones
69+TriOsc tones[N];
70+// overall gain
71+Gain gain => Envelope envelope => NRev reverb => dac;
72+1.0/N => gain.gain;
73+.05 => reverb.mix;
74+// connect to dac
75+for( int i; i < N; i++ ) { tones[i] => gain; }
76+// set envelope
77+envelope.duration(1::second);
78+
79+// increment per unit time (use negative for descending)
80+-.001 => float INC;
81+
82+// keep shepard tone generating in the background;
83+// we will raise and lower volume
84+spork ~ shepard();
85+// ------------ audio: shepard tone generator ---------
86+
87+// current word
88+string word;
89+// word vector
90+float vec[model.dim()];
91+// search results
92+string words[K_NEAREST];
93+
94+// state
95+0 => int GET_TEXT;
96+1 => int GET_NUM;
97+GET_TEXT => int state;
98+// prompt
99+string prompt;
100+// the line
101+string theText[0];
102+
103+// new line
104+endl();
105+// print program name
106+chout <= "\"Degenerate\"" <= IO.newline();
107+chout <= "-- a stream of unconsciousness poem generator" <= IO.newline();
108+chout.flush();
109+// new line
110+endl();
111+
112+// loop
113+while( true )
114+{
115+ if( state == GET_TEXT )
116+ {
117+ "enter a line (e.g., roses are red) =>" => prompt;
118+ }
119+ else
120+ {
121+ "how many degenerations (e.g., 20) =>" => prompt;
122+ }
123+ // prompt
124+ in.prompt( prompt ) => now;
125+
126+ // read
127+ while( in.more() )
128+ {
129+ // clear tokens array
130+ line.clear();
131+ // clear if in text input mode
132+ if( state == GET_TEXT ) theText.clear();
133+ // get the input line as one string; send to tokenizer
134+ tok.set( in.getLine() );
135+ // tokenize line into words separated by white space
136+ while( tok.more() )
137+ {
138+ // put into array (lowercased)
139+ line << tok.next().lower();
140+ // copy into our text for later
141+ if( state == GET_TEXT ) theText << line[line.size()-1];
142+ }
143+ // if non-empty
144+ if( !line.size() )
145+ continue;
146+
147+ // check state
148+ if( state == GET_TEXT )
149+ {
150+ // set state to GET_NUM
151+ GET_NUM => state;
152+ }
153+ else // GET_NUM
154+ {
155+ // check input
156+ Std.atoi( line[0] ) => int n;
157+ // make sure in range
158+ if( n <= 0 ) continue;
159+ // degenerate the input across n iterations
160+ degenerate( theText, n );
161+ // reset state to get text
162+ GET_TEXT => state;
163+ }
164+ }
165+}
166+
167+// do something with the text input
168+fun void degenerate( string input[], int iterations )
169+{
170+ // start envelope (bring up audio)
171+ envelope.keyOn();
172+
173+ // endline
174+ endl();
175+
176+ // each iteration updates one word from the previous
177+ for( int i; i < iterations; i++ )
178+ {
179+ for( int j; j < input.size(); j++ )
180+ {
181+ say(input[j]); wait();
182+ }
183+ endl();
184+
185+ // random word in the line
186+ Math.random2(0,input.size()-1) => int which;
187+ // take that work
188+ input[which] => word;
189+ // find similar words
190+ model.getSimilar( word, words.size(), words );
191+ // randomly take one and replace the word in question
192+ words[Math.random2(0,words.size()-1)] => input[which];
193+ }
194+
195+ // close envelope (ramp down audio)
196+ envelope.keyOff();
197+
198+ // endline
199+ endl();
200+ // pause
201+ T_STANZA_PAUSE => now;
202+}
203+
204+// say a word with space after
205+fun void say( string word )
206+{
207+ say( word, " " );
208+}
209+
210+// say a word
211+fun void say( string word, string append )
212+{
213+ // print it
214+ chout <= word <= append; chout.flush();
215+}
216+
217+// wait
218+fun void wait()
219+{
220+ wait( T_WORD );
221+}
222+
223+// wait
224+fun void wait( dur T )
225+{
226+ // let time pass, let sound...sound
227+ T => now;
228+}
229+
230+// new line with timing
231+fun void endl()
232+{
233+ endl( T_WORD );
234+}
235+
236+// new line with timing
237+fun void endl( dur T )
238+{
239+ // new line
240+ chout <= IO.newline(); chout.flush();
241+ // let time pass
242+ T => now;
243+}
244+
245+// shepard tone generator
246+fun void shepard()
247+{
248+//--------------------------------------------------------------------
249+// continuous shepard-risset tone generator
250+// adapted from https://chuck.stanford.edu/doc/examples/deep/shepard.ck
251+//--------------------------------------------------------------------
252+
253+ // mean for normal intensity curve
254+ 66 => float MU;
255+ // standard deviation for normal intensity curve
256+ 42 => float SIGMA;
257+ // normalize to 1.0 at x==MU
258+ 1 / Math.gauss(MU, MU, SIGMA) => float SCALE;
259+ // unit time (change interval)
260+ 1::ms => dur T;
261+
262+ // infinite time loop
263+ while( true )
264+ {
265+ for( int i; i < N; i++ )
266+ {
267+ // set frequency from pitch
268+ pitches[i] => Std.mtof => tones[i].freq;
269+ // compute loundess for each tone
270+ Math.gauss( pitches[i], MU, SIGMA ) * SCALE => float intensity;
271+ // map intensity to amplitude
272+ intensity*96 => Math.dbtorms => tones[i].gain;
273+ // increment pitch
274+ INC +=> pitches[i];
275+ // wrap (for positive INC)
276+ if( pitches[i] > 120 ) 108 -=> pitches[i];
277+ // wrap (for negative INC)
278+ else if( pitches[i] < 12 ) 108 +=> pitches[i];
279+ }
280+
281+ // advance time
282+ T => now;
283+ }
284+}
examples/ai/word2vec/word2vec-basic.ck+211−0
@@ -0,0 +1,211 @@
1+//------------------------------------------------------------------------------
2+// name: word2vec-basic.ck
3+// desc: word2vec basic usage
4+//
5+// NOTE: download pre-trained word vector model from:
6+// https://chuck.stanford.edu/chai/data/glove/
7+// | (can use any of these)
8+// glove-wiki-gigaword-50.txt (400000 words x 50 dimensions)
9+// glove-wiki-gigaword-50-pca-3.txt (400000 words x 3 dimensions)
10+// glove-wiki-gigaword-50-tsne-2.txt (400000 words x 2 dimensions)
11+// sorting: part of ChAI (ChucK for AI) [BETA]
12+//
13+// author: Yikai Li and Ge Wang
14+// date: Spring 2023
15+//------------------------------------------------------------------------------
16+
17+// instantiate
18+Word2Vec model;
19+
20+// pre-trained model to load
21+"glove-wiki-gigaword-50.txt" => string filepath;
22+
23+<<< "loading model:", filepath >>>;
24+<<< "(this could take a few seconds)...", "" >>>;
25+// NOTE: while loading can take a long time initially; this is internally cached;
26+// subsequent loads on the same filepath will use cached dictionary, as long as
27+// ChucK VM keeps running
28+// HINT: while caching should "just work" in miniAudicle, in command-line chuck
29+// one could keep one chuck running (using --loop) and chuk code to it from a
30+// second terminal (using chuck + code). for example:
31+//------------------------------------------------------------------------------
32+// terminal-1> chuck --loop ***** terminal-2> chuck + word2vec-basic
33+//------------------------------------------------------------------------------
34+// load a pre-trained model (see URLs above for download)
35+if( !model.load( me.dir() + filepath ) )
36+{
37+ <<< "cannot load model file...", "" >>>;
38+ me.exit();
39+}
40+
41+// print info
42+<<< "dictionary size:", model.size() >>>;
43+<<< "embedding dimensions:", model.dim() >>>;
44+<<< "using KDTree for search:", model.useKDTree() ? "YES" : "NO" >>>;
45+float mins[0], maxs[0];
46+// get bounds for each dimension
47+model.minMax( mins, maxs );
48+// print the min/max for each dimension
49+for( int i; i < model.dim(); i++ )
50+{ cherr <= "dimension " <= i <= ": [" <= mins[i]
51+ <= " <-range-> " <= maxs[i] <= "]" <= IO.newline(); }
52+
53+string words[10];
54+<<< "=========================================================", "" >>>;
55+
56+// get vector
57+<<< "vector associated with 'cat' is:", "" >>>;
58+float vector[model.dim()];
59+model.getVector("cat", vector);
60+for( int i; i < vector.size(); i++ ) { chout <= vector[i] <= " "; }
61+chout <= IO.newline();
62+
63+<<< "=========================================================", "" >>>;
64+
65+// get most similar by word
66+<<< words.size(), "words most similar to 'stanford' are:", "" >>>;
67+model.getSimilar("stanford", words.size(), words);
68+for( int i; i < words.size(); i++ )
69+{ <<< words[i], "" >>>; }
70+
71+<<< "=========================================================", "" >>>;
72+
73+// get similar words via vector
74+<<< words.size(), "words closest to the vector of 'cat' are:", "" >>>;
75+model.getSimilar( vector, words.size(), words );
76+for( int i; i < words.size(); i++ )
77+{ <<< words[i], "" >>>; }
78+
79+<<< "=========================================================", "" >>>;
80+
81+// eval an expression
82+<<< "similar words to expression 'rome - italy + china':", "" >>>;
83+W2V.eval( model, "rome - italy + china", 10 ) @=> words;
84+for( 0 => int i; i < words.size(); i++ )
85+{ <<< words[i], "" >>>; }
86+
87+<<< "=========================================================", "" >>>;
88+
89+"dog" => string A; "puppy" => string B; "cat" => string C;
90+// logical analogy
91+<<< A, "is to", B, "as", C, "is to..." >>>;
92+// e.g., dog:puppy::cat:[?] (this returns words for [?])
93+W2V.analogy( model, A, B, C, 10 ) @=> words;
94+for( 0 => int i; i < words.size(); i++ )
95+{ <<< words[i], "" >>>; }
96+
97+<<< "=========================================================", "" >>>;
98+
99+
100+
101+
102+//------------------------------------------------------------------------------
103+// word2vec helper
104+//------------------------------------------------------------------------------
105+class W2V
106+{
107+ fun static void copy( float to[], float from[] )
108+ {
109+ to.size(from.size());
110+ // add into element
111+ for( int i; i < to.size(); i++ ) from[i] => to[i];
112+ }
113+
114+ fun static float[] dup( float from[] )
115+ {
116+ float to[from.size()];
117+ // add into element
118+ for( int i; i < to.size(); i++ ) from[i] => to[i];
119+ // return
120+ return to;
121+ }
122+
123+ // result stored in x
124+ fun static void add( float x[], float y[] )
125+ {
126+ // smaller of the two
127+ x.size() < y.size() ? x.size() : y.size() => int size;
128+ // add into element
129+ for( int i; i < size; i++ ) y[i] +=> x[i];
130+ }
131+
132+ // result stored in x
133+ fun static void minus( float x[], float y[] )
134+ {
135+ // smaller of the two
136+ x.size() < y.size() ? x.size() : y.size() => int size;
137+ // add into element
138+ for( int i; i < size; i++ ) y[i] -=> x[i];
139+ }
140+
141+ fun static void scale( float x[], float scalar )
142+ {
143+ // scale
144+ for( int i; i < x.size(); i++ ) scalar *=> x[i];
145+ }
146+
147+ fun static void scale( float result[], float x[], float scalar )
148+ {
149+ // scale
150+ for( int i; i < x.size(); i++ ) scalar * x[i] => result[i];
151+ }
152+
153+ fun static string[] eval( Word2Vec @ w, string expr, int k )
154+ {
155+ // init
156+ int pos;
157+ 1.0 => float multiplier;
158+ string word;
159+ float wordVector[w.dim()];
160+ float exprVector[w.dim()];
161+
162+ // compute
163+ while( true )
164+ {
165+ expr.find(" ") => pos;
166+ if( pos == -1 )
167+ {
168+ w.getVector(expr, wordVector);
169+ for( 0 => int i; i < w.dim(); i++ )
170+ {
171+ wordVector[i] * multiplier +=> exprVector[i];
172+ }
173+ break;
174+ }
175+ else
176+ {
177+ expr.substring(0, pos) => word;
178+ w.getVector(word, wordVector);
179+ for( 0 => int i; i < w.dim(); i++ )
180+ {
181+ wordVector[i] * multiplier +=> exprVector[i];
182+ }
183+ expr.substring(pos + 1) => expr;
184+ if( expr.charAt(0) == '+' )
185+ {
186+ 1.0 => multiplier;
187+ expr.substring(2) => expr;
188+ }
189+ else
190+ {
191+ -1.0 => multiplier;
192+ expr.substring(2) => expr;
193+ }
194+ }
195+ }
196+
197+ // return
198+ string results[k];
199+ w.getSimilar( exprVector, k, results );
200+
201+ return results;
202+ }
203+
204+ // logical analogy: A to B is as C is to [what this function returns]
205+ fun static string[] analogy( Word2Vec @ w, string A, string B, string C, int k )
206+ {
207+ // the vector sum
208+ B + " - " + A + " + " + C => string v;
209+ return eval( w, v, k );
210+ }
211+}
examples/ai/word2vec/word2vec-prompt.ck+468−0
@@ -0,0 +1,468 @@
1+//------------------------------------------------------------------------------
2+// name: word2vec-prompt.ck
3+// desc: word2vec interative prompt explorer
4+//
5+// NOTE: this requires ConsoleInput which needs command line chuck
6+// NOTE: download pre-trained word vector model from:
7+// https://chuck.stanford.edu/chai/data/glove/
8+// | (can use any of these)
9+// glove-wiki-gigaword-50.txt (400000 words x 50 dimensions)
10+// glove-wiki-gigaword-50-pca-3.txt (400000 words x 3 dimensions)
11+// glove-wiki-gigaword-50-tsne-2.txt (400000 words x 2 dimensions)
12+// sorting: part of ChAI (ChucK for AI) [BETA]
13+//
14+// author: Yikai Li and Ge Wang
15+// date: Spring 2023
16+//------------------------------------------------------------------------------
17+
18+// make a ConsoleInput
19+ConsoleInput in;
20+// tokenizer
21+StringTokenizer tok;
22+// line
23+string line[0];
24+
25+// our default model
26+Word2Vec model;
27+
28+// loading any default here
29+"glove-wiki-gigaword-50-tsne-2.txt" => string filepath;
30+<<< "loading 2D model:", filepath, "..." >>>;
31+// load model
32+if( !model.load( me.dir() + filepath ) )
33+{
34+ <<< "cannot load model file...", "" >>>;
35+ me.exit();
36+}
37+// print info about model
38+print( model );
39+
40+ModalBar bar => NRev reverb => dac;
41+SndBuf doh => reverb => dac;
42+"special:dope" => doh.read;
43+0 => doh.gain;
44+
45+// print info about a loaded Word2Vec model
46+fun void print( Word2Vec model )
47+{
48+ // print info
49+ <<< "dictionary size:", model.size() >>>;
50+ <<< "embedding dimensions:", model.dim() >>>;
51+ <<< "using KDTree for search:", model.useKDTree() ? "YES" : "NO" >>>;
52+ // get bounds
53+ float mins[0], maxs[0];
54+ model.minMax( mins, maxs );
55+ for( int i; i < model.dim(); i++ )
56+ { cherr <= "dimension " <= i <= " range: [" <= mins[i] <= ", "
57+ <= maxs[i] <= "]" <= IO.newline(); }
58+}
59+
60+// loop
61+while( true )
62+{
63+ // prompt
64+ in.prompt( "word2vec2chuck =>" ) => now;
65+
66+ // read
67+ while( in.more() )
68+ {
69+ // get it
70+ tok.set( in.getLine() );
71+ // clear array
72+ line.clear();
73+ // print tokens
74+ while( tok.more() )
75+ {
76+ // put into array
77+ line << tok.next().lower();
78+ // print it
79+ // <<< line[line.size()-1], "" >>>;
80+ }
81+ // if non-empty
82+ if( line.size() )
83+ {
84+ // execute
85+ execute( line) => int result;
86+ }
87+ }
88+}
89+
90+
91+fun int execute( string line[] )
92+{
93+ // check
94+ line[0] => string command;
95+ // index
96+ 1 => int index;
97+
98+ // which command
99+ if( command == "quit" || command == "exit" )
100+ {
101+ // exit shred
102+ me.exit();
103+ }
104+ else if( command == "help" || command == "h" )
105+ {
106+ <<< " available word2vec2chuck commands:", "" >>>;
107+ <<< " load / l-- load a pre-trained model", "" >>>;
108+ <<< " eval / e -- evalute a word vector expression", "" >>>;
109+ <<< " analog / a-- query a logical analogy", "" >>>;
110+ <<< " vector / v -- display vector associated with a word", "" >>>;
111+ <<< " go / g -- from a word to another across a duration", "" >>>;
112+ <<< " similar / s -- from a vector (model size) return similar words", "" >>>;
113+ <<< " print / p -- print model info", "" >>>;
114+ <<< " help / h -- print this message", "" >>>;
115+ <<< " exit / quit -- exit from word2vec2chuck", "" >>>;
116+ <<< " load-50 -- load GloVe 50D model (glove-wiki-gigaword-50)", "" >>>;
117+ <<< " load-3 -- load PCA 3D model (glove-wiki-gigaword-50-pca-3)", "" >>>;
118+ <<< " load-2 -- load t-SNE 2D model (glove-wiki-gigaword-50-tsne-2)", "" >>>;
119+ }
120+ else if( command == "load" || command == "l" )
121+ {
122+ if( line.size() < 2 )
123+ {
124+ <<< "usage: load [model]", "" >>>;
125+ }
126+ else
127+ {
128+ <<< "loading model (this could take a few seconds)...", "" >>>;
129+ // load
130+ if( !model.load( me.dir() + filepath ) )
131+ {
132+ <<< "cannot load model file...", "" >>>;
133+ return 1;
134+ }
135+ // print info
136+ print( model );
137+ }
138+ }
139+ else if( command == "print" || command == "p" )
140+ {
141+ if( model.size() == 0 )
142+ {
143+ <<< " no model has been loaded yet.", "" >>>;
144+ }
145+ else
146+ {
147+ // print info
148+ print( model );
149+ }
150+ }
151+ else if( command == "load-50" || command == "load-3" || command == "load-2" )
152+ {
153+ string filepath;
154+ if( command == "load-50" ) "glove-wiki-gigaword-50.txt" => filepath;
155+ else if( command == "load-3" ) "glove-wiki-gigaword-50-pca-3.txt" => filepath;
156+ else "glove-wiki-gigaword-50-tsne-2.txt" => filepath;
157+
158+ <<< "loading model:", filepath >>>;
159+ <<< "(this could take a few seconds)...", "" >>>;
160+ // load
161+ if( !model.load( me.dir() + filepath ) )
162+ {
163+ <<< "cannot load model file...", "" >>>;
164+ return 1;
165+ }
166+ // print info
167+ print( model );
168+ }
169+ else if( command == "eval" || command == "e" )
170+ {
171+ if( line.size() < 2 )
172+ {
173+ <<< "usage: eval [word expression]", "" >>>;
174+ <<< " for example: eval rome - italy + china", "" >>>;
175+ <<< " (note: don't forget white spaces around + and -)", "" >>>;
176+ }
177+ else
178+ {
179+ // expression string
180+ line[1] => string expr;
181+ // concatenate
182+ for( 2 => int i; i < line.size(); i++ )
183+ { expr + " " + line[i] => expr; }
184+ // eval
185+ W2V.eval( model, expr, 10 ) @=> string words[];
186+ // print search results
187+ for (0 => int i; i < words.size(); i++)
188+ { <<< " ", words[i], "" >>>; }
189+ }
190+ }
191+ else if( command == "analog" || command == "a" )
192+ {
193+ if( line.size() < 4 )
194+ {
195+ <<< "usage: analog [wordA] [wordB] [wordC]", "" >>>;
196+ <<< " for example: analog cat kitten dog", "" >>>;
197+ }
198+ else
199+ {
200+ // expression string
201+ line[1] => string a;
202+ line[2] => string b;
203+ line[3] => string c;
204+ // eval
205+ W2V.analogy( model, a, b, c, 10 ) @=> string words[];
206+ // print
207+ <<< a, "is to", b, "as", c, "is to..." >>>;
208+ for (0 => int i; i < words.size(); i++)
209+ {
210+ // trivially reject a b c in the output
211+ if( words[i] == a || words[i] == b || words[i] == c ) continue;
212+ <<< " ", words[i], "" >>>;
213+ }
214+ }
215+ }
216+ else if( command == "vector" || command == "v" )
217+ {
218+ if( line.size() < 2 )
219+ {
220+ <<< "usage: vector [word]", "" >>>;
221+ }
222+ else
223+ {
224+ float vector[model.dim()];
225+ model.getVector( line[1], vector );
226+ // print
227+ cherr <= line[1] <= ": ";
228+ for( int i; i < vector.size(); i++ ) { cherr <= vector[i] <= " "; }
229+ cherr <= IO.newline();
230+ }
231+ }
232+ else if( command == "go" || command == "g" )
233+ {
234+ if( line.size() < 5 )
235+ {
236+ <<< "usage: go [word/start] [word/end] [second] [steps] [k results]", "" >>>;
237+ }
238+ else
239+ {
240+ <<< "going from", line[1], "to", line[2], "over", line[3], "seconds in", line[4], "steps" >>>;
241+ float coord1[model.dim()], coord2[model.dim()];
242+ model.getVector(line[1], coord1);
243+ model.getVector(line[2], coord2);
244+
245+ // print coordinate 1
246+ // cherr <= line[1] <= ": ";
247+ // for( int i; i < coord1.size(); i++ ) { cherr <= coord1[i] <= " "; }
248+ // cherr <= IO.newline();
249+
250+ // print coordinate 2
251+ // cherr <= line[2] <= ": ";
252+ // for( int i; i < coord2.size(); i++ ) { cherr <= coord2[i] <= " "; }
253+ // cherr <= IO.newline();
254+
255+ // walk
256+ 1 => int k;
257+ if( line.size() > 5 ) Std.atoi(line[5]) => k;
258+ go( line[1], line[2], Std.atof(line[3])::second, Std.atoi(line[4]), k );
259+ }
260+ }
261+ else if( command == "similar" || command == "s" )
262+ {
263+ if( line.size() != model.dim()+1)
264+ {
265+ <<< "usage: similar [float] [float] ... model dimension", "" >>>;
266+ }
267+ else
268+ {
269+ string results[10];
270+ model.getSimilar( [Std.atof(line[1]),Std.atof(line[2])], 10, results );
271+ for( int i; i < results.size(); i++ )<<< results[i]>>>;
272+ }
273+ }
274+ else
275+ {
276+ // not found
277+ <<< " command not found:", command >>>;
278+ }
279+
280+ return 0; // 0 is good
281+}
282+
283+
284+fun void sonifyDoh( float params[], float vstart[], float vend[] )
285+{
286+ if( params.size() < 2 )
287+ {
288+ <<< "not enough params!", "" >>>;
289+ return;
290+ }
291+
292+ // use param 1 for volume
293+ Math.remap(params[0], vstart[0], vend[0], .1, 1 ) => doh.gain;
294+ // use param 2 for rate
295+ Math.remap(params[1], vstart[1], vend[1], 1, 1.5 ) => doh.rate;
296+
297+ // trigger from beginning
298+ 0 => doh.pos;
299+}
300+
301+
302+// this goes from one word to another word
303+// > go fun disaster 5 30 1
304+// > go technology famine 4 20
305+fun void go( string start, string end, dur T, int steps, int k )
306+{
307+ float vstart[model.dim()], vend[model.dim()];
308+ model.getVector(start, vstart);
309+ model.getVector(end, vend);
310+
311+ // get bounds for mapping
312+ float mins[0], maxs[0];
313+ model.minMax( mins, maxs );
314+
315+ // duplicate
316+ W2V.dup( vend ) @=> float vdiff[];
317+ W2V.dup( vstart ) @=> float v[];
318+
319+ for( int i; i < vstart.size(); i++ ) { cherr <= vstart[i] <= " "; } cherr <= IO.newline();
320+ for( int i; i < vend.size(); i++ ) { cherr <= vend[i] <= " "; } cherr <= IO.newline();
321+
322+ W2V.minus( vdiff, vstart );
323+
324+ // increment
325+ 1.0 / steps => float inc;
326+ // time step
327+ T * inc => dur Tstep;
328+ // scale
329+ 0 => float factor;
330+
331+ string results[k];
332+ float coord[model.dim()];
333+
334+ // take the steps
335+ for( int i; i < steps+1; i++ )
336+ {
337+ // scale difference vector
338+ W2V.scale( v, vdiff, factor );
339+ inc +=> factor;
340+ // add
341+ W2V.add( v, vstart );
342+ // search
343+ model.getSimilar( v, k, results);
344+ results[Math.random2(0,k-1)] => string word;
345+ model.getVector( word, coord );
346+
347+ // print
348+ <<< i, "->", word >>>;
349+
350+ // sonify
351+ sonifyDoh( coord, vstart, vend);
352+ // for( int i; i < v.size(); i++ ) { cherr <= v[i] <= " "; }
353+ // cherr <= IO.newline();
354+
355+ // advance time
356+ Tstep => now;
357+ }
358+}
359+
360+
361+// word2vec helper
362+class W2V
363+{
364+ fun static void copy( float to[], float from[] )
365+ {
366+ to.size(from.size());
367+ // add into element
368+ for( int i; i < to.size(); i++ ) from[i] => to[i];
369+ }
370+
371+ fun static float[] dup( float from[] )
372+ {
373+ float to[from.size()];
374+ // add into element
375+ for( int i; i < to.size(); i++ ) from[i] => to[i];
376+ // return
377+ return to;
378+ }
379+
380+ // result stored in x
381+ fun static void add( float x[], float y[] )
382+ {
383+ // smaller of the two
384+ x.size() < y.size() ? x.size() : y.size() => int size;
385+ // add into element
386+ for( int i; i < size; i++ ) y[i] +=> x[i];
387+ }
388+
389+ // result stored in x
390+ fun static void minus( float x[], float y[] )
391+ {
392+ // smaller of the two
393+ x.size() < y.size() ? x.size() : y.size() => int size;
394+ // add into element
395+ for( int i; i < size; i++ ) y[i] -=> x[i];
396+ }
397+
398+ fun static void scale( float x[], float scalar )
399+ {
400+ // scale
401+ for( int i; i < x.size(); i++ ) scalar *=> x[i];
402+ }
403+
404+ fun static void scale( float result[], float x[], float scalar )
405+ {
406+ // scale
407+ for( int i; i < x.size(); i++ ) scalar * x[i] => result[i];
408+ }
409+
410+ fun static string[] eval( Word2Vec @ w, string expr, int k )
411+ {
412+ // init
413+ int pos;
414+ 1.0 => float multiplier;
415+ string word;
416+ float wordVector[w.dim()];
417+ float exprVector[w.dim()];
418+
419+ // compute
420+ while( true )
421+ {
422+ expr.find(" ") => pos;
423+ if( pos == -1 )
424+ {
425+ w.getVector(expr, wordVector);
426+ for( 0 => int i; i < w.dim(); i++ )
427+ {
428+ wordVector[i] * multiplier +=> exprVector[i];
429+ }
430+ break;
431+ }
432+ else
433+ {
434+ expr.substring(0, pos) => word;
435+ w.getVector(word, wordVector);
436+ for( 0 => int i; i < w.dim(); i++ )
437+ {
438+ wordVector[i] * multiplier +=> exprVector[i];
439+ }
440+ expr.substring(pos + 1) => expr;
441+ if( expr.charAt(0) == '+' )
442+ {
443+ 1.0 => multiplier;
444+ expr.substring(2) => expr;
445+ }
446+ else
447+ {
448+ -1.0 => multiplier;
449+ expr.substring(2) => expr;
450+ }
451+ }
452+ }
453+
454+ // return
455+ string results[k];
456+ w.getSimilar( exprVector, k, results );
457+
458+ return results;
459+ }
460+
461+ // logical analogy: A to B is as C is to [what this function returns]
462+ fun static string[] analogy( Word2Vec @ w, string A, string B, string C, int k )
463+ {
464+ // the vector sum
465+ B + " - " + A + " + " + C => string v;
466+ return eval( w, v, k );
467+ }
468+}
examples/analysis/features/centroid.ck+0−23
@@ -1,23 +0,0 @@
1−// our patch
2−SinOsc s => FFT fft =^ Centroid cent => blackhole;
3−
4−// set parameters
5−512 => fft.size;
6−// set hann window
7−Windowing.hann(512) => fft.window;
8−// set sine frequency
9−440 => s.freq;
10−// compute srate
11−second / samp => float srate;
12−
13−// control loop
14−while( true )
15−{
16− // upchuck: take fft then centroid
17− cent.upchuck();
18− // print out centroid
19− <<< cent.fval(0) * srate / 2 >>>;
20−
21− // advance time
22− fft.size()::samp => now;
23−}
examples/array/array_associative.ck+26−0
@@ -0,0 +1,26 @@
1+// declare regular array (capacity doesn't matter so much)
2+float foo[4];
3+
4+// use as int-based array
5+2.5 => foo[0];
6+
7+// use as associative array with key "yoyo"
8+4.0 => foo["yoyo"];
9+
10+// access as associative (print)
11+<<< foo["yoyo"] >>>;
12+
13+// access empty element
14+<<< foo["gaga"] >>>; // -> should print 0.0
15+
16+// add a second associative element
17+44.0 => foo["yiyi"];
18+
19+// get the array keys with all of the keys in the array
20+string keys[0];
21+foo.getKeys(keys);
22+
23+<<< keys[0], keys[1] >>>;
24+
25+// call .help() on an array to get more information about its type, methods, etc.
26+// foo.help();
examples/array/array_negative.ck+11−0
@@ -0,0 +1,11 @@
1+// arrays can have negative indices!
2+// version: need chuck-1.4.2.1 or higher
3+
4+// an array
5+[1,2,3,4] @=> int a[];
6+
7+// same as a(s.size(()-1)
8+<<< a[-1] >>>; // 4
9+
10+// same as a(s.size(()-3)
11+<<< a[-3] >>>; // 2
examples/array/array_zero.ck+14−0
@@ -0,0 +1,14 @@
1+// .zero() zeros out the contents AND keeps size unchanged
2+// version: need chuck-1.4.2.1 or higher
3+
4+// an array
5+[1,3,4] @=> int array[];
6+
7+// should print 3 3
8+<<< array[1], array.size() >>>;
9+
10+// zero out the array, leaving size as is
11+array.zero();
12+
13+// now should print 0 3
14+<<< array[1], array.size() >>>;
examples/basic/rec-auto-stereo.ck+1−1
@@ -1,5 +1,5 @@
11 // chuck this with other shreds to record to file
2−// example> chuck foo.ck bar.ck rec (see also rec2.ck)
2+// example> chuck foo.ck bar.ck rec-auto-stereo.ck
33
44 // pull samples from the dac
55 // WvOut2 -> stereo operation
examples/basic/rec-auto.ck+2−1
@@ -1,5 +1,6 @@
11 // chuck this with other shreds to record to file
2−// example> chuck foo.ck bar.ck rec (see also rec2.ck)
2+// example> chuck foo.ck bar.ck rec-auto.ck
3+// (see also rec-auto-stereo.ck)
34
45 // pull samples from the dac
56 dac => Gain g => WvOut w => blackhole;
examples/basic/rec.ck+2−1
@@ -1,5 +1,6 @@
11 // chuck this with other shreds to record to file
2−// example> chuck foo.ck bar.ck rec (see also rec2.ck)
2+// example> chuck foo.ck bar.ck rec.ck
3+// (see also rec-auto-stereo.ck)
34
45 // arguments: rec:<filename>
56
examples/deep/ks-chord.ck+149−0
@@ -0,0 +1,149 @@
1+//-----------------------------------------------------------------------------
2+// name: ks-chord.ck
3+// desc: karplus strong comb filter bank
4+//
5+// authors: Madeline Huberth (mhuberth@ccrma.stanford.edu)
6+// Ge Wang (ge@ccrma.stanford.edu)
7+// date: summer 2014
8+// Stanford Center @ Peking University
9+//-----------------------------------------------------------------------------
10+
11+// single voice Karplus Strong chubgraph
12+class KS extends Chubgraph
13+{
14+ // sample rate
15+ second / samp => float SRATE;
16+
17+ // ugens!
18+ DelayA delay;
19+ OneZero lowpass;
20+
21+ // noise, only for internal use
22+ Noise n => delay;
23+ // silence so it doesn't play
24+ 0 => n.gain;
25+
26+ // the feedback
27+ inlet => delay => lowpass => delay => outlet;
28+ // max delay
29+ 1::second => delay.max;
30+ // set lowpass
31+ -1 => lowpass.zero;
32+ // set feedback attenuation
33+ .9 => lowpass.gain;
34+
35+ // mostly for testing
36+ fun void play( float pitch, dur T )
37+ {
38+ tune( pitch ) => float length;
39+ // turn on noise
40+ 1 => n.gain;
41+ // fill delay with length samples
42+ length::samp => now;
43+ // silence
44+ 0 => n.gain;
45+ // let it play
46+ T-length::samp => now;
47+ }
48+
49+ // tune the fundamental resonance
50+ fun float tune( float pitch )
51+ {
52+ // computes further pitch tuning for higher pitches
53+ pitch - 43 => float diff;
54+ 0 => float adjust;
55+ if( diff > 0 ) diff * .0125 => adjust;
56+ // compute length
57+ computeDelay( Std.mtof(pitch+adjust) ) => float length;
58+ // set the delay
59+ length::samp => delay.delay;
60+ //return
61+ return length;
62+ }
63+
64+ // set feedback attenuation
65+ fun float feedback( float att )
66+ {
67+ // sanity check
68+ if( att >= 1 || att < 0 )
69+ {
70+ <<< "set feedback value between 0 and 1 (non-inclusive)" >>>;
71+ return lowpass.gain();
72+ }
73+
74+ // set it
75+ att => lowpass.gain;
76+ // return
77+ return att;
78+ }
79+
80+ // compute delay from frequency
81+ fun float computeDelay( float freq )
82+ {
83+ // compute delay length from srate and desired freq
84+ return SRATE / freq;
85+ }
86+}
87+
88+// chord class for KS
89+class KSChord extends Chubgraph
90+{
91+ // array of KS objects
92+ KS chordArray[4];
93+
94+ // connect to inlet and outlet of chubgraph
95+ for( int i; i < chordArray.size(); i++ ) {
96+ inlet => chordArray[i] => outlet;
97+ }
98+
99+ // set feedback
100+ fun float feedback( float att )
101+ {
102+ // sanith check
103+ if( att >= 1 || att < 0 )
104+ {
105+ <<< "set feedback value between 0 and 1 (non-inclusive)" >>>;
106+ return att;
107+ }
108+
109+ // set feedback on each element
110+ for( int i; i < chordArray.size(); i++ )
111+ {
112+ att => chordArray[i].feedback;
113+ }
114+
115+ return att;
116+ }
117+
118+ // tune 4 objects
119+ fun float tune( float pitch1, float pitch2, float pitch3, float pitch4 )
120+ {
121+ pitch1 => chordArray[0].tune;
122+ pitch2 => chordArray[1].tune;
123+ pitch3 => chordArray[2].tune;
124+ pitch4 => chordArray[3].tune;
125+ }
126+}
127+
128+
129+// sound to chord to dac
130+SndBuf buffy => KSChord object => dac;
131+// load a sound
132+"special:dope" => buffy.read;
133+// set feedback
134+object.feedback( .96 );
135+
136+// offset
137+-12 => int x;
138+// tune
139+object.tune( 60+x, 64+x, 72+x, 79+x );
140+// loop
141+while( true )
142+{
143+ // set playhead to beginning
144+ 0 => buffy.pos;
145+ // set rate
146+ 1 => buffy.rate;
147+ // advance time
148+ 550::ms / buffy.rate() => now;
149+}
examples/deep/say-chu.ck+1−1
@@ -45,7 +45,7 @@ fun void doCh() { · 44 unmodified lines
4545 }
4646
4747 fun void doKay() {
48− <<< "KKK" >>>;
48+ <<< "kK" >>>;
4949 0.0 => i.gain;
5050 0.05 :: second => now;
5151 0.005=>ne.time;
examples/event/event-extend.ck+4−1
@@ -1,4 +1,7 @@
1−// creating custom event objects
1+//---------------------------------------------------------------------
2+// name: event-extend.ck
3+// desc: defining and using a custom Event
4+//---------------------------------------------------------------------
25
36 // new event class
47 class TheEvent extends Event
examples/event/event-x-bpm-1.ck+144−0
@@ -0,0 +1,144 @@
1+//---------------------------------------------------------------------
2+// name: event-x-bpm-1.ck
3+// desc: shows how to
4+// 1) define a custom type of Event (called MyEvent here)
5+// to hold our custom data; create a MyEvent called PULSE
6+// 2) make a metronome to broadcast PULSE, which will wake
7+// up all shreds waiting on PULSE; this metronome will also
8+// update the 'measure' and 'tick' numbers in PULSE to
9+// indicate where we are in the measure
10+// 3) define two shreds--one() and two()--whose timing is
11+// driven by the metronome to a "drum beat"
12+//---------------------------------------------------------------------
13+
14+// sometimes it's helpful to define a custom kind of Event
15+// so we can associate our own data with it
16+class MyEvent extends Event
17+{
18+ // measure number
19+ int measure;
20+ // smallest beat subdivision within a measure (e.g., 16th notes)
21+ // we will assume the event will be broadcast every tick
22+ int tick;
23+}
24+
25+// make a shared event that any shred can wait on
26+MyEvent PULSE;
27+// global bpm variable
28+100 => global float BPM;
29+// how many ticks per measure?
30+16 => float ticksPerMeasure;
31+
32+// spork timekeeper
33+spork ~ metronome();
34+// different functions
35+spork ~ one() @=> Shred @ shOne;
36+spork ~ two() @=> Shred @ shTwo;
37+// a function to change the BPM
38+spork ~ tempoController();
39+
40+// keep things running
41+while( true )
42+{
43+ 1::second => now;
44+}
45+
46+// a thing to change BPM when desired
47+fun void tempoController()
48+{
49+ // a loop to control the BPM
50+ while( true )
51+ {
52+ // every two measures, change the BPM for fun
53+ if( PULSE.tick == 0 && (PULSE.measure%2 == 0) )
54+ {
55+ // randomize BPM lol
56+ Math.random2f( 60, 120 ) => BPM;
57+ // print BPM
58+ <<< "new BPM:", BPM >>>;
59+ }
60+
61+ // wait on the pulse
62+ PULSE => now;
63+ }
64+}
65+
66+// metronome (our "conductor")
67+fun void metronome()
68+{
69+ while( true )
70+ {
71+ // compute every time in case BPM changes
72+ 1/BPM * minute => dur BEAT;
73+ // assume 4/4, compute durationm of a tick
74+ BEAT*4/ticksPerMeasure => dur TICK;
75+
76+ // broadcast to all shreds waiting on PULSE
77+ PULSE.broadcast();
78+
79+ // increment tick count
80+ PULSE.tick++;
81+ // print
82+ cherr <= "."; cherr.flush();
83+ // if we reached the end of a measure
84+ if( PULSE.tick >= ticksPerMeasure )
85+ {
86+ // increment measure number
87+ PULSE.measure++;
88+ // reset tick count to 0
89+ 0 => PULSE.tick;
90+ // next line
91+ cherr <= IO.newline();
92+ }
93+
94+ // advance time by a tick duration
95+ TICK => now;
96+ }
97+}
98+
99+// define function
100+fun void one()
101+{
102+ SndBuf buffy => dac;
103+ "special:dope" => buffy.read;
104+ 0 => buffy.gain;
105+
106+ while( true )
107+ {
108+ // wait on the shared event
109+ PULSE => now;
110+ // play depending on tick number
111+ if( PULSE.tick == 0 || PULSE.tick == 8 )
112+ {
113+ // LOW DOH
114+ 0 => buffy.pos;
115+ .5 => buffy.rate;
116+ .5 => buffy.gain;
117+ }
118+ else if( PULSE.tick == 4 || PULSE.tick == 12 )
119+ {
120+ 0 => buffy.pos;
121+ 1 => buffy.rate;
122+ .5 => buffy.gain;
123+ }
124+ }
125+}
126+
127+// define function
128+fun void two()
129+{
130+ SndBuf buffy => dac;
131+ "special:dope" => buffy.read;
132+ 0 => buffy.gain;
133+
134+ while( true )
135+ {
136+ // wait on the shared event
137+ PULSE => now;
138+ // in this case play every tick
139+ 0 => buffy.pos;
140+ // HIGH PITCHED DOH
141+ 2 => buffy.rate;
142+ .1 => buffy.gain;
143+ }
144+}
examples/event/event-x-bpm-2.ck+139−0
@@ -0,0 +1,139 @@
1+//---------------------------------------------------------------------
2+// name: event-x-bpm-2.ck
3+// desc: this is the same as event-x-bpm-1.ck, but one() uses array
4+// lookup (instead of if/else) to figure out what to play on tick
5+//---------------------------------------------------------------------
6+
7+// sometimes it's helpful to define a custom kind of Event
8+// so we can associate our own data with it
9+class MyEvent extends Event
10+{
11+ // measure number
12+ int measure;
13+ // smallest beat subdivision within a measure (e.g., 16th notes)
14+ // we will assume the event will be broadcast every tick
15+ int tick;
16+}
17+
18+// make a shared event that any shred can wait on
19+MyEvent PULSE;
20+// bpm variable
21+100 => float BPM;
22+// how many ticks per measure?
23+16 => float ticksPerMeasure;
24+
25+// play volume / probablity per tick (can think of this as a sequence)
26+[1.0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0] @=> float playProbs[];
27+// play rate per tick
28+[.5, 0, 0, 0, 1, 0, 0, 0, .5, 0, 0, 0, 1, 0, 0, 0] @=> float playRates[];
29+// NOTE: the sizes of these arrays should equal ticksPerMeasure
30+
31+// spork timekeeper
32+spork ~ metronome();
33+// different functions
34+spork ~ one() @=> Shred @ shOne;
35+spork ~ two() @=> Shred @ shTwo;
36+// a function to change the BPM
37+spork ~ tempoController();
38+
39+// keep things running
40+while( true )
41+{
42+ 1::second => now;
43+}
44+
45+// a thing to change BPM when desired
46+fun void tempoController()
47+{
48+ // a loop to control the BPM
49+ while( true )
50+ {
51+ // every two measures, change the BPM for fun
52+ if( PULSE.tick == 0 && (PULSE.measure%2 == 0) )
53+ {
54+ // randomize BPM lol
55+ Math.random2f( 60, 120 ) => BPM;
56+ // print BPM
57+ <<< "new BPM:", BPM >>>;
58+ }
59+
60+ // wait on the pulse
61+ PULSE => now;
62+ }
63+}
64+
65+// metronome (our "conductor")
66+fun void metronome()
67+{
68+ while( true )
69+ {
70+ // compute every time in case BPM changes
71+ 1/BPM * minute => dur BEAT;
72+ // assume 4/4, compute durationm of a tick
73+ BEAT*4/ticksPerMeasure => dur TICK;
74+
75+ // broadcast to all shreds waiting on PULSE
76+ PULSE.broadcast();
77+
78+ // increment tick count
79+ PULSE.tick++;
80+ // print
81+ cherr <= "."; cherr.flush();
82+ // if we reached the end of a measure
83+ if( PULSE.tick >= ticksPerMeasure )
84+ {
85+ // increment measure number
86+ PULSE.measure++;
87+ // reset tick count to 0
88+ 0 => PULSE.tick;
89+ // next line
90+ cherr <= IO.newline();
91+ }
92+
93+ // advance time by a tick duration
94+ TICK => now;
95+ }
96+}
97+
98+// define function
99+fun void one()
100+{
101+ SndBuf buffy => dac;
102+ "special:dope" => buffy.read;
103+ 0 => buffy.gain;
104+
105+ while( true )
106+ {
107+ // wait on the shared event
108+ PULSE => now;
109+ // look up
110+ if( playProbs[PULSE.tick] > 0 ) // instead of 0, it could be a threshold controlled by a knob
111+ {
112+ // play
113+ 0 => buffy.pos;
114+ // use the prob value also as volume
115+ playProbs[PULSE.tick] => buffy.gain;
116+ // look up the play rate
117+ playRates[PULSE.tick] => buffy.rate;
118+ }
119+ }
120+}
121+
122+// define function
123+fun void two()
124+{
125+ SndBuf buffy => dac;
126+ "special:dope" => buffy.read;
127+ 0 => buffy.gain;
128+
129+ while( true )
130+ {
131+ // wait on the shared event
132+ PULSE => now;
133+ // in this case play every tick
134+ 0 => buffy.pos;
135+ // HIGH PITCHED DOH
136+ 2 => buffy.rate;
137+ .1 => buffy.gain;
138+ }
139+}
examples/hid/kbhit/kb.ckrenamed from examples/event/kb.ck+0−0

File renamed without changes.

examples/hid/kbhit/kb2.ckrenamed from examples/event/kb2.ck+0−0

File renamed without changes.

examples/io/chout.ck+3−0
@@ -6,3 +6,6 @@ chout <= 1 <= " foo " <= 5.5 <= IO.newline(); · 5 unmodified lines
66
77 // output to console on stderr
88 cherr <= 1 <= " bar " <= 5.5 <= IO.newline();
9+
10+// 'chout' is buffered; use chout.flush() to output immediately
11+// 'cherr' prints immediately, flush() or no flush()
examples/io/jabberwocky.txt+37−0
@@ -0,0 +1,37 @@
1+'Twas brillig, and the slithy toves
2+Did gyre and gimble in the wabe:
3+All mimsy were the borogoves,
4+And the mome raths outgrabe.
5+
6+"Beware the Jabberwock, my son!
7+The jaws that bite, the claws that catch!
8+Beware the Jubjub bird, and shun
9+The frumious Bandersnatch!"
10+
11+He took his vorpal sword in hand;
12+Long time the manxome foe he sought—
13+So rested he by the Tumtum tree
14+And stood awhile in thought.
15+
16+And, as in uffish thought he stood,
17+The Jabberwock, with eyes of flame,
18+Came whiffling through the tulgey wood,
19+And burbled as it came!
20+
21+One, two! One, two! And through and through
22+The vorpal blade went snicker-snack!
23+He left it dead, and with its head
24+He went galumphing back.
25+
26+"And hast thou slain the Jabberwock?
27+Come to my arms, my beamish boy!
28+O frabjous day! Callooh! Callay!"
29+He chortled in his joy.
30+
31+'Twas brillig, and the slithy toves
32+Did gyre and gimble in the wabe:
33+All mimsy were the borogoves,
34+And the mome raths outgrabe.
35+
36+"Jabberwocky"
37+-- by Lewis Carroll
examples/io/read-byte.ck+36−0
@@ -0,0 +1,36 @@
1+//---------------------------------------------------------------------
2+// name: read-byte.ck
3+// desc: example of reading raw bytes from file
4+// NOTE: file must be opened in BINARY mode for this to work
5+//---------------------------------------------------------------------
6+
7+// default filepath
8+me.dir() + "read-byte.txt" => string filename;
9+// look at command line
10+if( me.args() > 0 ) me.arg(0) => filename;
11+
12+// instantiate
13+FileIO fio;
14+// open a file (in BINARY mode)
15+fio.open( filename, FileIO.READ | FileIO.BINARY );
16+// ensure it's ok
17+if( !fio.good() )
18+{
19+ cherr <= "can't open file: " <= filename <= " for reading..."
20+ <= IO.newline();
21+ me.exit();
22+}
23+
24+// variable to read into
25+int val;
26+
27+// loop until end
28+while( fio.more() )
29+{
30+ // read the next byte
31+ // (other options include IO.INT16 and IO.INT32)
32+ fio.readInt( IO.INT8 ) => val;
33+
34+ // print the value
35+ cherr <= val <= IO.newline();
36+}
examples/io/read-byte.txt+2−0
@@ -0,0 +1,2 @@
1+abcde
2+12345
examples/io/read-float.ck+33−0
@@ -0,0 +1,33 @@
1+//---------------------------------------------------------------------
2+// name: read-float.ck
3+// desc: basic example of reading floats using FileIO
4+//---------------------------------------------------------------------
5+
6+// default file
7+me.dir() + "read-float.txt" => string filename;
8+
9+// look at command line
10+if( me.args() > 0 ) me.arg(0) => filename;
11+
12+// instantiate
13+FileIO fio;
14+
15+// open a file
16+fio.open( filename, FileIO.READ );
17+
18+// ensure it's ok
19+if( !fio.good() )
20+{
21+ cherr <= "can't open file: " <= filename <= " for reading..."
22+ <= IO.newline();
23+ me.exit();
24+}
25+
26+// variable to read into
27+float val;
28+
29+// loop until end
30+while( fio => val )
31+{
32+ cherr <= val <= IO.newline();
33+}
examples/io/read-float.txt+4−0
@@ -0,0 +1,4 @@
1+.1 2.2 3.
2+8e-3 9e5 -2.2
3+-4e-4
4+
examples/io/read-int.ck+6−1
@@ -1,5 +1,10 @@
1+//---------------------------------------------------------------------
2+// name: read-int.ck
3+// desc: basic example of reading int using FileIO
4+//---------------------------------------------------------------------
5+
16 // default file
2−me.sourceDir() + "/int.txt" => string filename;
7+me.dir() + "read-int.txt" => string filename;
38
49 // look at command line
510 if( me.args() > 0 ) me.arg(0) => filename;
examples/io/read-int.txtrenamed from examples/io/int.txt+0−1
@@ -1,4 +1,3 @@
11 1 2 3
22 8 9 -2
33 -4
4−
examples/io/read-line.ck+6−1
@@ -1,5 +1,10 @@
1+//---------------------------------------------------------------------
2+// name: read-line.ck
3+// desc: basic example of reading a line of text using FileIO
4+//---------------------------------------------------------------------
5+
16 // default file
2−me.sourceDir() + "line.txt" => string filename;
7+me.dir() + "read-line.txt" => string filename;
38
49 // look at command line
510 if( me.args() > 0 ) me.arg(0) => filename;
examples/io/read-line.txtrenamed from examples/io/line.txt+0−0

File renamed without changes.

examples/io/read-str.ck+1−1
@@ -1,5 +1,5 @@
11 // default file
2−me.sourceDir() + "/str.txt" => string filename;
2+me.dir() + "read-str.txt" => string filename;
33
44 // look at command line
55 if( me.args() > 0 ) me.arg(0) => filename;
examples/io/read-str.txtrenamed from examples/io/str.txt+0−0

File renamed without changes.

examples/io/read-tokens.ck+66−0
@@ -0,0 +1,66 @@
1+//---------------------------------------------------------------------
2+// name: read-tokens.ck
3+// desc: this example shows how to:
4+// 1) open a text file for reading
5+// 2) read the file line by line
6+// 3) for each line, tokenize it into words (separated by spaces)
7+//
8+// author: Ge Wang (https://ccrma.stanford.edu/~ge/)
9+// date: Winter 2023
10+//---------------------------------------------------------------------
11+
12+// path and name of file to read
13+me.dir() + "jabberwocky.txt" => string filename;
14+// or get filename from command line arguments, if any
15+if( me.args() > 0 ) me.arg(0) => filename;
16+
17+// delay between words (for effect)
18+50::ms => dur WORD_T;
19+// delay between lines
20+800::ms => dur LINE_T;
21+
22+// instantiate a file IO object
23+FileIO fio;
24+// a string tokenizer
25+StringTokenizer tokenizer;
26+// a line of text
27+string line;
28+// a word token
29+string word;
30+
31+// open the file
32+fio.open( filename, FileIO.READ );
33+
34+// ensure it's ok
35+if( !fio.good() )
36+{
37+ cherr <= "can't open file: " <= filename <= " for reading..."
38+ <= IO.newline();
39+ me.exit();
40+}
41+
42+// new line
43+cherr <= IO.newline();
44+
45+// loop until end
46+while( fio.more() )
47+{
48+ // read current line
49+ fio.readLine() => line;
50+ // for each line, tokenize
51+ tokenizer.set( line );
52+ // loop over tokens
53+ while( tokenizer.more() )
54+ {
55+ // get the next word
56+ tokenizer.next() => word;
57+ // print word followed by a space
58+ cherr <= word <= " ";
59+ // delay for effect
60+ WORD_T => now;
61+ }
62+ // done with current line
63+ cherr <= IO.newline();
64+ // delay for effect
65+ LINE_T => now;
66+}
examples/io/seek.ck+40−0
@@ -0,0 +1,40 @@
1+// default file
2+me.sourceDir() + "jabberwocky.txt" => string filename;
3+
4+// look at command line
5+if( me.args() > 0 ) me.arg(0) => filename;
6+
7+// instantiate
8+FileIO fio;
9+
10+// open a file
11+fio.open( filename, FileIO.READ );
12+
13+// ensure it's ok
14+if( !fio.good() )
15+{
16+ cherr <= "can't open file: " <= filename <= " for reading..." <= IO.nl();
17+ me.exit();
18+}
19+
20+// variable to read into
21+string str;
22+
23+// loop until end
24+while( fio.more() )
25+{
26+ chout <= fio.readLine() <= IO.newline();
27+}
28+
29+<<< "\n------------", "" >>>;
30+<<< "rewinding...", "" >>>;
31+<<< "------------\n", "" >>>;
32+fio.seek( 0 );
33+
34+// loop until end
35+while( fio.more() )
36+{
37+ chout <= fio.readLine() <= IO.newline();
38+}
39+
40+
examples/io/write-byte.ck+35−0
@@ -0,0 +1,35 @@
1+//---------------------------------------------------------------------
2+// name: write-byte.ck
3+// desc: example of writing bytes in BINARY mode
4+//---------------------------------------------------------------------
5+// filename
6+"write-byte.txt" => string filename;
7+// instantiate a file IO object
8+FileIO fout;
9+// open for write (in BINARY mode)
10+fout.open( filename, FileIO.WRITE | FileIO.BINARY );
11+
12+// test
13+if( !fout.good() )
14+{
15+ cherr <= "can't open file for writing..." <= IO.newline();
16+ me.exit();
17+}
18+
19+// byte sequence to write; equivalent to:
20+// abc\n123\n
21+[97, 98, 99, 10, 49, 50, 51, 10] @=> int bytes[];
22+
23+// loop
24+for( int i; i < bytes.size(); i++ )
25+{
26+ // write the next byte
27+ // (other options include IO.INT16 and IO.INT32)
28+ fout.write( bytes[i], IO.INT8 );
29+}
30+
31+// close the thing
32+fout.close();
33+
34+// print
35+<<< "file written:", filename >>>;
examples/io/write.ck+8−3
@@ -1,7 +1,9 @@
1+// filename
2+"write.txt" => string filename;
3+// instantiate a file IO object
14 FileIO fout;
2−
3−// open for write
4−fout.open( "out.txt", FileIO.WRITE );
5+// open for write (default mode: ASCII)
6+fout.open( filename, FileIO.WRITE );
57
68 // test
79 if( !fout.good() )
@@ -15,3 +17,6 @@ fout <= 1 <= " " <= 2 <= " " <= "foo" <= IO.newline(); · 7 unmodified lines
1517
1618 // close the thing
1719 fout.close();
20+
21+// print
22+<<< "file written:", filename >>>;
examples/io/write2.ck+8−3
@@ -1,7 +1,9 @@
1+// filename
2+"write2.txt" => string filename;
3+// instantiate a file IO object
14 FileIO fout;
2−
3−// open for write
4−fout.open( "out2.txt", FileIO.WRITE );
5+// open for write (default mode: ASCII)
6+fout.open( filename, FileIO.WRITE );
57
68 // test
79 if( !fout.good() )
@@ -17,3 +19,6 @@ fout.write( "boo" ); · 9 unmodified lines
1719
1820 // close the thing
1921 fout.close();
22+
23+// print
24+<<< "file written:", filename >>>;
examples/machine/crash.ck+4−0
@@ -0,0 +1,4 @@
1+// ummm this expicitly and deliberately crashes ChucK; use with caution
2+Machine.crash();
3+
4+// if ChucK didn't crash, then something is *really* wrong
examples/machine/eval.ck+22−0
@@ -0,0 +1,22 @@
1+// name: eval.ck
2+// desc: use Machine.eval to run-time compile and run string as code
3+// this enables chuck to generate more code to run!
4+// powerful! perilous!
5+//
6+// version: need chuck-1.4.2.1 or higher
7+//
8+// uncomment this to print out info about Machine:
9+// Machine.help();
10+//
11+// date: Spring 2023
12+
13+// our code to run
14+"cherr <= 1+1 <= IO.newline();" => string codeStr;
15+
16+// compile the string as code and spork it as a new shred
17+if( !Machine.eval( codeStr ) ) <<< "error evaluating code!", "" >>>;
18+
19+// NOTE: since Machine.eval() sporks the code as a child shred, we
20+// need to give it a chance to run; (a parent shred upon ending will
21+// also end all of its child shreds)
22+1::samp => now;
examples/machine/intsize.ck+2−0
@@ -0,0 +1,2 @@
1+// get the size (in bits) of a chuck int
2+cherr <= "size of chuck int: " <= Machine.intsize() <= "-bit" <= IO.newline();
examples/machine/is-realtime.ck+6−0
@@ -0,0 +1,6 @@
1+<<< "are we running in realtime audio mode?",
2+ Machine.realtime() ? "YES" : "NO " >>>;
3+
4+<<< "are we running in silent mode (e.g., --silent)?",
5+ Machine.silent() ? "YES" : "NO " >>>;
6+
examples/machine/machine-shred.ck+24−0
@@ -0,0 +1,24 @@
1+// on-the-fly shred management
2+
3+// this is kind of like using the OTF commands
4+// add / remove / replace etc.
5+// except this is done from code and also can be timed.
6+// (this is also a hack for including other files)
7+
8+// infinite time loop
9+while( true )
10+{
11+ // the path is relative to where 'chuck' is invoked
12+ Machine.add( "../basic/moe.ck" ) => int moe;
13+
14+ // the operation is sample synchronous
15+ 500::ms => now;
16+
17+ // replace
18+ Machine.replace( moe, "../basic/wind.ck" ) => int wind;
19+
20+ 500::ms => now;
21+
22+ // remove
23+ Machine.remove( wind );
24+}
examples/math/map.ck+28−0
@@ -0,0 +1,28 @@
1+// name: map.ck
2+// desc: mapping a number in one range to a second range, using
3+// Math.map( float value, float x1, float x2,
4+// float y1, float y2 )
5+//
6+// version: need chuck-1.4.2.1 or higher
7+//
8+// NOTE: Math.map(...) allows 'value' to be outside range [x1,x2]
9+// whereas Math.map2(...) clamps 'value' to range [x1,x2]
10+//
11+// uncomment this line to print Math library API
12+// Math.help();
13+//
14+// author: Ge Wang
15+// date: Spring 2023
16+
17+// map 2.5 from [2,4] to [0,1]
18+<<< Math.map( 2.5, 2, 4, 0, 1 ), "" >>>;
19+// map 5 from [1,10] to [-1,1]
20+<<< Math.map( 5, 1, 10, -1, 1 ), "" >>>;
21+// map 5 from [10,1] to [-1,1]
22+<<< Math.map( 5, 10, 1, -1, 1 ), "" >>>;
23+// map 1 from [2,3] to [0,100]
24+<<< Math.map( 1, 2, 3, 0, 100 ), "(not clamped)" >>>;
25+// clampf() and map()
26+<<< Math.map2( Math.clampf(1,2,3), 2, 3, 0, 100 ), "(clamped using Math.clampf())" >>>;
27+// same as Math.map2()
28+<<< Math.map2( 1, 2, 3, 0, 100 ), "(clamped using Math.map2())" >>>;
examples/math/math-help.ck+6−0
@@ -0,0 +1,6 @@
1+// name: help-math.ck
2+// desc: there are many functions in the Math class library
3+// run this file to print the current Math API
4+
5+// print
6+Math.help();
examples/osc/multi-msg/r-multi-msg.ck+1−2
@@ -29,7 +29,7 @@ fun void onNotes() · 28 unmodified lines
2929 // use port 6449 (or whatever)
3030 6449 => oin.port;
3131 // create an address in the receiver, expect an int and a float
32− oin.addAddress( "/foo/notes, i f" );
32+ oin.addAddress( "/foo/notes, if" );
3333
3434 // infinite event loop
3535 while( true )
@@ -87,4 +87,3 @@ fun void onHarmonics() · 51 unmodified lines
8787 }
8888 }
8989 }
90−
examples/osc/multicast/r.ck+23−13
@@ -1,7 +1,7 @@
11 //----------------------------------------------------------------------------
2−// name: r.ck
2+// name: r.ck ('r' is for "receiver")
33 // desc: OpenSoundControl (OSC) receiver example
4−// note: launch with s.ck (that's the sender)
4+// note: launch with s.ck (or another sender)
55 //----------------------------------------------------------------------------
66
77 // the patch
@@ -16,7 +16,7 @@ OscMsg msg; · 8 unmodified lines
1616 // use port 6449 (or whatever)
1717 6449 => oin.port;
1818 // create an address in the receiver, expect an int and a float
19−oin.addAddress( "/foo/notes, i f" );
19+oin.addAddress( "/foo/notes" );
2020
2121 // infinite event loop
2222 while( true )
@@ -26,17 +26,27 @@ while( true ) · 3 unmodified lines
2626
2727 // grab the next message from the queue.
2828 while( oin.recv(msg) )
29− {
30− // expected datatypes (note: as indicated by "i f")
31− int i;
32− float f;
29+ {
30+ // print stuff
31+ cherr <= "received OSC message: \"" <= msg.address <= "\" "
32+ <= "typetag: \"" <= msg.typetag <= "\" "
33+ <= "arguments: " <= msg.numArgs() <= IO.newline();
3334
34− // fetch the first data element as int
35− msg.getInt(0) => i => Std.mtof => s.freq;
36− // fetch the second data element as float
37− msg.getFloat(1) => f => s.gain;
35+ // check typetag for specific types
36+ if( msg.typetag == "if" )
37+ {
38+ // expected datatypes: int float
39+ // (note: as indicated by "if")
40+ int i;
41+ float f;
3842
39− // print
40− <<< "got (via OSC):", i, f >>>;
43+ // fetch the first data element as int
44+ msg.getInt(0) => i => Std.mtof => s.freq;
45+ // fetch the second data element as float
46+ msg.getFloat(1) => f => s.gain;
47+
48+ // print
49+ cherr <= i <= " " <= f <= IO.newline();
50+ }
4151 }
4252 }
examples/osc/one2many/r.ck+22−12
@@ -1,7 +1,7 @@
11 //----------------------------------------------------------------------------
22 // name: r.ck ('r' is for "receiver")
33 // desc: OpenSoundControl (OSC) receiver example
4−// note: launch with s.ck (that's the sender)
4+// note: launch with s.ck (or another sender)
55 //----------------------------------------------------------------------------
66
77 // the patch
@@ -16,7 +16,7 @@ OscMsg msg; · 8 unmodified lines
1616 // use port 6449 (or whatever)
1717 6449 => oin.port;
1818 // create an address in the receiver, expect an int and a float
19−oin.addAddress( "/foo/notes, i f" );
19+oin.addAddress( "/foo/notes" );
2020
2121 // infinite event loop
2222 while( true )
@@ -26,17 +26,27 @@ while( true ) · 3 unmodified lines
2626
2727 // grab the next message from the queue.
2828 while( oin.recv(msg) )
29− {
30− // expected datatypes (note: as indicated by "i f")
31− int i;
32− float f;
29+ {
30+ // print stuff
31+ cherr <= "received OSC message: \"" <= msg.address <= "\" "
32+ <= "typetag: \"" <= msg.typetag <= "\" "
33+ <= "arguments: " <= msg.numArgs() <= IO.newline();
3334
34− // fetch the first data element as int
35− msg.getInt(0) => i => Std.mtof => s.freq;
36− // fetch the second data element as float
37− msg.getFloat(1) => f => s.gain;
35+ // check typetag for specific types
36+ if( msg.typetag == "if" )
37+ {
38+ // expected datatypes: int float
39+ // (note: as indicated by "if")
40+ int i;
41+ float f;
3842
39− // print
40− <<< "got (via OSC):", i, f >>>;
43+ // fetch the first data element as int
44+ msg.getInt(0) => i => Std.mtof => s.freq;
45+ // fetch the second data element as float
46+ msg.getFloat(1) => f => s.gain;
47+
48+ // print
49+ cherr <= i <= " " <= f <= IO.newline();
50+ }
4151 }
4252 }
examples/osc/one2many/s-sender.ck+10−4
@@ -12,12 +12,18 @@ · 11 unmodified lines
1212
1313 // array of destination hostnames
1414 string hostnames[0];
15+
16+//----------------------------------------------------------------------------
1517 // appending names of destinations
16−hostnames << "localhost"; // localhost == this machine
18+//----------------------------------------------------------------------------
19+
20+// localhost == this machine
21+hostnames << "localhost";
22+
1723 // external hosts (add as many as needed)
18−hostnames << "albacore.local";
19−hostnames << "banhmi.local";
20−hostnames << "chowder.local";
24+// hostnames << "albacore.local";
25+// hostnames << "192.168.0.10";
26+// hostnames << "host.domain.edu";
2127 // ...
2228
2329 // sender object
examples/osc/osc-dump.ck+20−11
@@ -1,12 +1,21 @@
1−// osc_dump.ck
2−// listen to all OSC messages on specified port
1+//----------------------------------------------------------------------------
2+// name: osc-dump.ck
3+// desc: listen to and print all OSC messages on specified port
4+// for example, launch this with s.ck
5+// (make sure port is the same in both sender and receiver)
6+//----------------------------------------------------------------------------
37
48 // OSC in
59 OscIn oin;
10+
611 // see if port is supplied on command line
712 if( me.args() ) me.arg(0) => Std.atoi => oin.port;
813 // default port
9−else 9999 => oin.port;
14+else 6449 => oin.port;
15+
16+// print
17+cherr <= "listening for OSC messages over port: " <= oin.port()
18+ <= "..." <= IO.newline();
1019 // listen to everything coming
1120 oin.listenAll();
1221
@@ -14,7 +23,7 @@ oin.listenAll(); · 1 unmodified line
1423 OscMsg msg;
1524
1625 // infinite time loop
17−while(true)
26+while( true )
1827 {
1928 // wait for OSC input
2029 oin => now;
@@ -22,20 +31,20 @@ while(true) · 1 unmodified line
2231 // drain the message queue
2332 while( oin.recv(msg) )
2433 {
25− // print address
26− chout <= msg.address <= " ";
27− // loop over number of arguments
34+ // print address and typetag
35+ cherr <= msg.address <= " " <= msg.typetag <= " ";
36+ // loop over number of arguments by type
2837 for(int n; n < msg.numArgs(); n++)
2938 {
3039 // print by type
3140 if(msg.typetag.charAt(n) == 'i')
32− chout <= msg.getInt(n) <= " ";
41+ cherr <= msg.getInt(n) <= " ";
3342 else if(msg.typetag.charAt(n) == 'f')
34− chout <= msg.getFloat(n) <= " ";
43+ cherr <= msg.getFloat(n) <= " ";
3544 else if(msg.typetag.charAt(n) == 's')
36− chout <= msg.getString(n) <= " ";
45+ cherr <= msg.getString(n) <= " ";
3746 }
3847 // print newline
39− chout <= IO.nl();
48+ cherr <= IO.nl();
4049 }
4150 }
examples/osc/r.ck+22−12
@@ -1,7 +1,7 @@
11 //----------------------------------------------------------------------------
22 // name: r.ck ('r' is for "receiver")
33 // desc: OpenSoundControl (OSC) receiver example
4−// note: launch with s.ck (that's the sender)
4+// note: launch with s.ck (or another sender)
55 //----------------------------------------------------------------------------
66
77 // the patch
@@ -16,7 +16,7 @@ OscMsg msg; · 8 unmodified lines
1616 // use port 6449 (or whatever)
1717 6449 => oin.port;
1818 // create an address in the receiver, expect an int and a float
19−oin.addAddress( "/foo/notes, i f" );
19+oin.addAddress( "/foo/notes" );
2020
2121 // infinite event loop
2222 while( true )
@@ -26,17 +26,27 @@ while( true ) · 3 unmodified lines
2626
2727 // grab the next message from the queue.
2828 while( oin.recv(msg) )
29− {
30− // expected datatypes (note: as indicated by "i f")
31− int i;
32− float f;
29+ {
30+ // print stuff
31+ cherr <= "received OSC message: \"" <= msg.address <= "\" "
32+ <= "typetag: \"" <= msg.typetag <= "\" "
33+ <= "arguments: " <= msg.numArgs() <= IO.newline();
3334
34− // fetch the first data element as int
35− msg.getInt(0) => i => Std.mtof => s.freq;
36− // fetch the second data element as float
37− msg.getFloat(1) => f => s.gain;
35+ // check typetag for specific types
36+ if( msg.typetag == "if" )
37+ {
38+ // expected datatypes: int float
39+ // (note: as indicated by "if")
40+ int i;
41+ float f;
3842
39− // print
40− <<< "got (via OSC):", i, f >>>;
43+ // fetch the first data element as int
44+ msg.getInt(0) => i => Std.mtof => s.freq;
45+ // fetch the second data element as float
46+ msg.getFloat(1) => f => s.gain;
47+
48+ // print
49+ cherr <= i <= " " <= f <= IO.newline();
50+ }
4151 }
4252 }
examples/shred/machine.ck+0−1
@@ -22,4 +22,3 @@ while( true ) · 21 unmodified lines
2222 // remove
2323 Machine.remove( wind );
2424 }
25−
examples/special/LiSa-munger3.ck+1−1
@@ -97,7 +97,7 @@ fun void getgrain(int which, dur grainlen, dur rampup, dur rampdown, float rate) · 96 unmodified lines
9797 // get an available voice
9898 lisa[which].getVoice() => int newvoice;
9999
100− // make sure we got a valid voice
100+ // make sure we got a valid voice
101101 if( newvoice > -1 )
102102 {
103103 // set play rate
examples/type/polymorph.ck+71−0
@@ -0,0 +1,71 @@
1+//---------------------------------------------------------------------
2+// name: polymorph.ck
3+// desc: example showing polymorphism using a base class and two
4+// subclasses that each implement their own play() function;
5+// a generic array of base class references is initialized
6+// with the more specific subclass instances; this allows
7+// for .play() to be called during the loop, the behavior of
8+// which can take on different forms depending on the specific
9+// type of underlying subclass.
10+//
11+// philosophically, polymorphism in programming amounts to
12+// a structured way to "break" the established contract between
13+// a type system and the programmer, allowing objects of
14+// apparently the same type to exhibit different behaviors.
15+//
16+// author: Ge Wang (https://ccrma.stanford.edu/~ge/)
17+// date: Winter 2023
18+//---------------------------------------------------------------------
19+// generic base class
20+class Motif
21+{
22+ // default method to be potentially overridden in subclasses
23+ fun void play()
24+ {
25+ <<< "base class Motif.play()", "" >>>;
26+ }
27+}
28+
29+// subclass that inherits from Motif
30+// can think of MoA as a more specific kind of Motif
31+class MoA extends Motif
32+{
33+ // define play behavior for MoA by overriding play()
34+ fun void play()
35+ {
36+ <<< "do Motif A", "" >>>;
37+ }
38+}
39+
40+// subclass that inherits from Motif
41+// can think of MoB as a more specific kind of Motif
42+class MoB extends Motif
43+{
44+ // define play behavior for MoB by overriding play()
45+ fun void play()
46+ {
47+ <<< "do Motif B", "" >>>;
48+ }
49+}
50+
51+// instantiate array of base class Motif references
52+// each element is a specific kind of Motif
53+[new MoA, new MoB, new MoB, new MoA] @=> Motif @ motifs[];
54+
55+// array index variable
56+0 => int which;
57+
58+// loop
59+while( true )
60+{
61+ // will automatically call the right play() depending on
62+ // the underlying type (MoA vs. MoB) as instantiated above
63+ spork ~ motifs[which].play();
64+
65+ // advance time
66+ 300::ms => now;
67+
68+ // cycle which / print divider every cycel
69+ which++; if( which >= motifs.size() )
70+ { 0 => which; cherr <= "--" <= IO.newline(); }
71+}
examples/type/type_object.ck+4−4
@@ -1,7 +1,7 @@
1−// in contrast to primitive types, we have
2−// objects ( more later ). These will display
3−// a reference address when printed.
1+// in contrast to primitive types, we have Objects
2+// <<< >>> will display a reference address when printed
43
4+// instantiate a base Object
55 Object obj;
6−
6+// print
77 <<<obj>>>;
examples/type/type_primitives.ck+4−2
@@ -1,5 +1,4 @@
11 // quick survey of chuck primitives
2−
32 // <<<>>> will print the type and value of any variable;
43
54 // integers
@@ -18,7 +17,7 @@ · 12 unmodified lines
1817 <<<f>>>;
1918
2019 // durations are a measure of time
21−// the value we print will be in audio samples.
20+// the value we print will be in audio samples
2221
2322 9.0::second => dur d;
2423 <<<d>>>;
@@ -30,3 +29,6 @@ now => time t; · 5 unmodified lines
3029 <<<"waiting 10 seconds...">>>;
3130 10::second => now;
3231 <<<now>>>;
32+
33+// there is more: see type_analysis.ck for more primitives
34+// including complex and polar
examples/type/type_query.ck+75−0
@@ -0,0 +1,75 @@
1+//---------------------------------------------------------------------
2+// name: type-query.ck
3+// desc: this example shows working with the Type type in ChucK
4+// to query Types currently in the ChucK type system
5+//
6+// version: needs 1.4.2.1 or higher
7+//
8+// author: Ge Wang (https://ccrma.stanford.edu/~ge/)
9+// date: Winter 2023
10+//---------------------------------------------------------------------
11+
12+// instantiate an array of Type refs
13+Type @ types[0];
14+
15+// get types currently in ChucK type system
16+Type.getTypes(
17+ types, // to be filled with results
18+ false, // include objects
19+ true, // include primitive types
20+ false, // include special types (@array and @function)
21+ true, // include builtin types
22+ false, // include types from chugins
23+ false, // include types from ck files in lib path
24+ false // include user-defined classes
25+);
26+
27+// print results of query
28+for( int i; i < types.size(); i++ )
29+{
30+ cherr <= "(builtin primitive types): " <= types[i].name() <= IO.newline();
31+}
32+
33+// get types currently in ChucK type system
34+Type.getTypes(
35+ types, // to be filled with results
36+ true, // include objects
37+ false, // include primitive types
38+ false, // include special types (@array and @function)
39+ true, // include builtin types
40+ false, // include types from chugins
41+ false, // include types from ck files in lib path
42+ false // include user-defined classes
43+);
44+
45+// print results of query
46+for( int i; i < types.size(); i++ )
47+{
48+ cherr <= "(builtin object types): " <= types[i].name() <= IO.newline();
49+}
50+
51+// get types currently in ChucK type system
52+Type.getTypes(
53+ types, // to be filled with results
54+ true, // include objects
55+ false, // include primitive types
56+ false, // include special types (@array and @function)
57+ false, // include builtin types
58+ true, // include types from chugins
59+ false, // include types from ck files in lib path
60+ false // include user-defined classes
61+);
62+
63+// print results of query
64+for( int i; i < types.size(); i++ )
65+{
66+ cherr <= "(chugin types): " <= types[i].name() <= IO.newline();
67+}
68+
69+// get all subclasses of UGen
70+UGen.typeOf().children( types );
71+// print results
72+for( int i; i < types.size(); i++ )
73+{
74+ cherr <= "(UGens): " <= types[i].name() <= IO.newline();
75+}
examples/type/type_type.ck+116−0
@@ -0,0 +1,116 @@
1+//---------------------------------------------------------------------
2+// name: type-type.ck
3+// desc: this example shows working with the Type type in ChucK;
4+// a Type instance represents a specific type currently in
5+// in the ChucK VM
6+//
7+// version: needs 1.4.2.1 or higher
8+//
9+// author: Ge Wang (https://ccrma.stanford.edu/~ge/)
10+// date: Winter 2023
11+//---------------------------------------------------------------------
12+
13+// print some info about a Type
14+fun void about( Type t )
15+{
16+ // divider
17+ cherr <= "--------------------------------------------------" <= IO.newline();
18+ // check
19+ if( t == null )
20+ {
21+ cherr <= "null Type passed to about()!" <= IO.newline();
22+ return;
23+ }
24+
25+ //-----------------------------------------------------------------
26+ // name
27+ //-----------------------------------------------------------------
28+ cherr <= "type name: " <= t.name();
29+ repeat( t.arrayDepth() ) cherr <= "[]";
30+ cherr <= IO.newline();
31+
32+ //-----------------------------------------------------------------
33+ // parents
34+ //-----------------------------------------------------------------
35+ cherr <= "inherits: ";
36+ // get parent
37+ t.parent() @=> Type @ p;
38+ // nothing
39+ if( p == null ) cherr <= "(nothing)" <= IO.newline();
40+ else
41+ {
42+ while( p != null )
43+ {
44+ // name of parent
45+ cherr <= p.name();
46+ // get parent's parent
47+ p.parent() @=> p;
48+ // null?
49+ cherr <= ((p != null) ? " -> " : IO.newline());
50+ }
51+ }
52+
53+ //-----------------------------------------------------------------
54+ // is a kind of?
55+ //-----------------------------------------------------------------
56+ cherr <= "isa...Object:" <= t.isa("Object") <= " "
57+ <= "UGen:" <= t.isa("UGen") <= " "
58+ <= "UAna:" <= t.isa("UAna") <= IO.newline();
59+
60+ //-----------------------------------------------------------------
61+ // more attributes
62+ //-----------------------------------------------------------------
63+ cherr <= "primitive: " <= (t.isPrimitive() ? "YES" : "NO" ) <= IO.newline();
64+ cherr <= "array: " <= (t.isArray() ? "YES" : "NO" )
65+ <= " depth: " <= t.arrayDepth() <= IO.newline();
66+}
67+
68+// make an array
69+int array[2][2];
70+about( array.typeOf() );
71+about( Type.of( array ) );
72+
73+// a patch
74+SinOsc foo;
75+
76+// get the type of classes
77+SinOsc.typeOf() @=> Type @ tSinOsc;
78+// print info
79+about( tSinOsc );
80+// get the type of an instance
81+foo.typeOf() @=> Type @ tfoo;
82+// print info (should be the same as above)
83+about( tfoo );
84+
85+// get type of any value or variable
86+about( Type.of( 1 ) );
87+about( Type.of( 2.0 ) );
88+about( Type.of( now ) );
89+about( Type.of( 3::second ) );
90+about( Type.of( #(1,2) ) );
91+about( Type.of( %(1,pi/2) ) );
92+about( Type.of( @(1,2,3) ) );
93+about( Type.of( @(1,2,3,4) ) );
94+about( Type.of( dac ) );
95+
96+// get type by name
97+about( Type.find("MFCC") );
98+
99+// get the type of the Type type; should be itself
100+Type.typeOf() @=> Type @ tType;
101+
102+// get all subclasses of StkInstrument
103+StkInstrument.typeOf().children( types );
104+// print results
105+for( int i; i < types.size(); i++ )
106+{
107+ cherr <= "StkInstrument: " <= types[i].name() <= IO.newline();
108+}
109+
110+// get all subclasses of UAna
111+UAna.typeOf().children( types );
112+// print results
113+for( int i; i < types.size(); i++ )
114+{
115+ cherr <= "UAna: " <= types[i].name() <= IO.newline();
116+}
notes/VERSIONS+639−6
@@ -1,23 +1,656 @@
1−1.4.1.1 (April 2022)
1+1.5.0.0 (March 2023; was originally 1.4.2.1)
2+---
3+***************************************************************************
4+* chuck-1.5.0.0 (chai)
5+***************************************************************************
6+* significant addition: ChAI (Chuck + AI)
7+* significant update: WebChucK (chuck on browsers)
8+* also: new features, new bug fixes, and new bugs!
9+***************************************************************************
10+---
11+(NOTE) WebChucK (ChucK on browsers) [beta] was released during the
12+development of this version. https://chuck.stanford.edu/webchuck/
13+---
14+(NOTE) ChAI (ChucK + AI), first appeared in beta as part of chuck-1.4.2.0;
15+ChAI was used in the course Music 356 / CS 470 "Music and AI" [*] at
16+Stanford University, taught by Ge Wang and Yikai Li (TA); Many thanks to
17+the immensely creative students of "Music and AI". The v1.0 version of the
18+ChAI API and modules is hereby released, with new additions on the way.
19+
20+[*] "Music and AI" (Winter 2023 Stanford University)
21+https://ccrma.stanford.edu/courses/356-winter-2023/
22+---
23+(HISTORICAL NOTE for ChAI)
24+Much of ChAI and its ways of thinking and doing can be foundationally
25+attributed to the work of Dr. Rebecca Fiebrink, her landmark Ph.D. Thesis,
26+/Real-time Human Interaction With Supervised Learning Algorithms for Music
27+Composition and Performance/ (2011) [1], the Wekinator framework [2], her
28+teaching at the intersections of AI, HCI, and Music [3], as well as earlier
29+collaborations between Rebecca and Ge [4,5] including SMIRK [6] (Small Musical
30+Information Retrieval toolKit; 2008; early efforts in on-the-fly learning),
31+the unit analyzer framework [7] (2007; afford real-time audio feature
32+extraction). All of these have directly or indirectly contributed the
33+creation of ChAI. Additionally, ChAI benefitted from the teaching
34+and design philosophy of Perry R. Cook (Ph.D. advisor to Rebecca and Ge
35+at Princeton, and ChucK co-author), who argued for real-time human interaction,
36+parametric sound synthesis, and playfulness in the design of musical tools.
37+
38+[1] Fiebrink, Rebecca. 2011. /Real-time Human Interaction With Supervised
39+Learning Algorithms for Music Composition and Performance/ Ph.D. Thesis.
40+Princeton University. https://www.cs.princeton.edu/techreports/2010/891.pdf
41+[2] http://www.wekinator.org/
42+Wekinator | Software for real-time, interactive machine learning
43+[3] Fiebrink, Rebecca. "Machine Learning for Musicians and Artists" MOOC
44+https://www.kadenze.com/courses/machine-learning-for-musicians-and-artists/info
45+[4] Fiebrink, R., G. Wang, P. R. Cook. 2008. "Foundations for On-the-fly
46+Learning in the ChucK Programming Language." /International Computer Music
47+Conference/. https://mcd.stanford.edu/publish/files/2008-icmc-learning.pdf
48+[5] Fiebrink, R., G. Wang, P. R. Cook. 2008. "Support for Music Information
49+Retrieval in the ChucK Programming Language." /International Conference
50+on Music Information Retrieval/ (ISMIR).
51+https://mcd.stanford.edu/publish/files/2008-ismir-proto.pdf
52+[6] http://smirk.cs.princeton.edu/
53+sMIRk | Small Music Information Retrieval toolKit
54+[7] Wang, G., R. Fiebrink, P. R. Cook. 2007. "Combining Analysis and
55+Synthesis in the ChucK Programming Language." /International Computer
56+Music Conference/. https://mcd.stanford.edu/publish/files/2007-icmc-uana.pdf
57+---
58+- (added) Wekinator [ChAI] (thanks Rebecca Fiebrink and Yikai Li)
59+ |- A Wekinator utility that maps input vectors to output vectors,
60+ commonly used for interactive machine learning combining
61+ human-computer interaction and ML. Based on Rebecca Fiebrink's
62+ Wekinator framework.
63+ |- (inheritance) Wekinator -> Object
64+ -------------------
65+ void add();
66+ Add current inputs and outputs to the observations.
67+ void add( float[] inputs, float[] outputs );
68+ Add given inputs and outputs to the observations.
69+ void add( int output_index, float[] inputs, float[] outputs );
70+ Add given inputs and outputs to the observations for the specified output.
71+ void clear();
72+ Clear everything except the global properties.
73+ void clearAllObs();
74+ Clear all observations.
75+ void clearAllObs( int output_index );
76+ Clear all observations for the specified output.
77+ void clearObs( int lo, int hi );
78+ Clear the observations by id range.
79+ void clearObs( int output_index, int lo, int hi );
80+ Clear the observations by id range for the specified output.
81+ void deleteLastRound();
82+ Delete the last round of observations.
83+ void exportObs( string filename );
84+ Export the observations to a file.
85+ void exportObs( int output_index, string filename );
86+ Export the observations for the specified output to a file.
87+ int getAllRecordStatus();
88+ Get the record status for all outputs.
89+ int getAllRunStatus();
90+ Get the run status for all outputs.
91+ void getObs( float[][] obs );
92+ Get the observations in the Wekinator.
93+ void getObs( int output_index, float[][] obs );
94+ Get the observations for the specified output in the Wekinator.
95+ void getOutputProperty( int output_index, string property_name, int[] property_value );
96+ Get the output property of the Wekinator. See the Wekinator documentation for more information.
97+ float getOutputPropertyFloat( int output_index, int property_type, string property_name );
98+ Get the output property of the Wekinator. See the Wekinator documentation for more information.
99+ int getOutputPropertyInt( int output_index, string property_name );
100+ Get the output property of the Wekinator. See the Wekinator documentation for more information.
101+ int getOutputPropertyInt( int output_index, int property_type, string property_name );
102+ Get the output property of the Wekinator. See the Wekinator documentation for more information.
103+ int getOutputRecordStatus( int output_index );
104+ Get the record status for the specified output.
105+ int getOutputRunStatus( int output_index );
106+ Get the run status for the specified output.
107+ float getPropertyFloat( int property_type, string property_name );
108+ Get the property of the Wekinator. See the Wekinator documentation for more information.
109+ int getPropertyInt( int property_type, string property_name );
110+ Get the property of the Wekinator. See the Wekinator documentation for more information.
111+ int getRound();
112+ Get the current recording round.
113+ void importObs( string filename );
114+ Import the observations from a file.
115+ void input( float[] inputs );
116+ Set the inputs of the Wekinator.
117+ int inputDims( int n );
118+ Set the number of input dimensions to Wekinator.
119+ int inputDims();
120+ Get the number of input dimensions to Wekinator.
121+ void load( string filename );
122+ Load the Wekinator from a file.
123+ int modelType( int model_type );
124+ Set the model type of the Wekinator. Options: AI.Regression: AI.MLP, AI.LR, AI.Classification: AI.KNN, AI.SVM, AI.DT
125+ int modelType();
126+ Get the model type id of the Wekinator.
127+ string modelTypeName();
128+ Get the model type name of the Wekinator.
129+ void nextRound();
130+ Bump the recording round.
131+ int numObs();
132+ Get the number of observations in the Wekinator.
133+ int numObs( int output_index );
134+ Get the number of observations for the specified output in the Wekinator.
135+ void output( float[] outputs );
136+ Set the outputs of the Wekinator.
137+ int outputDims( int n );
138+ Set the number of output dimensions to Wekinator.
139+ int outputDims();
140+ Get the number of output dimensions to Wekinator.
141+ void predict( float[] inputs, float[] outputs );
142+ Predict outputs for the given inputs.
143+ void randomizeOutputs();
144+ Randomize the outputs of the Wekinator.
145+ void save( string filename );
146+ Save the Wekinator to a file.
147+ void setAllRecordStatus( int status );
148+ Set the record status for all outputs.
149+ void setAllRunStatus( int status );
150+ Set the run status for all outputs.
151+ void setOutputProperty( int output_index, string property_name, int property_value );
152+ Set the output property of the Wekinator. See the Wekinator documentation for more information.
153+ void setOutputProperty( int output_index, int property_type, string property_name, int property_value );
154+ Set the output property of the Wekinator. See the Wekinator documentation for more information.
155+ void setOutputProperty( int output_index, int property_type, string property_name, float property_value );
156+ Set the output property of the Wekinator. See the Wekinator documentation for more information.
157+ void setOutputProperty( int output_index, string property_name, int[] property_value );
158+ Set the output property of the Wekinator. See the Wekinator documentation for more information.
159+ void setOutputRecordStatus( int output_index, int status );
160+ Set the record status for the specified output.
161+ void setOutputRunStatus( int output_index, int status );
162+ Set the run status for the specified output.
163+ void setProperty( int property_type, string property_name, int property_value );
164+ Set the property of the Wekinator. See the Wekinator documentation for more information.
165+ void setProperty( int property_type, string property_name, float property_value );
166+ Set the property of the Wekinator. See the Wekinator documentation for more information.
167+ int taskType( int task_type );
168+ Set the task type of the Wekinator. Options: AI.Regression, AI.Classification
169+ int taskType();
170+ Get the task type id of the Wekinator.
171+ string taskTypeName();
172+ Get the task type name of the Wekinator.
173+ void train();
174+ Train models for all outputs.
175+- (added) new examples in ai/wekinator [ChAI]
176+ |- wekinator-basic.ck -- example of basic Wekinator usage
177+ |- wekinator-custom.ck -- more extensive customization for Wekinator
178+ |- wekinator-import.ck -- example of importing observations from file
179+- (added) MLP [ChAI] (thanks Yikai Li)
180+ |- a multilayer perceptron (MLP)--a basic artificial neural
181+ network--that maps an input layer to an output layer across a
182+ number of fully-connected hidden layers. This implemention can be
183+ trained either 1) by using one of the comprehensive .train()
184+ functions OR 2) by iteratively calling .forward() and .backprop()
185+ for each input-output observation, and using .shuffle() for each
186+ epoch. Commonly used for regression or classification.
187+ |- (inheritance) MLP -> Object
188+ -------------
189+ void backprop( float[] output, float learningRate );
190+ (Manually) backpropagate from the output layer, for a single input-output
191+ observation; compute the gradient of the loss function with respect to
192+ the weights in the network, one layer at a time.
193+ void forward( float[] input );
194+ (Manually) forward-propagate the input vector through the network.
195+ void getActivations( int layer, float[] activations );
196+ Get the activations of the given layer, after a manual .forward().
197+ void getBiases( int layer, float[] biases );
198+ Get the biases of the given layer.
199+ void getGradients( int layer, float[] gradients );
200+ Get the gradients of the given layer, after a manual .backprop().
201+ int getPropertyInt( int modelType, string key );
202+ Get int property of name 'key' for the given model type (options: AI.MLP, AI.KNN, AI.SVM).
203+ float getPropertyFloat( int modelType, string key );
204+ Get float property of name 'key' for the given model type (options: AI.MLP, AI.KNN, AI.SVM).
205+ void getWeights( int layer, float[][] weights );
206+ Get the weights of the given layer.
207+ void init( int[] unitsPerLayer );
208+ Initialize the MLP with the given number of neurons per layer, as
209+ specified in 'unitsPerLayer'.
210+ void init( int[] nodesPerLayer, int[] activationPerLayer );
211+ Initialize the MLP with the given number of nodes per layer and the given
212+ ctivation function per layer, as specified in 'activationPerLayer'
213+ (options: AI.Linear, AI.Sigmoid, AI.ReLU, AI.Tanh, or AI.Softmax).
214+ void init( int[] nodesPerLayer, int activationFunction );
215+ Initialize the MLP with the given number of nodes per layer and the given
216+ activation function for all layers (options: AI.Linear, AI.Sigmoid,
217+ I.ReLU, AI.Tanh, or AI.Softmax).
218+ int load( string filename );
219+ Load a MLP model from file.
220+ int predict( float[] input, float[] output );
221+ Predict the output layer from an input layer.
222+ void setProperty( int modelType, string key, int value );
223+ Set int property of name 'key' for the given model type (options: AI.MLP, AI.KNN, AI.SVM).
224+ void setProperty( int modelType, string key, float value );
225+ Set float property of name 'key' for the given model type (options: AI.MLP, AI.KNN, AI.SVM).
226+ int save( string filename );
227+ Save the MLP model to file.
228+ void train( float[][] inputs, float[][] outputs );
229+ Train the MLP with the given input and output observations with default
230+ learning rate=.001 and epochs=100.
231+ (Also see MLP.train(inputs,outputs,learningRate,epochs).)
232+ void train( float[][] inputs, float[][] outputs, float learningRate, int epochs );
233+ Train the MLP with the given input and output observations, the learning
234+ rate, and number of epochs.
235+ static void shuffle( float[][] X, float[][] Y );
236+ (Manually) shuffle the given input and output vectors.
237+- (added) new examples in ai/mlp [ChAI]
238+ |- mlp.ck -- example training a basic artificial neural network
239+ |- mlp-manual.ck -- example of step-by-step training an MLP, printing each stage
240+ |- mlp-load.ck -- loading a saved MLP model from file
241+ |- mlp-save.ck -- saving the MLP model to file'
242+ |- model.txt -- an example model file
243+- (added) Word2Vec [ChAI] (thanks Yikai Li)
244+ |- A word embeddings utility that maps words to vectors; can load a
245+ model and perform similiarity retrieval.
246+ |- (inheritance) Word2Vec -> Object
247+ ------------------
248+ int contains( string word );
249+ Query if 'word' is in the current model.
250+ int dim();
251+ Get number of dimensions for word embedding.
252+ void getSimilar( string word, int k, string[] output );
253+ Get the k most similar words to the given word.
254+ void getSimilar( float[] vec, int k, string[] output );
255+ Get the k most similar words to the given vector.
256+ void getVector( string word, float[] output );
257+ Get the vector of the given word.
258+ int load( string path );
259+ Load pre-trained word embedding model from the given path.
260+ int load( string path, int useKDTreeDim );
261+ Load pre-trained word embedding model from the given path; will use
262+ KDTree for similarity searches if the data dimension is less than
263+ or equal to 'useKDTreeDim'. Set 'useKDTreeDim' to 0 to use linear
264+ (brute force) similarity search; set 'useKDTreeDim' to less than 0
265+ to always use KDTree.
266+ void minMax( float[] mins, float[] maxs );
267+ Retrieve the minimums and maximums for each dimension.
268+ int size();
269+ Get number of words in dictionary.
270+ int useKDTree();
271+ Get whether a KDTree is used for similarity search.
272+- (added) new examples in ai/word2vec [ChAI]
273+ |- poem-i-feel.ck -- a stream of unconsciousness poem generator
274+ |- poem-randomwalk.ck -- another stream of unconsciousness generator
275+ |- poem-spew.ck -- yet another stream of unconsciousness generator
276+ |- poem-ungenerate.ck -- interactive prompt un/de-generator
277+ (need to use command line chuck)
278+ |- word2vec-basic.ck -- demos load(), getVector(), getSimilar()
279+ |- word2vec-prompt.ck -- command line interactive tool
280+ (need to use command line chuck)
281+- (added) Chroma unit analyzer (thanks Yikai Li)
282+ |- A unit analyzer that computes pitch chroma
283+ |- see examples/ai/features/chroma.ck
284+- (added) Kurtosis unit analyzer (thanks Yikai Li)
285+ |- A unit analyzer that computes kurtosis
286+ |- see examples/ai/features/kurtosis.ck
287+- (added) SFM unit analyzer (thanks Yikai Li)
288+ |- A unit analyzer that computes spetral flatness measure
289+ |- see examples/ai/features/sfm.ck
290+- (moved) examples/analysis/features => examples/ai/features
291+- (added) new examples in examples/ai/features
292+ |- features-combined -- real-time extraction of multiple features
293+ |- mfcc-basic.ck -- shows MFCC unit analyzer / feature extractor
294+ |- mfcc-mean.ck -- averaged MFCC feature extraction
295+ |- chroma.ck -- shows Chroma unit analyzer
296+ |- kurtosis.ck -- shows Kurtosis unit analyzer
297+ |- sfm.ck -- shows SFM (spectral flatness measure) unit analyzer
298+- (added) PCA [ChAI] (thanks Yikai Li)
299+ |- A principle component analysis (PCA) utility, commonly used
300+ for dimensionality reduction.
301+ |- (inheritance) PCA -> Object
302+ -------------------
303+ static void reduce( float[][] input, int D, float[][] output );
304+ Dimension-reduce 'input' (NxM) to 'output' (NxD) as the projection
305+ of the input data onto its first 'D' principle components
306+- (added) example: ai/pca/pca.ck
307+- (reworked) KNN [ChAI] (thanks Yikai Li)
308+ |- A basic k-NN utility that searches for k nearest
309+ neighbors from a set of observations / feature
310+ vectors. (Also see KNN2. The differrence between KNN
311+ and KNN2 is that KNN does not deal with labels whereas
312+ KNN2 is designed to work with labels.)
313+ |- (inheritance) KNN -> Object
314+ -------------------
315+ void search( float[] query, int k, int[] indices );
316+ Search for the 'k' nearest neighbors of 'query' and
317+ return their corresponding indices.
318+ void search( float[] query, int k, int[] indices,
319+ float[][] observations );
320+ Search for the 'k' nearest neighbors of 'query' and
321+ return their corresponding indices and observations
322+ int train( float[][] x );
323+ Train the KNN model with the given observations 'x'
324+ void weigh( float[] weights );
325+ Set the weights for each dimension in the data.
326+- (added) KNN2 [ChAI] (thanks Yikai Li)
327+ |- A k-NN utility that predicts probabilities of class
328+ membership based on distances from a test input to its
329+ k nearest neighbors. (Also see KNN. The differrence
330+ between KNN and KNN2 is that KNN does not deal with
331+ labels whereas KNN2 is designed to work with labels.)
332+ |- (inheritance) KNN2 -> Object
333+ -------------------
334+ int predict( float[] query, int k, float[] prob );
335+ Predict the output probabilities 'prob' given unlabeled test
336+ input 'query' based on distances to 'k' nearest neighbors.
337+ void search( float[] query, int k, int[] labels );
338+ Search for the 'k' nearest neighbors of 'query' and return
339+ their labels.
340+ void search( float[] query, int k, int[] labels, int[] indices );
341+ Search for the 'k' nearest neighbors of 'query' and return
342+ their labels and indices.
343+ void search( float[] query, int k, int[] labels, int[] indices,
344+ float[][] observations);
345+ Search for the 'k' nearest neighbors of 'query' and return
346+ their labels, indices, and observations.
347+ int train( float[][] x, int[] labels );
348+ Train the KNN model with the given samples 'x' and
349+ corresponding labels.
350+ void weigh( float[] weights );
351+ Set the weights for each dimension in the data.
352+- (added) example: ai/knn/knn-search.ck
353+- (added) example: ai/knn/knn2-classify.ck
354+- (added) example: ai/knn/knn2-search.ck
355+- (added) new static method for all Objects
356+ Type Object.typeOf()
357+ Get the type of this object (or class).
358+- (added) new Type type
359+ |- A representation of a ChucK type.
360+ |- (inheritance) Type -> Object
361+ --------------
362+ int arrayDepth();
363+ Return the number of array dimensions associated with this Type (e.g., 'int[][]' has 2; 'int' has 0).
364+ void children( Type[] kids );
365+ Retrieve this Type's children Types in the array 'kids'.
366+ int equals( Type another );
367+ Return whether this Type is same as 'another'.
368+ int isArray();
369+ Return whether this Type is some kind of an array.
370+ int isPrimitive();
371+ Return whether this is a primitive Type (e.g., 'int' and 'dur' are primitives types; 'Object' and its children Types are not).
372+ int isa( Type another );
373+ Return whether this Type is a kind of 'another'.
374+ int isa( string another );
375+ Return whether this Type is a kind of 'another'.
376+ string name();
377+ Return the name of this Type.
378+ string origin();
379+ Return a string decribing where this Type was defined (e.g., "builtin", "chugin", "user").
380+ Type parent();
381+ Return this Type's parent Type; returns null if this Type is 'Object'.
382+ static Type find( string typeName );
383+ Find and return the Type associated with 'typeName'; returns null if no Types currently in the VM with that name.
384+ static void getTypes( Type[] types, int includeObjects, int includePrimitives, int includeSpecial, int includeBuiltin, int includeChugins, int includeImports, int includeUserDefined );
385+ Retrieves in the array 'types' all top-level Types currently in the ChucK runtime type system; 'includeObjects'--include all Objects? 'includePrimitives'--include primitive types suchs as 'int' and 'dur'? 'includeSpecial'--include special types such as '@array' and '@function'? The results are further filtered by 'includeBuiltin'--include builtin types? 'includeChugins'--include types imported from chugins? 'includeImports'--include types imported from CK files in library path? 'includeUserDefined'--include types defined in ChucK code?
386+ static void getTypes( Type[] types );
387+ Retrieves in the array 'types' all top-level Types currently in the ChucK VM's type system; 'includeObjects' indicated whether to include all Objects; 'includePrimitives' indicates whether to include primitive types suchs as 'int' and 'dur'.
388+ static Type of( Object obj );
389+ Return the Type of 'obj'
390+ static Type of( int val );
391+ Return the Type associated with 'int'.
392+ static Type of( float val );
393+ Return the Type associated with 'float'.
394+ static Type of( time val );
395+ Return the Type associated with 'time'.
396+ static Type of( dur val );
397+ Return the Type associated with 'dur'.
398+ static Type of( complex val );
399+ Return the Type associated with 'complex'.
400+ static Type of( polar val );
401+ Return the Type associated with 'polar'.
402+ static Type of( vec3 val );
403+ Return the Type associated with 'vec3'.
404+ static Type of( vec4 val );
405+ Return the Type associated with 'vec4'.
406+- (added) new examples in examples/type
407+ |- polymorph.ck -- an example of polymorphism in ChucK
408+ |- type_query.ck -- querying for a list of types from the ChucK runtime type system
409+ |- type_type.ck -- example showing some functionalities of the Type type
410+- (added) array.zero()
411+ |- zero out the contents of the array; size is unchanged.
412+- (added) negative indexing for arrays (thanks nshaheed)
413+ |- [1,2,3,4] @=> int a[]; a[-1]; // evaluates to 4
414+- (added) example: array/array_negative.ck
415+- (added) Math functions
416+ float map( float value, float x1, float y1,
417+ float x2, float y2 );
418+ Map 'value' from range [x1,y1] into range [x2,y2]; 'value'
419+ can be outside range[x1,y1].
420+ float map2( float value, float x1, float y1,
421+ float x2, float y2 );
422+ Map 'value' from range [x1,y1] into range [x2,y2]; 'value'
423+ will be clamped to [x1,y1] if outside range.
424+ (Math.remap() is the same as Math.map2())
425+ float clampi( int value, int min, int max );
426+ Clamp integer 'value' to range [min, max].
427+ float clampf( float value, float min, float max );
428+ Clamp float 'value' to range [min, max].
429+ float cossim( float[] a[], float[] b[] );
430+ Compute the cosine similarity between arrays a and b.
431+ float cossim( vec3 a, vec3 b );
432+ Compute the cosine similarity between 3D vectors a and b.
433+ float cossim( vec4 a, vec4 b );
434+ Compute the cosine similarity between 4D vectors a and b.
435+ float euclidean( float[] a[], float[] b[] );
436+ Compute the euclidean distance between arrays a and b.
437+ float euclidean( vec3 a, vec3 b );
438+ Compute the euclidean distance between 3D vectors a and b.
439+ float euclidean( vec4 a, vec4 b );
440+ Compute the euclidean distance between 4D vectors a and b.
441+- (added) examples/math
442+ |- map.ck -- shows mapping using Math.map() and Math.map2()
443+ |- math-help.ck -- just prints Math API using Math.help();
444+- (added) Machine functions
445+ int eval( string code );
446+ Evaluate a string as ChucK code, compiling it and spork it as a child
447+ shred of the current shred.
448+ int eval( string code, string args );
449+ Evaluate a string as ChucK code, with optional arguments (bundled in
450+ 'args' as "ARG1:ARG2:...", compiling it and spork it as a child shred of
451+ the current shred.
452+ int eval( string code, string args, int count );
453+ Evaluate a string as ChucK code, with optional arguments (bundled in
454+ 'args' as "ARG1:ARG2:...", compiling it and sporking 'count' instances as
455+ a child shreds of the current shred.
456+ int loglevel( int level );
457+ Set log level
458+ |- 0: NONE
459+ |- 1: CORE
460+ |- 2: SYSTEM
461+ |- 3: SEVERE
462+ |- 4: WARNING
463+ |- 5: INFO
464+ |- 6: CONFIG
465+ |- 7: FINE
466+ |- 8: FINER
467+ |- 9: FINEST
468+ |- 10: ALL
469+ static int loglevel();
470+ Get log level
471+- (added) examples in machine
472+ |- eval.ck -- demonstrate Machine.eval(), noting its behavior wrt
473+ to schreduler
474+- (modified) MFCC -- added (back) a missing and crucial log10() to
475+ to the MFCC computation and updated implementation; output
476+ range magnitudes now in the hundreds
477+- (enhanced) overloaded functions with non-matching return types now
478+ provide additional information in the compiler error message
479+- (fixed) overloaded functions with identical arguments now will
480+ correctly result in a compiler error
481+- (fixed, hopefully) no more LPF and HPF filter explosion for small
482+ values of .freq (<.2), large values of .freq (>Nyquist frequency),
483+ or Q < 1 with high frequency below Nyquist; now LPF.freq and HPF .Q
484+ are internally clamped to values between [1,SRATE/2];
485+- (fixed) SndBuf crash in cases where file size is integer multiple
486+ of .chunks and .chunks > 0 and reaching the end of the file
487+- (fixed) SndBuf.valueAt(n) for n == file size in samples now returns 0;
488+ previously this special case returned .valueAt(n-1)
489+- (fixed) SndBuf assertation failure if SndBuf.chunks was set AFTER
490+ loading a file; now .chunks will ONLY take effect for the next
491+ SndBuf.read
492+- (renamed) int LiSa.loop0(int) and int LiSa.loop0(); previously these
493+ were incorrectly overloaded as "loop()" and was unavailable
494+- (fixed) FileIO.seek() previously fails if EOF is reached in reading
495+ a file; FileIO.seek() now functions after EOF is reached.
496+- (fixed) FileIO.more() now looks ahead for EOF
497+- (updated) all cherr prints now flushes immediately
498+- (updated) IO.newline() or a solitary "\n" now automatically flushes
499+ chout
500+- (added) examples in examples/io
501+ |- read-byte.ck -- reading raw bytes from file in binary mode
502+ |- read-float.ck -- reading floats from file (in ASCII mode)
503+ |- seek.ck -- shows FileIO.seek usage for rewind a file read
504+ |- write-byte.ck -- writing raw bytes to file in binary mode
505+- (added) examples in examples/events
506+ |- event-x-bpm-1.ck -- example using custom Events to synchronize
507+ multiple shreds to a common clock
508+ |- event-x-bpm-2.ck -- same as event-x-bpm-2.ck but using arrays
509+- (added) absyn tree printing for instruction dumping abysn2str()
510+- (added) Machine.refcount() and refcount printing for object references
511+- (updated and fixed) memory system upgrade (part 1); scope-sensitive
512+ cleanup for each return statement; clarified reference counting
513+ semantics; function argument release for builtin functions; improved
514+ post-function call object cleanup; auto-reference-increment on
515+ returned objects from all builtin/imported functions;
516+- (updated) built-in abstract classes FM, StkInstrmnt, BLT, and
517+ FilterBasic, when used directly, issues a WARNING level log
518+ message in their respective synthesis tick functions (set log
519+ level in chuck or miniAudicle to WARNING or higher to enable
520+ printing), and allows program to procede silently. (Example that
521+ previously crashed: 'FM fm => dac; 1::second => now;')
522+- (developer) Chugin API clients in C++ now able to create
523+ strings and access member variables (thanks Nick Shaheed!)
524+
525+
526+01.4.2.0 (January 2023)
527+---
528+(NOTE) chuck-1.4.2.0 marks a beginning (in BETA) of chAI => ChucK for AI
529+-- a set of functionalities for interactive machine learning and artful,
530+humanistic design of music and artificial intelligence; it coincides with
531+the new "Music and AI" course at Stanford University, designed and taught
532+by Ge Wang with Ph.D. candidate Yikai Li.
533+
534+---
535+ - (added) MFCC unit analyzer (thanks Yikai Li)
536+ |- A unit analyzer that computes Mel-frequency Cepstral Coefficients
537+ (MFCCs), and outputs a vector of coefficients.
538+ |- (inheritance) MFCC -> UAna -> UGen -> Object
539+ - (added) examples: analysis/features/mfcc.ck
540+ - (added) all associative arrays now have a new method [thanks nshaheed]
541+ void getKeys( string[] keys );
542+ Return all keys found in associative array in keys
543+ - (added) Machine.realtime(): "return true if the shred is in realtime
544+ mode, false if it's in silent mode (i.e. --silent is enabled)"
545+ -- thanks nshaheed --
546+ - (added) Machine.silent(): "return false if the shred is in realtime
547+ mode, true if it's in silent mode (i.e. --silent is enabled)"
548+ -- thanks nshaheed --
549+ - (fixed) .help() now more accurately prints ("unit analyzer")
550+ for UAna types
551+ - (fixed) multi-variable array declaration; the following should
552+ now work:
553+ int x[1], y[2];
554+ int x, y[3];
555+ - (fixed) resolved an issue with multi-dimensional arrays pre-maturely
556+ releasing internal type data structure -- e.g., causing an assertion
557+ failure in the second function call
558+ fun void test()
559+ {
560+ [ [1,2,3], [1,2,3] ] @=> int arr[][];
561+ }
562+ test();
563+ test();
564+ - (fixed) internal array storage now (more) correctly differentiate
565+ between int and float, on systems where the two are the same size
566+ (e.g., both 32-bit or both 64-bit)
567+ - (fixed) command line chuck: when opening default input audio device
568+ (e.g., Microphone), check for mono devices (the case on some MacOS
569+ systems) now happens earlier, before searching other 2-channel input
570+ audio devices; this preempts chuck using virtual audio input devices
571+ such as ZoomAudioDevice as the input device
572+ - (dev) added test examples in 01-Basic related to multi-var array
573+ declarations
574+ - (dev) extraneous white spaces removed throughout src/core
575+ ** thank you nshaheed for this soul-restoring measure **
576+ - (dev) all tabs replaced with 4 spaces, now consistent across project
577+ ** thank you nshaheed for this soul-restoring measure **
578+ - (dev) nshaheed: linux makefiles now correctly inserts Debug (-g)
579+ build flag when Debug build is enabled (default builds for Release)
580+-----------------------
581+(BETA) chAI-related additions: please note this is in Beta, meaning that
582+APIs may change in the near future; many additions are in the works
583+-----------------------
584+ - (added) SVM object (thanks Yikai Li)
585+ |- a support vector machine (SVM) utility trains a model and
586+ predicts output based on new input
587+ |- (inheritance) SVM -> Object
588+ |- methods:
589+ int predict( float[] x, float[] y );
590+ Predict the output 'y' given the input 'x'.
591+ int train( float[][] x, float[][] y );
592+ Train the SVM model with the given samples 'x' and 'y'.
593+ - (added) KNN object (thanks Yikai Li)
594+ |- A k-nearest neighbor (KNN) utility that predicts the output of
595+ a given input based on the training data
596+ |- (inheritance) KNN -> Object
597+ |- methods:
598+ int predict( int k, float[] x, float[] prob );
599+ Predict the output probabilities (in 'prob') given new input
600+ 'x' based on 'k' nearing neighbors.
601+ int train( float[][] x, int[] y );
602+ Train the KNN model with the given samples 'x' and
603+ corresponding labels 'y'.
604+ - (added) HMM object (thanks Yikai Li)
605+ |- A hidden markov model (HMM) utility that generates a sequence
606+ of observations based on the training data
607+ |- (inheritance) SVM -> Object
608+ |- methods:
609+ int load( float[] initiailDistribution,
610+ float[][] transitionMatrix,
611+ float[][] emissionMatrix );
612+ Initialize the HMM model with the given initial state
613+ distribution, transition matrix, and emission matrix.
614+ int train( int numStates, int numEmissions,
615+ int[] observations );
616+ Train the HMM model with the given observations.
617+ int generate( int length, int[] output );
618+ Generate a sequence of observations of the given length.
619+ - (added) basic usage examples in examples/ai/ folder
620+ |- also can use the built-in help() function
621+ KNN.help(); // this will print KNN type info and API
622+ SVM.help(); // this will print SVM type info and API
623+ HMM.help(); // this will print HMM type info and API
624+-----------------------
625+(BETA) end chAI additions
626+-----------------------
627+
628+
629+1.4.1.1 (May 2022)
2630 ---
3631 - (added) native support for Apple Silicon (e.g., M1) as intel/apple
4632 universal binary; *significant* performance throughput observed
5633 running chuck natively on Apple Silicon
6− - (added) array.popOut( int index )
7− removes an array element by index [thanks chamington and nshaheed]
8634 - (modified) building from source, on MacOS command line:
9635 > make mac (compile for current architecture: arm64/x86_64)
10− > make mac-ub (compile universal binary: arm64/x86_64)
636+ > make mac-ub (compile universal binary: arm64+x86_64)
11637 > lipo -archs ./chuck (checks architectures)
12638 > ./chuck --about (prints out compiled platform...
13639 ...and if compiled as universal binary):
14640 ---
15641 chuck version: 1.4.1.1 (numchucks)
16− macOS : 64-bit (universal binary)
642+ macOS : 64-bit [universal binary]
17643 ---
18644 > make osx (deprecated; use 'make mac' or 'make mac-ub')
645+ - (updated, pre-built executables, MacOS) both command line chuck and
646+ miniAudicle are now built as universal binaries to support both
647+ intel(x86_64) and Apple silicion/M1(arm64) architectures
648+ - (updated, pre-built executables, MacOS) all packaged chugins are
649+ now also built as universal binaries
19650 - (added) Math.equal( float x, float y )
20651 returns whether two floats are considered equivalent
652+ - (added) array.popOut( int index )
653+ removes an array element by index [thanks chamington and nshaheed]
21654 - (added) OscOut.send() error reporting now includes the intended
22655 recipient (hostname:port)
23656 - (added) examples/hid/gametra.ck
@@ -311,7 +944,7 @@ contributed. Happy ChucKing! · 287 unmodified lines
311944 - (fixed) repeat statement now worked correctly for shreds
312945 - (fixed) crash with --adaptive:N and ugens that used tickf e.g. WvOut2
313946 - (fixed) SndBuf occasional crash at end of file
314− - (fixed)(Win) install issue where chugins and/or example files were missing
947+ - (fixed) (windows) install issue where chugins and/or example files were missing
315948 - (removed) --blocking functionality; callback only for real-time audio
316949 - (internal) refactored VM to be more friendly for integration
317950
src/core/chuck.cpp+145−89
@@ -1,21 +1,21 @@
11 /*----------------------------------------------------------------------------
22 ChucK Concurrent, On-the-fly Audio Programming Language
33 Compiler and Virtual Machine
4−
4+
55 Copyright (c) 2003 Ge Wang and Perry R. Cook. All rights reserved.
66 http://chuck.stanford.edu/
77 http://chuck.cs.princeton.edu/
8−
8+
99 This program is free software; you can redistribute it and/or modify
1010 it under the terms of the GNU General Public License as published by
1111 the Free Software Foundation; either version 2 of the License, or
1212 (at your option) any later version.
13−
13+
1414 This program is distributed in the hope that it will be useful,
1515 but WITHOUT ANY WARRANTY; without even the implied warranty of
1616 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1717 GNU General Public License for more details.
18−
18+
1919 You should have received a copy of the GNU General Public License
2020 along with this program; if not, write to the Free Software
2121 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -23,8 +23,8 @@ · 1 unmodified line
2323 -----------------------------------------------------------------------------*/
2424
2525 //-----------------------------------------------------------------------------
26−// file: chuck.h
27−// desc: chuck engine header; VM + compiler + state; no audio I/O
26+// file: chuck.cpp
27+// desc: chuck engine chasis; VM + compiler + state; independent of audio I/O
2828 // REFACTOR-2017
2929 //
3030 // author: Ge Wang (https://ccrma.stanford.edu/~ge/)
@@ -55,10 +55,8 @@ · 24 unmodified lines
5555 #include <unistd.h>
5656 #include <netinet/in.h>
5757 #include <arpa/inet.h>
58−#include <sys/param.h> // added 1.3.0.0
5958 #else
6059 #include <direct.h> // added 1.3.0.0
61−#define MAXPATHLEN (255) // addec 1.3.0.0
6260 #endif // #ifndef __PLATFORM_WIN32__
6361
6462
@@ -92,7 +90,7 @@ · 27 unmodified lines
9290
9391
9492 // chuck statics
95−const char ChucK::VERSION[] = "1.4.1.1 (numchucks)";
93+const char ChucK::VERSION[] = "1.4.2.1-bleed-2023.02.24 (numchucks)";
9694 t_CKUINT ChucK::o_numVMs = 0;
9795 t_CKBOOL ChucK::o_isGlobalInit = FALSE;
9896 t_CKBOOL ChucK::enableSystemCall = FALSE;
@@ -112,7 +110,6 @@ const char * ChucK::version() · 13 unmodified lines
112110
113111
114112
115−#ifndef __DISABLE_OTF_SERVER__
116113 //-----------------------------------------------------------------------------
117114 // name: intSize()
118115 // desc: get chuck int size (in bits)
@@ -121,7 +118,6 @@ t_CKUINT ChucK::intSize() · 2 unmodified lines
121118 {
122119 return machine_intsize();
123120 }
124−#endif
125121
126122
127123
@@ -146,7 +142,7 @@ ChucK::ChucK() · 18 unmodified lines
146142 m_started = FALSE;
147143 // zero out the hook
148144 m_hook = NULL; // m_hook = nullptr
149−
145+
150146 // global init, if needed
151147 if( !o_isGlobalInit ) globalInit();
152148 }
@@ -214,7 +210,7 @@ void ChucK::initDefaultParams() · 61 unmodified lines
214210 m_listParams[CHUCK_PARAM_USER_CHUGINS] = CHUCK_PARAM_USER_CHUGINS_DEFAULT;
215211 m_listParams[CHUCK_PARAM_USER_CHUGIN_DIRECTORIES] = CHUCK_PARAM_USER_CHUGIN_DIRECTORIES_DEFAULT;
216212 m_params[CHUCK_PARAM_HINT_IS_REALTIME_AUDIO] = CHUCK_PARAM_HINT_IS_REALTIME_AUDIO_DEFAULT;
217−
213+
218214 ck_param_types[CHUCK_PARAM_SAMPLE_RATE] = ck_param_int;
219215 ck_param_types[CHUCK_PARAM_INPUT_CHANNELS] = ck_param_int;
220216 ck_param_types[CHUCK_PARAM_OUTPUT_CHANNELS] = ck_param_int;
@@ -410,25 +406,25 @@ bool ChucK::init() · 189 unmodified lines
410406
411407 // initialize VM
412408 if( !initVM() ) goto cleanup;
413−
409+
414410 // initialize compiler
415411 if( !initCompiler() ) goto cleanup;
416−
412+
417413 // initialize chugin system
418414 if( !initChugins() ) goto cleanup;
419415
420416 // initialize OTF programming system
421417 if( !initOTF() ) goto cleanup;
422−
418+
423419 // did user init?
424420 m_init = TRUE;
425−
421+
426422 return true;
427−
423+
428424 cleanup:
429425 // shutdown, dealloc
430426 shutdown();
431−
427+
432428 return false;
433429 }
434430
@@ -447,7 +443,7 @@ bool ChucK::initVM() · 12 unmodified lines
447443 t_CKUINT ins = getParamInt( CHUCK_PARAM_INPUT_CHANNELS );
448444 t_CKUINT adaptiveSize = getParamInt( CHUCK_PARAM_VM_ADAPTIVE );
449445 t_CKBOOL halt = getParamInt( CHUCK_PARAM_VM_HALT ) != 0;
450−
446+
451447 // instantiate VM
452448 m_carrier->vm = new Chuck_VM();
453449 // reference back to carrier
@@ -458,7 +454,7 @@ bool ChucK::initVM() · 4 unmodified lines
458454 CK_FPRINTF_STDERR( "[chuck]: %s\n", m_carrier->vm->last_error() );
459455 return false;
460456 }
461−
457+
462458 return true;
463459 }
464460
@@ -481,7 +477,7 @@ bool ChucK::initCompiler() · 16 unmodified lines
481477 m_carrier->compiler = new Chuck_Compiler();
482478 // reference back to carrier
483479 m_carrier->compiler->setCarrier( m_carrier );
484−
480+
485481 // initialize compiler
486482 if( !m_carrier->compiler->initialize() )
487483 {
@@ -503,11 +499,13 @@ bool ChucK::initCompiler() · 15 unmodified lines
503499 }
504500
505501 std::string cwd;
506− char cstr_cwd[MAXPATHLEN];
507−
502+ char * cstr_cwd = NULL; // 1.4.2.1 (barak) | was: char cstr_cwd[MAXPATHLEN];
503+
508504 // figure out current working directory (added 1.3.0.0)
509505 // is this needed for current path to work correctly?!
510− if( getcwd(cstr_cwd, MAXPATHLEN) == NULL )
506+ // was: if( getcwd(cstr_cwd, MAXPATHLEN) == NULL )
507+ // let getcwd allocate memory | 1.4.2.1 (barak)
508+ if( (cstr_cwd = getcwd(NULL, 0)) == NULL )
511509 {
512510 // uh...
513511 EM_log( CK_LOG_SEVERE, "error: unable to determine current working directory!" );
@@ -516,6 +514,8 @@ bool ChucK::initCompiler() · 2 unmodified lines
516514 {
517515 // make c++ string
518516 cwd = std::string(cstr_cwd);
517+ // reclaim memory from getcwd
518+ SAFE_FREE(cstr_cwd);
519519 // add trailing "/"
520520 cwd += '/';
521521 // deferring this step until later, and only for Windows
@@ -588,7 +588,7 @@ bool ChucK::initChugins() · 66 unmodified lines
588588 {
589589 Chuck_VM_Code * code = NULL;
590590 Chuck_VM_Shred * shred = NULL;
591−
591+
592592 // whether or not chug should be enabled (added 1.3.0.0)
593593 if( getParamInt( CHUCK_PARAM_CHUGIN_ENABLE ) != 0 )
594594 {
@@ -603,6 +603,10 @@ bool ChucK::initChugins() · 8 unmodified lines
603603 // list of individually named chug-ins (added 1.3.0.0)
604604 std::list<std::string> named_dls = getParamStringList( CHUCK_PARAM_USER_CHUGINS );
605605
606+ //---------------------------------------------------------------------
607+ // set origin hint | 1.4.2.1 (ge) added
608+ m_carrier->compiler->m_originHint = te_originChugin;
609+ //---------------------------------------------------------------------
606610 // log
607611 EM_log( CK_LOG_SYSTEM, "loading chugins..." );
608612 // push indent level
@@ -618,10 +622,14 @@ bool ChucK::initChugins() · 9 unmodified lines
618622 // pop log
619623 EM_poplog();
620624
625+ //---------------------------------------------------------------------
626+ // set origin hint | 1.4.2.1 (ge) added
627+ m_carrier->compiler->m_originHint = te_originImport;
628+ //---------------------------------------------------------------------
621629 // log
622630 EM_log( CK_LOG_SYSTEM, "pre-loading ChucK libs..." );
623631 EM_pushlog();
624−
632+
625633 // iterate over list of ck files that the compiler found
626634 for( std::list<std::string>::iterator j =
627635 compiler()->m_cklibs_to_preload.begin();
@@ -629,40 +637,40 @@ bool ChucK::initChugins() · 1 unmodified line
629637 {
630638 // the filename
631639 std::string filename = *j;
632−
640+
633641 // log
634642 EM_log( CK_LOG_SEVERE, "preloading '%s'...", filename.c_str() );
635643 // push indent
636644 EM_pushlog();
637−
645+
638646 // SPENCERTODO: what to do for full path
639647 std::string full_path = filename;
640−
648+
641649 // parse, type-check, and emit
642650 if( compiler()->go( filename, NULL, NULL, full_path ) )
643651 {
644652 // TODO: how to compilation handle?
645653 //return 1;
646−
654+
647655 // get the code
648656 code = compiler()->output();
649657 // name it - TODO?
650658 // code->name += string(argv[i]);
651−
659+
652660 // spork it
653661 shred = vm()->spork( code, NULL, TRUE );
654662 }
655−
663+
656664 // pop indent
657665 EM_poplog();
658666 }
659−
667+
660668 // clear the list of chuck files to preload
661669 compiler()->m_cklibs_to_preload.clear();
662670
663671 // pop log
664672 EM_poplog();
665−
673+
666674 return true;
667675 }
668676 else
@@ -674,10 +682,16 @@ bool ChucK::initChugins() · 5 unmodified lines
674682 // load user namespace
675683 m_carrier->env->load_user_namespace();
676684
685+ // unset origin hint | 1.4.2.1 (ge) added
686+ m_carrier->compiler->m_originHint = te_originUnknown;
687+
677688 return true;
678689
679690 error: // 1.4.1.0 (ge) added
680− // any cleanup goes here; none for now
691+
692+ // unset origin hint | 1.4.2.1 (ge) added
693+ m_carrier->compiler->m_originHint = te_originUnknown;
694+
681695 return false;
682696 }
683697
@@ -698,11 +712,11 @@ bool ChucK::initOTF() · 14 unmodified lines
698712 // log
699713 EM_log( CK_LOG_SYSTEM, "starting listener on port: %d...",
700714 m_carrier->otf_port );
701−
715+
702716 // start tcp server
703717 m_carrier->otf_socket = ck_tcp_create( 1 );
704718 if( !m_carrier->otf_socket ||
705− !ck_bind( m_carrier->otf_socket, m_carrier->otf_port ) ||
719+ !ck_bind( m_carrier->otf_socket, (int)m_carrier->otf_port ) ||
706720 !ck_listen( m_carrier->otf_socket, 10 ) )
707721 {
708722 CK_FPRINTF_STDERR( "[chuck]: cannot bind to tcp port %li...\n", m_carrier->otf_port );
@@ -740,6 +754,8 @@ bool ChucK::shutdown() · 31 unmodified lines
740754 {
741755 // log
742756 EM_log( CK_LOG_SYSTEM, "shutting down ChucK instance..." );
757+ // push
758+ EM_pushlog();
743759
744760 // stop VM
745761 if( m_carrier != NULL && m_carrier->vm != NULL )
@@ -756,10 +772,10 @@ bool ChucK::shutdown() · 10 unmodified lines
756772 // free vm, compiler, friends
757773 // first, otf
758774 // REFACTOR-2017 TODO: le_cb?
759−
775+
760776 // STK-specific
761777 stk_detach( m_carrier );
762−
778+
763779 #ifndef __DISABLE_OTF_SERVER__
764780 // cancel otf thread
765781 if( m_carrier->otf_thread )
@@ -774,7 +790,7 @@ bool ChucK::shutdown() · 8 unmodified lines
774790
775791 // close otf socket
776792 if( m_carrier->otf_socket ) ck_close( m_carrier->otf_socket );
777−
793+
778794 // reset
779795 m_carrier->otf_socket = NULL;
780796 m_carrier->otf_port = 0;
@@ -797,6 +813,11 @@ bool ChucK::shutdown() · 16 unmodified lines
797813 // clear flag
798814 m_started = FALSE;
799815
816+ // log
817+ EM_log( CK_LOG_SYSTEM, "ChucK instance shutdown complete." );
818+ // pop
819+ EM_poplog();
820+
800821 // done
801822 return true;
802823 }
@@ -808,7 +829,7 @@ bool ChucK::shutdown() · 5 unmodified lines
808829 // name: compileFile()
809830 // desc: compile a file (can be called anytime)
810831 //-----------------------------------------------------------------------------
811−bool ChucK::compileFile( const std::string & path, const std::string & argsTogether, int count )
832+bool ChucK::compileFile( const std::string & path, const std::string & argsTogether, t_CKINT count )
812833 {
813834 // sanity check
814835 if( !m_carrier->compiler )
@@ -817,17 +838,23 @@ bool ChucK::compileFile( const std::string & path, const std::string & argsToget · 2 unmodified lines
817838 CK_FPRINTF_STDERR( "[chuck]: compileFile() invoked before initialization ...\n" );
818839 return false;
819840 }
820−
841+
821842 std::string filename;
822843 std::vector<std::string> args;
823844 Chuck_VM_Code * code = NULL;
824845 Chuck_VM_Shred * shred = NULL;
825−
846+ std::string full_path;
847+
848+ //-------------------------------------------------------------------------
849+ // set origin hint | 1.4.2.1 (ge) added
850+ m_carrier->compiler->m_originHint = te_originUserDefined;
851+ //-------------------------------------------------------------------------
852+
826853 // log
827854 EM_log( CK_LOG_FINE, "compiling '%s'...", path.c_str() );
828855 // push indent
829856 EM_pushlog();
830−
857+
831858 // append
832859 std::string theThing = path + ":" + argsTogether;
833860 #ifdef __ANDROID__
@@ -847,35 +874,35 @@ bool ChucK::compileFile( const std::string & path, const std::string & argsToget · 13 unmodified lines
847874 }
848875 }
849876 #endif // __ANDROID__
850−
877+
851878 // parse out command line arguments
852879 if( !extract_args( theThing, filename, args ) )
853880 {
854881 // error
855882 CK_FPRINTF_STDERR( "[chuck]: malformed filename with argument list...\n" );
856883 CK_FPRINTF_STDERR( " --> '%s'", theThing.c_str() );
857− return false;
884+ goto error;
858885 }
859−
886+
860887 // construct full path to be associated with the file so me.sourceDir() works
861888 // (added 1.3.0.0)
862− std::string full_path = get_full_path(filename);
863−
889+ full_path = get_full_path(filename);
890+
864891 // parse, type-check, and emit (full_path added 1.3.0.0)
865892 if( !m_carrier->compiler->go( filename, NULL, NULL, full_path ) )
866− return false;
867−
893+ goto error;
894+
868895 // get the code
869896 code = m_carrier->compiler->output();
870897 // name it
871898 code->name += path;
872−
899+
873900 // log
874901 EM_log( CK_LOG_FINE, "sporking %d %s...", count,
875902 count == 1 ? "instance" : "instances" );
876−
903+
877904 // spork it
878− while( count-- )
905+ while( count > 0 ) // 1.4.2.1 (ge) | added changed to check for > 0, in case of negative count
879906 {
880907 #ifndef __EMSCRIPTEN__
881908 // spork (for now, spork_immediate arg is always false)
@@ -884,18 +911,30 @@ bool ChucK::compileFile( const std::string & path, const std::string & argsToget · 2 unmodified lines
884911 // spork (in emscripten, need to spork immediately so can get shred id)
885912 shred = m_carrier->vm->spork( code, NULL, TRUE );
886913 #endif
887−
914+
888915 // add args
889916 shred->args = args;
917+ // decrement count
918+ count--;
890919 }
891−
920+
892921 // pop indent
893922 EM_poplog();
894−
923+
895924 // reset the parser
896925 reset_parse();
897−
926+
927+ // unset origin hint | 1.4.2.1 (ge) added
928+ m_carrier->compiler->m_originHint = te_originUnknown;
929+
898930 return true;
931+
932+error: // 1.4.2.1 (ge) added
933+
934+ // unset origin hint | 1.4.2.1 (ge) added
935+ m_carrier->compiler->m_originHint = te_originUnknown;
936+
937+ return false;
899938 }
900939
901940
@@ -905,7 +944,7 @@ bool ChucK::compileFile( const std::string & path, const std::string & argsToget · 3 unmodified lines
905944 // name: compileCode()
906945 // desc: compile code directly
907946 //-----------------------------------------------------------------------------
908−bool ChucK::compileCode( const std::string & code, const std::string & argsTogether, int count)
947+bool ChucK::compileCode( const std::string & code, const std::string & argsTogether, t_CKINT count)
909948 {
910949 // sanity check
911950 if( !m_carrier->compiler )
@@ -914,71 +953,88 @@ bool ChucK::compileCode( const std::string & code, const std::string & argsToget · 2 unmodified lines
914953 CK_FPRINTF_STDERR( "[chuck]: compileCode() invoked before initialization ...\n" );
915954 return false;
916955 }
917−
956+
918957 std::vector<std::string> args;
919958 Chuck_VM_Code * vm_code = NULL;
920959 Chuck_VM_Shred * shred = NULL;
921−
960+ std::string workingDir;
961+ std::string full_path;
962+
963+ //-------------------------------------------------------------------------
964+ // set origin hint | 1.4.2.1 (ge) added
965+ m_carrier->compiler->m_originHint = te_originUserDefined;
966+ //-------------------------------------------------------------------------
967+
922968 // log
923969 EM_log( CK_LOG_FINE, "compiling code from string..." );
924970 // push indent
925971 EM_pushlog();
926−
972+
927973 // falsify filename / path for various logs
928974 std::string theThing = "compiled.code:" + argsTogether;
929975 std::string fakefakeFilename = "<result file name goes here>";
930−
976+
931977 // parse out command line arguments
932978 if( !extract_args( theThing, fakefakeFilename, args ) )
933979 {
934980 // error
935981 CK_FPRINTF_STDERR( "[chuck]: malformed filename with argument list...\n" );
936982 CK_FPRINTF_STDERR( " --> '%s'", theThing.c_str() );
937− return false;
983+ goto error;
938984 }
939−
985+
940986 // working directory
941− std::string workingDir = getParamString( CHUCK_PARAM_WORKING_DIRECTORY );
942−
987+ workingDir = getParamString( CHUCK_PARAM_WORKING_DIRECTORY );
988+
943989 // construct full path to be associated with the file so me.sourceDir() works
944− std::string full_path = workingDir + "/compiled.code";
990+ full_path = workingDir + "/compiled.code";
945991 // log
946992 EM_log( CK_LOG_FINE, "full path: %s...", full_path.c_str() );
947−
993+
948994 // parse, type-check, and emit (full_path added 1.3.0.0)
949995 if( !m_carrier->compiler->go( "<compiled.code>", NULL, code.c_str(), full_path ) )
950− return false;
951−
996+ goto error;
997+
952998 // get the code
953999 vm_code = m_carrier->compiler->output();
9541000 // name it (no path to append)
9551001 vm_code->name += "compiled.code";
956−
1002+
9571003 // log
9581004 EM_log( CK_LOG_FINE, "sporking %d %s...", count,
9591005 count == 1 ? "instance" : "instances" );
960−
1006+
9611007 // spork it
9621008 while( count-- )
9631009 {
964− #ifndef __EMSCRIPTEN__
1010+#ifndef __EMSCRIPTEN__
9651011 // spork (for now, spork_immediate arg is always false)
9661012 shred = m_carrier->vm->spork( vm_code, NULL, FALSE );
967− #else
1013+#else
9681014 // spork (in emscripten, need to spork immediately so can get shred id)
9691015 shred = m_carrier->vm->spork( vm_code, NULL, TRUE );
970− #endif
1016+#endif
9711017 // add args
9721018 shred->args = args;
9731019 }
974−
1020+
9751021 // pop indent
9761022 EM_poplog();
9771023
9781024 // reset the parser
9791025 reset_parse();
9801026
1027+ // unset origin hint | 1.4.2.1 (ge) added
1028+ m_carrier->compiler->m_originHint = te_originUnknown;
1029+
9811030 return true;
1031+
1032+error: // 1.4.2.1 (ge) added
1033+
1034+ // unset origin hint | 1.4.2.1 (ge) added
1035+ m_carrier->compiler->m_originHint = te_originUnknown;
1036+
1037+ return false;
9821038 }
9831039
9841040
@@ -1003,7 +1059,7 @@ bool ChucK::start() · 18 unmodified lines
10031059 // return VM running state
10041060 return m_carrier->vm->running();
10051061 }
1006−
1062+
10071063 // start the VM!
10081064 if( !m_carrier->vm->running() ) m_carrier->vm->start();
10091065
@@ -1021,11 +1077,11 @@ bool ChucK::start() · 11 unmodified lines
10211077 // name: run()
10221078 // desc: run engine (call from host callback)
10231079 //-----------------------------------------------------------------------------
1024−void ChucK::run( SAMPLE * input, SAMPLE * output, int numFrames )
1080+void ChucK::run( SAMPLE * input, SAMPLE * output, t_CKINT numFrames )
10251081 {
10261082 // make sure we started...
10271083 if( !m_started ) this->start();
1028−
1084+
10291085 // call the callback
10301086 m_carrier->vm->run( numFrames, input, output );
10311087 }
@@ -1112,12 +1168,12 @@ t_CKBOOL ChucK::globalInit() · 80 unmodified lines
11121168 {
11131169 // sanity check
11141170 if( o_isGlobalInit ) return FALSE;
1115−
1171+
11161172 // nothing to do, for now
1117−
1173+
11181174 // set flag
11191175 o_isGlobalInit = TRUE;
1120−
1176+
11211177 // done
11221178 return TRUE;
11231179 }
@@ -1135,22 +1191,22 @@ void ChucK::globalCleanup() · 11 unmodified lines
11351191 if( !o_isGlobalInit ) return;
11361192 // set flag
11371193 o_isGlobalInit = FALSE;
1138−
1194+
11391195 // log
11401196 EM_log( CK_LOG_INFO, "detaching all resources..." );
11411197 // push
11421198 EM_pushlog();
1143−
1199+
11441200 //#ifndef __DISABLE_MIDI__
11451201 // close midi file handles
11461202 // midirw_detach();
11471203 //#endif // __DISABLE_MIDI__
1148−
1204+
11491205 #ifndef __ALTER_HID__
11501206 // shutdown HID
11511207 HidInManager::cleanup();
11521208 #endif // __ALTER_HID__
1153−
1209+
11541210 #ifndef __DISABLE_SERIAL__
11551211 // shutdown serial
11561212 Chuck_IO_Serial::shutdown();
@@ -1163,7 +1219,7 @@ void ChucK::globalCleanup() · 6 unmodified lines
11631219
11641220 // pop
11651221 EM_poplog();
1166−
1222+
11671223 // REFACTOR-2017 TODO Ge:
11681224 // stop le_cb, ...?
11691225 }
src/core/chuck.h+15−17
@@ -1,21 +1,21 @@
11 /*----------------------------------------------------------------------------
22 ChucK Concurrent, On-the-fly Audio Programming Language
33 Compiler and Virtual Machine
4−
4+
55 Copyright (c) 2003 Ge Wang and Perry R. Cook. All rights reserved.
66 http://chuck.stanford.edu/
77 http://chuck.cs.princeton.edu/
8−
8+
99 This program is free software; you can redistribute it and/or modify
1010 it under the terms of the GNU General Public License as published by
1111 the Free Software Foundation; either version 2 of the License, or
1212 (at your option) any later version.
13−
13+
1414 This program is distributed in the hope that it will be useful,
1515 but WITHOUT ANY WARRANTY; without even the implied warranty of
1616 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1717 GNU General Public License for more details.
18−
18+
1919 You should have received a copy of the GNU General Public License
2020 along with this program; if not, write to the Free Software
2121 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -24,10 +24,10 @@ · 2 unmodified lines
2424
2525 //-----------------------------------------------------------------------------
2626 // file: chuck.h
27−// desc: chuck engine header; VM + compiler + state; no audio I/O
27+// desc: chuck engine header; VM + compiler + state; independent of audio I/O
2828 // REFACTOR-2017
2929 //
30−// author: Ge Wang (http://www.gewang.com/)
30+// author: Ge Wang (https://ccrma.stanford.edu/~ge/)
3131 // date: fall 2017
3232 //
3333 // additional authors:
@@ -99,7 +99,7 @@ public: · 65 unmodified lines
9999 ChucK();
100100 // desctructor
101101 virtual ~ChucK();
102−
102+
103103 public:
104104 // set parameter by name
105105 // -- all params should have reasonable defaults
@@ -115,9 +115,9 @@ public: · 9 unmodified lines
115115
116116 public:
117117 // compile a file (can be called anytime)
118− bool compileFile( const std::string & path, const std::string & argsTogether, int count = 1 );
118+ bool compileFile( const std::string & path, const std::string & argsTogether, t_CKINT count = 1 );
119119 // compile code directly
120− bool compileCode( const std::string & code, const std::string & argsTogether, int count = 1 );
120+ bool compileCode( const std::string & code, const std::string & argsTogether, t_CKINT count = 1 );
121121
122122 public:
123123 // initialize ChucK (using params)
@@ -127,12 +127,12 @@ public: · 3 unmodified lines
127127
128128 public:
129129 // run engine (call from callback)
130− void run( SAMPLE * input, SAMPLE * output, int numFrames );
130+ void run( SAMPLE * input, SAMPLE * output, t_CKINT numFrames );
131131
132132 public:
133133 // is initialized
134134 bool isInit() { return m_init; }
135−
135+
136136 public:
137137 // additional native chuck bindings/types (use with extra caution)
138138 bool bind( f_ck_query queryFunc, const std::string & name );
@@ -175,12 +175,10 @@ protected: · 36 unmodified lines
175175 public: // static functions
176176 // chuck version
177177 static const char * version();
178− #ifndef __DISABLE_OTF_SERVER__
179178 // chuck int size (in bits)
180− // (this depends on machine, which depends on OTF, so
181− // disable it if we don't have OTF)
179+ // (this depends on machine, which depends on OTF, so disable it if we don't have OTF)
180+ // 1.4.2.1 (ge) | reinstated for non-OTF, along with parts of machine
182181 static t_CKUINT intSize();
183− #endif
184182 // number of ChucK's
185183 static t_CKUINT numVMs() { return o_numVMs; };
186184 // --poop compatibilty
@@ -197,7 +195,7 @@ protected: · 10 unmodified lines
197195 static const char VERSION[];
198196 // number of VMs -- managed from VM constructor/destructors
199197 static t_CKUINT o_numVMs;
200−
198+
201199 protected:
202200 // initialize default params
203201 void initDefaultParams();
@@ -209,7 +207,7 @@ protected: · 5 unmodified lines
209207 bool initChugins();
210208 // init OTF programming system
211209 bool initOTF();
212−
210+
213211 protected:
214212 // core elements: compiler, VM, etc.
215213 Chuck_Carrier * m_carrier;
src/core/chuck.y+1−1
@@ -51,7 +51,7 @@ · 50 unmodified lines
5151 // function
5252 int yylex( void );
5353
54−void yyerror( char *s )
54+void yyerror( char * s )
5555 {
5656 EM_error( EM_tokPos, "%s", s );
5757 }
src/core/chuck_absyn.cpp+49−49
@@ -29,11 +29,11 @@ · 28 unmodified lines
2929 // author: Ge Wang (ge@ccrma.stanford.edu | gewang@cs.princeton.edu)
3030 // date: Autumn 2002
3131 //-----------------------------------------------------------------------------
32−#include <stdlib.h>
33−#include <stdio.h>
3432 #include "chuck_absyn.h"
3533 #include "chuck_utils.h"
3634 #include "chuck_errmsg.h"
35+#include <stdlib.h>
36+#include <stdio.h>
3737
3838
3939 a_Program new_program( a_Section section, int pos )
@@ -49,21 +49,21 @@ a_Program append_program( a_Program program, a_Section section, int pos ) · 9 unmodified lines
4949 {
5050 a_Program a = new_program( section, pos );
5151 a_Program current;
52−
52+
5353 current = program->next;
5454 if (current == NULL) {
5555 program->next = a;
5656 return program;
5757 }
58−
58+
5959 while (1)
6060 {
61− if (current->next == NULL) {
62− current->next = a;
63− break;
64− } else {
65− current = current->next;
66− }
61+ if (current->next == NULL) {
62+ current->next = a;
63+ break;
64+ } else {
65+ current = current->next;
66+ }
6767 }
6868 return program;
6969 }
@@ -84,7 +84,7 @@ a_Section new_section_func_def( a_Func_Def func_def, int pos ) · 14 unmodified lines
8484 a->s_type = ae_section_func;
8585 a->func_def = func_def;
8686 a->linepos = pos;
87−
87+
8888 return a;
8989 }
9090
@@ -94,7 +94,7 @@ a_Section new_section_class_def( a_Class_Def class_def, int pos ) · 3 unmodified lines
9494 a->s_type = ae_section_class;
9595 a->class_def = class_def;
9696 a->linepos = pos;
97−
97+
9898 return a;
9999 }
100100
@@ -118,11 +118,11 @@ a_Stmt_List append_stmt_list( a_Stmt_List stmt_list, a_Stmt stmt, int pos ) · 17 unmodified lines
118118 stmt_list->next = a;
119119 return stmt_list;
120120 }
121−
121+
122122 while (1)
123123 {
124124 if (current->next == NULL) {
125− current->next = a;
125+ current->next = a;
126126 break;
127127 } else {
128128 current = current->next;
@@ -137,7 +137,7 @@ a_Stmt new_stmt_from_expression( a_Exp exp, int pos ) · 8 unmodified lines
137137 a->s_type = ae_stmt_exp;
138138 a->stmt_exp = exp;
139139 a->linepos = pos;
140−
140+
141141 return a;
142142 }
143143
@@ -234,7 +234,7 @@ a_Stmt new_stmt_from_for( a_Stmt c1, a_Stmt c2, a_Exp c3, a_Stmt body, int pos ) · 90 unmodified lines
234234 a->linepos = pos;
235235 a->stmt_for.linepos = pos;
236236 a->stmt_for.self = a;
237−
237+
238238 return a;
239239 }
240240
@@ -293,7 +293,7 @@ a_Stmt new_stmt_from_return( a_Exp exp, int pos ) · 52 unmodified lines
293293 a->linepos = pos;
294294 a->stmt_return.linepos = pos;
295295 a->stmt_return.self = a;
296−
296+
297297 return a;
298298 }
299299
@@ -318,7 +318,7 @@ a_Stmt new_stmt_from_case( a_Exp exp, int pos ) · 18 unmodified lines
318318 a->stmt_case.linepos = pos;
319319 a->stmt_case.self = a;
320320
321− return a;
321+ return a;
322322 }
323323
324324 a_Exp append_expression( a_Exp list, a_Exp exp, int pos )
@@ -353,7 +353,7 @@ a_Exp new_exp_from_binary( a_Exp lhs, ae_Operator oper, a_Exp rhs, int pos ) · 28 unmodified lines
353353 a->linepos = pos;
354354 a->binary.linepos = pos;
355355 a->binary.self = a;
356−
356+
357357 return a;
358358 }
359359
@@ -367,11 +367,11 @@ a_Exp new_exp_from_unary( ae_Operator oper, a_Exp exp, int pos ) · 7 unmodified lines
367367 a->linepos = pos;
368368 a->unary.linepos = pos;
369369 a->unary.self = a;
370−
370+
371371 return a;
372372 }
373373
374−a_Exp new_exp_from_unary2( ae_Operator oper, a_Type_Decl type,
374+a_Exp new_exp_from_unary2( ae_Operator oper, a_Type_Decl type,
375375 a_Array_Sub array, int pos )
376376 {
377377 a_Exp a = (a_Exp)checked_malloc( sizeof( struct a_Exp_ ) );
@@ -383,7 +383,7 @@ a_Exp new_exp_from_unary2( ae_Operator oper, a_Type_Decl type, · 5 unmodified lines
383383 a->linepos = pos;
384384 a->unary.linepos = pos;
385385 a->unary.self = a;
386−
386+
387387 return a;
388388 }
389389
@@ -397,7 +397,7 @@ a_Exp new_exp_from_unary3( ae_Operator oper, a_Stmt code, int pos ) · 7 unmodified lines
397397 a->linepos = pos;
398398 a->unary.linepos = pos;
399399 a->unary.self = a;
400−
400+
401401 return a;
402402 }
403403
@@ -411,7 +411,7 @@ a_Exp new_exp_from_cast( a_Type_Decl type, a_Exp exp, int pos ) · 7 unmodified lines
411411 a->linepos = pos;
412412 a->cast.linepos = pos;
413413 a->cast.self = a;
414−
414+
415415 return a;
416416 }
417417
@@ -496,7 +496,7 @@ a_Exp new_exp_from_id( c_str xid, int pos ) · 78 unmodified lines
496496 a->primary.linepos = pos;
497497 a->primary.self = a;
498498
499− return a;
499+ return a;
500500 }
501501
502502 a_Exp new_exp_from_int( long num, int pos )
@@ -509,7 +509,7 @@ a_Exp new_exp_from_int( long num, int pos ) · 6 unmodified lines
509509 a->linepos = pos;
510510 a->primary.linepos = pos;
511511 a->primary.self = a;
512−
512+
513513 return a;
514514 }
515515
@@ -537,7 +537,7 @@ a_Exp new_exp_from_str( c_str str, int pos ) · 21 unmodified lines
537537 a->linepos = pos;
538538 a->primary.linepos = pos;
539539 a->primary.self = a;
540−
540+
541541 return a;
542542 }
543543
@@ -551,7 +551,7 @@ a_Exp new_exp_from_char( c_str chr, int pos ) · 7 unmodified lines
551551 a->linepos = pos;
552552 a->primary.linepos = pos;
553553 a->primary.self = a;
554−
554+
555555 return a;
556556 }
557557
@@ -573,7 +573,7 @@ a_Exp new_exp_from_if( a_Exp cond, a_Exp if_exp, a_Exp else_exp, int pos ) · 15 unmodified lines
573573 {
574574 a_Exp a = (a_Exp)checked_malloc( sizeof( struct a_Exp_ ) );
575575 a->s_type = ae_exp_if;
576− a->s_meta = ( ( if_exp->s_meta == ae_meta_var &&
576+ a->s_meta = ( ( if_exp->s_meta == ae_meta_var &&
577577 else_exp->s_meta == ae_meta_var ) ? ae_meta_var : ae_meta_value );
578578 a->exp_if.cond = cond;
579579 a->exp_if.if_exp = if_exp;
@@ -672,7 +672,7 @@ a_Exp new_exp_from_vec( a_Vec exp, int pos ) // ge: added 1.3.5.3 · 92 unmodified lines
672672 a->linepos = pos;
673673 a->primary.vec->self = a;
674674 a->primary.self = a;
675−
675+
676676 return a;
677677 }
678678
@@ -695,17 +695,17 @@ a_Var_Decl new_var_decl( c_constr xid, a_Array_Sub array, int pos ) · 16 unmodified lines
695695 a->xid = insert_symbol(xid);
696696 a->array = array;
697697 a->linepos = pos;
698−
698+
699699 return a;
700700 }
701701
702702 a_Var_Decl_List new_var_decl_list( a_Var_Decl var_decl, int pos )
703703 {
704− a_Var_Decl_List a = (a_Var_Decl_List)checked_malloc(
704+ a_Var_Decl_List a = (a_Var_Decl_List)checked_malloc(
705705 sizeof( struct a_Var_Decl_List_ ) );
706706 a->var_decl = var_decl;
707707 a->linepos = pos;
708−
708+
709709 return a;
710710 }
711711
@@ -713,7 +713,7 @@ a_Var_Decl_List prepend_var_decl_list( a_Var_Decl var_decl, a_Var_Decl_List list · 1 unmodified line
713713 {
714714 a_Var_Decl_List a = new_var_decl_list( var_decl, pos );
715715 a->next = list;
716−
716+
717717 return a;
718718 }
719719
@@ -732,7 +732,7 @@ a_Type_Decl add_type_decl_array( a_Type_Decl a, a_Array_Sub array, int pos ) · 12 unmodified lines
732732 {
733733 assert( a->array == NULL );
734734 a->array = array;
735−
735+
736736 return a;
737737 }
738738
@@ -748,7 +748,7 @@ a_Arg_List new_arg_list( a_Type_Decl type_decl, a_Var_Decl var_decl, int pos ) · 9 unmodified lines
748748 return a;
749749 }
750750
751−a_Arg_List prepend_arg_list( a_Type_Decl type_decl, a_Var_Decl var_decl,
751+a_Arg_List prepend_arg_list( a_Type_Decl type_decl, a_Var_Decl var_decl,
752752 a_Arg_List arg_list, int pos )
753753 {
754754 a_Arg_List a = new_arg_list( type_decl, var_decl, pos );
@@ -776,7 +776,7 @@ a_Func_Def new_func_def( ae_Keyword func_decl, ae_Keyword static_decl, · 21 unmodified lines
776776 return a;
777777 }
778778
779−a_Class_Def new_class_def( ae_Keyword class_decl, a_Id_List name,
779+a_Class_Def new_class_def( ae_Keyword class_decl, a_Id_List name,
780780 a_Class_Ext ext, a_Class_Body body, int pos )
781781 {
782782 a_Class_Def a = (a_Class_Def)checked_malloc( sizeof( struct a_Class_Def_ ) );
@@ -794,7 +794,7 @@ a_Class_Def new_iface_def( ae_Keyword class_decl, a_Id_List name, · 11 unmodified lines
794794 {
795795 a_Class_Def a = new_class_def( class_decl, name, ext, body, pos );
796796 a->iface = 1;
797−
797+
798798 return a;
799799 }
800800
@@ -849,7 +849,7 @@ void clean_exp( a_Exp exp ) · 48 unmodified lines
849849 {
850850 if( !exp ) return;
851851 clean_exp( exp->next );
852− free( exp );
852+ free( exp );
853853 }
854854
855855 a_Array_Sub new_array_sub( a_Exp exp, int pos )
@@ -858,7 +858,7 @@ a_Array_Sub new_array_sub( a_Exp exp, int pos ) · 2 unmodified lines
858858 a->exp_list = exp;
859859 a->depth = 1;
860860 a->linepos = pos;
861−
861+
862862 // make sure no multi
863863 /* if( exp && exp->next )
864864 {
@@ -875,9 +875,9 @@ a_Array_Sub new_array_sub( a_Exp exp, int pos ) · 10 unmodified lines
875875 goto error;
876876 }
877877 } */
878−
878+
879879 return a;
880−
880+
881881 /* error:
882882 clean_exp( exp );
883883 a->exp_list = NULL;
@@ -896,7 +896,7 @@ a_Array_Sub prepend_array_sub( a_Array_Sub a, a_Exp exp, int pos ) · 12 unmodified lines
896896 a->err_pos = exp->linepos; // set error for type-checker
897897 goto error;
898898 }
899−
899+
900900 // empty or not
901901 if( (exp && !a->exp_list) || (!exp && a->exp_list) )
902902 {
@@ -904,18 +904,18 @@ a_Array_Sub prepend_array_sub( a_Array_Sub a, a_Exp exp, int pos ) · 1 unmodified line
904904 a->err_pos = pos; // set error for type-checker
905905 goto error;
906906 }
907−
907+
908908 // prepend
909909 if( exp )
910910 {
911911 exp->next = a->exp_list;
912912 a->exp_list = exp;
913913 }
914−
914+
915915 // count
916916 a->depth++;
917917 return a;
918−
918+
919919 error:
920920 clean_exp( exp );
921921 return a;
@@ -927,7 +927,7 @@ a_Complex new_complex( a_Exp re, int pos ) · 5 unmodified lines
927927 a->re = re;
928928 if( re ) a->im = re->next;
929929 a->linepos = pos;
930−
930+
931931 return a;
932932 }
933933
@@ -937,7 +937,7 @@ a_Polar new_polar( a_Exp mod, int pos ) · 3 unmodified lines
937937 a->mod = mod;
938938 if( mod ) a->phase = mod->next;
939939 a->linepos = pos;
940−
940+
941941 return a;
942942 }
943943
@@ -951,7 +951,7 @@ a_Vec new_vec( a_Exp e, int pos ) // ge: added 1.3.5.3 · 7 unmodified lines
951951 e = e->next;
952952 }
953953 a->linepos = pos;
954−
954+
955955 return a;
956956 }
957957
src/core/chuck_absyn.h+15−14
@@ -52,7 +52,7 @@ typedef enum { · 51 unmodified lines
5252 ae_op_s_or_chuck, ae_op_s_xor_chuck, ae_op_shift_right_chuck,
5353 ae_op_shift_left_chuck, ae_op_percent_chuck, ae_op_s_chuck,
5454 ae_op_plusplus, ae_op_minusminus, ae_op_tilda, ae_op_exclamation,
55− ae_op_at_chuck, ae_op_unchuck, ae_op_upchuck, ae_op_spork,
55+ ae_op_at_chuck, ae_op_unchuck, ae_op_upchuck, ae_op_spork,
5656 ae_op_typeof, ae_op_sizeof, ae_op_new, ae_op_arrow_left, ae_op_arrow_right
5757 } ae_Operator;
5858
@@ -118,7 +118,7 @@ typedef struct a_Vec_ * a_Vec; // ge: added 1.3.5.3 · 59 unmodified lines
118118
119119 // forward reference for type
120120 typedef struct Chuck_Type * t_CKTYPE;
121−typedef struct Chuck_Value * t_CKVALUE;
121+typedef struct Chuck_Value * t_CKVALUE;
122122 typedef struct Chuck_Func * t_CKFUNC;
123123 typedef struct Chuck_Namespace * t_CKNSPC;
124124 typedef struct Chuck_VM_Code * t_CKVMCODE;
@@ -226,10 +226,11 @@ struct a_Exp_Decl_ { a_Type_Decl type; a_Var_Decl_List var_decl_list; int num_va · 101 unmodified lines
226226 t_CKTYPE ck_type; int linepos; a_Exp self; };
227227 struct a_Exp_Hack_ { a_Exp exp; int linepos; a_Exp self; };
228228 struct a_Var_Decl_List_ { a_Var_Decl var_decl; a_Var_Decl_List next; int linepos; a_Exp self; };
229+// 1.4.2.0 (ge) added ck_type and ref, to handle multiple array decl (e.g., int x, y[], z[1];)
229230 struct a_Var_Decl_ { S_Symbol xid; a_Var_Decl var_decl; a_Array_Sub array; t_CKVALUE value;
230− void * addr; int linepos; a_Exp self; };
231+ void * addr; t_CKTYPE ck_type; int ref; int linepos; a_Exp self; };
231232 struct a_Type_Decl_ { a_Id_List xid; a_Array_Sub array; int ref; int linepos; /*a_Exp self;*/ };
232−struct a_Array_Sub_ { t_CKUINT depth; a_Exp exp_list; int linepos; a_Exp self;
233+struct a_Array_Sub_ { t_CKUINT depth; a_Exp exp_list; int linepos; a_Exp self;
233234 int err_num; int err_pos; };
234235 struct a_Arg_List_ { a_Type_Decl type_decl; a_Var_Decl var_decl; t_CKTYPE type;
235236 a_Arg_List next; int linepos; a_Exp self; };
@@ -238,7 +239,7 @@ struct a_Polar_ { a_Exp mod; a_Exp phase; int linepos; a_Exp self; }; · 2 unmodified lines
238239 struct a_Vec_ { a_Exp args; int numdims; int linepos; a_Exp self; }; // ge: added 1.3.5.3
239240
240241 // enum primary exp type
241−typedef enum { ae_primary_var, ae_primary_num, ae_primary_float,
242+typedef enum { ae_primary_var, ae_primary_num, ae_primary_float,
242243 ae_primary_str, ae_primary_array, ae_primary_exp,
243244 ae_primary_hack, ae_primary_complex, ae_primary_polar,
244245 ae_primary_vec, ae_primary_char, ae_primary_nil
@@ -248,7 +249,7 @@ struct a_Exp_Primary_ · 3 unmodified lines
248249 {
249250 ae_Exp_Primary_Type s_type;
250251 t_CKVALUE value;
251−
252+
252253 union
253254 {
254255 S_Symbol var;
@@ -286,7 +287,7 @@ struct a_Exp_ · 31 unmodified lines
286287 t_CKUINT group_size;
287288 t_CKTYPE cast_to;
288289 t_CKUINT emit_var; // 1 = emit var, 2 = emit var and value
289−
290+
290291 union
291292 {
292293 struct a_Exp_Binary_ binary;
@@ -320,15 +321,15 @@ struct a_Stmt_GotoLabel_ { S_Symbol name; int linepos; a_Stmt self; }; · 27 unmodified lines
320321
321322 // enum values for stmt type
322323 typedef enum { ae_stmt_exp, ae_stmt_while, ae_stmt_until, ae_stmt_for, ae_stmt_loop,
323− ae_stmt_if, ae_stmt_code, ae_stmt_switch, ae_stmt_break,
324+ ae_stmt_if, ae_stmt_code, ae_stmt_switch, ae_stmt_break,
324325 ae_stmt_continue, ae_stmt_return, ae_stmt_case, ae_stmt_gotolabel
325326 } ae_Stmt_Type;
326−
327+
327328 struct a_Stmt_
328329 {
329330 ae_Stmt_Type s_type;
330331 int skip;
331−
332+
332333 union
333334 {
334335 a_Exp stmt_exp;
@@ -350,7 +351,7 @@ struct a_Stmt_ · 15 unmodified lines
350351 };
351352
352353 struct a_Stmt_List_ { a_Stmt stmt; a_Stmt_List next; int linepos; };
353−struct a_Class_Def_ { ae_Keyword decl; a_Id_List name; a_Class_Ext ext;
354+struct a_Class_Def_ { ae_Keyword decl; a_Id_List name; a_Class_Ext ext;
354355 a_Class_Body body; t_CKTYPE type; int iface; t_CKNSPC home;
355356 int linepos; };
356357 struct a_Class_Ext_ { a_Id_List extend_id; a_Id_List impl_list; int linepos; };
@@ -363,10 +364,10 @@ typedef enum { ae_func_user, ae_func_builtin } ae_Func_Type; · 6 unmodified lines
363364 // struct t_Func_BuiltIn_ { builtin_func_ptr func_ptr; int linepos; };
364365 struct a_Func_Def_ {
365366 ae_Keyword func_decl;
366− ae_Keyword static_decl;
367+ ae_Keyword static_decl;
367368 a_Type_Decl type_decl;
368369 t_CKTYPE ret_type;
369− S_Symbol name;
370+ S_Symbol name;
370371 a_Arg_List arg_list;
371372 a_Stmt code;
372373 t_CKFUNC ck_func;
@@ -384,7 +385,7 @@ typedef enum { ae_section_stmt, ae_section_func, ae_section_class · 11 unmodified lines
384385 struct a_Section_
385386 {
386387 ae_Section_Type s_type;
387−
388+
388389 union
389390 {
390391 a_Stmt_List stmt_list;
src/core/chuck_carrier.cpp+4−4
@@ -1,21 +1,21 @@
11 /*----------------------------------------------------------------------------
22 ChucK Concurrent, On-the-fly Audio Programming Language
33 Compiler and Virtual Machine
4−
4+
55 Copyright (c) 2003 Ge Wang and Perry R. Cook. All rights reserved.
66 http://chuck.stanford.edu/
77 http://chuck.cs.princeton.edu/
8−
8+
99 This program is free software; you can redistribute it and/or modify
1010 it under the terms of the GNU General Public License as published by
1111 the Free Software Foundation; either version 2 of the License, or
1212 (at your option) any later version.
13−
13+
1414 This program is distributed in the hope that it will be useful,
1515 but WITHOUT ANY WARRANTY; without even the implied warranty of
1616 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1717 GNU General Public License for more details.
18−
18+
1919 You should have received a copy of the GNU General Public License
2020 along with this program; if not, write to the Free Software
2121 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
src/core/chuck_carrier.h+8−8
@@ -1,21 +1,21 @@
11 /*----------------------------------------------------------------------------
22 ChucK Concurrent, On-the-fly Audio Programming Language
33 Compiler and Virtual Machine
4−
4+
55 Copyright (c) 2003 Ge Wang and Perry R. Cook. All rights reserved.
66 http://chuck.stanford.edu/
77 http://chuck.cs.princeton.edu/
8−
8+
99 This program is free software; you can redistribute it and/or modify
1010 it under the terms of the GNU General Public License as published by
1111 the Free Software Foundation; either version 2 of the License, or
1212 (at your option) any later version.
13−
13+
1414 This program is distributed in the hope that it will be useful,
1515 but WITHOUT ANY WARRANTY; without even the implied warranty of
1616 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1717 GNU General Public License for more details.
18−
18+
1919 You should have received a copy of the GNU General Public License
2020 along with this program; if not, write to the Free Software
2121 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -75,20 +75,20 @@ struct Chuck_Carrier · 53 unmodified lines
7575 Chuck_VM * vm;
7676 Chuck_IO_Chout * chout;
7777 Chuck_IO_Cherr * cherr;
78−
78+
7979 #ifndef __DISABLE_OTF_SERVER__
8080 // OTF programming things
8181 ck_socket otf_socket;
8282 t_CKINT otf_port;
8383 CHUCK_THREAD otf_thread;
8484 #endif
85−
85+
8686 // STK-specific
8787 #ifndef __DISABLE_WVOUT__
8888 XWriteThread * stk_writeThread;
8989 std::map<WvOut *, WvOut *> stk_wvOutMap;
9090 #endif
91−
91+
9292 // constructor
9393 Chuck_Carrier() :
9494 chuck(NULL),
@@ -107,7 +107,7 @@ struct Chuck_Carrier · 12 unmodified lines
107107 cherr( NULL )
108108
109109 { }
110−
110+
111111 // get hint: is realtime audio?
112112 t_CKBOOL hintIsRealtimeAudio();
113113 };
src/core/chuck_compile.cpp+107−103
@@ -43,10 +43,8 @@ · 42 unmodified lines
4343 #include "uana_xform.h"
4444 #include "uana_extract.h"
4545
46−#ifndef __DISABLE_OTF_SERVER__
4746 #include "ulib_machine.h"
48−#endif
49−
47+#include "ulib_ai.h"
5048 #include "ulib_math.h"
5149 #include "ulib_std.h"
5250
@@ -71,8 +69,8 @@ using namespace std; · 18 unmodified lines
7169
7270 // function prototypes
7371 t_CKBOOL load_internal_modules( Chuck_Compiler * compiler );
74−t_CKBOOL load_external_modules( Chuck_Compiler * compiler,
75− const char * extension,
72+t_CKBOOL load_external_modules( Chuck_Compiler * compiler,
73+ const char * extension,
7674 std::list<std::string> & chugin_search_paths,
7775 std::list<std::string> & named_dls);
7876 t_CKBOOL load_module( Chuck_Compiler * compiler, Chuck_Env * env,
@@ -89,9 +87,12 @@ Chuck_Compiler::Chuck_Compiler() · 10 unmodified lines
8987 {
9088 emitter = NULL;
9189 code = NULL;
92−
90+
9391 // REFACTOR-2017: add carrier
9492 m_carrier = NULL;
93+
94+ // origin hint | 1.4.2.1 (ge) added
95+ m_originHint = te_originUnknown;
9596 }
9697
9798
@@ -121,11 +122,14 @@ t_CKBOOL Chuck_Compiler::initialize() · 23 unmodified lines
121122 // push indent level
122123 EM_pushlog();
123124
125+ // set origin hint
126+ m_originHint = te_originBuiltin;
127+
124128 // allocate the type checker
125129 Chuck_Env * env = type_engine_init( m_carrier );
126130 // add reference
127131 env->add_ref();
128−
132+
129133 // allocate the emitter
130134 emitter = emit_engine_init( env );
131135 // add reference
@@ -136,7 +140,10 @@ t_CKBOOL Chuck_Compiler::initialize() · 4 unmodified lines
136140 // load internal libs
137141 if( !load_internal_modules( this ) )
138142 goto error;
139−
143+
144+ // unset origin hint
145+ m_originHint = te_originUnknown;
146+
140147 // pop indent
141148 EM_poplog();
142149
@@ -174,13 +181,13 @@ void Chuck_Compiler::shutdown() · 31 unmodified lines
174181 code = NULL;
175182 m_auto_depend = FALSE;
176183 m_recent.clear();
177−
184+
178185 for(std::list<Chuck_DLL *>::iterator i = m_dlls.begin();
179186 i != m_dlls.end(); i++)
180187 {
181188 delete (*i);
182189 }
183−
190+
184191 m_dlls.clear();
185192
186193 // pop indent
@@ -203,7 +210,7 @@ t_CKBOOL Chuck_Compiler::bind( f_ck_query query_func, const std::string & name, · 16 unmodified lines
203210 name.c_str() );
204211 // push indent level
205212 EM_pushlog();
206−
213+
207214 // get env
208215 Chuck_Env * env = this->env();
209216 // make context
@@ -213,32 +220,32 @@ t_CKBOOL Chuck_Compiler::bind( f_ck_query query_func, const std::string & name, · 3 unmodified lines
213220 env->reset();
214221 // load it
215222 type_engine_load_context( env, context );
216−
223+
217224 // do it
218225 if( !load_module( this, env, query_func, name.c_str(), nspc.c_str() ) ) goto error;
219226
220227 // clear context
221228 type_engine_unload_context( env );
222−
229+
223230 // commit what is in the type checker at this point
224231 env->global()->commit();
225−
232+
226233 // pop indent level
227234 EM_poplog();
228−
235+
229236 return TRUE;
230−
237+
231238 error:
232−
239+
233240 // probably dangerous: rollback
234241 env->global()->rollback();
235−
242+
236243 // clear context
237244 type_engine_unload_context( env );
238−
245+
239246 // pop indent level
240247 EM_poplog();
241−
248+
242249 return FALSE;
243250 }
244251
@@ -267,10 +274,10 @@ void Chuck_Compiler::set_auto_depend( t_CKBOOL v ) · 22 unmodified lines
267274 t_CKBOOL Chuck_Compiler::go( const string & filename, FILE * fd, const char * str_src, const string & full_path )
268275 {
269276 t_CKBOOL ret = TRUE;
270− Chuck_Context * context = NULL;
277+ // Chuck_Context * context = NULL;
271278
272279 EM_reset_msg();
273−
280+
274281 // check to see if resolve dependencies automatically
275282 if( !m_auto_depend )
276283 {
@@ -286,7 +293,7 @@ t_CKBOOL Chuck_Compiler::go( const string & filename, FILE * fd, const char * st · 9 unmodified lines
286293 // 1.4.1.0 (ge) | added to unset the fileName reference, which determines
287294 // how messages print to console (e.g., [file.ck]: or [chuck]:)
288295 EM_change_file( NULL );
289−
296+
290297 return ret;
291298 }
292299
@@ -307,7 +314,7 @@ t_CKBOOL Chuck_Compiler::resolve( const string & type ) · 14 unmodified lines
307314
308315 // look up if name is already parsed
309316
310−
317+
311318
312319 return ret;
313320 }
@@ -450,7 +457,7 @@ t_CKBOOL Chuck_Compiler::do_normal_depend( const string & filename, FILE * fd, · 136 unmodified lines
450457 // make the context
451458 context = type_engine_make_context( g_program, filename );
452459 if( !context ) return FALSE;
453−
460+
454461 // remember full path (added 1.3.0.0)
455462 context->full_path = full_path;
456463
@@ -510,26 +517,26 @@ t_CKBOOL Chuck_Compiler::do_auto_depend( const string & filename, FILE * fd, · 53 unmodified lines
510517 {
511518 t_CKBOOL ret = TRUE;
512519 Chuck_Context * context = NULL;
513−
520+
514521 // parse the code
515522 if( !chuck_parse( filename.c_str(), fd, str_src ) )
516523 return FALSE;
517−
524+
518525 // make the context
519526 context = type_engine_make_context( g_program, filename );
520527 if( !context ) return FALSE;
521−
528+
522529 // reset the env
523530 env()->reset();
524−
531+
525532 // load the context
526533 if( !type_engine_load_context( env(), context ) )
527534 return FALSE;
528−
535+
529536 // do entire file
530537 if( !do_entire_file( context ) )
531538 { ret = FALSE; goto cleanup; }
532−
539+
533540 // get the code
534541 if( !(code = context->code()) )
535542 {
@@ -537,21 +544,21 @@ t_CKBOOL Chuck_Compiler::do_auto_depend( const string & filename, FILE * fd, · 1 unmodified line
537544 EM_error2( 0, "internal error: context->code() NULL!" );
538545 goto cleanup;
539546 }
540−
547+
541548 cleanup:
542−
549+
543550 // commit
544551 if( ret ) env()->global()->commit();
545552 // or rollback
546553 else env()->global()->rollback();
547−
554+
548555 // unload the context from the type-checker
549556 if( !type_engine_unload_context( env() ) )
550557 {
551558 EM_error2( 0, "internal error unloading context...\n" );
552559 return FALSE;
553560 }
554−
561+
555562 return ret;
556563 }
557564
@@ -617,15 +624,15 @@ t_CKBOOL load_module( Chuck_Compiler * compiler, Chuck_Env * env, f_ck_query que · 59 unmodified lines
617624 {
618625 Chuck_DLL * dll = NULL;
619626 t_CKBOOL query_failed = FALSE;
620−
627+
621628 // load osc
622629 dll = new Chuck_DLL( compiler->carrier(), name );
623630 // (fixed: 1.3.0.0) query_failed now catches either failure of load or query
624631 if( (query_failed = !(dll->load( query ) && dll->query())) ||
625632 !type_engine_add_dll( env, dll, nspc ) )
626633 {
627− CK_FPRINTF_STDERR(
628− "[chuck]: internal error loading module '%s.%s'...\n",
634+ CK_FPRINTF_STDERR(
635+ "[chuck]: internal error loading module '%s.%s'...\n",
629636 nspc, name );
630637 if( query_failed )
631638 CK_FPRINTF_STDERR( " %s", dll->last_error() );
@@ -649,7 +656,7 @@ t_CKBOOL load_internal_modules( Chuck_Compiler * compiler ) · 17 unmodified lines
649656 EM_log( CK_LOG_SEVERE, "loading built-in modules..." );
650657 // push indent level
651658 EM_pushlog();
652−
659+
653660 // get env
654661 Chuck_Env * env = compiler->env();
655662 // make context
@@ -658,7 +665,7 @@ t_CKBOOL load_internal_modules( Chuck_Compiler * compiler ) · 2 unmodified lines
658665 env->reset();
659666 // load it
660667 type_engine_load_context( env, context );
661−
668+
662669 // still compile MidiMsg even if __DISABLE_MIDI__
663670 if( !init_class_Midi( env ) ) goto error;
664671 #ifndef __DISABLE_MIDI__
@@ -666,75 +673,73 @@ t_CKBOOL load_internal_modules( Chuck_Compiler * compiler ) · 1 unmodified line
666673 #endif // __DISABLE_MIDI__
667674
668675 // load
676+ EM_log( CK_LOG_SEVERE, "module 'math'" );
677+ if( !load_module( compiler, env, libmath_query, "Math", "global" ) ) goto error;
669678 EM_log( CK_LOG_SEVERE, "module 'osc'" );
670679 load_module( compiler, env, osc_query, "osc", "global" );
671− EM_log( CK_LOG_SEVERE, "module 'xxx'" );
672− load_module( compiler, env, xxx_query, "xxx", "global" );
680+ EM_log( CK_LOG_SEVERE, "module 'ai'" );
681+ if( !load_module( compiler, env, libai_query, "AI", "global" ) ) goto error;
682+ EM_log( CK_LOG_SEVERE, "module 'extract'" );
683+ load_module( compiler, env, extract_query, "extract", "global" );
673684 EM_log( CK_LOG_SEVERE, "module 'filter'" );
674685 load_module( compiler, env, filter_query, "filter", "global" );
675686 EM_log( CK_LOG_SEVERE, "module 'STK'" );
676687 load_module( compiler, env, stk_query, "stk", "global" );
677688 EM_log( CK_LOG_SEVERE, "module 'xform'" );
678689 load_module( compiler, env, xform_query, "xform", "global" );
679− EM_log( CK_LOG_SEVERE, "module 'extract'" );
680− load_module( compiler, env, extract_query, "extract", "global" );
681−
690+ EM_log( CK_LOG_SEVERE, "module 'xxx'" );
691+ load_module( compiler, env, xxx_query, "xxx", "global" );
692+ EM_log( CK_LOG_SEVERE, "module 'std'" );
693+ if( !load_module( compiler, env, libstd_query, "Std", "global" ) ) goto error;
694+
682695 // load
683− #ifndef __DISABLE_OTF_SERVER__
684696 EM_log( CK_LOG_SEVERE, "module 'machine'" );
685697 if( !load_module( compiler, env, machine_query, "Machine", "global" ) ) goto error;
686698 machine_init( compiler, otf_process_msg );
687− #endif
688−
689− EM_log( CK_LOG_SEVERE, "module 'std'" );
690− if( !load_module( compiler, env, libstd_query, "Std", "global" ) ) goto error;
691− EM_log( CK_LOG_SEVERE, "module 'math'" );
692− if( !load_module( compiler, env, libmath_query, "Math", "global" ) ) goto error;
693699
694700 #ifndef __DISABLE_NETWORK__
695701 EM_log( CK_LOG_SEVERE, "module 'opsc'" );
696702 if( !load_module( compiler, env, opensoundcontrol_query, "opsc", "global" ) ) goto error;
697703 #endif
698−
704+
699705 EM_log( CK_LOG_SEVERE, "module 'RegEx'" );
700706 if( !load_module( compiler, env, regex_query, "RegEx", "global" ) ) goto error;
701−
702− // Deprecated:
707+
708+ // deprecated:
703709 // if( !load_module( compiler, env, net_query, "net", "global" ) ) goto error;
704−
710+
705711 #ifndef __DISABLE_HID__
706712 EM_log( CK_LOG_SEVERE, "module 'HID'" );
707713 if( !init_class_HID( env ) ) goto error;
708714 #endif
709−
715+
710716 #ifndef __DISABLE_SERIAL__
711− // log
712717 EM_log( CK_LOG_SEVERE, "module 'SerialIO'" );
713718 if( !init_class_serialio( env ) ) goto error;
714719 #endif
715−
720+
716721 // clear context
717722 type_engine_unload_context( env );
718−
723+
719724 // commit what is in the type checker at this point
720725 env->global()->commit();
721−
726+
722727 // pop indent level
723728 EM_poplog();
724−
729+
725730 return TRUE;
726−
731+
727732 error:
728−
733+
729734 // probably dangerous: rollback
730735 env->global()->rollback();
731−
736+
732737 // clear context
733738 type_engine_unload_context( env );
734−
739+
735740 // pop indent level
736741 EM_poplog();
737−
742+
738743 return FALSE;
739744 }
740745
@@ -744,17 +749,17 @@ error: · 3 unmodified lines
744749 // name: load_external_module_at_path()
745750 // desc: ...
746751 //-----------------------------------------------------------------------------
747−t_CKBOOL load_external_module_at_path( Chuck_Compiler * compiler,
752+t_CKBOOL load_external_module_at_path( Chuck_Compiler * compiler,
748753 const char * name,
749754 const char * dl_path )
750755 {
751756 Chuck_Env * env = compiler->env();
752−
757+
753758 EM_log(CK_LOG_SEVERE, "loading chugin '%s'", name);
754−
759+
755760 Chuck_DLL * dll = new Chuck_DLL( compiler->carrier(), name );
756761 t_CKBOOL query_failed = FALSE;
757−
762+
758763 if((query_failed = !(dll->load(dl_path) && dll->query())) ||
759764 !type_engine_add_dll2(env, dll, "global"))
760765 {
@@ -768,14 +773,14 @@ t_CKBOOL load_external_module_at_path( Chuck_Compiler * compiler, · 7 unmodified lines
768773 }
769774 delete dll;
770775 EM_poplog();
771−
776+
772777 return FALSE;
773778 }
774779 else
775780 {
776781 compiler->m_dlls.push_back(dll);
777782 return TRUE;
778− }
783+ }
779784 }
780785
781786
@@ -789,8 +794,8 @@ static t_CKBOOL extension_matches( const char * filename, const char * extension · 7 unmodified lines
789794 {
790795 t_CKUINT extension_length = strlen(extension);
791796 t_CKUINT filename_length = strlen(filename);
792−
793− return strncmp( extension, filename+(filename_length-extension_length),
797+
798+ return strncmp( extension, filename+(filename_length-extension_length),
794799 extension_length) == 0;
795800 }
796801
@@ -806,24 +811,24 @@ t_CKBOOL load_external_modules_in_directory( Chuck_Compiler * compiler, · 9 unmodified lines
806811 const char * extension )
807812 {
808813 static const t_CKBOOL RECURSIVE_SEARCH = false;
809−
814+
810815 DIR * dir = opendir(directory);
811−
816+
812817 if( dir )
813818 {
814819 // log
815820 EM_log( CK_LOG_INFO, "examining directory '%s' for chugins", directory );
816−
821+
817822 struct dirent *de = NULL;
818−
823+
819824 while( (de = readdir(dir)) )
820825 {
821826 t_CKBOOL is_regular = false;
822827 t_CKBOOL is_directory = false;
823−
828+
824829 #if defined(__PLATFORM_WIN32__)
825830 is_directory = de->data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY;
826− is_regular = ((de->data.dwFileAttributes & FILE_ATTRIBUTE_NORMAL) ||
831+ is_regular = ((de->data.dwFileAttributes & FILE_ATTRIBUTE_NORMAL) ||
827832 (de->data.dwFileAttributes & FILE_ATTRIBUTE_READONLY) ||
828833 (de->data.dwFileAttributes & FILE_ATTRIBUTE_ARCHIVE));
829834 #elif defined(__WINDOWS_PTHREAD__) // Cygwin -- doesn't have dirent d_type
@@ -836,9 +841,9 @@ t_CKBOOL load_external_modules_in_directory( Chuck_Compiler * compiler, · 6 unmodified lines
836841 }
837842 else
838843 {
839− // uhh ...
840− EM_log( CK_LOG_INFO,
841− "unable to open file '%s', ignoring for chugins",
844+ // uhh ...
845+ EM_log( CK_LOG_INFO,
846+ "unable to open file '%s', ignoring for chugins",
842847 absolute_path.c_str() );
843848 continue;
844849 }
@@ -846,14 +851,14 @@ t_CKBOOL load_external_modules_in_directory( Chuck_Compiler * compiler, · 1 unmodified line
846851 is_directory = de->d_type == DT_DIR;
847852 is_regular = de->d_type == DT_REG;
848853 #endif
849−
854+
850855 if( is_regular ) // TODO: follow links?
851856 {
852857 if( extension_matches(de->d_name, extension) )
853858 {
854859 std::string absolute_path = std::string(directory) + "/" + de->d_name;
855−
856− load_external_module_at_path(compiler, de->d_name,
860+
861+ load_external_module_at_path(compiler, de->d_name,
857862 absolute_path.c_str());
858863 }
859864 else if( extension_matches(de->d_name, ".ck") )
@@ -870,13 +875,13 @@ t_CKBOOL load_external_modules_in_directory( Chuck_Compiler * compiler, · 10 unmodified lines
870875 strncmp(de->d_name, "..", sizeof("..")) != 0 )
871876 {
872877 std::string absolute_path = std::string(directory) + "/" + de->d_name;
873− load_external_modules_in_directory(compiler,
878+ load_external_modules_in_directory(compiler,
874879 absolute_path.c_str(),
875880 extension);
876881 }
877882 }
878883 }
879−
884+
880885 // close
881886 closedir( dir );
882887 }
@@ -889,7 +894,7 @@ t_CKBOOL load_external_modules_in_directory( Chuck_Compiler * compiler, · 6 unmodified lines
889894 EM_log( CK_LOG_INFO, "ignoring for chugins..." );
890895 EM_poplog();
891896 }
892−
897+
893898 return TRUE;
894899 }
895900
@@ -912,7 +917,7 @@ t_CKBOOL Chuck_Compiler:: load_external_modules( const char * extension, · 16 unmodified lines
912917 env->reset();
913918 // load it
914919 type_engine_load_context( env, context );
915−
920+
916921 /* first load dynamic libraries explicitly named on the command line */
917922 for(std::list<std::string>::iterator i_dl = named_dls.begin();
918923 i_dl != named_dls.end(); i_dl++)
@@ -920,38 +925,37 @@ t_CKBOOL Chuck_Compiler:: load_external_modules( const char * extension, · 1 unmodified line
920925 std::string & dl_path = *i_dl;
921926 if(!extension_matches(dl_path.c_str(), extension))
922927 dl_path += extension;
923−
928+
924929 load_external_module_at_path(this, dl_path.c_str(),
925930 dl_path.c_str());
926931 }
927−
932+
928933 /* now recurse through search paths and load any DLs or .ck files found */
929934 for(std::list<std::string>::iterator i_sp = chugin_search_paths.begin();
930935 i_sp != chugin_search_paths.end(); i_sp++)
931936 {
932937 load_external_modules_in_directory(this, (*i_sp).c_str(), extension);
933− }
934−
938+ }
939+
935940 // clear context
936941 type_engine_unload_context( env );
937−
942+
938943 // commit what is in the type checker at this point
939944 env->global()->commit();
940945
941946 return TRUE;
942− /*
947+ /*
943948 error:
944−
949+
945950 // probably dangerous: rollback
946951 env->global()->rollback();
947−
952+
948953 // clear context
949954 type_engine_unload_context( env );
950−
955+
951956 // pop indent level
952957 EM_poplog();
953−
958+
954959 return FALSE;
955− */
960+ */
956961 }
957−
src/core/chuck_compile.h+12−7
@@ -56,7 +56,7 @@ struct Chuck_Compiler · 55 unmodified lines
5656 protected: // data
5757 // carrier
5858 Chuck_Carrier * m_carrier;
59−
59+
6060 public: // get protected data
6161 // REFACTOR-2017: get associated, per-compiler environment
6262 Chuck_Env * env() const { return m_carrier->env; }
@@ -67,7 +67,6 @@ public: // get protected data · 4 unmodified lines
6767 // set carrier
6868 t_CKBOOL setCarrier( Chuck_Carrier * c ) { m_carrier = c; return TRUE; }
6969
70−
7170 public: // data
7271 // emitter
7372 Chuck_Emitter * emitter;
@@ -78,10 +77,16 @@ public: // data · 4 unmodified lines
7877 t_CKBOOL m_auto_depend;
7978 // recent map
8079 std::map<std::string, Chuck_Context *> m_recent;
81−
80+
81+ // chugins
8282 std::list<Chuck_DLL *> m_dlls;
83+ // libraries (ck code) to import
8384 std::list<std::string> m_cklibs_to_preload;
84−
85+
86+ // origin hint; this flag is set to different te_Origin values
87+ // to denote where new entities originate | 1.4.2.1 (ge) added
88+ te_Origin m_originHint;
89+
8590 public: // to all
8691 // contructor
8792 Chuck_Compiler();
@@ -102,19 +107,19 @@ public: // compile · 14 unmodified lines
102107 // set auto depend
103108 void set_auto_depend( t_CKBOOL v );
104109 // parse, type-check, and emit a program
105− t_CKBOOL go( const std::string & filename, FILE * fd = NULL,
110+ t_CKBOOL go( const std::string & filename, FILE * fd = NULL,
106111 const char * str_src = NULL, const std::string & full_path = "" );
107112 // resolve a type automatically, if auto_depend is on
108113 t_CKBOOL resolve( const std::string & type );
109114 // get the code generated from the last go()
110115 Chuck_VM_Code * output( );
111116
112−public: // replace-dac | added 1.4.1.0 (jack)
117+public: // replace-dac | added 1.4.1.0 (jack)
113118 // sets a "replacement dac": one global UGen is secretly used
114119 // as a stand-in for "dac" for this compilation;
115120 // for example, ChuckSubInstances in Chunity use a global Gain as a
116121 // replacement dac, then use the global getUGenSamples() function to
117− // get the samples of the gain. this enables the creation
122+ // get the samples of the gain. this enables the creation
118123 // of a new sample sucker.
119124 void setReplaceDac( t_CKBOOL shouldReplaceDac, const std::string & replacement );
120125
src/core/chuck_def.h+17−7
@@ -104,12 +104,12 @@ typedef struct { t_CKUINT N ; t_CKFLOAT * values ; } t_CKVECTOR; · 103 unmodified lines
104104
105105 // kinds (added 1.3.1.0 to faciliate 64-bit support)
106106 // to differentiate in case int and float have same size
107−#define kindof_VOID 0
108−#define kindof_INT 1
109−#define kindof_FLOAT 2
110−#define kindof_COMPLEX 3
111−#define kindof_VEC3 4
112−#define kindof_VEC4 5
107+#define kindof_VOID 0
108+#define kindof_INT 1
109+#define kindof_FLOAT 2
110+#define kindof_COMPLEX 3
111+#define kindof_VEC3 4
112+#define kindof_VEC4 5
113113
114114 typedef char * c_str;
115115 typedef const char * c_constr;
@@ -140,6 +140,9 @@ typedef struct { SAMPLE re ; SAMPLE im ; } t_CKCOMPLEX_SAMPLE; · 24 unmodified lines
140140 #define FALSE 0
141141 #endif
142142
143+// special non-zero value to denote "no value" | added 1.4.2.0 (ge)
144+#define CK_NO_VALUE 0xffffffff
145+
143146 // 3.1415926535897932384626433832795028841971693993751058209749445...
144147 #define ONE_PI (3.14159265358979323846)
145148 #define TWO_PI (2.0 * ONE_PI)
@@ -151,6 +154,8 @@ typedef struct { SAMPLE re ; SAMPLE im ; } t_CKCOMPLEX_SAMPLE; · 5 unmodified lines
151154 #define SAFE_RELEASE(x) do { if(x){ x->release(); x = NULL; } } while(0)
152155 #define SAFE_ADD_REF(x) do { if(x){ x->add_ref(); } } while(0)
153156 #define SAFE_REF_ASSIGN(lhs,rhs) do { SAFE_RELEASE(lhs); (lhs) = (rhs); SAFE_ADD_REF(lhs); } while(0)
157+#define SAFE_FREE(x) do { if(x){ free(x); x = NULL; } } while(0)
158+#define SAFE_UNLOCK_DELETE(x) do { if(x){ x->unlock(); delete x; x = NULL; } } while(0)
154159 #endif
155160
156161 // max + min
@@ -188,7 +193,12 @@ typedef struct { SAMPLE re ; SAMPLE im ; } t_CKCOMPLEX_SAMPLE; · 31 unmodified lines
188193
189194 #ifdef __PLATFORM_WIN32__
190195 #ifndef usleep
191−#define usleep(x) Sleep( (x / 1000 <= 0 ? 1 : x / 1000) )
196+ #define usleep(x) Sleep( (x / 1000 <= 0 ? 1 : x / 1000) )
197+#endif
198+// 1.4.2.0 (ge and spencer) | added for legacy windows, as part of switch to snprintf
199+// https://stackoverflow.com/questions/2915672/snprintf-and-visual-studio-2010
200+#if defined(_MSC_VER) && _MSC_VER < 1900
201+ #define snprintf(buf,len, format,...) _snprintf_s(buf, len,len, format, __VA_ARGS__)
192202 #endif
193203 #pragma warning (disable : 4996) // stdio deprecation
194204 #pragma warning (disable : 4786) // stl debug info
src/core/chuck_dl.cpp+231−92
@@ -97,25 +97,25 @@ void CK_DLL_CALL ck_begin_class( Chuck_DL_Query * query, const char * name, cons · 96 unmodified lines
9797 if( !parent_path )
9898 {
9999 // error
100− EM_error2( 0, "class import: ck_begin_class: unknown parent type '%s'",
100+ EM_error2( 0, "class import: ck_begin_class: unknown parent type '%s'",
101101 query->curr_class->name.c_str(), name, parent );
102102 return;
103103 }
104−
104+
105105 Chuck_Type * ck_parent_type = type_engine_find_type( query->env(), parent_path );
106−
106+
107107 delete_id_list( parent_path );
108−
108+
109109 if( !ck_parent_type )
110110 {
111111 // error
112112 EM_error2( 0, "class import: ck_begin_class: unable to find parent type '%s'", ck_parent_type );
113113 return;
114114 }
115−
115+
116116 parent_offset = ck_parent_type->obj_size;
117117 }
118−
118+
119119 // push
120120 query->stack.push_back( query->curr_class );
121121 // allocate
@@ -134,7 +134,7 @@ void CK_DLL_CALL ck_begin_class( Chuck_DL_Query * query, const char * name, cons · 12 unmodified lines
134134 c->name = name;
135135 c->parent = parent;
136136 c->current_mvar_offset = parent_offset;
137−
137+
138138 // curr
139139 query->curr_class = c;
140140 query->curr_func = NULL;
@@ -162,7 +162,7 @@ void CK_DLL_CALL ck_add_ctor( Chuck_DL_Query * query, f_ctor ctor ) · 21 unmodified lines
162162 f->name = "[ctor]";
163163 f->type = "void";
164164 f->ctor = ctor;
165−
165+
166166 // add
167167 query->curr_class->ctors.push_back( f );
168168 query->curr_func = f;
@@ -198,7 +198,7 @@ void CK_DLL_CALL ck_add_dtor( Chuck_DL_Query * query, f_dtor dtor ) · 29 unmodified lines
198198 f->name = "[dtor]";
199199 f->type = "void";
200200 f->dtor = dtor;
201−
201+
202202 // add
203203 query->curr_class->dtor = f;
204204 // set
@@ -212,7 +212,7 @@ void CK_DLL_CALL ck_add_dtor( Chuck_DL_Query * query, f_dtor dtor ) · 7 unmodified lines
212212 // name: ck_add_mfun()
213213 // desc: add member function, can be followed by add_arg
214214 //-----------------------------------------------------------------------------
215−void CK_DLL_CALL ck_add_mfun( Chuck_DL_Query * query, f_mfun addr,
215+void CK_DLL_CALL ck_add_mfun( Chuck_DL_Query * query, f_mfun addr,
216216 const char * type, const char * name )
217217 {
218218 // make sure there is class
@@ -228,7 +228,7 @@ void CK_DLL_CALL ck_add_mfun( Chuck_DL_Query * query, f_mfun addr, · 9 unmodified lines
228228 f->name = name;
229229 f->type = type;
230230 f->mfun = addr;
231−
231+
232232 // add
233233 query->curr_class->mfuns.push_back( f );
234234 query->curr_func = f;
@@ -257,7 +257,7 @@ void CK_DLL_CALL ck_add_sfun( Chuck_DL_Query * query, f_sfun addr, · 22 unmodified lines
257257 f->name = name;
258258 f->type = type;
259259 f->sfun = addr;
260−
260+
261261 // add
262262 query->curr_class->sfuns.push_back( f );
263263 query->curr_func = f;
@@ -270,7 +270,7 @@ void CK_DLL_CALL ck_add_sfun( Chuck_DL_Query * query, f_sfun addr, · 6 unmodified lines
270270 // name: ck_add_mvar()
271271 // desc: add member var
272272 //-----------------------------------------------------------------------------
273−t_CKUINT CK_DLL_CALL ck_add_mvar( Chuck_DL_Query * query,
273+t_CKUINT CK_DLL_CALL ck_add_mvar( Chuck_DL_Query * query,
274274 const char * type, const char * name,
275275 t_CKBOOL is_const )
276276 {
@@ -286,22 +286,22 @@ t_CKUINT CK_DLL_CALL ck_add_mvar( Chuck_DL_Query * query, · 9 unmodified lines
286286 if( !path )
287287 {
288288 // error
289− EM_error2( 0, "class import: add_mvar: mvar %s.%s has unknown type '%s'",
289+ EM_error2( 0, "class import: add_mvar: mvar %s.%s has unknown type '%s'",
290290 query->curr_class->name.c_str(), name, type );
291291 return CK_INVALID_OFFSET;
292292 }
293−
293+
294294 Chuck_Type * ck_type = type_engine_find_type( query->env(), path );
295−
295+
296296 delete_id_list( path );
297−
297+
298298 if( !ck_type )
299299 {
300300 // error
301301 EM_error2( 0, "class import: add_mvar: unable to find type '%s'", type );
302302 return CK_INVALID_OFFSET;
303303 }
304−
304+
305305 // allocate
306306 Chuck_DL_Value * v = new Chuck_DL_Value;
307307 v->name = name;
@@ -312,11 +312,11 @@ t_CKUINT CK_DLL_CALL ck_add_mvar( Chuck_DL_Query * query, · 4 unmodified lines
312312 query->curr_class->mvars.push_back( v );
313313 query->curr_func = NULL;
314314 query->last_var = v;
315−
315+
316316 t_CKUINT offset = query->curr_class->current_mvar_offset;
317317 query->curr_class->current_mvar_offset = type_engine_next_offset( query->curr_class->current_mvar_offset,
318318 ck_type );
319−
319+
320320 return offset;
321321 }
322322
@@ -344,11 +344,11 @@ void CK_DLL_CALL ck_add_svar( Chuck_DL_Query * query, const char * type, const c · 21 unmodified lines
344344 v->type = type;
345345 v->is_const = is_const;
346346 v->static_addr = addr;
347−
347+
348348 // add
349349 query->curr_class->svars.push_back( v );
350350 query->curr_func = NULL;
351−
351+
352352 query->last_var = v;
353353 }
354354
@@ -368,7 +368,7 @@ void CK_DLL_CALL ck_add_arg( Chuck_DL_Query * query, const char * type, const ch · 13 unmodified lines
368368 EM_error2( 0, "class import: add_arg invoked without begin_class..." );
369369 return;
370370 }
371−
371+
372372 // make sure there is function
373373 if( !query->curr_func )
374374 {
@@ -376,12 +376,12 @@ void CK_DLL_CALL ck_add_arg( Chuck_DL_Query * query, const char * type, const ch · 1 unmodified line
376376 EM_error2( 0, "class import: add_arg can only follow 'ctor', 'mfun', 'sfun', 'arg'..." );
377377 return;
378378 }
379−
379+
380380 // allocate
381381 Chuck_DL_Value * v = new Chuck_DL_Value;
382382 v->name = name;
383383 v->type = type;
384−
384+
385385 // add
386386 query->curr_func->args.push_back( v );
387387 }
@@ -402,7 +402,7 @@ void CK_DLL_CALL ck_add_ugen_func( Chuck_DL_Query * query, f_tick ugen_tick, f_p · 14 unmodified lines
402402 EM_error2( 0, "class import: add_ugen_func invoked without begin_class..." );
403403 return;
404404 }
405−
405+
406406 // make sure tick not defined already
407407 if( query->curr_class->ugen_tick && ugen_tick )
408408 {
@@ -410,7 +410,7 @@ void CK_DLL_CALL ck_add_ugen_func( Chuck_DL_Query * query, f_tick ugen_tick, f_p · 1 unmodified line
410410 EM_error2( 0, "class import: ugen_tick already defined..." );
411411 return;
412412 }
413−
413+
414414 // make sure pmsg not defined already
415415 if( query->curr_class->ugen_pmsg && ugen_pmsg )
416416 {
@@ -418,7 +418,7 @@ void CK_DLL_CALL ck_add_ugen_func( Chuck_DL_Query * query, f_tick ugen_tick, f_p · 1 unmodified line
418418 EM_error2( 0, "class import: ugen_pmsg already defined..." );
419419 return;
420420 }
421−
421+
422422 // set
423423 if( ugen_tick ) query->curr_class->ugen_tick = ugen_tick;
424424 if( ugen_pmsg ) query->curr_class->ugen_pmsg = ugen_pmsg;
@@ -443,7 +443,7 @@ void CK_DLL_CALL ck_add_ugen_funcf( Chuck_DL_Query * query, f_tickf ugen_tickf, · 18 unmodified lines
443443 EM_error2( 0, "class import: add_ugen_func invoked without begin_class..." );
444444 return;
445445 }
446−
446+
447447 // make sure tick not defined already
448448 if( query->curr_class->ugen_tickf && ugen_tickf )
449449 {
@@ -451,7 +451,7 @@ void CK_DLL_CALL ck_add_ugen_funcf( Chuck_DL_Query * query, f_tickf ugen_tickf, · 1 unmodified line
451451 EM_error2( 0, "class import: ugen_tick already defined..." );
452452 return;
453453 }
454−
454+
455455 // make sure pmsg not defined already
456456 if( query->curr_class->ugen_pmsg && ugen_pmsg )
457457 {
@@ -459,7 +459,7 @@ void CK_DLL_CALL ck_add_ugen_funcf( Chuck_DL_Query * query, f_tickf ugen_tickf, · 1 unmodified line
459459 EM_error2( 0, "class import: ugen_pmsg already defined..." );
460460 return;
461461 }
462−
462+
463463 // set
464464 if( ugen_tickf ) query->curr_class->ugen_tickf = ugen_tickf;
465465 if( ugen_pmsg ) query->curr_class->ugen_pmsg = ugen_pmsg;
@@ -533,7 +533,7 @@ t_CKBOOL CK_DLL_CALL ck_end_class( Chuck_DL_Query * query ) · 67 unmodified lines
533533 EM_error2( 0, "class import: end_class invoked without begin_class..." );
534534 return FALSE;
535535 }
536−
536+
537537 // type check the class?
538538 // 1.3.2.0: import class into type engine if at top level
539539 if( query->stack.size() == 1 ) // top level class
@@ -542,21 +542,21 @@ t_CKBOOL CK_DLL_CALL ck_end_class( Chuck_DL_Query * query ) · 2 unmodified lines
542542 {
543543 EM_log(CK_LOG_SEVERE, "[chuck](DL): error importing class '%s' into type engine",
544544 query->curr_class->name.c_str());
545−
545+
546546 // pop
547547 assert( query->stack.size() );
548548 query->curr_class = query->stack.back();
549549 query->stack.pop_back();
550−
550+
551551 return FALSE;
552552 }
553553 }
554−
554+
555555 // pop
556556 assert( query->stack.size() );
557557 query->curr_class = query->stack.back();
558558 query->stack.pop_back();
559−
559+
560560 return TRUE;
561561 }
562562
@@ -586,7 +586,7 @@ t_CKBOOL CK_DLL_CALL ck_doc_class( Chuck_DL_Query * query, const char * doc ) · 23 unmodified lines
586586 else
587587 return FALSE;
588588 // #endif // CK_DOC
589−
589+
590590 return TRUE;
591591 }
592592
@@ -602,7 +602,7 @@ t_CKBOOL CK_DLL_CALL ck_add_example( Chuck_DL_Query * query, const char * ex ) · 9 unmodified lines
602602 else
603603 return FALSE;
604604 // #endif // CK_DOC
605−
605+
606606 return TRUE;
607607 }
608608
@@ -615,7 +615,7 @@ t_CKBOOL CK_DLL_CALL ck_doc_func( Chuck_DL_Query * query, const char * doc ) · 6 unmodified lines
615615 else
616616 return FALSE;
617617 // #endif // CK_DOC
618−
618+
619619 return TRUE;
620620 }
621621
@@ -628,7 +628,7 @@ t_CKBOOL CK_DLL_CALL ck_doc_var( Chuck_DL_Query * query, const char * doc ) · 6 unmodified lines
628628 else
629629 return FALSE;
630630 // #endif // CK_DOC
631−
631+
632632 return TRUE;
633633 }
634634
@@ -692,11 +692,11 @@ t_CKBOOL Chuck_DLL::load( f_ck_query query_func, t_CKBOOL lazy ) · 57 unmodified lines
692692 m_version_func = ck_builtin_declversion;
693693 m_done_query = FALSE;
694694 m_func = "ck_query";
695−
695+
696696 // if not lazy, do it
697697 if( !lazy && !this->query() )
698698 return FALSE;
699−
699+
700700 return TRUE;
701701 }
702702
@@ -730,7 +730,7 @@ const Chuck_DL_Query * Chuck_DLL::query( ) · 27 unmodified lines
730730 // return if there already
731731 if( m_done_query )
732732 return &m_query;
733−
733+
734734 // get the address of the DL version function from the DLL
735735 if( !m_version_func )
736736 m_version_func = (f_ck_declversion)this->get_addr( CK_DECLVERSION_FUNC );
@@ -738,11 +738,11 @@ const Chuck_DL_Query * Chuck_DLL::query( ) · 1 unmodified line
738738 m_version_func = (f_ck_declversion)this->get_addr( (string("_")+CK_DECLVERSION_FUNC).c_str() );
739739 if( !m_version_func )
740740 {
741− m_last_error = string("no version function found in dll '")
741+ m_last_error = string("no version function found in dll '")
742742 + m_filename + string("'");
743743 return NULL;
744744 }
745−
745+
746746 // check version
747747 t_CKUINT dll_version = m_version_func();
748748 t_CKBOOL version_ok = FALSE;
@@ -751,7 +751,7 @@ const Chuck_DL_Query * Chuck_DLL::query( ) · 2 unmodified lines
751751 if(CK_DLL_VERSION_GETMAJOR(dll_version) == CK_DLL_VERSION_MAJOR &&
752752 CK_DLL_VERSION_GETMINOR(dll_version) <= CK_DLL_VERSION_MINOR)
753753 version_ok = TRUE;
754−
754+
755755 if(!version_ok)
756756 // SPENCERTODO: do they need to be equal, or can dll_version be < ?
757757 {
@@ -767,12 +767,12 @@ const Chuck_DL_Query * Chuck_DLL::query( ) · 9 unmodified lines
767767 << CK_DLL_VERSION_MAJOR
768768 << "."
769769 << CK_DLL_VERSION_MINOR;
770−
770+
771771 m_last_error = oss.str();
772−
772+
773773 return NULL;
774774 }
775−
775+
776776 // get the address of the query function from the DLL
777777 if( !m_query_func )
778778 m_query_func = (f_ck_query)this->get_addr( m_func.c_str() );
@@ -780,7 +780,7 @@ const Chuck_DL_Query * Chuck_DLL::query( ) · 1 unmodified line
780780 m_query_func = (f_ck_query)this->get_addr( (string("_")+m_func).c_str() );
781781 if( !m_query_func )
782782 {
783− m_last_error = string("no query function found in dll '")
783+ m_last_error = string("no query function found in dll '")
784784 + m_filename + string("'");
785785 return NULL;
786786 }
@@ -805,7 +805,7 @@ const Chuck_DL_Query * Chuck_DLL::query( ) · 18 unmodified lines
805805 + string("'");
806806 return NULL;
807807 }
808−
808+
809809 // load the proto table
810810 /* Chuck_DL_Proto * proto;
811811 m_name2proto.clear();
@@ -818,13 +818,13 @@ const Chuck_DL_Query * Chuck_DLL::query( ) · 6 unmodified lines
818818 + string("'");
819819 return NULL;
820820 }
821−
821+
822822 // get the addr
823823 if( !proto->addr )
824824 proto->addr = (f_ck_func)this->get_addr( (char *)proto->name.c_str() );
825825 if( !proto->addr )
826826 {
827− m_last_error = string("no addr associated with export '") +
827+ m_last_error = string("no addr associated with export '") +
828828 proto->name + string("'");
829829 return NULL;
830830 }
@@ -832,7 +832,7 @@ const Chuck_DL_Query * Chuck_DLL::query( ) · 1 unmodified line
832832 // put in the lookup table
833833 m_name2proto[proto->name] = proto;
834834 }
835−
835+
836836 // load the proto table
837837 Chuck_UGen_Info * info;
838838 m_name2ugen.clear();
@@ -845,13 +845,13 @@ const Chuck_DL_Query * Chuck_DLL::query( ) · 6 unmodified lines
845845 + string("'");
846846 return NULL;
847847 }
848−
848+
849849 // put in the lookup table
850850 m_name2ugen[info->name] = info;
851851 }*/
852852
853853 m_done_query = TRUE;
854−
854+
855855 // call attach
856856 // if( m_attach_func ) m_attach_func( 0, NULL );
857857
@@ -900,7 +900,7 @@ void * Chuck_DLL::get_addr( const char * symbol ) · 42 unmodified lines
900900 m_last_error = "cannot find addr from dynamic library - nothing open...";
901901 return FALSE;
902902 }
903−
903+
904904 return dlsym( m_handle, symbol );
905905 }
906906
@@ -957,14 +957,14 @@ Chuck_DL_Query::Chuck_DL_Query( Chuck_Carrier * carrier ) · 50 unmodified lines
957957 doc_var = ck_doc_var;
958958 create_main_thread_hook = ck_create_main_thread_hook;
959959 m_carrier = carrier;
960−
960+
961961 // memset(reserved2, NULL, sizeof(void*)*RESERVED_SIZE);
962−
962+
963963 dll_name = "[noname]";
964964 reserved = NULL;
965965 curr_class = NULL;
966966 curr_func = NULL;
967−
967+
968968 srate = carrier->vm->srate();
969969
970970 linepos = 0;
@@ -1027,9 +1027,9 @@ Chuck_DL_Func::~Chuck_DL_Func() · 56 unmodified lines
10271027
10281028
10291029 /*******************************************************************************
1030−
1030+
10311031 Main Thread Hook stuff
1032−
1032+
10331033 *******************************************************************************/
10341034
10351035 t_CKBOOL ck_mthook_activate(Chuck_DL_MainThreadHook *hook)
@@ -1064,9 +1064,9 @@ m_active(FALSE) · 28 unmodified lines
10641064
10651065
10661066 /*******************************************************************************
1067−
1068− Chuck_DL_Api stuff
1069−
1067+
1068+ Chuck_DL_Api stuff
1069+
10701070 *******************************************************************************/
10711071
10721072 namespace Chuck_DL_Api
@@ -1080,74 +1080,212 @@ static t_CKUINT ck_get_srate(CK_DL_API api, Chuck_VM_Shred * shred) · 7 unmodified lines
10801080 return shred->vm_ref->srate();
10811081 }
10821082
1083−static Chuck_DL_Api::Type ck_get_type( CK_DL_API api, Chuck_VM_Shred * shred, std::string & name )
1083+static Chuck_DL_Api::Type ck_get_type( CK_DL_API api, Chuck_VM_Shred * shred, const char * name )
10841084 {
10851085 Chuck_Env * env = shred->vm_ref->env();
1086− a_Id_List list = new_id_list( name.c_str(), 0 ); // TODO: nested types
1087−
1086+ a_Id_List list = new_id_list( name, 0 ); // TODO: nested types
1087+
10881088 Chuck_Type * t = type_engine_find_type( env, list );
1089−
1089+
10901090 delete_id_list( list );
1091−
1091+
10921092 return ( Chuck_DL_Api::Type ) t;
10931093 }
10941094
10951095 static Chuck_DL_Api::Object ck_create( CK_DL_API api, Chuck_VM_Shred * shred, Chuck_DL_Api::Type t )
10961096 {
10971097 assert( t != NULL );
1098−
1098+
10991099 Chuck_Type * type = ( Chuck_Type * ) t;
11001100 Chuck_Object * o = instantiate_and_initialize_object( type, shred->vm_ref );
1101−
1101+
11021102 return ( Chuck_DL_Api::Object ) o;
11031103 }
11041104
1105−static Chuck_DL_Api::String ck_create_string( CK_DL_API api, Chuck_VM_Shred * shred, std::string & str )
1105+static Chuck_DL_Api::String ck_create_string( CK_DL_API api, Chuck_VM_Shred * shred, const char * cstr )
11061106 {
11071107 Chuck_String * string = ( Chuck_String * ) instantiate_and_initialize_object( shred->vm_ref->env()->t_string, shred->vm_ref );
1108−
1109− string->set( str );
1110−
1108+
1109+ string->set( cstr );
1110+
11111111 return ( Chuck_DL_Api::String ) string;
11121112 }
11131113
1114−static t_CKBOOL ck_get_mvar_int( CK_DL_API api, Chuck_DL_Api::Object, std::string &, t_CKINT & )
1114+//-----------------------------------------------------------------------------
1115+// name: ck_get_mvar()
1116+// desc: retrieve a class's member variable offset
1117+//-----------------------------------------------------------------------------
1118+static t_CKBOOL ck_get_mvar(Chuck_DL_Api::Object o, const char* name, te_Type basic_type, t_CKINT& offset)
11151119 {
1120+ std::string mvar(name);
1121+ Chuck_Object* obj = (Chuck_Object*)o;
1122+ Chuck_Type* type = obj->type_ref;
1123+
1124+ if (type->info == NULL) {
1125+ // put error here
1126+ EM_error2(0, "get mvar: ck_get_mvar: object has no type info");
1127+ return FALSE;
1128+ }
1129+
1130+ vector<Chuck_Value*> vars;
1131+ Chuck_Value* var = NULL;
1132+ type->info->get_values(vars);
1133+
1134+ // iterate over retrieved functions
1135+ for (vector<Chuck_Value*>::iterator v = vars.begin(); v != vars.end(); v++)
1136+ {
1137+ // get pointer to chuck value
1138+ Chuck_Value* value = *v;
1139+ // check for NULL
1140+ if (value == NULL) continue;
1141+ // see if name matches
1142+ if (value->name != mvar) continue;
1143+ // see if name is correct type
1144+ if (value->type->xid != basic_type) continue;
1145+ // see if var is a member var
1146+ if (!value->is_member) continue;
1147+
1148+ // ladies and gentlement, we've got it
1149+ var = value;
1150+ break;
1151+ }
1152+
1153+ // make error
1154+ if (!var) {
1155+ EM_error2(0, "get mvar: ck_get_mvar: member variable %s not found", mvar.c_str());
1156+ return FALSE;
1157+ }
1158+
1159+ offset = var->offset;
11161160 return TRUE;
11171161 }
11181162
1119−static t_CKBOOL ck_get_mvar_float( CK_DL_API api, Chuck_DL_Api::Object, std::string &, t_CKFLOAT & )
1163+//-----------------------------------------------------------------------------
1164+// name: ck_get_mvar_int()
1165+// desc: retrieve a class's member variable of type int
1166+//-----------------------------------------------------------------------------
1167+static t_CKBOOL ck_get_mvar_int(CK_DL_API api, Chuck_DL_Api::Object obj, const char* name, t_CKINT & m_int)
11201168 {
1121− return TRUE;
1169+ assert(obj != NULL);
1170+ t_CKINT offset;
1171+
1172+ t_CKBOOL success = ck_get_mvar(obj, name, te_int, offset);
1173+
1174+ if (success)
1175+ {
1176+ Chuck_Object* ck_obj = (Chuck_Object*)obj;
1177+ m_int = OBJ_MEMBER_INT(ck_obj, offset); // get offset
1178+ }
1179+ return success;
11221180 }
11231181
1124−static t_CKBOOL ck_get_mvar_dur( CK_DL_API api, Chuck_DL_Api::Object, std::string &, t_CKDUR & )
1182+//-----------------------------------------------------------------------------
1183+// name: ck_get_mvar_float()
1184+// desc: retrieve a class's member variable of type float
1185+//-----------------------------------------------------------------------------
1186+static t_CKBOOL ck_get_mvar_float( CK_DL_API api, Chuck_DL_Api::Object obj, const char* name, t_CKFLOAT & m_float )
11251187 {
1126− return TRUE;
1188+ assert(obj != NULL);
1189+ t_CKINT offset;
1190+
1191+ t_CKBOOL success = ck_get_mvar(obj, name, te_float, offset);
1192+
1193+ if (success)
1194+ {
1195+ Chuck_Object* ck_obj = (Chuck_Object*)obj;
1196+ m_float = OBJ_MEMBER_FLOAT(ck_obj, offset); // get offset
1197+ }
1198+ return success;
11271199 }
11281200
1129−static t_CKBOOL ck_get_mvar_time( CK_DL_API api, Chuck_DL_Api::Object, std::string &, t_CKTIME & )
1201+//-----------------------------------------------------------------------------
1202+// name: ck_get_mvar_dur()
1203+// desc: retrieve a class's member variable of type dur
1204+//-----------------------------------------------------------------------------
1205+static t_CKBOOL ck_get_mvar_dur( CK_DL_API api, Chuck_DL_Api::Object obj, const char * name, t_CKDUR & value )
11301206 {
1131− return TRUE;
1207+ assert(obj != NULL);
1208+ t_CKINT offset;
1209+
1210+ t_CKBOOL success = ck_get_mvar(obj, name, te_dur, offset);
1211+
1212+ if (success)
1213+ {
1214+ Chuck_Object* ck_obj = (Chuck_Object*)obj;
1215+ value = OBJ_MEMBER_DUR(ck_obj, offset); // get offset
1216+ }
1217+ return success;
11321218 }
11331219
1134−static t_CKBOOL ck_get_mvar_string( CK_DL_API api, Chuck_DL_Api::Object, std::string &, Chuck_DL_Api::String & )
1220+//-----------------------------------------------------------------------------
1221+// name: ck_get_mvar_time()
1222+// desc: retrieve a class's member variable of type time
1223+//-----------------------------------------------------------------------------
1224+static t_CKBOOL ck_get_mvar_time( CK_DL_API api, Chuck_DL_Api::Object obj, const char * name, t_CKTIME & value )
11351225 {
1136− return TRUE;
1226+ assert(obj != NULL);
1227+ t_CKINT offset;
1228+
1229+ t_CKBOOL success = ck_get_mvar(obj, name, te_time, offset);
1230+
1231+ if (success)
1232+ {
1233+ Chuck_Object* ck_obj = (Chuck_Object*)obj;
1234+ value = OBJ_MEMBER_TIME(ck_obj, offset); // get offset
1235+ }
1236+ return success;
11371237 }
11381238
1139−static t_CKBOOL ck_get_mvar_object( CK_DL_API api, Chuck_DL_Api::Object, std::string &, Chuck_DL_Api::Object & )
1239+//-----------------------------------------------------------------------------
1240+// name: ck_get_mvar_string()
1241+// desc: retrieve a class's member variable of type string
1242+//-----------------------------------------------------------------------------
1243+static t_CKBOOL ck_get_mvar_string( CK_DL_API api, Chuck_DL_Api::Object obj, const char * name, Chuck_DL_Api::String & str )
11401244 {
1141− return TRUE;
1245+ assert(obj != NULL);
1246+ t_CKINT offset;
1247+
1248+ t_CKBOOL success = ck_get_mvar(obj, name, te_string, offset);
1249+
1250+ if (success)
1251+ {
1252+ Chuck_Object* ck_obj = (Chuck_Object*)obj;
1253+ str = OBJ_MEMBER_STRING(ck_obj, offset); // get offset
1254+ }
1255+ return success;
11421256 }
11431257
1144−static t_CKBOOL ck_set_string( CK_DL_API api, Chuck_DL_Api::String s, std::string & str )
1258+//-----------------------------------------------------------------------------
1259+// name: ck_get_mvar_object()
1260+// desc: retrieve a class's member variable of type object
1261+//-----------------------------------------------------------------------------
1262+static t_CKBOOL ck_get_mvar_object( CK_DL_API api, Chuck_DL_Api::Object obj, const char * name, Chuck_DL_Api::Object & object )
1263+{
1264+ assert(obj != NULL);
1265+ t_CKINT offset;
1266+
1267+ // TODO how to do this?
1268+ t_CKBOOL success = ck_get_mvar(obj, name, te_object, offset);
1269+
1270+ if (success)
1271+ {
1272+ Chuck_Object* ck_obj = (Chuck_Object*)obj;
1273+ object = OBJ_MEMBER_OBJECT(ck_obj, offset); // get offset
1274+ }
1275+ return success;
1276+}
1277+
1278+//-----------------------------------------------------------------------------
1279+// name: ck_set_string()
1280+// desc: set a class's member string
1281+//-----------------------------------------------------------------------------
1282+static t_CKBOOL ck_set_string( CK_DL_API api, Chuck_DL_Api::String s, const char * str )
11451283 {
11461284 assert( s != NULL );
1147−
1148− Chuck_String * string = ( Chuck_String * ) s;
1285+
1286+ Chuck_String * string = (Chuck_String *) s;
11491287 string->set( str );
1150−
1288+
11511289 return TRUE;
11521290 }
11531291
@@ -1197,7 +1335,8 @@ const char * dlerror( void ) · 43 unmodified lines
11971335 {
11981336 int error = GetLastError();
11991337 if( error == 0 ) return NULL;
1200− sprintf( dlerror_buffer, "%i", error );
1338+ // 1.4.2.0 (ge) | changed to snprintf
1339+ snprintf( dlerror_buffer, DLERROR_BUFFER_LENGTH, "%i", error );
12011340 return dlerror_buffer;
12021341 }
12031342 }
src/core/chuck_dl.h+61−55
@@ -154,11 +154,11 @@ namespace Chuck_DL_Api { struct Api; } · 153 unmodified lines
154154
155155
156156 // chuck dll export linkage and calling convention
157−#if defined (__PLATFORM_WIN32__)
157+#if defined (__PLATFORM_WIN32__)
158158 #define CK_DLL_LINKAGE extern "C" __declspec( dllexport )
159159 #else
160− #define CK_DLL_LINKAGE extern "C"
161−#endif
160+ #define CK_DLL_LINKAGE extern "C"
161+#endif
162162
163163 // calling convention of functions provided by chuck to the dll
164164 #if defined(__WINDOWS_DS__)
@@ -183,7 +183,7 @@ typedef const Chuck_DL_Api::Api *CK_DL_API; · 18 unmodified lines
183183 // example: CK_DLL_QUERY
184184 #ifndef __CK_DLL_STATIC__
185185 #define CK_DLL_QUERY(name) CK_DLL_DECLVERSION CK_DLL_EXPORT(t_CKBOOL) ck_query( Chuck_DL_Query * QUERY )
186−#else
186+#else
187187 #define CK_DLL_QUERY(name) CK_DLL_QUERY_STATIC(name)
188188 #endif // __CK_DLL_STATIC__
189189 // macro for defining ChucK DLL export allocator
@@ -382,13 +382,13 @@ public: · 192 unmodified lines
382382
383383 // re-added 1.4.0.1
384384 f_create_main_thread_hook create_main_thread_hook;
385−
385+
386386 // NOTE: everything below std::anything cannot be reliably accessed
387387 // by offset between dynamic modules, since std::anything could be variable
388388 // size -- put everything need to be accessed across modules above here!
389389 // discovered by the vigilant and forever traumatized Jack Atherton,
390390 // fixed during REFACTOR-2017; warning by the guilt-ridden Ge Wang
391−
391+
392392 // dll
393393 Chuck_DLL * dll_ref;
394394 // reserved
@@ -410,7 +410,7 @@ public: · 15 unmodified lines
410410 std::vector<Chuck_DL_Class *> classes;
411411 // stack
412412 std::vector<Chuck_DL_Class * >stack;
413−
413+
414414 // constructor
415415 Chuck_DL_Query( Chuck_Carrier * carrier );
416416 // desctructor
@@ -458,12 +458,12 @@ struct Chuck_DL_Class · 41 unmodified lines
458458 std::vector<Chuck_DL_Class *> classes;
459459 // current mvar offset
460460 t_CKUINT current_mvar_offset;
461−
461+
462462 t_CKUINT ugen_num_in, ugen_num_out;
463−
463+
464464 std::string doc;
465465 std::vector<std::string> examples;
466−
466+
467467 // constructor
468468 Chuck_DL_Class() { dtor = NULL; ugen_tick = NULL; ugen_tickf = NULL; ugen_pmsg = NULL; uana_tock = NULL; ugen_pmsg = NULL; current_mvar_offset = 0; ugen_num_in = ugen_num_out = 0; }
469469 // destructor
@@ -515,7 +515,7 @@ struct Chuck_DL_Func · 45 unmodified lines
515515 std::vector<Chuck_DL_Value *> args;
516516 // description
517517 std::string doc;
518−
518+
519519 // constructor
520520 Chuck_DL_Func() { ctor = NULL; }
521521 Chuck_DL_Func( const char * t, const char * n, t_CKUINT a )
@@ -580,7 +580,7 @@ union Chuck_DL_Return · 58 unmodified lines
580580 t_CKVEC4 v_vec4; // ge: added 1.3.5.3
581581 Chuck_Object * v_object;
582582 Chuck_String * v_string;
583−
583+
584584 Chuck_DL_Return() { v_vec4.x = v_vec4.y = v_vec4.z = v_vec4.w = 0; }
585585 };
586586
@@ -595,7 +595,7 @@ struct Chuck_DLL : public Chuck_VM_Object · 8 unmodified lines
595595 {
596596 public:
597597 // load dynamic ckx/dll from filename
598− t_CKBOOL load( const char * filename,
598+ t_CKBOOL load( const char * filename,
599599 const char * func = CK_QUERY_FUNC,
600600 t_CKBOOL lazy = FALSE );
601601 t_CKBOOL load( f_ck_query query_func, t_CKBOOL lazy = FALSE );
@@ -611,7 +611,7 @@ public: · 9 unmodified lines
611611 t_CKBOOL good() const;
612612 // name
613613 const char * name() const;
614−
614+
615615 public:
616616 // constructor
617617 Chuck_DLL( Chuck_Carrier * carrier, const char * xid = NULL )
@@ -644,7 +644,7 @@ public: · 26 unmodified lines
644644 void * bindle, Chuck_Carrier * carrier);
645645 t_CKBOOL (* const activate)(Chuck_DL_MainThreadHook *);
646646 t_CKBOOL (* const deactivate)(Chuck_DL_MainThreadHook *);
647−
647+
648648 Chuck_Carrier * const m_carrier;
649649 f_mainthreadhook const m_hook;
650650 f_mainthreadquit const m_quit;
@@ -665,45 +665,49 @@ struct Api · 14 unmodified lines
665665 public:
666666 static Api g_api;
667667 static inline const Api * instance() { return &g_api; }
668−
668+
669669 struct VMApi
670670 {
671671 VMApi();
672672 t_CKUINT (* const get_srate)( CK_DL_API, Chuck_VM_Shred * );
673673 } * const vm;
674−
674+
675675 struct ObjectApi
676676 {
677677 ObjectApi();
678− private:
678+
679+ // 1.4.2.1 (nshaheed and ge and anonymous pr-lab member) | changed from private to public
680+ // also changed all std::string & in this section to const char *
681+ // intent: this allows for chugins to access member variables and create chuck strings
682+ public:
679683 // function pointer get_type()
680− Type (* const get_type)( CK_DL_API, Chuck_VM_Shred *, std::string &name );
684+ Type (* const get_type)( CK_DL_API, Chuck_VM_Shred *, const char * name );
681685 // function pointer create()
682686 Object (* const create)( CK_DL_API, Chuck_VM_Shred *, Type type );
683687 // function pointer create_string()
684− String (* const create_string)( CK_DL_API, Chuck_VM_Shred *, std::string &value );
688+ String (* const create_string)( CK_DL_API, Chuck_VM_Shred *, const char * value );
685689 // function pointers for get_mvar_*()
686− t_CKBOOL (* const get_mvar_int)( CK_DL_API, Object object, std::string &name, t_CKINT &value );
687− t_CKBOOL (* const get_mvar_float)( CK_DL_API, Object object, std::string &name, t_CKFLOAT &value );
688− t_CKBOOL (* const get_mvar_dur)( CK_DL_API, Object object, std::string &name, t_CKDUR &value );
689− t_CKBOOL (* const get_mvar_time)( CK_DL_API, Object object, std::string &name, t_CKTIME &value );
690− t_CKBOOL (* const get_mvar_string)( CK_DL_API, Object object, std::string &name, String &value );
691− t_CKBOOL (* const get_mvar_object)( CK_DL_API, Object object, std::string &name, Object &value );
690+ t_CKBOOL (* const get_mvar_int)( CK_DL_API, Object object, const char * name, t_CKINT & value );
691+ t_CKBOOL (* const get_mvar_float)( CK_DL_API, Object object, const char * name, t_CKFLOAT & value );
692+ t_CKBOOL (* const get_mvar_dur)( CK_DL_API, Object object, const char * name, t_CKDUR & value );
693+ t_CKBOOL (* const get_mvar_time)( CK_DL_API, Object object, const char * name, t_CKTIME & value );
694+ t_CKBOOL (* const get_mvar_string)( CK_DL_API, Object object, const char * name, String & value );
695+ t_CKBOOL (* const get_mvar_object)( CK_DL_API, Object object, const char * name, Object & value );
692696 // function pointer for set_string()
693− t_CKBOOL (* const set_string)( CK_DL_API, String string, std::string &value );
697+ t_CKBOOL (* const set_string)( CK_DL_API, String string, const char * value );
694698 } * const object;
695−
699+
696700 Api() :
697701 vm(new VMApi),
698702 object(new ObjectApi)
699703 { }
700−
704+
701705 private:
702706 Api( Api & a ) :
703707 vm(a.vm),
704708 object(a.object)
705709 { assert(0); };
706−
710+
707711 Api & operator=( Api & a ) { assert(0); return a; }
708712 };
709713 }
@@ -720,31 +724,33 @@ private: · 10 unmodified lines
720724
721725 #error ChucK not support on Mac OS X 10.3 or lower
722726
723−#elif defined(__WINDOWS_DS__) || defined(__WINDOWS_ASIO__)
724−
725− #ifdef __cplusplus
726− extern "C" {
727− #endif
728−
729− #define RTLD_LAZY 0x1
730− #define RTLD_NOW 0x2
731− #define RTLD_LOCAL 0x4
732− #define RTLD_GLOBAL 0x8
733− #define RTLD_NOLOAD 0x10
734− #define RTLD_SHARED 0x20 /* not used, the default */
735− #define RTLD_UNSHARED 0x40
736− #define RTLD_NODELETE 0x80
737− #define RTLD_LAZY_UNDEF 0x100
738−
739− void * dlopen( const char * path, int mode );
740− void * dlsym( void * handle, const char * symbol );
741− const char * dlerror( void );
742− int dlclose( void * handle );
743− static char dlerror_buffer[128];
744−
745− #ifdef __cplusplus
746− }
747− #endif
727+#elif defined(__WINDOWS_DS__) || defined(__WINDOWS_ASIO__)
728+
729+ #ifdef __cplusplus
730+ extern "C" {
731+ #endif
732+
733+ #define RTLD_LAZY 0x1
734+ #define RTLD_NOW 0x2
735+ #define RTLD_LOCAL 0x4
736+ #define RTLD_GLOBAL 0x8
737+ #define RTLD_NOLOAD 0x10
738+ #define RTLD_SHARED 0x20 /* not used, the default */
739+ #define RTLD_UNSHARED 0x40
740+ #define RTLD_NODELETE 0x80
741+ #define RTLD_LAZY_UNDEF 0x100
742+
743+ void * dlopen( const char * path, int mode );
744+ void * dlsym( void * handle, const char * symbol );
745+ const char * dlerror( void );
746+ int dlclose( void * handle );
747+ // 1.4.2.0 (ge) | added DLERROR_BUFFER_LENGTH
748+ #define DLERROR_BUFFER_LENGTH 128
749+ static char dlerror_buffer[DLERROR_BUFFER_LENGTH];
750+
751+ #ifdef __cplusplus
752+ }
753+ #endif
748754
749755 #else
750756 #include "dlfcn.h"
src/core/chuck_emit.cpp+357−250
@@ -35,6 +35,7 @@ · 34 unmodified lines
3535 #include "chuck_errmsg.h"
3636 #include "chuck_instr.h"
3737 #include "chuck_globals.h" // added 1.4.1.0
38+#include "chuck_parse.h" // added 1.4.2.1
3839 #include <sstream>
3940 #include <iostream>
4041
@@ -93,7 +94,7 @@ t_CKBOOL emit_engine_instantiate_object( Chuck_Emitter * emit, Chuck_Type * type · 52 unmodified lines
9394 a_Array_Sub array, t_CKBOOL is_ref );
9495 t_CKBOOL emit_engine_emit_spork( Chuck_Emitter * emit, a_Exp_Func_Call exp );
9596 t_CKBOOL emit_engine_emit_cast( Chuck_Emitter * emit, Chuck_Type * to, Chuck_Type * from );
96−t_CKBOOL emit_engine_emit_symbol( Chuck_Emitter * emit, S_Symbol symbol,
97+t_CKBOOL emit_engine_emit_symbol( Chuck_Emitter * emit, S_Symbol symbol,
9798 Chuck_Value * v, t_CKBOOL emit_var, int linepos );
9899 // disabled until further notice (added 1.3.0.0)
99100 // t_CKBOOL emit_engine_emit_spork( Chuck_Emitter * emit, a_Stmt stmt );
@@ -139,7 +140,7 @@ t_CKBOOL emit_engine_shutdown( Chuck_Emitter *& emit ) · 39 unmodified lines
139140 delete emit;
140141 emit = NULL;
141142
142− return TRUE;
143+ return TRUE;
143144 }
144145
145146
@@ -226,7 +227,7 @@ Chuck_VM_Code * emit_engine_emit_prog( Chuck_Emitter * emit, a_Program prog, · 80 unmodified lines
226227 // the next
227228 prog = prog->next;
228229 }
229−
230+
230231 // 1.4.1.0 (jack): error-checking: was dac-replacement initted?
231232 // (see chuck_compile.h for an explanation on replacement dacs)
232233 if( emit->should_replace_dac )
@@ -238,7 +239,7 @@ Chuck_VM_Code * emit_engine_emit_prog( Chuck_Emitter * emit, a_Program prog, · 5 unmodified lines
238239 EM_error2( 0, " ... (hint: need to declare this variable as a global UGen)" );
239240 ret = FALSE;
240241 }
241−
242+
242243 // (also need to make sure it was constructed; see runtime error in
243244 // Chuck_Instr_Reg_Push_Global)
244245 }
@@ -314,8 +315,17 @@ Chuck_VM_Code * emit_to_code( Chuck_Code * in, · 69 unmodified lines
314315 // uh
315316 EM_error2( 0, "-------" );
316317 for( t_CKUINT i = 0; i < code->num_instr; i++ )
317− EM_error2( 0, "[%i] %s( %s )", i,
318− code->instr[i]->name(), code->instr[i]->params() );
318+ {
319+ // check code str | 1.4.2.1 (ge) added
320+ if( code->instr[i]->m_codestr )
321+ {
322+ // print the reconstructed code str
323+ EM_error2( 0, "%s", code->instr[i]->m_codestr->c_str() );
324+ }
325+ // print the instruction
326+ EM_error2( 0, "[%i] %s( %s )", i,
327+ code->instr[i]->name(), code->instr[i]->params() );
328+ }
319329 EM_error2( 0, "-------\n" );
320330 }
321331
@@ -377,15 +387,25 @@ t_CKBOOL emit_engine_emit_stmt( Chuck_Emitter * emit, a_Stmt stmt, t_CKBOOL pop · 55 unmodified lines
377387
378388 // return
379389 t_CKBOOL ret = TRUE;
390+ // next index
391+ t_CKUINT nextIndex = 0;
392+ // expression string
393+ string codestr;
380394
381395 // loop over statements
382396 switch( stmt->s_type )
383397 {
384398 case ae_stmt_exp: // expression statement
399+ // get str
400+ codestr = absyn2str( stmt->stmt_exp );
401+ // get next index | 1.4.2.1 (ge) added
402+ nextIndex = emit->next_index();
403+
385404 // emit it
386405 ret = emit_engine_emit_exp( emit, stmt->stmt_exp );
387406 if( !ret )
388407 return FALSE;
408+
389409 // need to pop the final value from stack
390410 if( ret && pop && stmt->stmt_exp->type->size > 0 )
391411 {
@@ -398,17 +418,36 @@ t_CKBOOL emit_engine_emit_stmt( Chuck_Emitter * emit, a_Stmt stmt, t_CKBOOL pop · 6 unmodified lines
398418 if( exp->s_type == ae_exp_primary && exp->primary.s_type == ae_primary_hack )
399419 exp = exp->primary.exp;
400420
401− // HACK!
421+ // need to pop in reverse order
422+ vector<a_Exp> pxe;
423+ // go
402424 while( exp )
403425 {
426+ pxe.push_back( exp );
427+ exp = exp->next;
428+ }
429+
430+ // loop over the expression that is the statement (prior to 1.4.2.1 comment: "HACK" hmmm...)
431+ for( t_CKINT i = pxe.size()-1; i >= 0; i-- )
432+ // for( t_CKINT i = 0; i < pxe.size(); i++ )
433+ {
434+ exp = pxe[i];
404435 // if decl, then expect only one word per var
405436 // added 1.3.1.0: iskindofint -- since on some 64-bit systems sz_INT == sz_FLOAT
406437 if( exp->s_type == ae_exp_decl )
438+ {
407439 // (added 1.3.1.0 -- multiply by type size; #64-bit)
408440 // (fixed 1.3.1.2 -- uh... decl should also be int-sized, so changed to INT/WORD)
409441 emit->append( new Chuck_Instr_Reg_Pop_Word4( exp->decl.num_var_decls * sz_INT / sz_WORD ) );
442+ }
410443 else if( exp->type->size == sz_INT && iskindofint(emit->env, exp->type) ) // ISSUE: 64-bit (fixed 1.3.1.0)
411− emit->append( new Chuck_Instr_Reg_Pop_Word );
444+ {
445+ // is an object left on the stack for the stmt
446+ if( exp->s_type == ae_exp_func_call && isobj(emit->env, exp->type) )
447+ { emit->append( new Chuck_Instr_Release_Object3_Pop_Word ); }
448+ else // not an object
449+ { emit->append( new Chuck_Instr_Reg_Pop_Word ); }
450+ }
412451 else if( exp->type->size == sz_FLOAT ) // ISSUE: 64-bit (fixed 1.3.1.0)
413452 emit->append( new Chuck_Instr_Reg_Pop_Word2 );
414453 else if( exp->type->size == sz_COMPLEX ) // ISSUE: 64-bit (fixed 1.3.1.0)
@@ -424,11 +463,15 @@ t_CKBOOL emit_engine_emit_stmt( Chuck_Emitter * emit, a_Stmt stmt, t_CKBOOL pop · 9 unmodified lines
424463 exp->type->size );
425464 return FALSE;
426465 }
427−
428− // go
429− exp = exp->next;
430466 }
431467 }
468+
469+ // see if we added at least one instruction
470+ if( nextIndex < emit->next_index() )
471+ {
472+ // set codestr (for instruction dump)
473+ emit->code->code[nextIndex]->set_codestr( codestr );
474+ }
432475 break;
433476
434477 case ae_stmt_if: // if statement
@@ -445,7 +488,7 @@ t_CKBOOL emit_engine_emit_stmt( Chuck_Emitter * emit, a_Stmt stmt, t_CKBOOL pop · 10 unmodified lines
445488 else
446489 ret = emit_engine_emit_while( emit, &stmt->stmt_while );
447490 break;
448−
491+
449492 case ae_stmt_until: // until statement
450493 if( stmt->stmt_until.is_do )
451494 ret = emit_engine_emit_do_until( emit, &stmt->stmt_until );
@@ -469,29 +512,29 @@ t_CKBOOL emit_engine_emit_stmt( Chuck_Emitter * emit, a_Stmt stmt, t_CKBOOL pop · 17 unmodified lines
469512 case ae_stmt_code: // code segment
470513 ret = emit_engine_emit_code_segment( emit, &stmt->stmt_code );
471514 break;
472−
515+
473516 case ae_stmt_continue: // continue statement
474517 ret = emit_engine_emit_continue( emit, &stmt->stmt_continue );
475518 break;
476−
519+
477520 case ae_stmt_return: // return statement
478521 ret = emit_engine_emit_return( emit, &stmt->stmt_return );
479522 break;
480−
523+
481524 case ae_stmt_case: // case statement
482525 // not implemented
483526 ret = FALSE;
484527 // ret = emit_engine_emit_case( emit, &stmt->stmt_case );
485528 break;
486−
529+
487530 case ae_stmt_gotolabel: // goto label statement
488531 // not implemented
489532 ret = FALSE;
490533 // ret = emit_engine_emit_gotolabel( emit, &stmt->stmt_case );
491534 break;
492−
535+
493536 default: // bad
494− EM_error2( stmt->linepos,
537+ EM_error2( stmt->linepos,
495538 "(emit): internal error: unhandled statement type '%i'...",
496539 stmt->s_type );
497540 break;
@@ -535,7 +578,7 @@ t_CKBOOL emit_engine_emit_if( Chuck_Emitter * emit, a_Stmt_If stmt ) · 37 unmodified lines
535578 emit->append( new Chuck_Instr_Reg_Push_Imm2( 0.0 ) );
536579 op = new Chuck_Instr_Branch_Eq_double( 0 );
537580 break;
538−
581+
539582 default:
540583 // check for IO
541584 if( isa( stmt->cond->type, emit->env->t_io ) )
@@ -571,7 +614,7 @@ t_CKBOOL emit_engine_emit_if( Chuck_Emitter * emit, a_Stmt_If stmt ) · 29 unmodified lines
571614
572615 // emit the skip to the end
573616 emit->append( op2 = new Chuck_Instr_Goto(0) );
574−
617+
575618 // set the op's target
576619 op->set( emit->next_index() );
577620
@@ -592,7 +635,7 @@ t_CKBOOL emit_engine_emit_if( Chuck_Emitter * emit, a_Stmt_If stmt ) · 14 unmodified lines
592635
593636 // pop stack
594637 emit->pop_scope();
595−
638+
596639 return ret;
597640 }
598641
@@ -644,7 +687,7 @@ t_CKBOOL emit_engine_emit_for( Chuck_Emitter * emit, a_Stmt_For stmt ) · 45 unmodified lines
644687 emit->append( new Chuck_Instr_Reg_Push_Imm2( 0.0 ) );
645688 op = new Chuck_Instr_Branch_Eq_double( 0 );
646689 break;
647−
690+
648691 default:
649692 // check for IO
650693 if( isa( stmt->c2->stmt_exp->type, emit->env->t_io ) )
@@ -671,10 +714,10 @@ t_CKBOOL emit_engine_emit_for( Chuck_Emitter * emit, a_Stmt_For stmt ) · 20 unmodified lines
671714 ret = emit_engine_emit_stmt( emit, stmt->body );
672715 if( !ret )
673716 return FALSE;
674−
717+
675718 // added 1.3.1.1: pop scope for loop body
676719 emit->pop_scope();
677−
720+
678721 // continue here
679722 cont_index = emit->next_index();
680723
@@ -708,7 +751,7 @@ t_CKBOOL emit_engine_emit_for( Chuck_Emitter * emit, a_Stmt_For stmt ) · 27 unmodified lines
708751 // advance
709752 e = e->next;
710753 }
711−
754+
712755 // pop (changed to Chuck_Instr_Reg_Pop_Word4 in 1.3.1.0)
713756 if( num_words > 0 ) emit->append( new Chuck_Instr_Reg_Pop_Word4( num_words ) );
714757 }
@@ -771,7 +814,7 @@ t_CKBOOL emit_engine_emit_while( Chuck_Emitter * emit, a_Stmt_While stmt ) · 56 unmodified lines
771814 ret = emit_engine_emit_exp( emit, stmt->cond );
772815 if( !ret )
773816 return FALSE;
774−
817+
775818 // the condition
776819 switch( stmt->cond->type->xid )
777820 {
@@ -787,7 +830,7 @@ t_CKBOOL emit_engine_emit_while( Chuck_Emitter * emit, a_Stmt_While stmt ) · 9 unmodified lines
787830 emit->append( new Chuck_Instr_Reg_Push_Imm2( 0.0 ) );
788831 op = new Chuck_Instr_Branch_Eq_double( 0 );
789832 break;
790−
833+
791834 default:
792835 // check for IO
793836 if( isa( stmt->cond->type, emit->env->t_io ) )
@@ -803,24 +846,24 @@ t_CKBOOL emit_engine_emit_while( Chuck_Emitter * emit, a_Stmt_While stmt ) · 9 unmodified lines
803846 stmt->cond->type->name.c_str() );
804847 return FALSE;
805848 }
806−
849+
807850 // append the op
808851 emit->append( op );
809852
810853 // added 1.3.1.1: new scope just for loop body
811854 emit->push_scope();
812−
855+
813856 // emit the body
814857 ret = emit_engine_emit_stmt( emit, stmt->body );
815858 if( !ret )
816859 return FALSE;
817−
860+
818861 // added 1.3.1.1: pop scope for loop body
819862 emit->pop_scope();
820−
863+
821864 // go back to do check the condition
822865 emit->append( new Chuck_Instr_Goto( start_index ) );
823−
866+
824867 // set the op's target
825868 op->set( emit->next_index() );
826869
@@ -860,7 +903,7 @@ t_CKBOOL emit_engine_emit_do_while( Chuck_Emitter * emit, a_Stmt_While stmt ) · 33 unmodified lines
860903 t_CKBOOL ret = TRUE;
861904 Chuck_Instr_Branch_Op * op = NULL;
862905 t_CKUINT start_index = emit->next_index();
863−
906+
864907 // push stack
865908 emit->push_scope();
866909
@@ -876,7 +919,7 @@ t_CKBOOL emit_engine_emit_do_while( Chuck_Emitter * emit, a_Stmt_While stmt ) · 9 unmodified lines
876919 ret = emit_engine_emit_stmt( emit, stmt->body );
877920 if( !ret )
878921 return FALSE;
879−
922+
880923 // added 1.3.1.1: pop scope for loop body
881924 emit->pop_scope();
882925
@@ -884,7 +927,7 @@ t_CKBOOL emit_engine_emit_do_while( Chuck_Emitter * emit, a_Stmt_While stmt ) · 1 unmodified line
884927 ret = emit_engine_emit_exp( emit, stmt->cond );
885928 if( !ret )
886929 return FALSE;
887−
930+
888931 // the condition
889932 switch( stmt->cond->type->xid )
890933 {
@@ -900,7 +943,7 @@ t_CKBOOL emit_engine_emit_do_while( Chuck_Emitter * emit, a_Stmt_While stmt ) · 9 unmodified lines
900943 emit->append( new Chuck_Instr_Reg_Push_Imm2( 0.0 ) );
901944 op = new Chuck_Instr_Branch_Neq_double( 0 );
902945 break;
903−
946+
904947 default:
905948 // check for IO
906949 if( isa( stmt->cond->type, emit->env->t_io ) )
@@ -916,7 +959,7 @@ t_CKBOOL emit_engine_emit_do_while( Chuck_Emitter * emit, a_Stmt_While stmt ) · 9 unmodified lines
916959 stmt->cond->type->c_name() );
917960 return FALSE;
918961 }
919−
962+
920963 // append the op
921964 emit->append( op );
922965
@@ -943,7 +986,7 @@ t_CKBOOL emit_engine_emit_do_while( Chuck_Emitter * emit, a_Stmt_While stmt ) · 20 unmodified lines
943986 emit->code->stack_cont.pop_back();
944987 // pop break stack
945988 emit->code->stack_break.pop_back();
946−
989+
947990 return ret;
948991 }
949992
@@ -989,7 +1032,7 @@ t_CKBOOL emit_engine_emit_until( Chuck_Emitter * emit, a_Stmt_Until stmt ) · 39 unmodified lines
9891032 emit->append( new Chuck_Instr_Reg_Push_Imm2( 0.0 ) );
9901033 op = new Chuck_Instr_Branch_Neq_double( 0 );
9911034 break;
992−
1035+
9931036 default:
9941037 // check for IO
9951038 if( isa( stmt->cond->type, emit->env->t_io ) )
@@ -1005,7 +1048,7 @@ t_CKBOOL emit_engine_emit_until( Chuck_Emitter * emit, a_Stmt_Until stmt ) · 9 unmodified lines
10051048 stmt->cond->type->name.c_str() );
10061049 return FALSE;
10071050 }
1008−
1051+
10091052 // append the op
10101053 emit->append( op );
10111054
@@ -1014,13 +1057,13 @@ t_CKBOOL emit_engine_emit_until( Chuck_Emitter * emit, a_Stmt_Until stmt ) · 2 unmodified lines
10141057
10151058 // emit the body
10161059 emit_engine_emit_stmt( emit, stmt->body );
1017−
1060+
10181061 // added 1.3.1.1: pop scope for loop body
10191062 emit->pop_scope();
10201063
10211064 // go back to do check the condition
10221065 emit->append( new Chuck_Instr_Goto( start_index ) );
1023−
1066+
10241067 // set the op's target
10251068 op->set( emit->next_index() );
10261069
@@ -1044,7 +1087,7 @@ t_CKBOOL emit_engine_emit_until( Chuck_Emitter * emit, a_Stmt_Until stmt ) · 17 unmodified lines
10441087 emit->code->stack_cont.pop_back();
10451088 // pop break stack
10461089 emit->code->stack_break.pop_back();
1047−
1090+
10481091 return ret;
10491092 }
10501093
@@ -1077,7 +1120,7 @@ t_CKBOOL emit_engine_emit_do_until( Chuck_Emitter * emit, a_Stmt_Until stmt ) · 26 unmodified lines
10771120 ret = emit_engine_emit_stmt( emit, stmt->body );
10781121 if( !ret )
10791122 return FALSE;
1080−
1123+
10811124 // added 1.3.1.1: pop scope for loop body
10821125 emit->pop_scope();
10831126
@@ -1135,7 +1178,7 @@ t_CKBOOL emit_engine_emit_do_until( Chuck_Emitter * emit, a_Stmt_Until stmt ) · 51 unmodified lines
11351178 emit->code->stack_cont.pop_back();
11361179 // pop break stack
11371180 emit->code->stack_break.pop_back();
1138−
1181+
11391182 return ret;
11401183 }
11411184
@@ -1150,7 +1193,7 @@ t_CKBOOL emit_engine_emit_loop( Chuck_Emitter * emit, a_Stmt_Loop stmt ) · 8 unmodified lines
11501193 {
11511194 t_CKBOOL ret = TRUE;
11521195 Chuck_Instr_Branch_Op * op = NULL;
1153−
1196+
11541197 Chuck_Instr * instr = NULL;
11551198
11561199 // push stack
@@ -1194,7 +1237,7 @@ t_CKBOOL emit_engine_emit_loop( Chuck_Emitter * emit, a_Stmt_Loop stmt ) · 37 unmodified lines
11941237
11951238 return FALSE;
11961239 }
1197−
1240+
11981241 // append the op
11991242 emit->append( op );
12001243
@@ -1209,16 +1252,16 @@ t_CKBOOL emit_engine_emit_loop( Chuck_Emitter * emit, a_Stmt_Loop stmt ) · 8 unmodified lines
12091252 ret = emit_engine_emit_stmt( emit, stmt->body );
12101253 if( !ret )
12111254 return FALSE;
1212−
1255+
12131256 // added 1.3.1.1: pop scope for loop body
12141257 emit->pop_scope();
1215−
1258+
12161259 // go back to do check the condition
12171260 emit->append( new Chuck_Instr_Goto( start_index ) );
1218−
1261+
12191262 // set the op's target
12201263 op->set( emit->next_index() );
1221−
1264+
12221265 // pop the loop counter
12231266 emit->append( new Chuck_Instr_Pop_Loop_Counter );
12241267
@@ -1260,7 +1303,7 @@ t_CKBOOL emit_engine_emit_break( Chuck_Emitter * emit, a_Stmt_Break br ) · 35 unmodified lines
12601303 emit->append( op );
12611304 // remember
12621305 emit->code->stack_break.push_back( op );
1263−
1306+
12641307 return TRUE;
12651308 }
12661309
@@ -1291,12 +1334,27 @@ t_CKBOOL emit_engine_emit_continue( Chuck_Emitter * emit, a_Stmt_Continue cont ) · 24 unmodified lines
12911334 //-----------------------------------------------------------------------------
12921335 t_CKBOOL emit_engine_emit_return( Chuck_Emitter * emit, a_Stmt_Return stmt )
12931336 {
1337+ // emit the value
12941338 if( !emit_engine_emit_exp( emit, stmt->val ) )
12951339 return FALSE;
12961340
1341+ // if return is an object type
1342+ if( stmt->val && isobj( emit->env, stmt->val->type ) )
1343+ {
1344+ // add reference (to be released by the function caller)
1345+ emit->append( new Chuck_Instr_Reg_AddRef_Object3 );
1346+ }
1347+
1348+ // 1.4.2.1 (ge) | traverse and unwind current scope frames, release object
1349+ // references given the current state of the stack frames; every `return`
1350+ // statement needs its own scope unwinding; FYI: this does not change the
1351+ // scope frames, which is needed to continue compilation for the rest
1352+ // of the function; this does emit instructions (e.g., Release_Object2)
1353+ // associated with this traversal action (also see 'break' and 'continue')
1354+ emit->traverse_scope_on_jump();
1355+
12971356 // emit return
12981357 // emit->append( new Chuck_Instr_Func_Return );
1299−
13001358 // determine where later
13011359 Chuck_Instr_Goto * instr = new Chuck_Instr_Goto( 0 );
13021360 emit->append( instr );
@@ -1329,7 +1387,7 @@ t_CKBOOL emit_engine_emit_exp( Chuck_Emitter * emit, a_Exp exp, t_CKBOOL doAddRe · 26 unmodified lines
13291387 // for now...
13301388 // assert( exp->next == NULL );
13311389
1332− // loop over
1390+ // loop over
13331391 while( exp )
13341392 {
13351393 switch( exp->s_type )
@@ -1395,7 +1453,7 @@ t_CKBOOL emit_engine_emit_exp( Chuck_Emitter * emit, a_Exp exp, t_CKBOOL doAddRe · 59 unmodified lines
13951453 // break;
13961454
13971455 default:
1398− EM_error2( exp->linepos,
1456+ EM_error2( exp->linepos,
13991457 "(emit): internal error: unhandled expression type '%i'...",
14001458 exp->s_type );
14011459 return FALSE;
@@ -1405,7 +1463,7 @@ t_CKBOOL emit_engine_emit_exp( Chuck_Emitter * emit, a_Exp exp, t_CKBOOL doAddRe · 3 unmodified lines
14051463 if( exp->cast_to != NULL )
14061464 if( !emit_engine_emit_cast( emit, exp->cast_to, exp->type ) )
14071465 return FALSE;
1408−
1466+
14091467 // check if we need to handle ref (added 1.3.0.0)
14101468 // (NOTE: cast shouldn't matter since pointer width should remain constant)
14111469 if( doAddRef && isobj( emit->env, exp->type ) )
@@ -1434,17 +1492,17 @@ t_CKBOOL emit_engine_emit_exp_binary( Chuck_Emitter * emit, a_Exp_Binary binary · 22 unmodified lines
14341492
14351493 t_CKBOOL left = FALSE;
14361494 t_CKBOOL right = FALSE;
1437−
1495+
14381496 // hack to allow && to terminate as soon as possible - spencer
14391497 // i.e. in ( 0 && f() ) the function f() will not be called
14401498 // (obviates need for boolean AND instruction)
14411499 if( binary->op == ae_op_and )
14421500 {
14431501 Chuck_Instr_Branch_Op * op;
1444−
1502+
14451503 // push default result
14461504 emit->append( new Chuck_Instr_Reg_Push_Imm( 0 ) );
1447−
1505+
14481506 left = emit_engine_emit_exp( emit, binary->lhs );
14491507 if( !left )
14501508 return FALSE;
@@ -1463,39 +1521,39 @@ t_CKBOOL emit_engine_emit_exp_binary( Chuck_Emitter * emit, a_Exp_Binary binary · 12 unmodified lines
14631521
14641522 // set branch location
14651523 op->set( emit->next_index() );
1466−
1524+
14671525 return TRUE;
14681526 }
1469−
1527+
14701528 // hack to allow || to terminate as soon as possible - spencer
14711529 // i.e. in ( 1 || f() ) the function f() will not be called
14721530 // (obviates need for boolean OR instruction)
14731531 else if( binary->op == ae_op_or )
14741532 {
14751533 Chuck_Instr_Branch_Op * op;
1476−
1534+
14771535 // push default result
14781536 emit->append( new Chuck_Instr_Reg_Push_Imm( 1 ) );
1479−
1537+
14801538 left = emit_engine_emit_exp( emit, binary->lhs );
14811539 if( !left )
1482− return FALSE;
1483−
1540+ return FALSE;
1541+
14841542 // compare to 0; use default result if non-zero
14851543 emit->append( new Chuck_Instr_Reg_Push_Imm( 0 ) );
14861544 emit->append( op = new Chuck_Instr_Branch_Neq_int( 0 ) );
1487−
1545+
14881546 // pop default result
14891547 emit->append( new Chuck_Instr_Reg_Pop_Word );
1490−
1548+
14911549 // result of whole expression is now result of rhs
14921550 right = emit_engine_emit_exp( emit, binary->rhs );
14931551 if( !right )
14941552 return FALSE;
1495−
1553+
14961554 // set branch location
14971555 op->set( emit->next_index() );
1498−
1556+
14991557 return TRUE;
15001558 }
15011559
@@ -1543,7 +1601,7 @@ t_CKBOOL emit_engine_emit_op( Chuck_Emitter * emit, ae_Operator op, a_Exp lhs, a · 41 unmodified lines
15431601
15441602 // emit op
15451603 switch( op )
1546− {
1604+ {
15471605 // ----------------------------- num --------------------------------------
15481606 case ae_op_plus:
15491607 // time + dur
@@ -1631,7 +1689,7 @@ t_CKBOOL emit_engine_emit_op( Chuck_Emitter * emit, ae_Operator op, a_Exp lhs, a · 81 unmodified lines
16311689 }
16321690 }
16331691 break;
1634−
1692+
16351693 case ae_op_plus_chuck:
16361694 // time advance
16371695 if( left == te_dur && right == te_time && rhs->s_meta == ae_meta_var &&
@@ -1741,7 +1799,7 @@ t_CKBOOL emit_engine_emit_op( Chuck_Emitter * emit, ae_Operator op, a_Exp lhs, a · 103 unmodified lines
17411799 }
17421800 }
17431801 break;
1744−
1802+
17451803 case ae_op_minus_chuck:
17461804 if( ( left == te_dur && right == te_time ) ) // time - dur = time
17471805 emit->append( instr = new Chuck_Instr_Minus_double_Assign );
@@ -1822,7 +1880,7 @@ t_CKBOOL emit_engine_emit_op( Chuck_Emitter * emit, ae_Operator op, a_Exp lhs, a · 74 unmodified lines
18221880 }
18231881 }
18241882 break;
1825−
1883+
18261884 case ae_op_times_chuck:
18271885 // check
18281886 if( left == te_float && right == te_vec3 )
@@ -1886,10 +1944,10 @@ t_CKBOOL emit_engine_emit_op( Chuck_Emitter * emit, ae_Operator op, a_Exp lhs, a · 57 unmodified lines
18861944 break;
18871945
18881946 default: break;
1889− }
1947+ }
18901948 }
18911949 break;
1892−
1950+
18931951 case ae_op_divide_chuck:
18941952 // reverse
18951953 if( ( left == te_dur && right == te_time ) ) // time / dur = float
@@ -1932,18 +1990,18 @@ t_CKBOOL emit_engine_emit_op( Chuck_Emitter * emit, ae_Operator op, a_Exp lhs, a · 36 unmodified lines
19321990 case te_int:
19331991 emit->append( instr = new Chuck_Instr_Binary_Or );
19341992 break;
1935−
1993+
19361994 default: break;
19371995 }
19381996 break;
1939−
1997+
19401998 case ae_op_s_or_chuck:
19411999 switch( left )
19422000 {
19432001 case te_int:
19442002 emit->append( instr = new Chuck_Instr_Binary_Or_Assign );
19452003 break;
1946−
2004+
19472005 default: break;
19482006 }
19492007 break;
@@ -1998,7 +2056,7 @@ t_CKBOOL emit_engine_emit_op( Chuck_Emitter * emit, ae_Operator op, a_Exp lhs, a · 48 unmodified lines
19982056 default: break;
19992057 }
20002058 break;
2001−
2059+
20022060 case ae_op_shift_right:
20032061 switch( left )
20042062 {
@@ -2080,7 +2138,7 @@ t_CKBOOL emit_engine_emit_op( Chuck_Emitter * emit, ae_Operator op, a_Exp lhs, a · 75 unmodified lines
20802138 default: break;
20812139 }
20822140 break;
2083−
2141+
20842142 case ae_op_s_xor_chuck:
20852143 switch( left )
20862144 {
@@ -2101,11 +2159,11 @@ t_CKBOOL emit_engine_emit_op( Chuck_Emitter * emit, ae_Operator op, a_Exp lhs, a · 14 unmodified lines
21012159
21022160 return TRUE;
21032161 }
2104−
2162+
21052163 case ae_op_unchuck:
21062164 {
21072165 a_Exp cl = lhs, cr = rhs;
2108−
2166+
21092167 // TODO: cross chuck
21102168 assert( cl->next == NULL && cr->next == NULL );
21112169 while( cr )
@@ -2117,17 +2175,17 @@ t_CKBOOL emit_engine_emit_op( Chuck_Emitter * emit, ae_Operator op, a_Exp lhs, a · 5 unmodified lines
21172175 return FALSE;
21182176 cl = cl->next;
21192177 }
2120−
2178+
21212179 cr = cr->next;
21222180 }
21232181
21242182 return TRUE;
21252183 }
2126−
2184+
21272185 case ae_op_upchuck:
21282186 {
21292187 a_Exp cl = lhs, cr = rhs;
2130−
2188+
21312189 // TODO: cross chuck
21322190 assert( cl->next == NULL && cr->next == NULL );
21332191 while( cr )
@@ -2139,7 +2197,7 @@ t_CKBOOL emit_engine_emit_op( Chuck_Emitter * emit, ae_Operator op, a_Exp lhs, a · 5 unmodified lines
21392197 return FALSE;
21402198 cl = cl->next;
21412199 }
2142−
2200+
21432201 cr = cr->next;
21442202 }
21452203
@@ -2149,7 +2207,7 @@ t_CKBOOL emit_engine_emit_op( Chuck_Emitter * emit, ae_Operator op, a_Exp lhs, a · 3 unmodified lines
21492207 case ae_op_at_chuck:
21502208 {
21512209 a_Exp cl = lhs, cr = rhs;
2152−
2210+
21532211 // TODO: cross chuck
21542212 assert( cl->next == NULL && cr->next == NULL );
21552213 while( cr )
@@ -2161,17 +2219,17 @@ t_CKBOOL emit_engine_emit_op( Chuck_Emitter * emit, ae_Operator op, a_Exp lhs, a · 5 unmodified lines
21612219 return FALSE;
21622220 cl = cl->next;
21632221 }
2164−
2222+
21652223 cr = cr->next;
21662224 }
21672225
21682226 return TRUE;
21692227 }
2170−
2228+
21712229 case ae_op_s_chuck:
21722230 break;
21732231
2174− // -------------------------------- bool -----------------------------------
2232+ // -------------------------------- bool -----------------------------------
21752233 case ae_op_eq:
21762234 if( isa( t_left, emit->env->t_string ) && isa( t_right, emit->env->t_string )
21772235 && !isa( t_left, emit->env->t_null ) && !isa( t_right, emit->env->t_null ) ) // !null
@@ -2208,7 +2266,7 @@ t_CKBOOL emit_engine_emit_op( Chuck_Emitter * emit, ae_Operator op, a_Exp lhs, a · 30 unmodified lines
22082266 }
22092267 }
22102268 break;
2211−
2269+
22122270 case ae_op_neq:
22132271 if( isa( t_left, emit->env->t_string ) && isa( t_right, emit->env->t_string )
22142272 && !isa( t_left, emit->env->t_null ) && !isa( t_right, emit->env->t_null ) ) // !null
@@ -2246,7 +2304,7 @@ t_CKBOOL emit_engine_emit_op( Chuck_Emitter * emit, ae_Operator op, a_Exp lhs, a · 31 unmodified lines
22462304 }
22472305 }
22482306 break;
2249−
2307+
22502308 case ae_op_lt:
22512309 switch( left )
22522310 {
@@ -2268,7 +2326,7 @@ t_CKBOOL emit_engine_emit_op( Chuck_Emitter * emit, ae_Operator op, a_Exp lhs, a · 15 unmodified lines
22682326 break;
22692327 }
22702328 break;
2271−
2329+
22722330 case ae_op_le:
22732331 switch( left )
22742332 {
@@ -2309,7 +2367,7 @@ t_CKBOOL emit_engine_emit_op( Chuck_Emitter * emit, ae_Operator op, a_Exp lhs, a · 34 unmodified lines
23092367 break;
23102368 }
23112369 break;
2312−
2370+
23132371 case ae_op_gt:
23142372 switch( left )
23152373 {
@@ -2331,7 +2389,7 @@ t_CKBOOL emit_engine_emit_op( Chuck_Emitter * emit, ae_Operator op, a_Exp lhs, a · 15 unmodified lines
23312389 break;
23322390 }
23332391 break;
2334−
2392+
23352393 case ae_op_ge:
23362394 switch( left )
23372395 {
@@ -2353,7 +2411,7 @@ t_CKBOOL emit_engine_emit_op( Chuck_Emitter * emit, ae_Operator op, a_Exp lhs, a · 15 unmodified lines
23532411 break;
23542412 }
23552413 break;
2356−
2414+
23572415 case ae_op_and:
23582416 switch( left )
23592417 {
@@ -2364,7 +2422,7 @@ t_CKBOOL emit_engine_emit_op( Chuck_Emitter * emit, ae_Operator op, a_Exp lhs, a · 4 unmodified lines
23642422 default: break;
23652423 }
23662424 break;
2367−
2425+
23682426 case ae_op_or:
23692427 switch( left )
23702428 {
@@ -2426,7 +2484,7 @@ t_CKBOOL emit_engine_emit_op( Chuck_Emitter * emit, ae_Operator op, a_Exp lhs, a · 55 unmodified lines
24262484 t_left->c_name(), op2str( op ), t_right->c_name() );
24272485 return FALSE;
24282486 }
2429−
2487+
24302488 // make sure emit
24312489 if( !instr )
24322490 {
@@ -2435,7 +2493,7 @@ t_CKBOOL emit_engine_emit_op( Chuck_Emitter * emit, ae_Operator op, a_Exp lhs, a · 2 unmodified lines
24352493 t_left->c_name(), op2str( op ), t_right->c_name() );
24362494 return FALSE;
24372495 }
2438−
2496+
24392497 return TRUE;
24402498 }
24412499
@@ -2451,10 +2509,10 @@ t_CKBOOL emit_engine_emit_op_chuck( Chuck_Emitter * emit, a_Exp lhs, a_Exp rhs, · 9 unmodified lines
24512509 // any implicit cast happens before this
24522510 Chuck_Type * left = lhs->cast_to ? lhs->cast_to : lhs->type;
24532511 Chuck_Type * right = rhs->cast_to ? rhs->cast_to : rhs->type;
2454−
2512+
24552513 // the pointer
24562514 Chuck_Instr * instr = NULL;
2457−
2515+
24582516 // ugen => ugen
24592517 if( isa( left, emit->env->t_ugen ) && isa( right, emit->env->t_ugen ) )
24602518 {
@@ -2464,7 +2522,7 @@ t_CKBOOL emit_engine_emit_op_chuck( Chuck_Emitter * emit, a_Exp lhs, a_Exp rhs, · 3 unmodified lines
24642522 // done
24652523 return TRUE;
24662524 }
2467−
2525+
24682526 // ugen[] => ugen[] (or permutation)
24692527 if( ( isa( left, emit->env->t_ugen ) || ( isa( left, emit->env->t_array ) && isa( left->array_type, emit->env->t_ugen ) ) ) &&
24702528 ( isa( right, emit->env->t_ugen ) || ( isa( right, emit->env->t_array ) && isa( right->array_type, emit->env->t_ugen ) ) ) )
@@ -2475,7 +2533,7 @@ t_CKBOOL emit_engine_emit_op_chuck( Chuck_Emitter * emit, a_Exp lhs, a_Exp rhs, · 4 unmodified lines
24752533 // done
24762534 return TRUE;
24772535 }
2478−
2536+
24792537 // time advance
24802538 if( isa( left, emit->env->t_dur ) && isa( right, emit->env->t_time ) && rhs->s_meta == ae_meta_var )
24812539 {
@@ -2492,7 +2550,7 @@ t_CKBOOL emit_engine_emit_op_chuck( Chuck_Emitter * emit, a_Exp lhs, a_Exp rhs, · 10 unmodified lines
24922550
24932551 return TRUE;
24942552 }
2495−
2553+
24962554 // time advance
24972555 if( isa( left, emit->env->t_event ) && isa( right, emit->env->t_time ) && rhs->s_meta == ae_meta_var &&
24982556 rhs->s_type == ae_exp_primary && !strcmp( "now", S_name(rhs->primary.var) ) )
@@ -2504,7 +2562,7 @@ t_CKBOOL emit_engine_emit_op_chuck( Chuck_Emitter * emit, a_Exp lhs, a_Exp rhs, · 5 unmodified lines
25042562
25052563 return TRUE;
25062564 }
2507−
2565+
25082566 // input
25092567 if( isa( left, emit->env->t_io ) )
25102568 {
@@ -2513,21 +2571,21 @@ t_CKBOOL emit_engine_emit_op_chuck( Chuck_Emitter * emit, a_Exp lhs, a_Exp rhs, · 2 unmodified lines
25132571 assert( rhs->s_meta == ae_meta_var );
25142572 emit->append( instr = new Chuck_Instr_IO_in_int );
25152573 instr->set_linepos( rhs->linepos );
2516− return TRUE;
2574+ return TRUE;
25172575 }
25182576 else if( isa( right, emit->env->t_float ) )
25192577 {
25202578 assert( rhs->s_meta == ae_meta_var );
25212579 emit->append( instr = new Chuck_Instr_IO_in_float );
25222580 instr->set_linepos( rhs->linepos );
2523− return TRUE;
2581+ return TRUE;
25242582 }
25252583 else if( isa( right, emit->env->t_string ) )
25262584 {
25272585 assert( rhs->s_meta == ae_meta_var );
25282586 emit->append( instr = new Chuck_Instr_IO_in_string );
25292587 instr->set_linepos( rhs->linepos );
2530− return TRUE;
2588+ return TRUE;
25312589 }
25322590 }
25332591
@@ -2535,7 +2593,7 @@ t_CKBOOL emit_engine_emit_op_chuck( Chuck_Emitter * emit, a_Exp lhs, a_Exp rhs, · 1 unmodified line
25352593 if( isa( right, emit->env->t_function ) )
25362594 {
25372595 assert( binary->ck_func != NULL );
2538−
2596+
25392597 // emit
25402598 return emit_engine_emit_exp_func_call( emit, binary->ck_func, binary->self->type, binary->linepos );
25412599 }
@@ -2574,7 +2632,7 @@ t_CKBOOL emit_engine_emit_op_unchuck( Chuck_Emitter * emit, a_Exp lhs, a_Exp rhs · 32 unmodified lines
25742632 // any implicit cast happens before this
25752633 Chuck_Type * left = lhs->cast_to ? lhs->cast_to : lhs->type;
25762634 Chuck_Type * right = rhs->cast_to ? rhs->cast_to : rhs->type;
2577−
2635+
25782636 // if ugen
25792637 if( isa( left, emit->env->t_ugen ) && isa( right, emit->env->t_ugen ) )
25802638 {
@@ -2588,7 +2646,7 @@ t_CKBOOL emit_engine_emit_op_unchuck( Chuck_Emitter * emit, a_Exp lhs, a_Exp rhs · 7 unmodified lines
25882646 left->c_name(), right->c_name() );
25892647 return FALSE;
25902648 }
2591−
2649+
25922650 return TRUE;
25932651 }
25942652
@@ -2636,7 +2694,7 @@ t_CKBOOL emit_engine_emit_op_at_chuck( Chuck_Emitter * emit, a_Exp lhs, a_Exp rh · 41 unmodified lines
26362694 // any implicit cast happens before this
26372695 Chuck_Type * left = lhs->cast_to ? lhs->cast_to : lhs->type;
26382696 Chuck_Type * right = rhs->cast_to ? rhs->cast_to : rhs->type;
2639−
2697+
26402698 // assignment or something else
26412699 if( isa( left, right ) )
26422700 {
@@ -2743,7 +2801,7 @@ t_CKBOOL emit_engine_emit_exp_unary( Chuck_Emitter * emit, a_Exp_Unary unary ) · 100 unmodified lines
27432801 emit->append( new Chuck_Instr_PreInc_int );
27442802 else
27452803 {
2746− EM_error2( unary->linepos,
2804+ EM_error2( unary->linepos,
27472805 "(emit): internal error: unhandled type '%s' for pre '++'' operator",
27482806 unary->exp->type->c_name() );
27492807 return FALSE;
@@ -2764,7 +2822,7 @@ t_CKBOOL emit_engine_emit_exp_unary( Chuck_Emitter * emit, a_Exp_Unary unary ) · 14 unmodified lines
27642822 emit->append( new Chuck_Instr_PreDec_int );
27652823 else
27662824 {
2767− EM_error2( unary->linepos,
2825+ EM_error2( unary->linepos,
27682826 "(emit): internal error: unhandled type '%s' for pre '--' operator",
27692827 unary->exp->type->c_name() );
27702828 return FALSE;
@@ -2777,7 +2835,7 @@ t_CKBOOL emit_engine_emit_exp_unary( Chuck_Emitter * emit, a_Exp_Unary unary ) · 6 unmodified lines
27772835 emit->append( new Chuck_Instr_Complement_int );
27782836 else
27792837 {
2780− EM_error2( unary->linepos,
2838+ EM_error2( unary->linepos,
27812839 "(emit): internal error: unhandled type '%s' for '~' operator",
27822840 unary->exp->type->c_name() );
27832841 return FALSE;
@@ -2790,13 +2848,13 @@ t_CKBOOL emit_engine_emit_exp_unary( Chuck_Emitter * emit, a_Exp_Unary unary ) · 6 unmodified lines
27902848 emit->append( new Chuck_Instr_Not_int );
27912849 else
27922850 {
2793− EM_error2( unary->linepos,
2851+ EM_error2( unary->linepos,
27942852 "(emit): internal error: unhandled type '%s' for '!' operator",
27952853 unary->exp->type->c_name() );
27962854 return FALSE;
27972855 }
27982856 break;
2799−
2857+
28002858 case ae_op_minus:
28012859 // negate
28022860 if( equals( unary->exp->type, emit->env->t_int ) )
@@ -2805,7 +2863,7 @@ t_CKBOOL emit_engine_emit_exp_unary( Chuck_Emitter * emit, a_Exp_Unary unary ) · 2 unmodified lines
28052863 emit->append( new Chuck_Instr_Negate_double );
28062864 else
28072865 {
2808− EM_error2( unary->linepos,
2866+ EM_error2( unary->linepos,
28092867 "(emit): internal error: unhandled type '%s' for unary '-' operator",
28102868 unary->exp->type->c_name() );
28112869 return FALSE;
@@ -2845,12 +2903,12 @@ t_CKBOOL emit_engine_emit_exp_unary( Chuck_Emitter * emit, a_Exp_Unary unary ) · 33 unmodified lines
28452903 break;
28462904
28472905 default:
2848− EM_error2( unary->linepos,
2906+ EM_error2( unary->linepos,
28492907 "(emit): internal error: unhandled unary op '%s",
28502908 op2str( unary->op ) );
28512909 return FALSE;
28522910 }
2853−
2911+
28542912 return TRUE;
28552913 }
28562914
@@ -2953,20 +3011,20 @@ t_CKBOOL emit_engine_emit_exp_primary( Chuck_Emitter * emit, a_Exp_Primary exp ) · 96 unmodified lines
29533011 else
29543012 {
29553013 // emit the symbol
2956− return emit_engine_emit_symbol(
3014+ return emit_engine_emit_symbol(
29573015 emit, exp->var, exp->value, exp->self->emit_var, exp->linepos );
29583016 }
29593017 break;
2960−
3018+
29613019 case ae_primary_num:
29623020 memcpy( &temp, &exp->num, sizeof(temp) );
29633021 emit->append( new Chuck_Instr_Reg_Push_Imm( temp ) );
29643022 break;
2965−
3023+
29663024 case ae_primary_float:
29673025 emit->append( new Chuck_Instr_Reg_Push_Imm2( exp->fnum ) );
29683026 break;
2969−
3027+
29703028 case ae_primary_str:
29713029 // TODO: fix this
29723030 str = new Chuck_String();
@@ -2975,7 +3033,7 @@ t_CKBOOL emit_engine_emit_exp_primary( Chuck_Emitter * emit, a_Exp_Primary exp ) · 2 unmodified lines
29753033 // error (TODO: why is this a SAFE_RELEASE and not SAFE_DELETE?)
29763034 SAFE_RELEASE( str );
29773035 // error out
2978− CK_FPRINTF_STDERR(
3036+ CK_FPRINTF_STDERR(
29793037 "[chuck](emitter): OutOfMemory: while allocating string literal '%s'\n", exp->str );
29803038 return FALSE;
29813039 }
@@ -2985,7 +3043,7 @@ t_CKBOOL emit_engine_emit_exp_primary( Chuck_Emitter * emit, a_Exp_Primary exp ) · 3 unmodified lines
29853043 // add reference for string literal (added 1.3.0.2)
29863044 str->add_ref();
29873045 break;
2988−
3046+
29893047 case ae_primary_char:
29903048 emit->append( new Chuck_Instr_Reg_Push_Imm( str2char(exp->chr, exp->linepos ) ) );
29913049 break;
@@ -2999,17 +3057,17 @@ t_CKBOOL emit_engine_emit_exp_primary( Chuck_Emitter * emit, a_Exp_Primary exp ) · 7 unmodified lines
29993057 if( !emit_engine_emit_complex_lit( emit, exp->complex ) )
30003058 return FALSE;
30013059 break;
3002−
3060+
30033061 case ae_primary_polar:
30043062 if( !emit_engine_emit_polar_lit( emit, exp->polar ) )
30053063 return FALSE;
30063064 break;
3007−
3065+
30083066 case ae_primary_vec:
30093067 if( !emit_engine_emit_vec_lit( emit, exp->vec ) )
30103068 return FALSE;
30113069 break;
3012−
3070+
30133071 case ae_primary_exp:
30143072 if( !emit_engine_emit_exp( emit, exp->exp ) )
30153073 return FALSE;
@@ -3028,18 +3086,18 @@ t_CKBOOL emit_engine_emit_exp_primary( Chuck_Emitter * emit, a_Exp_Primary exp ) · 12 unmodified lines
30283086 types.push_back( e->type );
30293087 e = e->next;
30303088 }
3031−
3089+
30323090 // emit hack
30333091 emit->append( new Chuck_Instr_Gack( types ) );
30343092
30353093 break;
30363094 }
3037−
3095+
30383096 // ge (april 2012): nil is void, so nothing to emit; TODO: check it (added 1.3.0.0)
30393097 case ae_primary_nil:
30403098 break;
30413099 }
3042−
3100+
30433101 return TRUE;
30443102 }
30453103
@@ -3086,7 +3144,7 @@ t_CKBOOL emit_engine_emit_complex_lit( Chuck_Emitter * emit, a_Complex val ) · 40 unmodified lines
30863144 // go through and emit the real and imaginary
30873145 if( !emit_engine_emit_exp( emit, val->re ) )
30883146 return FALSE;
3089−
3147+
30903148 // imaginary (not needed since linked after real
30913149 // if( !emit_engine_emit_exp( emit, val->im ) )
30923150 // return FALSE;
@@ -3106,7 +3164,7 @@ t_CKBOOL emit_engine_emit_polar_lit( Chuck_Emitter * emit, a_Polar val ) · 13 unmodified lines
31063164 // go through and emit the mod and phase
31073165 if( !emit_engine_emit_exp( emit, val->mod ) )
31083166 return FALSE;
3109−
3167+
31103168 // phase (not needed since linked after mod)
31113169 // if( !emit_engine_emit_exp( emit, val->phase ) )
31123170 // return FALSE;
@@ -3137,7 +3195,7 @@ t_CKBOOL emit_engine_emit_vec_lit( Chuck_Emitter * emit, a_Vec val ) · 24 unmodified lines
31373195 // decrement
31383196 n--;
31393197 }
3140−
3198+
31413199 return TRUE;
31423200 }
31433201
@@ -3168,7 +3226,7 @@ t_CKBOOL emit_engine_emit_exp_cast( Chuck_Emitter * emit, a_Exp_Cast cast ) · 24 unmodified lines
31683226 // name: emit_engine_emit_cast()
31693227 // desc: ...
31703228 //-----------------------------------------------------------------------------
3171−t_CKBOOL emit_engine_emit_cast( Chuck_Emitter * emit,
3229+t_CKBOOL emit_engine_emit_cast( Chuck_Emitter * emit,
31723230 Chuck_Type * to, Chuck_Type * from )
31733231 {
31743232 // if type is already the same
@@ -3255,8 +3313,8 @@ t_CKBOOL emit_engine_emit_exp_postfix( Chuck_Emitter * emit, a_Exp_Postfix postf · 80 unmodified lines
32553313 "(emit): internal error: unhandled postfix operator '%s'",
32563314 op2str( postfix->op ) );
32573315 return FALSE;
3258− }
3259−
3316+ }
3317+
32603318 return TRUE;
32613319 }
32623320
@@ -3280,10 +3338,10 @@ t_CKBOOL emit_engine_emit_exp_dur( Chuck_Emitter * emit, a_Exp_Dur dur ) · 17 unmodified lines
32803338 // emit unit
32813339 if( !emit_engine_emit_exp( emit, dur->unit ) )
32823340 return FALSE;
3283−
3341+
32843342 // multiply
32853343 emit->append( new Chuck_Instr_Times_double );
3286−
3344+
32873345 return TRUE;
32883346 }
32893347
@@ -3408,13 +3466,6 @@ t_CKBOOL emit_engine_emit_exp_func_call( Chuck_Emitter * emit, · 118 unmodified lines
34083466 // is a member?
34093467 t_CKBOOL is_member = func->is_member;
34103468
3411− // if member
3412− //if( is_member )
3413− //{
3414− // // this
3415− // emit->append( new Chuck_Instr_Reg_Push_This );
3416− //}
3417−
34183469 // translate to code
34193470 emit->append( new Chuck_Instr_Func_To_Code );
34203471 // emit->append( new Chuck_Instr_Reg_Push_Imm( (t_CKUINT)func->code ) );
@@ -3425,7 +3476,7 @@ t_CKBOOL emit_engine_emit_exp_func_call( Chuck_Emitter * emit, · 4 unmodified lines
34253476 // call the function
34263477 t_CKUINT size = type->size;
34273478 t_CKUINT kind = getkindof( emit->env, type ); // added 1.3.1.0
3428−
3479+
34293480 // the pointer
34303481 Chuck_Instr * instr = NULL;
34313482 if( func->def->s_type == ae_func_builtin )
@@ -3436,9 +3487,9 @@ t_CKBOOL emit_engine_emit_exp_func_call( Chuck_Emitter * emit, · 4 unmodified lines
34363487 {
34373488 // is member (1.3.1.0: changed to use kind instead of size)
34383489 if( is_member )
3439− emit->append( instr = new Chuck_Instr_Func_Call_Member( kind ) );
3490+ emit->append( instr = new Chuck_Instr_Func_Call_Member( kind, func ) );
34403491 else
3441− emit->append( instr = new Chuck_Instr_Func_Call_Static( kind ) );
3492+ emit->append( instr = new Chuck_Instr_Func_Call_Static( kind, func ) );
34423493 }
34433494 else
34443495 {
@@ -3507,10 +3558,10 @@ t_CKBOOL emit_engine_emit_exp_func_call( Chuck_Emitter * emit, · 62 unmodified lines
35073558 "(emit): internal error in evaluating function call..." );
35083559 return FALSE;
35093560 }
3510−
3561+
35113562 // the rest
3512− return emit_engine_emit_exp_func_call( emit, func_call->ck_func, func_call->ret_type,
3513− func_call->linepos, spork );
3563+ return emit_engine_emit_exp_func_call( emit, func_call->ck_func,
3564+ func_call->ret_type, func_call->linepos, spork );
35143565 }
35153566
35163567
@@ -3525,7 +3576,7 @@ t_CKBOOL emit_engine_emit_exp_dot_member_special( Chuck_Emitter * emit, · 8 unmodified lines
35253576 {
35263577 // whether to emit addr or value
35273578 t_CKBOOL emit_addr = member->self->emit_var;
3528−
3579+
35293580 // special case: complex and polar
35303581 if( member->t_base->xid == te_complex )
35313582 {
@@ -3538,11 +3589,11 @@ t_CKBOOL emit_engine_emit_exp_dot_member_special( Chuck_Emitter * emit, · 6 unmodified lines
35383589 "(emit): cannot assign value to literal 'complex' value..." );
35393590 return FALSE;
35403591 }
3541−
3592+
35423593 // emit the base
35433594 if( !emit_engine_emit_exp( emit, member->base ) )
35443595 return FALSE;
3545−
3596+
35463597 string str = S_name(member->xid);
35473598 // check
35483599 if( str == "re" )
@@ -3551,7 +3602,7 @@ t_CKBOOL emit_engine_emit_exp_dot_member_special( Chuck_Emitter * emit, · 2 unmodified lines
35513602 emit->append( new Chuck_Instr_Dot_Cmp_Second( member->base->s_meta == ae_meta_var, emit_addr ) );
35523603 else
35533604 goto check_func;
3554−
3605+
35553606 // done
35563607 return TRUE;
35573608 }
@@ -3566,11 +3617,11 @@ t_CKBOOL emit_engine_emit_exp_dot_member_special( Chuck_Emitter * emit, · 8 unmodified lines
35663617 "(emit): cannot assign value to literal 'polar' value..." );
35673618 return FALSE;
35683619 }
3569−
3620+
35703621 // emit the base
35713622 if( !emit_engine_emit_exp( emit, member->base ) )
35723623 return FALSE;
3573−
3624+
35743625 string str = S_name(member->xid);
35753626 // check
35763627 if( str == "mag" )
@@ -3579,7 +3630,7 @@ t_CKBOOL emit_engine_emit_exp_dot_member_special( Chuck_Emitter * emit, · 2 unmodified lines
35793630 emit->append( new Chuck_Instr_Dot_Cmp_Second( member->base->s_meta == ae_meta_var, emit_addr ) );
35803631 else
35813632 goto check_func;
3582−
3633+
35833634 // done
35843635 return TRUE;
35853636 }
@@ -3595,11 +3646,11 @@ t_CKBOOL emit_engine_emit_exp_dot_member_special( Chuck_Emitter * emit, · 9 unmodified lines
35953646 member->t_base->c_name() );
35963647 return FALSE;
35973648 }
3598−
3649+
35993650 // emit the base
36003651 if( !emit_engine_emit_exp( emit, member->base ) )
36013652 return FALSE;
3602−
3653+
36033654 string str = S_name(member->xid);
36043655 // check for .xyz[w] .rgb[a] .value/goal/slew
36053656 if( str == "x" || str == "r" || str == "value" )
@@ -3612,7 +3663,7 @@ t_CKBOOL emit_engine_emit_exp_dot_member_special( Chuck_Emitter * emit, · 6 unmodified lines
36123663 emit->append( new Chuck_Instr_Dot_Cmp_Fourth( member->base->s_meta == ae_meta_var, emit_addr ) );
36133664 else
36143665 goto check_func;
3615−
3666+
36163667 // done
36173668 return TRUE;
36183669 }
@@ -3622,23 +3673,24 @@ t_CKBOOL emit_engine_emit_exp_dot_member_special( Chuck_Emitter * emit, · 3 unmodified lines
36223673 "(emit): internal error in lit_special()..." );
36233674
36243675 return FALSE;
3625−
3676+
36263677 //-----------------------------------------------------------------------------
36273678 // goto: check for special member functions, 1.3.5.3
36283679 //-----------------------------------------------------------------------------
36293680 check_func:
3630−
3681+
36313682 // the type of the base
36323683 Chuck_Type * t_base = member->t_base;
36333684 // is the base a class/namespace or a variable
3634− t_CKBOOL base_static = isa( member->t_base, emit->env->t_class );
3685+ t_CKBOOL base_static = type_engine_is_base_static( emit->env, member->t_base );
3686+ // t_CKBOOL base_static = isa( member->t_base, emit->env->t_class );
36353687 // a function
36363688 Chuck_Func * func = NULL;
36373689 // a non-function value
36383690 Chuck_Value * value = NULL;
36393691 // the offset
36403692 t_CKUINT offset = 0;
3641−
3693+
36423694 // check error
36433695 if( base_static )
36443696 {
@@ -3648,7 +3700,7 @@ check_func: · 3 unmodified lines
36483700 // done
36493701 return FALSE;
36503702 }
3651−
3703+
36523704 if( !isfunc( emit->env, member->self->type ) )
36533705 {
36543706 // should not get here
@@ -3657,13 +3709,13 @@ check_func: · 2 unmodified lines
36573709 // done
36583710 return FALSE;
36593711 }
3660−
3712+
36613713 // get the func
36623714 value = type_engine_find_value( t_base, member->xid );
36633715 func = value->func_ref;
36643716 // make sure it's there
36653717 assert( func != NULL );
3666−
3718+
36673719 // NOTE: base already emitted earier in this function (and as var)
36683720
36693721 // check base; 1.3.5.3
@@ -3677,12 +3729,12 @@ check_func: · 7 unmodified lines
36773729 // dup the base pointer (as 'this' argument -- special case primitive)
36783730 emit->append( new Chuck_Instr_Reg_Dup_Last );
36793731 }
3680−
3732+
36813733 // find the offset for virtual table
36823734 offset = func->vt_index;
36833735 // emit the function
36843736 emit->append( new Chuck_Instr_Dot_Primitive_Func( (t_CKUINT)func ) );
3685−
3737+
36863738 return TRUE;
36873739 }
36883740
@@ -3700,15 +3752,16 @@ t_CKBOOL emit_engine_emit_exp_dot_member( Chuck_Emitter * emit, · 11 unmodified lines
37003752 Chuck_Type * t_base = NULL;
37013753 // whether to emit addr or value
37023754 t_CKBOOL emit_addr = member->self->emit_var;
3703− // is the base a class/namespace or a variable
3704− t_CKBOOL base_static = isa( member->t_base, emit->env->t_class );
3755+ // is the base a class/namespace or a variable | 1.4.2.1 (ge) modified to func call
3756+ t_CKBOOL base_static = type_engine_is_base_static( emit->env, member->t_base );
3757+ // t_CKBOOL base_static = isa( member->t_base, emit->env->t_class );
37053758 // a function
37063759 Chuck_Func * func = NULL;
37073760 // a non-function value
37083761 Chuck_Value * value = NULL;
37093762 // the offset
37103763 t_CKUINT offset = 0;
3711−
3764+
37123765 // the pointer
37133766 Chuck_Instr * instr = NULL;
37143767
@@ -3726,7 +3779,7 @@ t_CKBOOL emit_engine_emit_exp_dot_member( Chuck_Emitter * emit, · 11 unmodified lines
37263779 // done
37273780 break;
37283781 }
3729−
3782+
37303783 // actual type - if base is class name its type is actually 'class'
37313784 // to get the actual type use actual_type
37323785 t_base = base_static ? member->t_base->actual_type : member->t_base;
@@ -3811,7 +3864,7 @@ t_CKBOOL emit_engine_emit_exp_dot_member( Chuck_Emitter * emit, · 78 unmodified lines
38113864 else // static
38123865 {
38133866 // emit the type
3814− // commented out so built-in static member variables don't have an
3867+ // commented out so built-in static member variables don't have an
38153868 // extra thing on the stack - spencer
38163869 // emit->append( new Chuck_Instr_Reg_Push_Imm( (t_CKUINT)t_base ) );
38173870
@@ -3855,7 +3908,7 @@ t_CKBOOL emit_engine_emit_exp_dot_member( Chuck_Emitter * emit, · 37 unmodified lines
38553908 }
38563909 }
38573910 }
3858−
3911+
38593912 return TRUE;
38603913 }
38613914
@@ -3893,8 +3946,8 @@ t_CKBOOL emit_engine_emit_exp_if( Chuck_Emitter * emit, a_Exp_If exp_if ) · 31 unmodified lines
38933946 // push 0
38943947 emit->append( new Chuck_Instr_Reg_Push_Imm2( 0.0 ) );
38953948 op = new Chuck_Instr_Branch_Eq_double( 0 );
3896− break;
3897−
3949+ break;
3950+
38983951 default:
38993952 EM_error2( exp_if->cond->linepos,
39003953 "(emit): internal error: unhandled type '%s' in if condition",
@@ -3914,7 +3967,7 @@ t_CKBOOL emit_engine_emit_exp_if( Chuck_Emitter * emit, a_Exp_If exp_if ) · 13 unmodified lines
39143967
39153968 // emit the skip to the end
39163969 emit->append( op2 = new Chuck_Instr_Goto(0) );
3917−
3970+
39183971 // set the op's target
39193972 op->set( emit->next_index() );
39203973
@@ -4006,7 +4059,7 @@ t_CKBOOL emit_engine_instantiate_object( Chuck_Emitter * emit, Chuck_Type * type · 85 unmodified lines
40064059 Chuck_Instr * instr = NULL;
40074060 emit->append( instr = new Chuck_Instr_Array_Alloc( emit->env,
40084061 type->array_depth, type->array_type, emit->code->frame->curr_offset,
4009− is_ref ) );
4062+ is_ref, type ) );
40104063 instr->set_linepos( array->linepos );
40114064
40124065 // handle constructor
@@ -4020,7 +4073,7 @@ t_CKBOOL emit_engine_instantiate_object( Chuck_Emitter * emit, Chuck_Type * type · 7 unmodified lines
40204073 {
40214074 // emit object instantiation code, include pre constructor
40224075 emit->append( new Chuck_Instr_Instantiate_Object( type ) );
4023−
4076+
40244077 // call pre constructor
40254078 emit_engine_pre_constructor( emit, type );
40264079 }
@@ -4048,10 +4101,10 @@ t_CKBOOL emit_engine_emit_exp_decl( Chuck_Emitter * emit, a_Exp_Decl decl, · 21 unmodified lines
40484101 t_CKBOOL is_init = FALSE;
40494102 t_CKBOOL is_array = FALSE;
40504103 t_CKBOOL needs_global_ctor = FALSE;
4051−
4104+
40524105 t_CKTYPE t = type_engine_find_type( emit->env, decl->type->xid );
40534106 te_GlobalType globalType; // added 1.4.0.1 (jack)
4054−
4107+
40554108 if( decl->is_global )
40564109 {
40574110 if( isa( t, emit->env->t_int ) )
@@ -4118,20 +4171,21 @@ t_CKBOOL emit_engine_emit_exp_decl( Chuck_Emitter * emit, a_Exp_Decl decl, · 60 unmodified lines
41184171 if( is_obj )
41194172 {
41204173 // if this is an array, ...
4121− if( list->var_decl->array )
4174+ if( var_decl->array )
41224175 {
4176+ // mark as true
41234177 is_array = TRUE;
4124−
41254178 // ... then check to see if empty []
4126− // and only instantiate if NOT empty
4179+ is_ref = ( var_decl->array->exp_list == NULL );
4180+ // ...and only instantiate if NOT empty
41274181 // REFACTOR-2017 TODO: do we want to
4128− // avoid doing this if the array is global?
4129− if( list->var_decl->array->exp_list )
4182+ // avoid doing this if the array is global?
4183+ if( !is_ref )
41304184 {
41314185 // set
41324186 is_init = TRUE;
41334187 // instantiate object, including array
4134− if( !emit_engine_instantiate_object( emit, type, list->var_decl->array, is_ref ) )
4188+ if( !emit_engine_instantiate_object( emit, type, var_decl->array, is_ref ) )
41354189 return FALSE;
41364190 }
41374191 }
@@ -4145,7 +4199,7 @@ t_CKBOOL emit_engine_emit_exp_decl( Chuck_Emitter * emit, a_Exp_Decl decl, · 7 unmodified lines
41454199 // set
41464200 is_init = TRUE;
41474201 // instantiate object (not array)
4148− if( !emit_engine_instantiate_object( emit, type, list->var_decl->array, is_ref ) )
4202+ if( !emit_engine_instantiate_object( emit, type, var_decl->array, is_ref ) )
41494203 return FALSE;
41504204 }
41514205 }
@@ -4225,7 +4279,7 @@ t_CKBOOL emit_engine_emit_exp_decl( Chuck_Emitter * emit, a_Exp_Decl decl, · 73 unmodified lines
42254279 instr->m_type = globalType;
42264280 instr->set_linepos( decl->linepos );
42274281 instr->m_is_array = is_array;
4228−
4282+
42294283 // extra fields for objects that need their ctors called
42304284 if( needs_global_ctor )
42314285 {
@@ -4233,7 +4287,7 @@ t_CKBOOL emit_engine_emit_exp_decl( Chuck_Emitter * emit, a_Exp_Decl decl, · 1 unmodified line
42334287 instr->m_stack_offset = local->offset;
42344288 instr->m_should_execute_ctors = TRUE;
42354289 }
4236−
4290+
42374291 // if it's an event, we need to initialize it and check if the exact type matches
42384292 if( globalType == te_globalEvent )
42394293 {
@@ -4273,7 +4327,7 @@ t_CKBOOL emit_engine_emit_exp_decl( Chuck_Emitter * emit, a_Exp_Decl decl, · 33 unmodified lines
42734327 return FALSE;
42744328 }
42754329 }
4276−
4330+
42774331 // add instruction
42784332 emit->append( instr );
42794333 }
@@ -4377,7 +4431,7 @@ t_CKBOOL emit_engine_emit_exp_decl( Chuck_Emitter * emit, a_Exp_Decl decl, · 97 unmodified lines
43774431 else
43784432 assert( FALSE );
43794433 }*/
4380−
4434+
43814435 list = list->next;
43824436 }
43834437
@@ -4391,7 +4445,7 @@ t_CKBOOL emit_engine_emit_exp_decl( Chuck_Emitter * emit, a_Exp_Decl decl, · 7 unmodified lines
43914445 // name: emit_engine_emit_code_segment()
43924446 // desc: ...
43934447 //-----------------------------------------------------------------------------
4394−t_CKBOOL emit_engine_emit_code_segment( Chuck_Emitter * emit,
4448+t_CKBOOL emit_engine_emit_code_segment( Chuck_Emitter * emit,
43954449 a_Stmt_Code stmt, t_CKBOOL push )
43964450 {
43974451 a_Stmt_List list = stmt->stmt_list;
@@ -4408,7 +4462,7 @@ t_CKBOOL emit_engine_emit_code_segment( Chuck_Emitter * emit, · 10 unmodified lines
44084462 }
44094463
44104464 // TODO: push
4411−
4465+
44124466 return TRUE;
44134467 }
44144468
@@ -4517,7 +4571,7 @@ t_CKBOOL emit_engine_emit_func_def( Chuck_Emitter * emit, a_Func_Def func_def ) · 102 unmodified lines
45174571 return FALSE;
45184572 }
45194573 }
4520−
4574+
45214575 // ge: 2012 april: added push scope (added 1.3.0.0)
45224576 emit->push_scope();
45234577
@@ -4553,7 +4607,7 @@ t_CKBOOL emit_engine_emit_func_def( Chuck_Emitter * emit, a_Func_Def func_def ) · 29 unmodified lines
45534607
45544608 // TODO: make sure the calculated stack depth is the same as func_def->stack depth
45554609 // taking into account member function
4556−
4610+
45574611 // add references for objects in the arguments (added 1.3.0.0)
45584612 // NOTE: this isn't in use since currently the caller is reference counting
45594613 // the arguments -- this is to better support sporking, which is more
@@ -4563,20 +4617,25 @@ t_CKBOOL emit_engine_emit_func_def( Chuck_Emitter * emit, a_Func_Def func_def ) · 3 unmodified lines
45634617 // emit the code
45644618 if( !emit_engine_emit_stmt( emit, func_def->code, FALSE ) )
45654619 return FALSE;
4566−
4567− // added by spencer June 2014 (1.3.5.0)
4568− // ensure return
4620+
4621+ // added by spencer June 2014 (1.3.5.0) | ensure return
45694622 if( func_def->ret_type && func_def->ret_type != emit->env->t_void )
45704623 {
4571− emit->append( new Chuck_Instr_Reg_Push_Imm(0) );
4572−
4573− Chuck_Instr_Goto * instr = new Chuck_Instr_Goto( 0 );
4574− emit->append( instr );
4575− emit->code->stack_return.push_back( instr );
4624+ // 1.4.2.1 (ge) | account for differences in return type size
4625+ // push 0 for the width of the return type in question
4626+ emit->append( new Chuck_Instr_Reg_Push_Zero( func_def->ret_type->size ) );
4627+ // previously this pushed 0 as int, regardless of return type size
4628+ // emit->append( new Chuck_Instr_Reg_Push_Imm(0) );
4629+
4630+ // 1.4.2.1 (ge) | commented out this goto...
4631+ // (okay as long as the next instruction is Chuck_Instr_Func_Return...)
4632+ // Chuck_Instr_Goto * instr = new Chuck_Instr_Goto( 0 );
4633+ // emit->append( instr );
4634+ // emit->code->stack_return.push_back( instr );
45764635 }
4577−
4636+
45784637 // ge: pop scope (2012 april | added 1.3.0.0)
4579− // TODO: ge 2012 april: pop scope? clean up function arguments? are argument properly ref counted?
4638+ // TODO: ge 2012 april: pop scope? clean up function arguments? are argument properly ref counted?
45804639 emit->pop_scope();
45814640
45824641 // set the index for next instruction for return statements
@@ -4591,7 +4650,7 @@ t_CKBOOL emit_engine_emit_func_def( Chuck_Emitter * emit, a_Func_Def func_def ) · 8 unmodified lines
45914650 func->code = emit_to_code( emit->code, NULL, emit->dump );
45924651 // add reference
45934652 func->code->add_ref();
4594−
4653+
45954654 // unset the func
45964655 emit->env->func = NULL;
45974656 // delete the code
@@ -4619,7 +4678,7 @@ t_CKBOOL emit_engine_emit_class_def( Chuck_Emitter * emit, a_Class_Def class_def · 21 unmodified lines
46194678 t_CKBOOL ret = TRUE;
46204679 // the class body
46214680 a_Class_Body body = class_def->body;
4622−
4681+
46234682 // make sure the code is empty
46244683 if( type->info->pre_ctor != NULL && type->info->pre_ctor->instr != NULL )
46254684 {
@@ -4652,7 +4711,7 @@ t_CKBOOL emit_engine_emit_class_def( Chuck_Emitter * emit, a_Class_Def class_def · 26 unmodified lines
46524711 // if( type->has_constructor ) type->info->pre_ctor = new Chuck_VM_Code;
46534712 // keep track of full path (added 1.3.0.0)
46544713 emit->code->filename = emit->context->full_path;
4655−
4714+
46564715 // get the size
46574716 emit->code->stack_depth += sizeof(t_CKUINT);
46584717 // add this
@@ -4674,11 +4733,11 @@ t_CKBOOL emit_engine_emit_class_def( Chuck_Emitter * emit, a_Class_Def class_def · 15 unmodified lines
46744733 case ae_section_stmt:
46754734 ret = emit_engine_emit_stmt_list( emit, body->section->stmt_list );
46764735 break;
4677−
4736+
46784737 case ae_section_func:
46794738 ret = emit_engine_emit_func_def( emit, body->section->func_def );
46804739 break;
4681−
4740+
46824741 case ae_section_class:
46834742 ret = emit_engine_emit_class_def( emit, body->section->class_def );
46844743 //EM_error2( body->section->class_def->linepos,
@@ -4686,7 +4745,7 @@ t_CKBOOL emit_engine_emit_class_def( Chuck_Emitter * emit, a_Class_Def class_def · 1 unmodified line
46864745 //ret = FALSE;
46874746 break;
46884747 }
4689−
4748+
46904749 // move to the next section
46914750 body = body->next;
46924751 }
@@ -4706,7 +4765,7 @@ t_CKBOOL emit_engine_emit_class_def( Chuck_Emitter * emit, a_Class_Def class_def · 13 unmodified lines
47064765 if( !type->info->class_data )
47074766 {
47084767 // we have a problem
4709− CK_FPRINTF_STDERR(
4768+ CK_FPRINTF_STDERR(
47104769 "[chuck](emitter): OutOfMemory: while allocating static data '%s'\n", type->c_name() );
47114770 // flag
47124771 ret = FALSE;
@@ -4749,16 +4808,16 @@ t_CKBOOL emit_engine_emit_spork( Chuck_Emitter * emit, a_Exp_Func_Call exp ) · 36 unmodified lines
47494808 {
47504809 // spork
47514810 Chuck_Instr_Mem_Push_Imm * op = NULL;
4752−
4811+
47534812 // if member function, push this
47544813 // TODO: this is a hack - what if exp is not func_call?
47554814 // if( exp->ck_func->is_member )
47564815 // emit->append( new Chuck_Instr_Reg_Push_This );
4757−
4816+
47584817 // evaluate args on sporker shred
47594818 if( !emit_engine_emit_func_args( emit, exp ) )
47604819 return FALSE;
4761−
4820+
47624821 // emit func pointer on sporker shred
47634822 if( !emit_engine_emit_exp( emit, exp->func ) )
47644823 {
@@ -4766,7 +4825,7 @@ t_CKBOOL emit_engine_emit_spork( Chuck_Emitter * emit, a_Exp_Func_Call exp ) · 1 unmodified line
47664825 "(emit): internal error in evaluating function call..." );
47674826 return FALSE;
47684827 }
4769−
4828+
47704829 // push the current code
47714830 emit->stack.push_back( emit->code );
47724831 // make a new one (spork~exp shred)
@@ -4787,25 +4846,33 @@ t_CKBOOL emit_engine_emit_spork( Chuck_Emitter * emit, a_Exp_Func_Call exp ) · 14 unmodified lines
47874846 op = new Chuck_Instr_Mem_Push_Imm( 0 );
47884847 // emit the stack depth - we don't know this yet
47894848 emit->append( op );
4790−
4849+
47914850 // call the func on sporkee shred
4792− if( !emit_engine_emit_exp_func_call(
4793− emit,
4794− exp->ck_func,
4795− exp->ret_type,
4796− exp->linepos,
4797− TRUE ) )
4798− return FALSE;
4799−
4851+ if( !emit_engine_emit_exp_func_call( emit,
4852+ exp->ck_func,
4853+ exp->ret_type,
4854+ exp->linepos,
4855+ TRUE ) ) return FALSE;
4856+
4857+ // 1.4.2.1 (ge) | added to pop/release the returned value, which could be an object
4858+ if( iskindofint(emit->env, exp->ret_type) )
4859+ {
4860+ // is an object?
4861+ if( isobj( emit->env, exp->ret_type) )
4862+ { emit->append( new Chuck_Instr_Release_Object3_Pop_Word ); }
4863+ else // not an object
4864+ { emit->append( new Chuck_Instr_Reg_Pop_Word ); }
4865+ }
4866+
48004867 // emit the function call, with special flag
48014868 // if( !emit_engine_emit_exp_func_call( emit, exp, TRUE ) )
48024869 // return FALSE;
4803−
4870+
48044871 // done
48054872 emit->append( new Chuck_Instr_EOC );
48064873 // set the stack depth now that we know
48074874 op->set( emit->code->stack_depth );
4808−
4875+
48094876 // emit it
48104877 Chuck_VM_Code * code = emit_to_code( emit->code, NULL, emit->dump );
48114878 // remember it
@@ -4813,17 +4880,17 @@ t_CKBOOL emit_engine_emit_spork( Chuck_Emitter * emit, a_Exp_Func_Call exp ) · 1 unmodified line
48134880 // add reference
48144881 exp->ck_vm_code->add_ref();
48154882 // code->name = string("spork~exp");
4816−
4883+
48174884 // restore the code to sporker shred
48184885 assert( emit->stack.size() > 0 );
48194886 emit->code = emit->stack.back();
48204887 // pop
48214888 emit->stack.pop_back();
4822−
4889+
48234890 a_Exp e = exp->args;
48244891 t_CKUINT size = 0;
48254892 while( e ) { size += e->cast_to ? e->cast_to->size : e->type->size; e = e->next; }
4826−
4893+
48274894 // handle member function
48284895 // TODO: this is a hack - what if exp is not func_call?
48294896 // if( emit->code->need_this )
@@ -4833,7 +4900,7 @@ t_CKBOOL emit_engine_emit_spork( Chuck_Emitter * emit, a_Exp_Func_Call exp ) · 3 unmodified lines
48334900 emit->append( new Chuck_Instr_Reg_Push_Imm( (t_CKUINT)code ) );
48344901 // emit spork instruction - this will copy, func, args, this
48354902 emit->append( new Chuck_Instr_Spork( size ) );
4836−
4903+
48374904 return TRUE;
48384905 }
48394906
@@ -4856,23 +4923,23 @@ t_CKBOOL emit_engine_emit_spork( Chuck_Emitter * emit, a_Exp_Func_Call exp ) · 16 unmodified lines
48564923 // emit->code->name = "spork~exp";
48574924 // // keep track of full path (added 1.3.0.0)
48584925 // emit->code->filename = emit->context->full_path;
4859−//
4926+//
48604927 // // call the code on sporkee shred
48614928 // if( !emit_engine_emit_stmt( emit, stmt, TRUE ) )
48624929 // return FALSE;
4863−//
4930+//
48644931 // // done
48654932 // emit->append( new Chuck_Instr_EOC );
4866−//
4933+//
48674934 // // emit it
48684935 // Chuck_VM_Code * code = emit_to_code( emit->code, NULL, emit->dump );
4869−//
4936+//
48704937 // // restore the code to sporker shred
48714938 // assert( emit->stack.size() > 0 );
48724939 // emit->code = emit->stack.back();
48734940 // // pop
48744941 // emit->stack.pop_back();
4875−//
4942+//
48764943 // if( code->need_this )
48774944 // {
48784945 // // push this if needed
@@ -4882,7 +4949,7 @@ t_CKBOOL emit_engine_emit_spork( Chuck_Emitter * emit, a_Exp_Func_Call exp ) · 3 unmodified lines
48824949 // emit->append( new Chuck_Instr_Reg_Push_Imm( (t_CKUINT)code ) );
48834950 // // emit spork instruction - this will copy, func, args, this
48844951 // emit->append( new Chuck_Instr_Spork_Stmt( 0 ) );
4885−//
4952+//
48864953 // return TRUE;
48874954 //}
48884955
@@ -4893,7 +4960,7 @@ t_CKBOOL emit_engine_emit_spork( Chuck_Emitter * emit, a_Exp_Func_Call exp ) · 4 unmodified lines
48934960 // name: emit_engine_emit_symbol()
48944961 // desc: ...
48954962 //-----------------------------------------------------------------------------
4896−t_CKBOOL emit_engine_emit_symbol( Chuck_Emitter * emit, S_Symbol symbol,
4963+t_CKBOOL emit_engine_emit_symbol( Chuck_Emitter * emit, S_Symbol symbol,
48974964 Chuck_Value * v, t_CKBOOL emit_var,
48984965 int linepos )
48994966 {
@@ -4908,7 +4975,7 @@ t_CKBOOL emit_engine_emit_symbol( Chuck_Emitter * emit, S_Symbol symbol, · 8 unmodified lines
49084975 S_name(symbol) );
49094976 return FALSE;
49104977 }
4911−
4978+
49124979 // if global, find what type
49134980 // (due to user classes, this info is only available during emit)
49144981 te_GlobalType global_type;
@@ -5057,7 +5124,7 @@ void Chuck_Emitter::addref_on_scope() · 142 unmodified lines
50575124 locals.clear();
50585125 // get the current scope
50595126 code->frame->get_scope( locals );
5060−
5127+
50615128 // iterate over locals
50625129 for( int i = 0; i < locals.size(); i++ )
50635130 {
@@ -5081,6 +5148,46 @@ void Chuck_Emitter::addref_on_scope() · 17 unmodified lines
50815148
50825149
50835150
5151+//-----------------------------------------------------------------------------
5152+// name: traverse_scope_on_jump() | 1.4.2.1 (ge) added
5153+// desc: traverse the scope and emit instructions on a jump statement:
5154+// 'return', 'break', 'continue'
5155+// this is done to ensure proper cleanup of objects on scope frames
5156+//-----------------------------------------------------------------------------
5157+void Chuck_Emitter::traverse_scope_on_jump( )
5158+{
5159+ // this gotta be the case
5160+ assert( code != NULL );
5161+
5162+ // clear locals
5163+ locals.clear();
5164+ // get locals (localOnly=false to get all locals at this point in 'code')
5165+ code->frame->get_scope( locals, false );
5166+
5167+ // loop over
5168+ for( int i = 0; i < locals.size(); i++ )
5169+ {
5170+ // get local
5171+ Chuck_Local * local = locals[i];
5172+ // skip scope boundary (denoted by NULL)
5173+ if( !local ) continue;
5174+
5175+ // check to see if it's an object (but not global)
5176+ // (REFACTOR-2017: don't release global objects)
5177+ if( local->is_obj && !local->is_global )
5178+ {
5179+ // emit instruction to release the object
5180+ this->append( new Chuck_Instr_Release_Object2( local->offset ) );
5181+ }
5182+ }
5183+
5184+ // clear it
5185+ locals.clear();
5186+}
5187+
5188+
5189+
5190+
50845191 //-----------------------------------------------------------------------------
50855192 // name: pop_scope()
50865193 // desc: ...
@@ -5111,11 +5218,11 @@ void Chuck_Emitter::pop_scope( ) · 24 unmodified lines
51115218 this->append( new Chuck_Instr_Release_Object2( local->offset ) );
51125219 }
51135220 }
5114−
5221+
51155222 // reclaim local; null out to be safe
51165223 SAFE_DELETE( local ); locals[i] = NULL;
51175224 }
5118−
5225+
51195226 // clear it
51205227 locals.clear();
51215228 }
@@ -5140,7 +5247,7 @@ t_CKBOOL Chuck_Emitter::find_dur( const string & name, t_CKDUR * out ) · 18 unmodified lines
51405247 if( !value || !equals( value->type, env->t_dur ) ) return FALSE;
51415248 // copy
51425249 *out = *( (t_CKDUR *)value->addr );
5143−
5250+
51445251 return TRUE;
51455252 }
51465253
@@ -5161,7 +5268,7 @@ t_CKBOOL emit_engine_instantiate_object( Chuck_Emitter * emit, Chuck_Type * type · 14 unmodified lines
51615268 // emit indices
51625269 emit_engine_emit_exp( emit, array->exp_list );
51635270 // emit array allocation
5164− emit->append( new Chuck_Instr_Array_Alloc(
5271+ emit->append( new Chuck_Instr_Array_Alloc(
51655272 type->array_depth, type->array_type, emit->code->frame->curr_offset,
51665273 is_ref ) );
51675274
@@ -5197,7 +5304,7 @@ t_CKBOOL emit_engine_instantiate_object( Chuck_Emitter * emit, Chuck_Type * type · 29 unmodified lines
51975304 emit->append( new Chuck_Instr_Instantiate_Object( type ) );
51985305
51995306 //}
5200−
5307+
52015308 // call pre constructor
52025309 emit_engine_pre_constructor( emit, type );
52035310
src/core/chuck_emit.h+7−5
@@ -74,10 +74,10 @@ public: · 73 unmodified lines
7474 std::vector<Chuck_Instr_Goto *> stack_break;
7575 // return stack
7676 std::vector<Chuck_Instr_Goto *> stack_return;
77−
77+
7878 // filename this code came from (added 1.3.0.0)
7979 std::string filename;
80−
80+
8181 // constructor
8282 Chuck_Code( )
8383 {
@@ -122,7 +122,7 @@ struct Chuck_Emitter : public Chuck_VM_Object · 38 unmodified lines
122122
123123 // constructor
124124 Chuck_Emitter()
125− { env = NULL; code = NULL; context = NULL;
125+ { env = NULL; code = NULL; context = NULL;
126126 nspc = NULL; func = NULL; dump = FALSE;
127127 should_replace_dac = FALSE; }
128128
@@ -148,11 +148,13 @@ struct Chuck_Emitter : public Chuck_VM_Object · 19 unmodified lines
148148 // add references to locals on current scope (added 1.3.0.0)
149149 void addref_on_scope();
150150 // pop scope
151− void pop_scope( );
151+ void pop_scope();
152+ // traverse scope on jumps such as 'return' 'break' 'continue' | 1.4.2.1 (ge)
153+ void traverse_scope_on_jump();
152154
153155 // default durations
154156 t_CKBOOL find_dur( const std::string & name, t_CKDUR * out );
155−
157+
156158 // post REFACTOR-2017: replace-dac
157159 std::string dac_replacement;
158160 t_CKBOOL should_replace_dac;
src/core/chuck_errmsg.cpp+55−53
@@ -31,16 +31,17 @@ · 30 unmodified lines
3131 // based on code by: Andrew Appel (appel@cs.princeton.edu)
3232 // date: Summer 2002
3333 //-----------------------------------------------------------------------------
34+#include "chuck_errmsg.h"
35+#include "chuck_utils.h"
36+#ifndef __DISABLE_THREADS__
37+#include "util_thread.h"
38+#endif
39+
3440 #include <stdlib.h>
3541 #include <stdarg.h>
3642 #include <string.h>
3743 #include <sstream>
3844 #include <iostream>
39−#include "chuck_utils.h"
40−#include "chuck_errmsg.h"
41−#ifndef __DISABLE_THREADS__
42−#include "util_thread.h"
43−#endif
4445
4546 // global
4647 t_CKINT EM_tokPos = 0;
@@ -51,7 +52,8 @@ t_CKBOOL anyErrors= FALSE; · 4 unmodified lines
5152 // local global
5253 static const char * fileName = "";
5354 static int lineNum = 1;
54−static char g_buffer[1024] = "";
55+#define CK_ERR_BUF_LENGTH 1024
56+static char g_buffer[CK_ERR_BUF_LENGTH] = "";
5557 static const size_t LASTERROR_SIZE = 1024;
5658 static char g_lasterror[LASTERROR_SIZE] = "[chuck]: (no error)";
5759 static size_t g_lasterrorIndex = strlen(g_lasterror);
@@ -79,10 +81,10 @@ void ck_fprintf_stdout( const char * format, ... ) · 21 unmodified lines
7981 va_start( args, format );
8082 vsnprintf( g_buffer2, g_buffer2_size, format, args );
8183 va_end( args );
82−
84+
8385 // send the formatted string to the buffer
8486 g_stdout_stream << g_buffer2;
85−
87+
8688 // try flushing
8789 ck_fflush_stdout();
8890 }
@@ -95,10 +97,10 @@ void ck_fprintf_stderr( const char * format, ... ) · 6 unmodified lines
9597 va_start( args, format );
9698 vsnprintf( g_buffer2, g_buffer2_size, format, args );
9799 va_end( args );
98−
100+
99101 // send the formatted string to the buffer
100102 g_stderr_stream << g_buffer2;
101−
103+
102104 // try flushing
103105 ck_fflush_stderr();
104106 }
@@ -112,7 +114,7 @@ void ck_fflush_stdout() · 7 unmodified lines
112114 // send to stdout
113115 fprintf( stdout, "%s", g_stdout_stream.str().c_str() );
114116 fflush( stdout );
115−
117+
116118 // and clear buffer
117119 g_stdout_stream.str( std::string() );
118120 }
@@ -124,7 +126,7 @@ void ck_fflush_stdout() · 5 unmodified lines
124126 {
125127 // if so, emit to callback
126128 g_stdout_callback( g_stdout_stream.str().c_str() );
127−
129+
128130 // and clear buffer
129131 g_stdout_stream.str( std::string() );
130132 }
@@ -140,7 +142,7 @@ void ck_fflush_stderr() · 9 unmodified lines
140142 // send to stderr
141143 fprintf( stderr, "%s", g_stderr_stream.str().c_str() );
142144 fflush( stderr );
143−
145+
144146 // and clear buffer
145147 g_stderr_stream.str( std::string() );
146148 }
@@ -152,7 +154,7 @@ void ck_fflush_stderr() · 5 unmodified lines
152154 {
153155 // if so, emit to callback
154156 g_stderr_callback( g_stderr_stream.str().c_str() );
155−
157+
156158 // and clear buffer
157159 g_stderr_stream.str( std::string() );
158160 }
@@ -164,10 +166,10 @@ void ck_vfprintf_stdout( const char * format, va_list args ) · 5 unmodified lines
164166 {
165167 // evaluate the format string
166168 vsnprintf( g_buffer2, g_buffer2_size, format, args );
167−
169+
168170 // send the formatted string to the buffer
169171 g_stdout_stream << g_buffer2;
170−
172+
171173 // try flushing
172174 ck_fflush_stdout();
173175 }
@@ -177,10 +179,10 @@ void ck_vfprintf_stderr( const char * format, va_list args ) · 3 unmodified lines
177179 {
178180 // evaluate the format string
179181 vsnprintf( g_buffer2, g_buffer2_size, format, args );
180−
182+
181183 // send the formatted string to the buffer
182184 g_stderr_stream << g_buffer2;
183−
185+
184186 // try flushing
185187 ck_fflush_stderr();
186188 }
@@ -367,27 +369,27 @@ static const char * g_str[] = { · 180 unmodified lines
367369
368370
369371 // intList
370−typedef struct intList {int i; struct intList *rest;} *IntList;
372+typedef struct intList {t_CKINT i; struct intList *rest;} *IntList;
371373 static IntList linePos=NULL;
372374
373375
374376 static int lastErrorCat(const char * str)
375377 {
376378 assert(g_lasterrorIndex <= LASTERROR_SIZE-1);
377−
379+
378380 size_t len = strlen(str);
379−
381+
380382 strncat(g_lasterror, str, LASTERROR_SIZE-g_lasterrorIndex-1);
381−
383+
382384 size_t appendCount = ck_min(LASTERROR_SIZE-g_lasterrorIndex-1, len);
383385 g_lasterrorIndex += appendCount;
384−
386+
385387 return appendCount > 0;
386388 }
387389
388390
389391 // constructor
390−static IntList intList( int i, IntList rest )
392+static IntList intList( t_CKINT i, IntList rest )
391393 {
392394 IntList l = (IntList)checked_malloc(sizeof *l);
393395 l->i=i; l->rest=rest;
@@ -430,43 +432,43 @@ void EM_reset_msg() · 36 unmodified lines
430432 g_lasterrorIndex = 0;
431433 }
432434
433−// [%s]:line(%d).char(%d):
434−void EM_error( int pos, const char * message, ... )
435+// [%s]:line(%d).char(%d):
436+void EM_error( t_CKINT pos, const char * message, ... )
435437 {
436438 va_list ap;
437439 IntList lines = linePos;
438440 int num = lineNum;
439441
440442 anyErrors = TRUE;
441− while( lines && lines->i >= pos )
443+ while( lines && lines->i >= pos )
442444 {
443445 lines = lines->rest;
444446 num--;
445447 }
446−
448+
447449 // separate errmsgs with newlines
448450 if( g_lasterror[0] != '\0' ) lastErrorCat( "\n" );
449−
451+
450452 CK_FPRINTF_STDERR( "[%s]:", *fileName ? mini(fileName) : "chuck" );
451− sprintf( g_buffer, "[%s]:", *fileName ? mini(fileName) : "chuck" );
453+ snprintf( g_buffer, CK_ERR_BUF_LENGTH, "[%s]:", *fileName ? mini(fileName) : "chuck" );
452454 lastErrorCat( g_buffer );
453455 if(lines)
454456 {
455457 CK_FPRINTF_STDERR( "line(%d).char(%d):", num, pos-lines->i );
456− sprintf( g_buffer, "line(%d).char(%d):", num, pos-lines->i );
458+ snprintf( g_buffer, CK_ERR_BUF_LENGTH, "line(%d).char(%d):", num, (int)(pos-lines->i) );
457459 lastErrorCat( g_buffer );
458460 }
459461 CK_FPRINTF_STDERR( " " );
460462 lastErrorCat( " " );
461−
463+
462464 va_start(ap, message);
463465 CK_VFPRINTF_STDERR( message, ap);
464466 va_end(ap);
465467
466468 va_start(ap, message);
467− vsprintf( g_buffer, message, ap );
469+ vsnprintf( g_buffer, CK_ERR_BUF_LENGTH, message, ap );
468470 va_end(ap);
469−
471+
470472 CK_FPRINTF_STDERR( "\n");
471473 CK_FFLUSH_STDERR();
472474 lastErrorCat( g_buffer );
@@ -474,7 +476,7 @@ void EM_error( int pos, const char * message, ... ) · 1 unmodified line
474476
475477
476478 // [%s]:line(%d):
477−void EM_error2( int line, const char * message, ... )
479+void EM_error2( t_CKINT line, const char * message, ... )
478480 {
479481 va_list ap;
480482
@@ -482,14 +484,14 @@ void EM_error2( int line, const char * message, ... ) · 1 unmodified line
482484
483485 // separate errmsgs with newlines
484486 if( g_lasterror[0] != '\0' ) lastErrorCat( "\n" );
485−
487+
486488 CK_FPRINTF_STDERR( "[%s]:", *fileName ? mini(fileName) : "chuck" );
487− sprintf( g_buffer, "[%s]:", *fileName ? mini(fileName) : "chuck" );
489+ snprintf( g_buffer, CK_ERR_BUF_LENGTH, "[%s]:", *fileName ? mini(fileName) : "chuck" );
488490 lastErrorCat( g_buffer );
489491 if(line)
490492 {
491− CK_FPRINTF_STDERR( "line(%d):", line );
492− sprintf( g_buffer, "line(%d):", line );
493+ CK_FPRINTF_STDERR( "line(%d):", (int)line );
494+ snprintf( g_buffer, CK_ERR_BUF_LENGTH, "line(%d):", (int)line );
493495 lastErrorCat( g_buffer );
494496 }
495497 CK_FPRINTF_STDERR( " " );
@@ -500,7 +502,7 @@ void EM_error2( int line, const char * message, ... ) · 4 unmodified lines
500502 va_end( ap );
501503
502504 va_start( ap, message );
503− vsprintf( g_buffer, message, ap );
505+ vsnprintf( g_buffer, CK_ERR_BUF_LENGTH, message, ap );
504506 va_end( ap );
505507
506508 lastErrorCat( g_buffer );
@@ -510,22 +512,22 @@ void EM_error2( int line, const char * message, ... ) · 3 unmodified lines
510512
511513
512514 // [%s]:line(%d):
513−void EM_error2b( int line, const char * message, ... )
515+void EM_error2b( t_CKINT line, const char * message, ... )
514516 {
515517 va_list ap;
516−
518+
517519 EM_extLineNum = line;
518520
519521 // separate errmsgs with newlines
520522 if( g_lasterror[0] != '\0' ) lastErrorCat( "\n" );
521−
523+
522524 CK_FPRINTF_STDERR( "[%s]:", *fileName ? mini(fileName) : "chuck" );
523− sprintf( g_buffer, "[%s]:", *fileName ? mini(fileName) : "chuck" );
525+ snprintf( g_buffer, CK_ERR_BUF_LENGTH, "[%s]:", *fileName ? mini(fileName) : "chuck" );
524526 lastErrorCat( g_buffer );
525527 if(line)
526528 {
527− CK_FPRINTF_STDERR( "line(%d):", line );
528− sprintf( g_buffer, "line(%d):", line );
529+ CK_FPRINTF_STDERR( "line(%d):", (int)line );
530+ snprintf( g_buffer, CK_ERR_BUF_LENGTH, "line(%d):", (int)line );
529531 lastErrorCat( g_buffer );
530532 }
531533 CK_FPRINTF_STDERR( " " );
@@ -536,7 +538,7 @@ void EM_error2b( int line, const char * message, ... ) · 4 unmodified lines
536538 va_end( ap );
537539
538540 va_start( ap, message );
539− vsprintf( g_buffer, message, ap );
541+ vsnprintf( g_buffer, CK_ERR_BUF_LENGTH, message, ap );
540542 va_end( ap );
541543
542544 lastErrorCat( g_buffer );
@@ -545,14 +547,14 @@ void EM_error2b( int line, const char * message, ... ) · 2 unmodified lines
545547 }
546548
547549
548−//
550+//
549551 void EM_error3( const char * message, ... )
550552 {
551553 va_list ap;
552−
554+
553555 // separate errmsgs with newlines
554556 if( g_lasterror[0] != '\0' ) lastErrorCat( "\n" );
555−
557+
556558 // g_lasterror[0] = '\0';
557559 g_buffer[0] = '\0';
558560
@@ -561,7 +563,7 @@ void EM_error3( const char * message, ... ) · 2 unmodified lines
561563 va_end( ap );
562564
563565 va_start( ap, message );
564− vsprintf( g_buffer, message, ap );
566+ vsnprintf( g_buffer, CK_ERR_BUF_LENGTH, message, ap );
565567 va_end( ap );
566568
567569 lastErrorCat( g_buffer );
@@ -575,7 +577,7 @@ void EM_log( t_CKINT level, const char * message, ... ) · 7 unmodified lines
575577 {
576578 va_list ap;
577579
578− if( level > CK_LOG_CRAZY ) level = CK_LOG_CRAZY;
580+ if( level > CK_LOG_ALL ) level = CK_LOG_ALL;
579581 else if( level <= CK_LOG_NONE ) level = CK_LOG_NONE + 1;
580582
581583 // check level
@@ -606,7 +608,7 @@ void EM_log( t_CKINT level, const char * message, ... ) · 24 unmodified lines
606608 // set log level
607609 void EM_setlog( t_CKINT level )
608610 {
609− if( level > CK_LOG_CRAZY ) level = CK_LOG_CRAZY;
611+ if( level > CK_LOG_ALL ) level = CK_LOG_ALL;
610612 else if( level < CK_LOG_NONE ) level = CK_LOG_NONE;
611613 g_loglevel = level;
612614
src/core/chuck_errmsg.h+7−7
@@ -46,14 +46,14 @@ extern t_CKBOOL EM_anyErrors; · 45 unmodified lines
4646 extern t_CKINT EM_tokPos;
4747 extern t_CKINT EM_lineNum;
4848
49−// EM_extLineNum is synced with EM_lineNum in lexer/parser phase, then synced
49+// EM_extLineNum is synced with EM_lineNum in lexer/parser phase, then synced
5050 // with scanner/typechecker (EM_lineNum is not synced with scanner/typechecker)
51−extern t_CKINT EM_extLineNum;
51+extern t_CKINT EM_extLineNum;
5252
5353 void EM_newline( );
5454
5555 // levels
56−#define CK_LOG_CRAZY 10 // set this to log everything
56+#define CK_LOG_ALL 10 // set this to log everything
5757 #define CK_LOG_FINEST 9
5858 #define CK_LOG_FINER 8
5959 #define CK_LOG_FINE 7
@@ -155,9 +155,9 @@ extern t_CKINT g_loglevel; · 95 unmodified lines
155155 // macro to compare
156156 #define DO_LOG(x) ( x <= g_loglevel )
157157
158−void EM_error( int, c_constr, ... );
159−void EM_error2( int, c_constr, ... );
160−void EM_error2b( int, c_constr, ... );
158+void EM_error( t_CKINT, c_constr, ... );
159+void EM_error2( t_CKINT, c_constr, ... );
160+void EM_error2b( t_CKINT, c_constr, ... );
161161 void EM_error3( c_constr, ... );
162162 void EM_impossible( c_constr, ... );
163163 t_CKBOOL EM_reset( c_constr filename, FILE * fd );
@@ -190,7 +190,7 @@ public: · 26 unmodified lines
190190 {
191191 EM_pushlog();
192192 }
193−
193+
194194 ~SmartPushLog()
195195 {
196196 EM_poplog();
src/core/chuck_frame.cpp+9−4
@@ -100,7 +100,7 @@ void Chuck_Frame::push_scope( ) · 99 unmodified lines
100100 // name: get_scope()
101101 // desc: get current scope (added 1.3.0.0)
102102 //-----------------------------------------------------------------------------
103−void Chuck_Frame::get_scope( vector<Chuck_Local *> & out ) const
103+void Chuck_Frame::get_scope( vector<Chuck_Local *> & out, bool localOnly ) const
104104 {
105105 // sanity
106106 assert( this->stack.size() > 0 );
@@ -111,8 +111,13 @@ void Chuck_Frame::get_scope( vector<Chuck_Local *> & out ) const · 4 unmodified lines
111111 t_CKINT index = this->stack.size() - 1;
112112
113113 // loop
114− while( index >= 0 && this->stack[index] != NULL )
114+ while( index >= 0 )
115115 {
116+ // did we hit a stack boundary (delineated by NULL)
117+ // localOnly option added 1.4.2.1 (ge) -- to get all scope in the frame
118+ if( localOnly && this->stack[index] != NULL )
119+ break;
120+
116121 // last thing
117122 local = stack[index];
118123 // move
@@ -140,7 +145,7 @@ void Chuck_Frame::pop_scope( vector<Chuck_Local *> & out ) · 21 unmodified lines
140145
141146 // the local
142147 Chuck_Local * local = NULL;
143−
148+
144149 // loop
145150 while( this->stack.size() && this->stack.back() )
146151 {
@@ -157,7 +162,7 @@ void Chuck_Frame::pop_scope( vector<Chuck_Local *> & out ) · 10 unmodified lines
157162 out.push_back( local );
158163 }
159164 }
160−
165+
161166 // sanity (should be at least one left)
162167 assert( this->stack.size() > 0 );
163168 // get ride of null boundary character (added 1.3.0.0)
src/core/chuck_frame.h+1−1
@@ -92,7 +92,7 @@ public: · 91 unmodified lines
9292 Chuck_Local * alloc_local( t_CKUINT size, const std::string & name,
9393 t_CKBOOL is_ref, t_CKBOOL is_obj, t_CKBOOL is_global );
9494 // get the current scope (added 1.3.0.0)
95− void get_scope( std::vector<Chuck_Local *> & out ) const;
95+ void get_scope( std::vector<Chuck_Local *> & out, bool localOnly = true ) const;
9696 // pop scope
9797 void pop_scope( std::vector<Chuck_Local *> & out );
9898 };
src/core/chuck_globals.cpp+206−206
@@ -436,7 +436,7 @@ struct Chuck_Execute_Chuck_Msg_Request · 435 unmodified lines
436436 struct Chuck_Global_Int_Container
437437 {
438438 t_CKINT val;
439−
439+
440440 Chuck_Global_Int_Container() { val = 0; }
441441 };
442442
@@ -450,7 +450,7 @@ struct Chuck_Global_Int_Container · 7 unmodified lines
450450 struct Chuck_Global_Float_Container
451451 {
452452 t_CKFLOAT val;
453−
453+
454454 Chuck_Global_Float_Container() { val = 0; }
455455 };
456456
@@ -464,7 +464,7 @@ struct Chuck_Global_Float_Container · 7 unmodified lines
464464 struct Chuck_Global_String_Container
465465 {
466466 Chuck_String * val;
467−
467+
468468 Chuck_Global_String_Container() { val = NULL; }
469469 };
470470
@@ -480,7 +480,7 @@ struct Chuck_Global_Event_Container · 9 unmodified lines
480480 Chuck_Event * val;
481481 Chuck_Type * type;
482482 t_CKBOOL ctor_needs_to_be_called;
483−
483+
484484 Chuck_Global_Event_Container() { val = NULL; type = NULL;
485485 ctor_needs_to_be_called = TRUE; }
486486 };
@@ -497,7 +497,7 @@ struct Chuck_Global_UGen_Container · 10 unmodified lines
497497 Chuck_UGen * val;
498498 Chuck_Type * type;
499499 t_CKBOOL ctor_needs_to_be_called;
500−
500+
501501 Chuck_Global_UGen_Container() { val = NULL; type = NULL;
502502 ctor_needs_to_be_called = TRUE; }
503503 };
@@ -514,7 +514,7 @@ struct Chuck_Global_Array_Container · 10 unmodified lines
514514 Chuck_Object * array;
515515 te_GlobalType array_type;
516516 t_CKBOOL ctor_needs_to_be_called;
517−
517+
518518 Chuck_Global_Array_Container( te_GlobalType arr_type )
519519 {
520520 array = NULL;
@@ -535,7 +535,7 @@ struct Chuck_Global_Object_Container · 14 unmodified lines
535535 Chuck_Object * val;
536536 Chuck_Type * type;
537537 t_CKBOOL ctor_needs_to_be_called;
538−
538+
539539 Chuck_Global_Object_Container() { val = NULL; type = NULL;
540540 ctor_needs_to_be_called = TRUE; }
541541 };
@@ -551,7 +551,7 @@ Chuck_Globals_Manager::Chuck_Globals_Manager( Chuck_VM * vm ) · 9 unmodified lines
551551 {
552552 // store
553553 m_vm = vm;
554−
554+
555555 // REFACTOR-2017: TODO might want to dynamically grow queue?
556556 m_global_request_queue.init( 16384 );
557557 m_global_request_retry_queue.init( 16384 );
@@ -609,13 +609,13 @@ t_CKBOOL Chuck_Globals_Manager::getGlobalInt( const char * name, · 51 unmodified lines
609609 get_int_message->name = name;
610610 get_int_message->cb = callback;
611611 get_int_message->cb_type = ck_get_plain;
612−
612+
613613 Chuck_Global_Request r;
614614 r.type = get_global_int_request;
615615 r.getIntRequest = get_int_message;
616−
616+
617617 m_global_request_queue.put( r );
618−
618+
619619 return TRUE;
620620 }
621621
@@ -634,13 +634,13 @@ t_CKBOOL Chuck_Globals_Manager::getGlobalInt( const char * name, · 12 unmodified lines
634634 get_int_message->name = name;
635635 get_int_message->cb_with_name = callback;
636636 get_int_message->cb_type = ck_get_name;
637−
637+
638638 Chuck_Global_Request r;
639639 r.type = get_global_int_request;
640640 r.getIntRequest = get_int_message;
641−
641+
642642 m_global_request_queue.put( r );
643−
643+
644644 return TRUE;
645645 }
646646
@@ -660,13 +660,13 @@ t_CKBOOL Chuck_Globals_Manager::getGlobalInt( const char * name, t_CKINT id, · 13 unmodified lines
660660 get_int_message->cb_with_id = callback;
661661 get_int_message->id = id;
662662 get_int_message->cb_type = ck_get_id;
663−
663+
664664 Chuck_Global_Request r;
665665 r.type = get_global_int_request;
666666 r.getIntRequest = get_int_message;
667−
667+
668668 m_global_request_queue.put( r );
669−
669+
670670 return TRUE;
671671 }
672672
@@ -684,13 +684,13 @@ t_CKBOOL Chuck_Globals_Manager::setGlobalInt( const char * name, t_CKINT val ) · 11 unmodified lines
684684 new Chuck_Set_Global_Int_Request;
685685 set_int_message->name = name;
686686 set_int_message->val = val;
687−
687+
688688 Chuck_Global_Request r;
689689 r.type = set_global_int_request;
690690 r.setIntRequest = set_int_message;
691−
691+
692692 m_global_request_queue.put( r );
693−
693+
694694 return TRUE;
695695 }
696696
@@ -707,7 +707,7 @@ t_CKBOOL Chuck_Globals_Manager::init_global_int( const std::string & name ) · 10 unmodified lines
707707 {
708708 m_global_ints[name] = new Chuck_Global_Int_Container;
709709 }
710−
710+
711711 return TRUE;
712712 }
713713
@@ -722,7 +722,7 @@ t_CKINT Chuck_Globals_Manager::get_global_int_value( const std::string & name ) · 8 unmodified lines
722722 {
723723 // ensure exists
724724 init_global_int( name );
725−
725+
726726 return m_global_ints[name]->val;
727727 }
728728
@@ -753,13 +753,13 @@ t_CKBOOL Chuck_Globals_Manager::getGlobalFloat( const char * name, · 24 unmodified lines
753753 get_float_message->name = name;
754754 get_float_message->cb = callback;
755755 get_float_message->cb_type = ck_get_plain;
756−
756+
757757 Chuck_Global_Request r;
758758 r.type = get_global_float_request;
759759 r.getFloatRequest = get_float_message;
760−
760+
761761 m_global_request_queue.put( r );
762−
762+
763763 return TRUE;
764764 }
765765
@@ -778,13 +778,13 @@ t_CKBOOL Chuck_Globals_Manager::getGlobalFloat( const char * name, · 12 unmodified lines
778778 get_float_message->name = name;
779779 get_float_message->cb_with_name = callback;
780780 get_float_message->cb_type = ck_get_name;
781−
781+
782782 Chuck_Global_Request r;
783783 r.type = get_global_float_request;
784784 r.getFloatRequest = get_float_message;
785−
785+
786786 m_global_request_queue.put( r );
787−
787+
788788 return TRUE;
789789 }
790790
@@ -804,13 +804,13 @@ t_CKBOOL Chuck_Globals_Manager::getGlobalFloat( const char * name, t_CKINT id, · 13 unmodified lines
804804 get_float_message->cb_with_id = callback;
805805 get_float_message->id = id;
806806 get_float_message->cb_type = ck_get_id;
807−
807+
808808 Chuck_Global_Request r;
809809 r.type = get_global_float_request;
810810 r.getFloatRequest = get_float_message;
811−
811+
812812 m_global_request_queue.put( r );
813−
813+
814814 return TRUE;
815815 }
816816
@@ -828,13 +828,13 @@ t_CKBOOL Chuck_Globals_Manager::setGlobalFloat( const char * name, · 11 unmodified lines
828828 new Chuck_Set_Global_Float_Request;
829829 set_float_message->name = name;
830830 set_float_message->val = val;
831−
831+
832832 Chuck_Global_Request r;
833833 r.type = set_global_float_request;
834834 r.setFloatRequest = set_float_message;
835−
835+
836836 m_global_request_queue.put( r );
837−
837+
838838 return TRUE;
839839 }
840840
@@ -851,7 +851,7 @@ t_CKBOOL Chuck_Globals_Manager::init_global_float( const std::string & name ) · 10 unmodified lines
851851 {
852852 m_global_floats[name] = new Chuck_Global_Float_Container;
853853 }
854−
854+
855855 return TRUE;
856856 }
857857
@@ -866,7 +866,7 @@ t_CKFLOAT Chuck_Globals_Manager::get_global_float_value( const std::string & nam · 8 unmodified lines
866866 {
867867 // ensure exists
868868 init_global_float( name );
869−
869+
870870 return m_global_floats[name]->val;
871871 }
872872
@@ -897,13 +897,13 @@ t_CKBOOL Chuck_Globals_Manager::getGlobalString( const char * name, · 24 unmodified lines
897897 get_string_message->name = name;
898898 get_string_message->cb = callback;
899899 get_string_message->cb_type = ck_get_plain;
900−
900+
901901 Chuck_Global_Request r;
902902 r.type = get_global_string_request;
903903 r.getStringRequest = get_string_message;
904−
904+
905905 m_global_request_queue.put( r );
906−
906+
907907 return TRUE;
908908 }
909909
@@ -922,13 +922,13 @@ t_CKBOOL Chuck_Globals_Manager::getGlobalString( const char * name, · 12 unmodified lines
922922 get_string_message->name = name;
923923 get_string_message->cb_with_name = callback;
924924 get_string_message->cb_type = ck_get_name;
925−
925+
926926 Chuck_Global_Request r;
927927 r.type = get_global_string_request;
928928 r.getStringRequest = get_string_message;
929−
929+
930930 m_global_request_queue.put( r );
931−
931+
932932 return TRUE;
933933 }
934934
@@ -948,13 +948,13 @@ t_CKBOOL Chuck_Globals_Manager::getGlobalString( const char * name, t_CKINT id, · 13 unmodified lines
948948 get_string_message->cb_with_id = callback;
949949 get_string_message->id = id;
950950 get_string_message->cb_type = ck_get_id;
951−
951+
952952 Chuck_Global_Request r;
953953 r.type = get_global_string_request;
954954 r.getStringRequest = get_string_message;
955−
955+
956956 m_global_request_queue.put( r );
957−
957+
958958 return TRUE;
959959 }
960960
@@ -972,13 +972,13 @@ t_CKBOOL Chuck_Globals_Manager::setGlobalString( const char * name, · 11 unmodified lines
972972 new Chuck_Set_Global_String_Request;
973973 set_string_message->name = name;
974974 set_string_message->val = val;
975−
975+
976976 Chuck_Global_Request r;
977977 r.type = set_global_string_request;
978978 r.setStringRequest = set_string_message;
979−
979+
980980 m_global_request_queue.put( r );
981−
981+
982982 return TRUE;
983983 }
984984
@@ -998,12 +998,12 @@ t_CKBOOL Chuck_Globals_Manager::init_global_string( const std::string & name ) · 13 unmodified lines
998998 // init
999999 m_global_strings[name]->val = (Chuck_String *)
10001000 instantiate_and_initialize_object( m_vm->env()->t_string, m_vm );
1001−
1001+
10021002 // add reference to prevent deletion
10031003 m_global_strings[name]->val->add_ref();
1004−
1004+
10051005 }
1006−
1006+
10071007 return TRUE;
10081008 }
10091009
@@ -1018,7 +1018,7 @@ Chuck_String * Chuck_Globals_Manager::get_global_string( const std::string & nam · 8 unmodified lines
10181018 {
10191019 // ensure exists
10201020 init_global_string( name );
1021−
1021+
10221022 return m_global_strings[name]->val;
10231023 }
10241024
@@ -1047,13 +1047,13 @@ t_CKBOOL Chuck_Globals_Manager::signalGlobalEvent( const char * name ) · 22 unmodified lines
10471047 new Chuck_Signal_Global_Event_Request;
10481048 signal_event_message->name = name;
10491049 signal_event_message->is_broadcast = FALSE;
1050−
1050+
10511051 Chuck_Global_Request r;
10521052 r.type = signal_global_event_request;
10531053 r.signalEventRequest = signal_event_message;
1054−
1054+
10551055 m_global_request_queue.put( r );
1056−
1056+
10571057 return TRUE;
10581058 }
10591059
@@ -1070,15 +1070,15 @@ t_CKBOOL Chuck_Globals_Manager::broadcastGlobalEvent( const char * name ) · 10 unmodified lines
10701070 new Chuck_Signal_Global_Event_Request;
10711071 signal_event_message->name = name;
10721072 signal_event_message->is_broadcast = TRUE;
1073−
1073+
10741074 Chuck_Global_Request r;
10751075 r.type = signal_global_event_request;
10761076 r.signalEventRequest = signal_event_message;
10771077 // chuck object might not be constructed on time. retry only once
10781078 r.retries = 1;
1079−
1079+
10801080 m_global_request_queue.put( r );
1081−
1081+
10821082 return TRUE;
10831083 }
10841084
@@ -1099,15 +1099,15 @@ t_CKBOOL Chuck_Globals_Manager::listenForGlobalEvent( const char * name, · 14 unmodified lines
10991099 listen_event_message->name = name;
11001100 listen_event_message->listen_forever = listen_forever;
11011101 listen_event_message->deregister = FALSE;
1102−
1102+
11031103 Chuck_Global_Request r;
11041104 r.type = listen_for_global_event_request;
11051105 r.listenForEventRequest = listen_event_message;
11061106 // chuck object might not be constructed on time. retry only once
11071107 r.retries = 1;
1108−
1108+
11091109 m_global_request_queue.put( r );
1110−
1110+
11111111 return TRUE;
11121112 }
11131113
@@ -1129,15 +1129,15 @@ t_CKBOOL Chuck_Globals_Manager::listenForGlobalEvent( const char * name, · 15 unmodified lines
11291129 listen_event_message->name = name;
11301130 listen_event_message->listen_forever = listen_forever;
11311131 listen_event_message->deregister = FALSE;
1132−
1132+
11331133 Chuck_Global_Request r;
11341134 r.type = listen_for_global_event_request;
11351135 r.listenForEventRequest = listen_event_message;
11361136 // chuck object might not be constructed on time. retry only once
11371137 r.retries = 1;
1138−
1138+
11391139 m_global_request_queue.put( r );
1140−
1140+
11411141 return TRUE;
11421142 }
11431143
@@ -1161,15 +1161,15 @@ t_CKBOOL Chuck_Globals_Manager::listenForGlobalEvent( const char * name, · 17 unmodified lines
11611161 listen_event_message->name = name;
11621162 listen_event_message->listen_forever = listen_forever;
11631163 listen_event_message->deregister = FALSE;
1164−
1164+
11651165 Chuck_Global_Request r;
11661166 r.type = listen_for_global_event_request;
11671167 r.listenForEventRequest = listen_event_message;
11681168 // chuck object might not be constructed on time. retry only once
11691169 r.retries = 1;
1170−
1170+
11711171 m_global_request_queue.put( r );
1172−
1172+
11731173 return TRUE;
11741174 }
11751175
@@ -1190,13 +1190,13 @@ t_CKBOOL Chuck_Globals_Manager::stopListeningForGlobalEvent( const char * name, · 14 unmodified lines
11901190 listen_event_message->name = name;
11911191 listen_event_message->listen_forever = FALSE;
11921192 listen_event_message->deregister = TRUE;
1193−
1193+
11941194 Chuck_Global_Request r;
11951195 r.type = listen_for_global_event_request;
11961196 r.listenForEventRequest = listen_event_message;
1197−
1197+
11981198 m_global_request_queue.put( r );
1199−
1199+
12001200 return TRUE;
12011201 }
12021202
@@ -1217,13 +1217,13 @@ t_CKBOOL Chuck_Globals_Manager::stopListeningForGlobalEvent( const char * name, · 14 unmodified lines
12171217 listen_event_message->name = name;
12181218 listen_event_message->listen_forever = FALSE;
12191219 listen_event_message->deregister = TRUE;
1220−
1220+
12211221 Chuck_Global_Request r;
12221222 r.type = listen_for_global_event_request;
12231223 r.listenForEventRequest = listen_event_message;
1224−
1224+
12251225 m_global_request_queue.put( r );
1226−
1226+
12271227 return TRUE;
12281228 }
12291229
@@ -1245,13 +1245,13 @@ t_CKBOOL Chuck_Globals_Manager::stopListeningForGlobalEvent( const char * name, · 15 unmodified lines
12451245 listen_event_message->name = name;
12461246 listen_event_message->listen_forever = FALSE;
12471247 listen_event_message->deregister = TRUE;
1248−
1248+
12491249 Chuck_Global_Request r;
12501250 r.type = listen_for_global_event_request;
12511251 r.listenForEventRequest = listen_event_message;
1252−
1252+
12531253 m_global_request_queue.put( r );
1254−
1254+
12551255 return TRUE;
12561256 }
12571257
@@ -1284,7 +1284,7 @@ t_CKBOOL Chuck_Globals_Manager::init_global_event( const std::string & name, · 26 unmodified lines
12841284 {
12851285 return FALSE;
12861286 }
1287−
1287+
12881288 return TRUE;
12891289 }
12901290
@@ -1329,10 +1329,10 @@ t_CKBOOL Chuck_Globals_Manager::getGlobalUGenSamples( const char * name, · 38 unmodified lines
13291329 // fail without doing anything
13301330 return FALSE;
13311331 }
1332−
1332+
13331333 // else, fill (if the ugen isn't buffered, then it will fill with zeroes)
13341334 m_global_ugens[name]->val->get_buffer( buffer, numFrames );
1335−
1335+
13361336 return TRUE;
13371337 }
13381338
@@ -1346,7 +1346,7 @@ t_CKBOOL Chuck_Globals_Manager::getGlobalUGenSamples( const char * name, · 7 unmodified lines
13461346 t_CKBOOL Chuck_Globals_Manager::init_global_ugen( const std::string & name,
13471347 Chuck_Type * type )
13481348 {
1349−
1349+
13501350 // if it hasn't been initted yet
13511351 if( m_global_ugens.count( name ) == 0 )
13521352 {
@@ -1366,7 +1366,7 @@ t_CKBOOL Chuck_Globals_Manager::init_global_ugen( const std::string & name, · 13 unmodified lines
13661366 {
13671367 return FALSE;
13681368 }
1369−
1369+
13701370 return TRUE;
13711371 }
13721372
@@ -1439,15 +1439,15 @@ t_CKBOOL Chuck_Globals_Manager::setGlobalIntArray( const char * name, · 66 unmodified lines
14391439 {
14401440 message->arrayValues[i] = arrayValues[i];
14411441 }
1442−
1442+
14431443 Chuck_Global_Request r;
14441444 r.type = set_global_int_array_request;
14451445 r.setIntArrayRequest = message;
14461446 // chuck object might not be constructed on time. retry only once
14471447 r.retries = 1;
1448−
1448+
14491449 m_global_request_queue.put( r );
1450−
1450+
14511451 return TRUE;
14521452 }
14531453
@@ -1466,15 +1466,15 @@ t_CKBOOL Chuck_Globals_Manager::getGlobalIntArray( const char * name, · 12 unmodified lines
14661466 message->name = name;
14671467 message->cb = callback;
14681468 message->cb_type = ck_get_plain;
1469−
1469+
14701470 Chuck_Global_Request r;
14711471 r.type = get_global_int_array_request;
14721472 r.getIntArrayRequest = message;
14731473 // chuck object might not be constructed on time. retry only once
14741474 r.retries = 1;
1475−
1475+
14761476 m_global_request_queue.put( r );
1477−
1477+
14781478 return TRUE;
14791479 }
14801480
@@ -1493,15 +1493,15 @@ t_CKBOOL Chuck_Globals_Manager::getGlobalIntArray( const char * name, · 12 unmodified lines
14931493 message->name = name;
14941494 message->cb_with_name = callback;
14951495 message->cb_type = ck_get_name;
1496−
1496+
14971497 Chuck_Global_Request r;
14981498 r.type = get_global_int_array_request;
14991499 r.getIntArrayRequest = message;
15001500 // chuck object might not be constructed on time. retry only once
15011501 r.retries = 1;
1502−
1502+
15031503 m_global_request_queue.put( r );
1504−
1504+
15051505 return TRUE;
15061506 }
15071507
@@ -1521,15 +1521,15 @@ t_CKBOOL Chuck_Globals_Manager::getGlobalIntArray( const char * name, · 13 unmodified lines
15211521 message->cb_with_id = callback;
15221522 message->id = id;
15231523 message->cb_type = ck_get_id;
1524−
1524+
15251525 Chuck_Global_Request r;
15261526 r.type = get_global_int_array_request;
15271527 r.getIntArrayRequest = message;
15281528 // chuck object might not be constructed on time. retry only once
15291529 r.retries = 1;
1530−
1530+
15311531 m_global_request_queue.put( r );
1532−
1532+
15331533 return TRUE;
15341534 }
15351535
@@ -1548,15 +1548,15 @@ t_CKBOOL Chuck_Globals_Manager::setGlobalIntArrayValue( const char * name, · 12 unmodified lines
15481548 message->name = name;
15491549 message->index = index;
15501550 message->value = value;
1551−
1551+
15521552 Chuck_Global_Request r;
15531553 r.type = set_global_int_array_value_request;
15541554 r.setIntArrayValueRequest = message;
15551555 // chuck object might not be constructed on time. retry only once
15561556 r.retries = 1;
1557−
1557+
15581558 m_global_request_queue.put( r );
1559−
1559+
15601560 return TRUE;
15611561 }
15621562
@@ -1576,15 +1576,15 @@ t_CKBOOL Chuck_Globals_Manager::getGlobalIntArrayValue( const char * name, · 13 unmodified lines
15761576 message->index = index;
15771577 message->cb = callback;
15781578 message->cb_type = ck_get_plain;
1579−
1579+
15801580 Chuck_Global_Request r;
15811581 r.type = get_global_int_array_value_request;
15821582 r.getIntArrayValueRequest = message;
15831583 // chuck object might not be constructed on time. retry only once
15841584 r.retries = 1;
1585−
1585+
15861586 m_global_request_queue.put( r );
1587−
1587+
15881588 return TRUE;
15891589 }
15901590
@@ -1604,15 +1604,15 @@ t_CKBOOL Chuck_Globals_Manager::getGlobalIntArrayValue( const char * name, · 13 unmodified lines
16041604 message->index = index;
16051605 message->cb_with_name = callback;
16061606 message->cb_type = ck_get_name;
1607−
1607+
16081608 Chuck_Global_Request r;
16091609 r.type = get_global_int_array_value_request;
16101610 r.getIntArrayValueRequest = message;
16111611 // chuck object might not be constructed on time. retry only once
16121612 r.retries = 1;
1613−
1613+
16141614 m_global_request_queue.put( r );
1615−
1615+
16161616 return TRUE;
16171617 }
16181618
@@ -1633,15 +1633,15 @@ t_CKBOOL Chuck_Globals_Manager::getGlobalIntArrayValue( const char * name, · 14 unmodified lines
16331633 message->cb_with_id = callback;
16341634 message->id = id;
16351635 message->cb_type = ck_get_id;
1636−
1636+
16371637 Chuck_Global_Request r;
16381638 r.type = get_global_int_array_value_request;
16391639 r.getIntArrayValueRequest = message;
16401640 // chuck object might not be constructed on time. retry only once
16411641 r.retries = 1;
1642−
1642+
16431643 m_global_request_queue.put( r );
1644−
1644+
16451645 return TRUE;
16461646 }
16471647
@@ -1660,15 +1660,15 @@ t_CKBOOL Chuck_Globals_Manager::setGlobalAssociativeIntArrayValue( · 12 unmodified lines
16601660 message->name = name;
16611661 message->key = key;
16621662 message->value = value;
1663−
1663+
16641664 Chuck_Global_Request r;
16651665 r.type = set_global_associative_int_array_value_request;
16661666 r.setAssociativeIntArrayValueRequest = message;
16671667 // chuck object might not be constructed on time. retry only once
16681668 r.retries = 1;
1669−
1669+
16701670 m_global_request_queue.put( r );
1671−
1671+
16721672 return TRUE;
16731673 }
16741674
@@ -1688,15 +1688,15 @@ t_CKBOOL Chuck_Globals_Manager::getGlobalAssociativeIntArrayValue( · 13 unmodified lines
16881688 message->key = key;
16891689 message->cb = callback;
16901690 message->cb_type = ck_get_plain;
1691−
1691+
16921692 Chuck_Global_Request r;
16931693 r.type = get_global_associative_int_array_value_request;
16941694 r.getAssociativeIntArrayValueRequest = message;
16951695 // chuck object might not be constructed on time. retry only once
16961696 r.retries = 1;
1697−
1697+
16981698 m_global_request_queue.put( r );
1699−
1699+
17001700 return TRUE;
17011701 }
17021702
@@ -1716,15 +1716,15 @@ t_CKBOOL Chuck_Globals_Manager::getGlobalAssociativeIntArrayValue( const char * · 13 unmodified lines
17161716 message->key = key;
17171717 message->cb_with_name = callback;
17181718 message->cb_type = ck_get_name;
1719−
1719+
17201720 Chuck_Global_Request r;
17211721 r.type = get_global_associative_int_array_value_request;
17221722 r.getAssociativeIntArrayValueRequest = message;
17231723 // chuck object might not be constructed on time. retry only once
17241724 r.retries = 1;
1725−
1725+
17261726 m_global_request_queue.put( r );
1727−
1727+
17281728 return TRUE;
17291729 }
17301730
@@ -1745,15 +1745,15 @@ t_CKBOOL Chuck_Globals_Manager::getGlobalAssociativeIntArrayValue( const char * · 14 unmodified lines
17451745 message->cb_with_id = callback;
17461746 message->id = id;
17471747 message->cb_type = ck_get_id;
1748−
1748+
17491749 Chuck_Global_Request r;
17501750 r.type = get_global_associative_int_array_value_request;
17511751 r.getAssociativeIntArrayValueRequest = message;
17521752 // chuck object might not be constructed on time. retry only once
17531753 r.retries = 1;
1754−
1754+
17551755 m_global_request_queue.put( r );
1756−
1756+
17571757 return TRUE;
17581758 }
17591759
@@ -1775,15 +1775,15 @@ t_CKBOOL Chuck_Globals_Manager::setGlobalFloatArray( const char * name, · 15 unmodified lines
17751775 {
17761776 message->arrayValues[i] = arrayValues[i];
17771777 }
1778−
1778+
17791779 Chuck_Global_Request r;
17801780 r.type = set_global_float_array_request;
17811781 r.setFloatArrayRequest = message;
17821782 // chuck object might not be constructed on time. retry only once
17831783 r.retries = 1;
1784−
1784+
17851785 m_global_request_queue.put( r );
1786−
1786+
17871787 return TRUE;
17881788 }
17891789
@@ -1802,15 +1802,15 @@ t_CKBOOL Chuck_Globals_Manager::getGlobalFloatArray( const char * name, · 12 unmodified lines
18021802 message->name = name;
18031803 message->cb = callback;
18041804 message->cb_type = ck_get_plain;
1805−
1805+
18061806 Chuck_Global_Request r;
18071807 r.type = get_global_float_array_request;
18081808 r.getFloatArrayRequest = message;
18091809 // chuck object might not be constructed on time. retry only once
18101810 r.retries = 1;
1811−
1811+
18121812 m_global_request_queue.put( r );
1813−
1813+
18141814 return TRUE;
18151815 }
18161816
@@ -1829,15 +1829,15 @@ t_CKBOOL Chuck_Globals_Manager::getGlobalFloatArray( const char * name, · 12 unmodified lines
18291829 message->name = name;
18301830 message->cb_with_name = callback;
18311831 message->cb_type = ck_get_name;
1832−
1832+
18331833 Chuck_Global_Request r;
18341834 r.type = get_global_float_array_request;
18351835 r.getFloatArrayRequest = message;
18361836 // chuck object might not be constructed on time. retry only once
18371837 r.retries = 1;
1838−
1838+
18391839 m_global_request_queue.put( r );
1840−
1840+
18411841 return TRUE;
18421842 }
18431843
@@ -1857,15 +1857,15 @@ t_CKBOOL Chuck_Globals_Manager::getGlobalFloatArray( const char * name, · 13 unmodified lines
18571857 message->cb_with_id = callback;
18581858 message->id = id;
18591859 message->cb_type = ck_get_id;
1860−
1860+
18611861 Chuck_Global_Request r;
18621862 r.type = get_global_float_array_request;
18631863 r.getFloatArrayRequest = message;
18641864 // chuck object might not be constructed on time. retry only once
18651865 r.retries = 1;
1866−
1866+
18671867 m_global_request_queue.put( r );
1868−
1868+
18691869 return TRUE;
18701870 }
18711871
@@ -1884,15 +1884,15 @@ t_CKBOOL Chuck_Globals_Manager::setGlobalFloatArrayValue( const char * name, · 12 unmodified lines
18841884 message->name = name;
18851885 message->index = index;
18861886 message->value = value;
1887−
1887+
18881888 Chuck_Global_Request r;
18891889 r.type = set_global_float_array_value_request;
18901890 r.setFloatArrayValueRequest = message;
18911891 // chuck object might not be constructed on time. retry only once
18921892 r.retries = 1;
1893−
1893+
18941894 m_global_request_queue.put( r );
1895−
1895+
18961896 return TRUE;
18971897 }
18981898
@@ -1912,15 +1912,15 @@ t_CKBOOL Chuck_Globals_Manager::getGlobalFloatArrayValue( const char * name, · 13 unmodified lines
19121912 message->index = index;
19131913 message->cb = callback;
19141914 message->cb_type = ck_get_plain;
1915−
1915+
19161916 Chuck_Global_Request r;
19171917 r.type = get_global_float_array_value_request;
19181918 r.getFloatArrayValueRequest = message;
19191919 // chuck object might not be constructed on time. retry only once
19201920 r.retries = 1;
1921−
1921+
19221922 m_global_request_queue.put( r );
1923−
1923+
19241924 return TRUE;
19251925 }
19261926
@@ -1940,15 +1940,15 @@ t_CKBOOL Chuck_Globals_Manager::getGlobalFloatArrayValue( const char * name, · 13 unmodified lines
19401940 message->index = index;
19411941 message->cb_with_name = callback;
19421942 message->cb_type = ck_get_name;
1943−
1943+
19441944 Chuck_Global_Request r;
19451945 r.type = get_global_float_array_value_request;
19461946 r.getFloatArrayValueRequest = message;
19471947 // chuck object might not be constructed on time. retry only once
19481948 r.retries = 1;
1949−
1949+
19501950 m_global_request_queue.put( r );
1951−
1951+
19521952 return TRUE;
19531953 }
19541954
@@ -1969,15 +1969,15 @@ t_CKBOOL Chuck_Globals_Manager::getGlobalFloatArrayValue( const char * name, · 14 unmodified lines
19691969 message->cb_with_id = callback;
19701970 message->id = id;
19711971 message->cb_type = ck_get_id;
1972−
1972+
19731973 Chuck_Global_Request r;
19741974 r.type = get_global_float_array_value_request;
19751975 r.getFloatArrayValueRequest = message;
19761976 // chuck object might not be constructed on time. retry only once
19771977 r.retries = 1;
1978−
1978+
19791979 m_global_request_queue.put( r );
1980−
1980+
19811981 return TRUE;
19821982 }
19831983
@@ -1996,15 +1996,15 @@ t_CKBOOL Chuck_Globals_Manager::setGlobalAssociativeFloatArrayValue( const char · 12 unmodified lines
19961996 message->name = name;
19971997 message->key = key;
19981998 message->value = value;
1999−
1999+
20002000 Chuck_Global_Request r;
20012001 r.type = set_global_associative_float_array_value_request;
20022002 r.setAssociativeFloatArrayValueRequest = message;
20032003 // chuck object might not be constructed on time. retry only once
20042004 r.retries = 1;
2005−
2005+
20062006 m_global_request_queue.put( r );
2007−
2007+
20082008 return TRUE;
20092009 }
20102010
@@ -2024,15 +2024,15 @@ t_CKBOOL Chuck_Globals_Manager::getGlobalAssociativeFloatArrayValue( const char · 13 unmodified lines
20242024 message->key = key;
20252025 message->cb = callback;
20262026 message->cb_type = ck_get_plain;
2027−
2027+
20282028 Chuck_Global_Request r;
20292029 r.type = get_global_associative_float_array_value_request;
20302030 r.getAssociativeFloatArrayValueRequest = message;
20312031 // chuck object might not be constructed on time. retry only once
20322032 r.retries = 1;
2033−
2033+
20342034 m_global_request_queue.put( r );
2035−
2035+
20362036 return TRUE;
20372037 }
20382038
@@ -2052,15 +2052,15 @@ t_CKBOOL Chuck_Globals_Manager::getGlobalAssociativeFloatArrayValue( const char · 13 unmodified lines
20522052 message->key = key;
20532053 message->cb_with_name = callback;
20542054 message->cb_type = ck_get_name;
2055−
2055+
20562056 Chuck_Global_Request r;
20572057 r.type = get_global_associative_float_array_value_request;
20582058 r.getAssociativeFloatArrayValueRequest = message;
20592059 // chuck object might not be constructed on time. retry only once
20602060 r.retries = 1;
2061−
2061+
20622062 m_global_request_queue.put( r );
2063−
2063+
20642064 return TRUE;
20652065 }
20662066
@@ -2082,15 +2082,15 @@ t_CKBOOL Chuck_Globals_Manager::getGlobalAssociativeFloatArrayValue( · 15 unmodified lines
20822082 message->cb_with_id = callback;
20832083 message->id = id;
20842084 message->cb_type = ck_get_id;
2085−
2085+
20862086 Chuck_Global_Request r;
20872087 r.type = get_global_associative_float_array_value_request;
20882088 r.getAssociativeFloatArrayValueRequest = message;
20892089 // chuck object might not be constructed on time. retry only once
20902090 r.retries = 1;
2091−
2091+
20922092 m_global_request_queue.put( r );
2093−
2093+
20942094 return TRUE;
20952095 }
20962096
@@ -2106,14 +2106,14 @@ t_CKBOOL Chuck_Globals_Manager::execute_chuck_msg_with_globals( Chuck_Msg * msg · 9 unmodified lines
21062106 Chuck_Execute_Chuck_Msg_Request * message =
21072107 new Chuck_Execute_Chuck_Msg_Request;
21082108 message->msg = msg;
2109−
2109+
21102110 Chuck_Global_Request r;
21112111 r.type = execute_chuck_msg_request;
21122112 r.executeChuckMsgRequest = message;
21132113 r.retries = 0;
2114−
2114+
21152115 m_global_request_queue.put( r );
2116−
2116+
21172117 return TRUE;
21182118 }
21192119
@@ -2139,7 +2139,7 @@ t_CKBOOL Chuck_Globals_Manager::init_global_array( const std::string & name, Chu · 19 unmodified lines
21392139 // TODO: how to keep reference to prevent from being deleted if
21402140 // a script ends and takes the array with it?
21412141 }
2142−
2142+
21432143 return TRUE;
21442144 }
21452145
@@ -2281,7 +2281,7 @@ t_CKBOOL Chuck_Globals_Manager::init_global_object( const std::string & name, · 135 unmodified lines
22812281 {
22822282 return FALSE;
22832283 }
2284−
2284+
22852285 return TRUE;
22862286 }
22872287
@@ -2432,7 +2432,7 @@ void Chuck_Globals_Manager::cleanup_global_variables() · 144 unmodified lines
24322432 delete (it->second);
24332433 }
24342434 m_global_ints.clear();
2435−
2435+
24362436 // floats: delete containers and clear map
24372437 for( std::map< std::string, Chuck_Global_Float_Container * >::iterator it=
24382438 m_global_floats.begin(); it!=m_global_floats.end(); it++ )
@@ -2440,7 +2440,7 @@ void Chuck_Globals_Manager::cleanup_global_variables() · 1 unmodified line
24402440 delete (it->second);
24412441 }
24422442 m_global_floats.clear();
2443−
2443+
24442444 // strings: release strings, delete containers, and clear map
24452445 for( std::map< std::string, Chuck_Global_String_Container * >::iterator it=
24462446 m_global_strings.begin(); it!=m_global_strings.end(); it++ )
@@ -2449,7 +2449,7 @@ void Chuck_Globals_Manager::cleanup_global_variables() · 2 unmodified lines
24492449 delete (it->second);
24502450 }
24512451 m_global_strings.clear();
2452−
2452+
24532453 // events: release events, delete containers, and clear map
24542454 for( std::map< std::string, Chuck_Global_Event_Container * >::iterator it=
24552455 m_global_events.begin(); it!=m_global_events.end(); it++ )
@@ -2458,7 +2458,7 @@ void Chuck_Globals_Manager::cleanup_global_variables() · 2 unmodified lines
24582458 delete (it->second);
24592459 }
24602460 m_global_events.clear();
2461−
2461+
24622462 // ugens: release ugens, delete containers, and clear map
24632463 for( std::map< std::string, Chuck_Global_UGen_Container * >::iterator it=
24642464 m_global_ugens.begin(); it!=m_global_ugens.end(); it++ )
@@ -2467,7 +2467,7 @@ void Chuck_Globals_Manager::cleanup_global_variables() · 2 unmodified lines
24672467 delete (it->second);
24682468 }
24692469 m_global_ugens.clear();
2470−
2470+
24712471 // arrays: release arrays, delete containers, and clear map
24722472 for( std::map< std::string, Chuck_Global_Array_Container * >::iterator it=
24732473 m_global_arrays.begin(); it!=m_global_arrays.end(); it++ )
@@ -2479,7 +2479,7 @@ void Chuck_Globals_Manager::cleanup_global_variables() · 5 unmodified lines
24792479 delete (it->second);
24802480 }
24812481 m_global_arrays.clear();
2482−
2482+
24832483 // ugens: release objects, delete containers, and clear map
24842484 for( std::map< std::string, Chuck_Global_Object_Container * >::iterator it=
24852485 m_global_objects.begin(); it!=m_global_objects.end(); it++ )
@@ -2500,11 +2500,11 @@ void Chuck_Globals_Manager::cleanup_global_variables() · 14 unmodified lines
25002500 void Chuck_Globals_Manager::handle_global_queue_messages()
25012501 {
25022502 bool should_retry_this_request = false;
2503−
2503+
25042504 while( m_global_request_queue.more() )
25052505 {
25062506 should_retry_this_request = false;
2507−
2507+
25082508 Chuck_Global_Request message;
25092509 if( m_global_request_queue.get( & message ) )
25102510 {
@@ -2519,12 +2519,12 @@ void Chuck_Globals_Manager::handle_global_queue_messages() · 8 unmodified lines
25192519 // clean up request storage
25202520 SAFE_DELETE( message.executeChuckMsgRequest );
25212521 break;
2522−
2522+
25232523 case spork_shred_request:
25242524 // spork the shred!
25252525 m_vm->spork( message.shred );
25262526 break;
2527−
2527+
25282528 case set_global_int_request:
25292529 // ensure the container exists
25302530 init_global_int( message.setIntRequest->name );
@@ -2533,7 +2533,7 @@ void Chuck_Globals_Manager::handle_global_queue_messages() · 2 unmodified lines
25332533 // clean up request storage
25342534 SAFE_DELETE( message.setIntRequest );
25352535 break;
2536−
2536+
25372537 case get_global_int_request:
25382538 // ensure one of the callbacks is not null (union)
25392539 if( message.getIntRequest->cb != NULL )
@@ -2557,7 +2557,7 @@ void Chuck_Globals_Manager::handle_global_queue_messages() · 17 unmodified lines
25572557 // clean up request storage
25582558 SAFE_DELETE( message.getIntRequest );
25592559 break;
2560−
2560+
25612561 case set_global_float_request:
25622562 // ensure the container exists
25632563 init_global_float( message.setFloatRequest->name );
@@ -2566,7 +2566,7 @@ void Chuck_Globals_Manager::handle_global_queue_messages() · 2 unmodified lines
25662566 // clean up request storage
25672567 SAFE_DELETE( message.setFloatRequest );
25682568 break;
2569−
2569+
25702570 case get_global_float_request:
25712571 // ensure one cb is not null (union)
25722572 if( message.getFloatRequest->cb != NULL )
@@ -2590,7 +2590,7 @@ void Chuck_Globals_Manager::handle_global_queue_messages() · 17 unmodified lines
25902590 // clean up request storage
25912591 SAFE_DELETE( message.getFloatRequest );
25922592 break;
2593−
2593+
25942594 case set_global_string_request:
25952595 // ensure the container exists
25962596 init_global_string( message.setStringRequest->name );
@@ -2599,7 +2599,7 @@ void Chuck_Globals_Manager::handle_global_queue_messages() · 2 unmodified lines
25992599 // clean up request storage
26002600 SAFE_DELETE( message.setStringRequest );
26012601 break;
2602−
2602+
26032603 case get_global_string_request:
26042604 // ensure one callback is not null (union)
26052605 if( message.getStringRequest->cb != NULL )
@@ -2623,7 +2623,7 @@ void Chuck_Globals_Manager::handle_global_queue_messages() · 17 unmodified lines
26232623 // clean up request storage
26242624 SAFE_DELETE( message.getStringRequest );
26252625 break;
2626−
2626+
26272627 case signal_global_event_request:
26282628 // ensure it exists and it doesn't need its ctor called
26292629 if( m_global_events.count( message.signalEventRequest->name ) > 0 &&
@@ -2651,7 +2651,7 @@ void Chuck_Globals_Manager::handle_global_queue_messages() · 21 unmodified lines
26512651 should_retry_this_request = true;
26522652 }
26532653 }
2654−
2654+
26552655 // clean up request storage
26562656 if( should_retry_this_request )
26572657 {
@@ -2662,7 +2662,7 @@ void Chuck_Globals_Manager::handle_global_queue_messages() · 4 unmodified lines
26622662 SAFE_DELETE( message.signalEventRequest );
26632663 }
26642664 break;
2665−
2665+
26662666 case listen_for_global_event_request:
26672667 // ensure a callback is not null (union)
26682668 if( message.listenForEventRequest->cb != NULL )
@@ -2689,7 +2689,7 @@ void Chuck_Globals_Manager::handle_global_queue_messages() · 20 unmodified lines
26892689 message.listenForEventRequest->cb_with_id );
26902690 break;
26912691 }
2692−
2692+
26932693 }
26942694 else
26952695 {
@@ -2711,7 +2711,7 @@ void Chuck_Globals_Manager::handle_global_queue_messages() · 15 unmodified lines
27112711 message.listenForEventRequest->listen_forever );
27122712 break;
27132713 }
2714−
2714+
27152715 }
27162716 }
27172717 else
@@ -2733,7 +2733,7 @@ void Chuck_Globals_Manager::handle_global_queue_messages() · 15 unmodified lines
27332733 SAFE_DELETE( message.listenForEventRequest );
27342734 }
27352735 break;
2736−
2736+
27372737 case set_global_int_array_request:
27382738 {
27392739 // replace an entire array, if it exists
@@ -2749,7 +2749,7 @@ void Chuck_Globals_Manager::handle_global_queue_messages() · 9 unmodified lines
27492749 // it exists! get existing array, new size
27502750 Chuck_Array4 * intArray = (Chuck_Array4 *) array;
27512751 t_CKUINT newSize = request->arrayValues.size();
2752−
2752+
27532753 // resize and copy in
27542754 intArray->set_size( newSize );
27552755 for( int i = 0; i < newSize; i++ )
@@ -2767,7 +2767,7 @@ void Chuck_Globals_Manager::handle_global_queue_messages() · 11 unmodified lines
27672767 }
27682768 }
27692769 }
2770−
2770+
27712771 // clean up request storage
27722772 if( should_retry_this_request )
27732773 {
@@ -2778,7 +2778,7 @@ void Chuck_Globals_Manager::handle_global_queue_messages() · 4 unmodified lines
27782778 SAFE_DELETE( message.setIntArrayRequest );
27792779 }
27802780 break;
2781−
2781+
27822782 case get_global_int_array_request:
27832783 {
27842784 // fetch an entire array, if it exists
@@ -2828,7 +2828,7 @@ void Chuck_Globals_Manager::handle_global_queue_messages() · 43 unmodified lines
28282828 }
28292829 }
28302830 }
2831−
2831+
28322832 // clean up request storage
28332833 if( should_retry_this_request )
28342834 {
@@ -2839,7 +2839,7 @@ void Chuck_Globals_Manager::handle_global_queue_messages() · 4 unmodified lines
28392839 SAFE_DELETE( message.getIntArrayRequest );
28402840 }
28412841 break;
2842−
2842+
28432843 case set_global_int_array_value_request:
28442844 {
28452845 // set a single value, if array exists and index in range
@@ -2870,7 +2870,7 @@ void Chuck_Globals_Manager::handle_global_queue_messages() · 24 unmodified lines
28702870 }
28712871 }
28722872 }
2873−
2873+
28742874 // clean up request storage
28752875 if( should_retry_this_request )
28762876 {
@@ -2881,7 +2881,7 @@ void Chuck_Globals_Manager::handle_global_queue_messages() · 4 unmodified lines
28812881 SAFE_DELETE( message.setIntArrayValueRequest );
28822882 }
28832883 break;
2884−
2884+
28852885 case get_global_int_array_value_request:
28862886 {
28872887 // get a single value, if array exists and index in range
@@ -2923,7 +2923,7 @@ void Chuck_Globals_Manager::handle_global_queue_messages() · 35 unmodified lines
29232923 }
29242924 }
29252925 }
2926−
2926+
29272927 // clean up request storage
29282928 if( should_retry_this_request )
29292929 {
@@ -2934,7 +2934,7 @@ void Chuck_Globals_Manager::handle_global_queue_messages() · 4 unmodified lines
29342934 SAFE_DELETE( message.getIntArrayValueRequest );
29352935 }
29362936 break;
2937−
2937+
29382938 case set_global_associative_int_array_value_request:
29392939 {
29402940 // set a single value by key, if array exists
@@ -2962,7 +2962,7 @@ void Chuck_Globals_Manager::handle_global_queue_messages() · 21 unmodified lines
29622962 }
29632963 }
29642964 }
2965−
2965+
29662966 // clean up request storage
29672967 if( should_retry_this_request )
29682968 {
@@ -2973,7 +2973,7 @@ void Chuck_Globals_Manager::handle_global_queue_messages() · 4 unmodified lines
29732973 SAFE_DELETE( message.setAssociativeIntArrayValueRequest );
29742974 }
29752975 break;
2976−
2976+
29772977 case get_global_associative_int_array_value_request:
29782978 {
29792979 // get a single value by key, if array exists and key in map
@@ -3015,7 +3015,7 @@ void Chuck_Globals_Manager::handle_global_queue_messages() · 35 unmodified lines
30153015 }
30163016 }
30173017 }
3018−
3018+
30193019 // clean up request storage
30203020 if( should_retry_this_request )
30213021 {
@@ -3026,7 +3026,7 @@ void Chuck_Globals_Manager::handle_global_queue_messages() · 4 unmodified lines
30263026 SAFE_DELETE( message.getAssociativeIntArrayValueRequest );
30273027 }
30283028 break;
3029−
3029+
30303030 case set_global_float_array_request:
30313031 {
30323032 // replace an entire array, if it exists
@@ -3042,7 +3042,7 @@ void Chuck_Globals_Manager::handle_global_queue_messages() · 9 unmodified lines
30423042 // it exists! get existing array, new size
30433043 Chuck_Array8 * floatArray = (Chuck_Array8 *) array;
30443044 t_CKUINT newSize = request->arrayValues.size();
3045−
3045+
30463046 // resize and copy in
30473047 floatArray->set_size( newSize );
30483048 for( int i = 0; i < newSize; i++ )
@@ -3060,7 +3060,7 @@ void Chuck_Globals_Manager::handle_global_queue_messages() · 11 unmodified lines
30603060 }
30613061 }
30623062 }
3063−
3063+
30643064 // clean up request storage
30653065 if( should_retry_this_request )
30663066 {
@@ -3071,7 +3071,7 @@ void Chuck_Globals_Manager::handle_global_queue_messages() · 4 unmodified lines
30713071 SAFE_DELETE( message.setFloatArrayRequest );
30723072 }
30733073 break;
3074−
3074+
30753075 case get_global_float_array_request:
30763076 {
30773077 // fetch an entire array, if it exists
@@ -3120,7 +3120,7 @@ void Chuck_Globals_Manager::handle_global_queue_messages() · 42 unmodified lines
31203120 }
31213121 }
31223122 }
3123−
3123+
31243124 // clean up request storage
31253125 if( should_retry_this_request )
31263126 {
@@ -3131,7 +3131,7 @@ void Chuck_Globals_Manager::handle_global_queue_messages() · 4 unmodified lines
31313131 SAFE_DELETE( message.getFloatArrayRequest );
31323132 }
31333133 break;
3134−
3134+
31353135 case set_global_float_array_value_request:
31363136 {
31373137 // set a single value, if array exists and index in range
@@ -3162,7 +3162,7 @@ void Chuck_Globals_Manager::handle_global_queue_messages() · 24 unmodified lines
31623162 }
31633163 }
31643164 }
3165−
3165+
31663166 // clean up request storage
31673167 if( should_retry_this_request )
31683168 {
@@ -3173,7 +3173,7 @@ void Chuck_Globals_Manager::handle_global_queue_messages() · 4 unmodified lines
31733173 SAFE_DELETE( message.setFloatArrayValueRequest );
31743174 }
31753175 break;
3176−
3176+
31773177 case get_global_float_array_value_request:
31783178 {
31793179 // get a single value, if array exists and index in range
@@ -3214,7 +3214,7 @@ void Chuck_Globals_Manager::handle_global_queue_messages() · 34 unmodified lines
32143214 }
32153215 }
32163216 }
3217−
3217+
32183218 // clean up request storage
32193219 if( should_retry_this_request )
32203220 {
@@ -3225,7 +3225,7 @@ void Chuck_Globals_Manager::handle_global_queue_messages() · 4 unmodified lines
32253225 SAFE_DELETE( message.getFloatArrayValueRequest );
32263226 }
32273227 break;
3228−
3228+
32293229 case set_global_associative_float_array_value_request:
32303230 {
32313231 // set a single value by key, if array exists
@@ -3253,7 +3253,7 @@ void Chuck_Globals_Manager::handle_global_queue_messages() · 21 unmodified lines
32533253 }
32543254 }
32553255 }
3256−
3256+
32573257 // clean up request storage
32583258 if( should_retry_this_request )
32593259 {
@@ -3264,7 +3264,7 @@ void Chuck_Globals_Manager::handle_global_queue_messages() · 4 unmodified lines
32643264 SAFE_DELETE( message.setAssociativeFloatArrayValueRequest );
32653265 }
32663266 break;
3267−
3267+
32683268 case get_global_associative_float_array_value_request:
32693269 {
32703270 // get a single value by key, if array exists and key in map
@@ -3305,7 +3305,7 @@ void Chuck_Globals_Manager::handle_global_queue_messages() · 34 unmodified lines
33053305 }
33063306 }
33073307 }
3308−
3308+
33093309 // clean up request storage
33103310 if( should_retry_this_request )
33113311 {
@@ -3324,7 +3324,7 @@ void Chuck_Globals_Manager::handle_global_queue_messages() · 12 unmodified lines
33243324 break;
33253325 }
33263326 }
3327−
3327+
33283328 // process retries
33293329 while( m_global_request_retry_queue.more() )
33303330 {
@@ -3338,7 +3338,7 @@ void Chuck_Globals_Manager::handle_global_queue_messages() · 7 unmodified lines
33383338 // trying to retry something that shouldn't be.
33393339 continue;
33403340 }
3341−
3341+
33423342 // decrement the number of retries
33433343 message.retries--;
33443344 // add it back to the queue for next time
src/core/chuck_globals.h+21−21
@@ -164,7 +164,7 @@ struct Chuck_Global_Request · 163 unmodified lines
164164 // chuck_msg
165165 Chuck_Execute_Chuck_Msg_Request* executeChuckMsgRequest;
166166 };
167−
167+
168168 Chuck_Global_Request()
169169 {
170170 retries = 0;
@@ -183,7 +183,7 @@ struct Chuck_Globals_Manager · 12 unmodified lines
183183 public:
184184 Chuck_Globals_Manager( Chuck_VM * vm );
185185 ~Chuck_Globals_Manager();
186−
186+
187187 public:
188188 // REFACTOR-2017: externally accessible + global variables.
189189 // use these getters and setters from outside the audio thread
@@ -191,17 +191,17 @@ public: · 1 unmodified line
191191 t_CKBOOL getGlobalInt( const char * name, void (*callback)(const char*, t_CKINT) );
192192 t_CKBOOL getGlobalInt( const char * name, t_CKINT callbackID, void (*callback)(t_CKINT, t_CKINT) );
193193 t_CKBOOL setGlobalInt( const char * name, t_CKINT val );
194−
194+
195195 t_CKBOOL getGlobalFloat( const char * name, void (*callback)(t_CKFLOAT) );
196196 t_CKBOOL getGlobalFloat( const char * name, void (*callback)(const char*, t_CKFLOAT) );
197197 t_CKBOOL getGlobalFloat( const char * name, t_CKINT callbackID, void (*callback)(t_CKINT, t_CKFLOAT) );
198198 t_CKBOOL setGlobalFloat( const char * name, t_CKFLOAT val );
199−
199+
200200 t_CKBOOL getGlobalString( const char * name, void (*callback)(const char*) );
201201 t_CKBOOL getGlobalString( const char * name, void (*callback)(const char*, const char*) );
202202 t_CKBOOL getGlobalString( const char * name, t_CKINT callbackID, void (*callback)(t_CKINT, const char*) );
203203 t_CKBOOL setGlobalString( const char * name, const char * val );
204−
204+
205205 t_CKBOOL signalGlobalEvent( const char * name );
206206 t_CKBOOL broadcastGlobalEvent( const char * name );
207207 t_CKBOOL listenForGlobalEvent( const char * name, void (*callback)(void), t_CKBOOL listen_forever );
@@ -210,9 +210,9 @@ public: · 2 unmodified lines
210210 t_CKBOOL stopListeningForGlobalEvent( const char * name, void (*callback)(void) );
211211 t_CKBOOL stopListeningForGlobalEvent( const char * name, void (*callback)(const char*) );
212212 t_CKBOOL stopListeningForGlobalEvent( const char * name, t_CKINT callbackID, void (*callback)(t_CKINT) );
213−
213+
214214 t_CKBOOL getGlobalUGenSamples( const char * name, SAMPLE* buffer, int numFrames );
215−
215+
216216 t_CKBOOL setGlobalIntArray( const char * name, t_CKINT arrayValues[], t_CKUINT numValues );
217217 t_CKBOOL getGlobalIntArray( const char * name, void (*callback)(t_CKINT[], t_CKUINT) );
218218 t_CKBOOL getGlobalIntArray( const char * name, void (*callback)(const char*, t_CKINT[], t_CKUINT) );
@@ -225,7 +225,7 @@ public: · 6 unmodified lines
225225 t_CKBOOL getGlobalAssociativeIntArrayValue( const char * name, const char * key, void (*callback)(t_CKINT) );
226226 t_CKBOOL getGlobalAssociativeIntArrayValue( const char * name, const char * key, void (*callback)(const char*, t_CKINT) );
227227 t_CKBOOL getGlobalAssociativeIntArrayValue( const char * name, t_CKINT callbackID, const char * key, void (*callback)(t_CKINT, t_CKINT) );
228−
228+
229229 t_CKBOOL setGlobalFloatArray( const char * name, t_CKFLOAT arrayValues[], t_CKUINT numValues );
230230 t_CKBOOL getGlobalFloatArray( const char * name, void (*callback)(t_CKFLOAT[], t_CKUINT) );
231231 t_CKBOOL getGlobalFloatArray( const char * name, void (*callback)(const char*, t_CKFLOAT[], t_CKUINT) );
@@ -238,11 +238,11 @@ public: · 6 unmodified lines
238238 t_CKBOOL getGlobalAssociativeFloatArrayValue( const char * name, const char * key, void (*callback)(t_CKFLOAT) );
239239 t_CKBOOL getGlobalAssociativeFloatArrayValue( const char * name, const char * key, void (*callback)(const char*, t_CKFLOAT) );
240240 t_CKBOOL getGlobalAssociativeFloatArrayValue( const char * name, t_CKINT callbackID, const char * key, void (*callback)(t_CKINT, t_CKFLOAT) );
241−
241+
242242 public:
243243 // run Chuck_Msg in the globals order
244244 t_CKBOOL execute_chuck_msg_with_globals( Chuck_Msg* msg );
245−
245+
246246 public:
247247 // REFACTOR-2017: externally accessible + global variables.
248248 // WARNING: these internal functions are to be used only by other
@@ -250,25 +250,25 @@ public: · 1 unmodified line
250250 t_CKBOOL init_global_int( const std::string & name );
251251 t_CKINT get_global_int_value( const std::string & name );
252252 t_CKINT* get_ptr_to_global_int( const std::string & name );
253−
253+
254254 t_CKBOOL init_global_float( const std::string & name );
255255 t_CKFLOAT get_global_float_value( const std::string & name );
256256 t_CKFLOAT* get_ptr_to_global_float( const std::string & name );
257−
257+
258258 t_CKBOOL init_global_string( const std::string & name );
259259 Chuck_String* get_global_string( const std::string & name );
260260 Chuck_String** get_ptr_to_global_string( const std::string & name );
261−
261+
262262 t_CKBOOL init_global_event( const std::string & name, Chuck_Type* type );
263263 Chuck_Event* get_global_event( const std::string & name );
264264 Chuck_Event** get_ptr_to_global_event( const std::string & name );
265−
265+
266266 t_CKBOOL init_global_ugen( const std::string & name, Chuck_Type* type );
267267 t_CKBOOL is_global_ugen_init( const std::string & name );
268268 t_CKBOOL is_global_ugen_valid( const std::string & name );
269269 Chuck_UGen* get_global_ugen( const std::string & name );
270270 Chuck_UGen** get_ptr_to_global_ugen( const std::string & name );
271−
271+
272272 t_CKBOOL init_global_array( const std::string & name, Chuck_Type* type, te_GlobalType arr_type );
273273 Chuck_Object* get_global_array( const std::string & name );
274274 Chuck_Object** get_ptr_to_global_array( const std::string & name );
@@ -282,24 +282,24 @@ public: · 7 unmodified lines
282282 t_CKBOOL is_global_object_valid( const std::string & name );
283283 Chuck_Object* get_global_object( const std::string & name );
284284 Chuck_Object** get_ptr_to_global_object( const std::string & name );
285−
285+
286286 t_CKBOOL should_call_global_ctor( const std::string & name, te_GlobalType type );
287287 void global_ctor_was_called( const std::string & name, te_GlobalType type );
288−
288+
289289 // global variables -- clean up
290290 void cleanup_global_variables();
291−
291+
292292 public: // these should ever ONLY be called from within the VM
293293 // request queue: add, query for size
294294 t_CKBOOL add_request( Chuck_Global_Request request );
295295 t_CKBOOL more_requests();
296296 // REFACTOR-2017: execute the messages from the global queue
297297 void handle_global_queue_messages();
298−
298+
299299 private:
300300 // ptr to my vm
301301 Chuck_VM * m_vm;
302−
302+
303303 // global variables -- storage
304304 std::map< std::string, Chuck_Global_Int_Container* > m_global_ints;
305305 std::map< std::string, Chuck_Global_Float_Container* > m_global_floats;
@@ -311,7 +311,7 @@ private: · 5 unmodified lines
311311
312312 // global variables -- messages for set, get, etc.
313313 XCircleBuffer< Chuck_Global_Request > m_global_request_queue;
314−
314+
315315 // retry queue: sometimes a request comes through exactly 1 sample
316316 // before the relevant global variable is constructed
317317 // (e.g. signalEvent before the compileCode that would construct the event)
src/core/chuck_instr.cpp+594−302
@@ -29,20 +29,19 @@ · 28 unmodified lines
2929 // author: Ge Wang (ge@ccrma.stanford.edu | gewang@cs.princeton.edu)
3030 // date: Autumn 2002
3131 //-----------------------------------------------------------------------------
32−#include <math.h>
33−#include <limits.h>
34−
32+#include "chuck_instr.h"
3533 #include "chuck_type.h"
3634 #include "chuck_lang.h"
37−#include "chuck_instr.h"
3835 #include "chuck_vm.h"
3936 #include "chuck_ugen.h"
4037 #include "chuck_dl.h"
4138 #include "chuck_errmsg.h"
4239 #include "chuck_globals.h" // added 1.4.1.0
43−
40+#include "util_math.h"
4441 #include "util_string.h"
4542
43+#include <math.h>
44+#include <limits.h>
4645 #include <typeinfo>
4746 using namespace std;
4847
@@ -53,9 +52,12 @@ using namespace std; · 4 unmodified lines
5352 // name: Chuck_Instr()
5453 // desc: base class constructor
5554 //-----------------------------------------------------------------------------
56−Chuck_Instr::Chuck_Instr() {
55+Chuck_Instr::Chuck_Instr()
56+{
5757 // set linepos to 0 so we can tell later whether it has been set properly
5858 m_linepos = 0;
59+ // default codestr
60+ m_codestr = NULL;
5961 }
6062
6163
@@ -73,11 +75,28 @@ const char * Chuck_Instr::name() const · 11 unmodified lines
7375
7476
7577
78+//-----------------------------------------------------------------------------
79+// name: set_codestr()
80+// desc: set codestr associated with this instruction
81+// only certain instructions (e.g., start of stmts) have this
82+//-----------------------------------------------------------------------------
83+void Chuck_Instr::set_codestr( const string & str )
84+{
85+ // cleanup
86+ SAFE_DELETE( m_codestr );
87+ // allocate
88+ m_codestr = new string( str );
89+}
90+
91+
92+
93+
7694 //-----------------------------------------------------------------------------
7795 // name: set_linepos()
7896 // desc: store line position for error messages
7997 //-----------------------------------------------------------------------------
80−void Chuck_Instr::set_linepos(t_CKUINT linepos) {
98+void Chuck_Instr::set_linepos(t_CKUINT linepos)
99+{
81100 m_linepos = linepos;
82101 }
83102
@@ -91,7 +110,7 @@ void Chuck_Instr::set_linepos(t_CKUINT linepos) { · 7 unmodified lines
91110 static void handle_overflow( Chuck_VM_Shred * shred, Chuck_VM * vm )
92111 {
93112 // we have a problem
94− CK_FPRINTF_STDERR(
113+ CK_FPRINTF_STDERR(
95114 "[chuck](VM): Exception StackOverflow in shred[id=%lu:%s], PC=[%lu]\n",
96115 shred->xid, shred->name.c_str(), shred->pc );
97116 // do something!
@@ -109,7 +128,7 @@ static void handle_overflow( Chuck_VM_Shred * shred, Chuck_VM * vm ) · 11 unmodified lines
109128 //-----------------------------------------------------------------------------
110129 void Chuck_Instr_Add_int::execute( Chuck_VM * vm, Chuck_VM_Shred * shred )
111130 {
112− t_CKINT *& sp = (t_CKINT *&)shred->reg->sp;
131+ t_CKINT *& sp = (t_CKINT *&)shred->reg->sp;
113132 pop_( sp, 2 );
114133 push_( sp, val_(sp) + val_(sp+1) );
115134 }
@@ -239,7 +258,7 @@ void Chuck_Instr_Complement_int::execute( Chuck_VM * vm, Chuck_VM_Shred * shred · 123 unmodified lines
239258 //-----------------------------------------------------------------------------
240259 void Chuck_Instr_Mod_int::execute( Chuck_VM * vm, Chuck_VM_Shred * shred )
241260 {
242− t_CKINT *& sp = (t_CKINT *&)shred->reg->sp;
261+ t_CKINT *& sp = (t_CKINT *&)shred->reg->sp;
243262 pop_( sp, 2 );
244263 push_( sp, val_(sp) % val_(sp+1) );
245264 }
@@ -253,7 +272,7 @@ void Chuck_Instr_Mod_int::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 7 unmodified lines
253272 //-----------------------------------------------------------------------------
254273 void Chuck_Instr_Mod_int_Reverse::execute( Chuck_VM * vm, Chuck_VM_Shred * shred )
255274 {
256− t_CKINT *& sp = (t_CKINT *&)shred->reg->sp;
275+ t_CKINT *& sp = (t_CKINT *&)shred->reg->sp;
257276 pop_( sp, 2 );
258277 push_( sp, val_(sp+1) % val_(sp) );
259278 }
@@ -267,7 +286,7 @@ void Chuck_Instr_Mod_int_Reverse::execute( Chuck_VM * vm, Chuck_VM_Shred * shred · 7 unmodified lines
267286 //-----------------------------------------------------------------------------
268287 void Chuck_Instr_Minus_int::execute( Chuck_VM * vm, Chuck_VM_Shred * shred )
269288 {
270− t_CKINT *& sp = (t_CKINT *&)shred->reg->sp;
289+ t_CKINT *& sp = (t_CKINT *&)shred->reg->sp;
271290 pop_( sp, 2 );
272291 push_( sp, val_(sp) - val_(sp+1) );
273292 }
@@ -281,7 +300,7 @@ void Chuck_Instr_Minus_int::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 7 unmodified lines
281300 //-----------------------------------------------------------------------------
282301 void Chuck_Instr_Minus_int_Reverse::execute( Chuck_VM * vm, Chuck_VM_Shred * shred )
283302 {
284− t_CKINT *& sp = (t_CKINT *&)shred->reg->sp;
303+ t_CKINT *& sp = (t_CKINT *&)shred->reg->sp;
285304 pop_( sp, 2 );
286305 push_( sp, val_(sp+1) - val_(sp) );
287306 }
@@ -313,7 +332,7 @@ void Chuck_Instr_Divide_int::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 25 unmodified lines
313332 pop_( sp, 2 );
314333 if( val_(sp+1) == 0 ) goto div_zero;
315334 push_( sp, val_(sp) / val_(sp+1) );
316−
335+
317336 return;
318337 div_zero:
319338 // we have a problem
@@ -341,7 +360,7 @@ void Chuck_Instr_Divide_int_Reverse::execute( Chuck_VM * vm, Chuck_VM_Shred * sh · 21 unmodified lines
341360 pop_( sp, 2 );
342361 if( val_(sp) == 0 ) goto div_zero;
343362 push_( sp, val_(sp+1) / val_(sp) );
344−
363+
345364 return;
346365 div_zero:
347366 // we have a problem
@@ -452,7 +471,7 @@ void Chuck_Instr_Divide_double_Reverse::execute( Chuck_VM * vm, Chuck_VM_Shred * · 104 unmodified lines
452471 //-----------------------------------------------------------------------------
453472 void Chuck_Instr_Mod_double::execute( Chuck_VM * vm, Chuck_VM_Shred * shred )
454473 {
455− t_CKFLOAT *& sp = (t_CKFLOAT *&)shred->reg->sp;
474+ t_CKFLOAT *& sp = (t_CKFLOAT *&)shred->reg->sp;
456475 pop_( sp, 2 );
457476 push_( sp, ::fmod( val_(sp), val_(sp+1) ) );
458477 }
@@ -466,7 +485,7 @@ void Chuck_Instr_Mod_double::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 7 unmodified lines
466485 //-----------------------------------------------------------------------------
467486 void Chuck_Instr_Mod_double_Reverse::execute( Chuck_VM * vm, Chuck_VM_Shred * shred )
468487 {
469− t_CKFLOAT *& sp = (t_CKFLOAT *&)shred->reg->sp;
488+ t_CKFLOAT *& sp = (t_CKFLOAT *&)shred->reg->sp;
470489 pop_( sp, 2 );
471490 push_( sp, ::fmod( val_(sp+1), val_(sp) ) );
472491 }
@@ -1113,7 +1132,7 @@ void Chuck_Instr_Divide_int_Assign::execute( Chuck_VM * vm, Chuck_VM_Shred * shr · 640 unmodified lines
11131132 if( val_(sp) == 0 ) goto div_zero;
11141133 temp = **(t_CKINT **)(sp+1) /= val_(sp);
11151134 push_( sp, temp );
1116−
1135+
11171136 return;
11181137 div_zero:
11191138 // we have a problem
@@ -1440,7 +1459,7 @@ void Chuck_Instr_Add_vec3_Assign::execute( Chuck_VM * vm, Chuck_VM_Shred * shred · 320 unmodified lines
14401459 t_CKVEC3 temp;
14411460 // pop value + pointer
14421461 pop_( sp, sz_VEC3 + sz_UINT );
1443−
1462+
14441463 // assign
14451464 temp.x = (*(t_CKVEC3 **)(sp+sz_VEC3))->x += ((t_CKVEC3 *&)sp)->x;
14461465 temp.y = (*(t_CKVEC3 **)(sp+sz_VEC3))->y += ((t_CKVEC3 *&)sp)->y;
@@ -1462,7 +1481,7 @@ void Chuck_Instr_Minus_vec3_Assign::execute( Chuck_VM * vm, Chuck_VM_Shred * shr · 15 unmodified lines
14621481 t_CKVEC3 temp;
14631482 // pop value + pointer
14641483 pop_( sp, sz_VEC3 + sz_UINT );
1465−
1484+
14661485 // assign
14671486 temp.x = (*(t_CKVEC3 **)(sp+sz_VEC3))->x -= ((t_CKVEC3 *&)sp)->x;
14681487 temp.y = (*(t_CKVEC3 **)(sp+sz_VEC3))->y -= ((t_CKVEC3 *&)sp)->y;
@@ -1484,7 +1503,7 @@ void Chuck_Instr_float_Times_vec3_Assign::execute( Chuck_VM * vm, Chuck_VM_Shred · 15 unmodified lines
14841503 t_CKVEC3 temp;
14851504 // pop float + pointer
14861505 pop_( sp, sz_FLOAT + sz_UINT );
1487−
1506+
14881507 // assign
14891508 temp.x = (*(t_CKVEC3 **)(sp+sz_FLOAT))->x *= *((t_CKFLOAT *)sp);
14901509 temp.y = (*(t_CKVEC3 **)(sp+sz_FLOAT))->y *= *((t_CKFLOAT *)sp);
@@ -1506,7 +1525,7 @@ void Chuck_Instr_vec3_Divide_float_Assign::execute( Chuck_VM * vm, Chuck_VM_Shre · 15 unmodified lines
15061525 t_CKVEC3 temp;
15071526 // pop float + pointer
15081527 pop_( sp, sz_FLOAT + sz_UINT );
1509−
1528+
15101529 // assign
15111530 temp.x = (*(t_CKVEC3 **)(sp+sz_FLOAT))->x /= *((t_CKFLOAT *)sp);
15121531 temp.y = (*(t_CKVEC3 **)(sp+sz_FLOAT))->y /= *((t_CKFLOAT *)sp);
@@ -1528,7 +1547,7 @@ void Chuck_Instr_Add_vec4_Assign::execute( Chuck_VM * vm, Chuck_VM_Shred * shred · 15 unmodified lines
15281547 t_CKVEC4 temp;
15291548 // pop value + pointer
15301549 pop_( sp, sz_VEC4 + sz_UINT );
1531−
1550+
15321551 // assign
15331552 temp.x = (*(t_CKVEC4 **)(sp+sz_VEC4))->x += ((t_CKVEC4 *&)sp)->x;
15341553 temp.y = (*(t_CKVEC4 **)(sp+sz_VEC4))->y += ((t_CKVEC4 *&)sp)->y;
@@ -1551,7 +1570,7 @@ void Chuck_Instr_Minus_vec4_Assign::execute( Chuck_VM * vm, Chuck_VM_Shred * shr · 16 unmodified lines
15511570 t_CKVEC4 temp;
15521571 // pop value + pointer
15531572 pop_( sp, sz_VEC4 + sz_UINT );
1554−
1573+
15551574 // assign
15561575 temp.x = (*(t_CKVEC4 **)(sp+sz_VEC4))->x -= ((t_CKVEC4 *&)sp)->x;
15571576 temp.y = (*(t_CKVEC4 **)(sp+sz_VEC4))->y -= ((t_CKVEC4 *&)sp)->y;
@@ -1574,7 +1593,7 @@ void Chuck_Instr_float_Times_vec4_Assign::execute( Chuck_VM * vm, Chuck_VM_Shred · 16 unmodified lines
15741593 t_CKVEC4 temp;
15751594 // pop float + pointer
15761595 pop_( sp, sz_FLOAT + sz_UINT );
1577−
1596+
15781597 // assign
15791598 temp.x = (*(t_CKVEC4 **)(sp+sz_FLOAT))->x *= *((t_CKFLOAT *)sp);
15801599 temp.y = (*(t_CKVEC4 **)(sp+sz_FLOAT))->y *= *((t_CKFLOAT *)sp);
@@ -1597,7 +1616,7 @@ void Chuck_Instr_vec4_Divide_float_Assign::execute( Chuck_VM * vm, Chuck_VM_Shre · 16 unmodified lines
15971616 t_CKVEC4 temp;
15981617 // pop float + pointer
15991618 pop_( sp, sz_FLOAT + sz_UINT );
1600−
1619+
16011620 // assign
16021621 temp.x = (*(t_CKVEC4 **)(sp+sz_FLOAT))->x *= *((t_CKFLOAT *)sp);
16031622 temp.y = (*(t_CKVEC4 **)(sp+sz_FLOAT))->y *= *((t_CKFLOAT *)sp);
@@ -1647,7 +1666,7 @@ void Chuck_Instr_Add_string::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 43 unmodified lines
16471666
16481667 null_pointer:
16491668 // we have a problem
1650− CK_FPRINTF_STDERR(
1669+ CK_FPRINTF_STDERR(
16511670 "[chuck](VM): NullPointerException: (string + string) on line[%lu] in shred[id=%lu:%s]\n",
16521671 m_linepos, shred->xid, shred->name.c_str() ); // , shred->pc );
16531672 goto done;
@@ -1692,7 +1711,7 @@ void Chuck_Instr_Add_string_Assign::execute( Chuck_VM * vm, Chuck_VM_Shred * shr · 38 unmodified lines
16921711
16931712 null_pointer:
16941713 // we have a problem
1695− CK_FPRINTF_STDERR(
1714+ CK_FPRINTF_STDERR(
16961715 "[chuck](VM): NullPointerException: (string +=> string) on line[%lu] in shred[id=%lu:%s]\n",
16971716 m_linepos, shred->xid, shred->name.c_str() );
16981717 goto done;
@@ -1741,7 +1760,7 @@ void Chuck_Instr_Add_string_int::execute( Chuck_VM * vm, Chuck_VM_Shred * shred · 42 unmodified lines
17411760
17421761 null_pointer:
17431762 // we have a problem
1744− CK_FPRINTF_STDERR(
1763+ CK_FPRINTF_STDERR(
17451764 "[chuck](VM): NullPointerException: (string + int) on line[%lu] in shred[id=%lu:%s]\n",
17461765 m_linepos, shred->xid, shred->name.c_str() );
17471766 goto done;
@@ -1790,7 +1809,7 @@ void Chuck_Instr_Add_string_float::execute( Chuck_VM * vm, Chuck_VM_Shred * shre · 42 unmodified lines
17901809
17911810 null_pointer:
17921811 // we have a problem
1793− CK_FPRINTF_STDERR(
1812+ CK_FPRINTF_STDERR(
17941813 "[chuck](VM): NullPointerException: (string + float) on line[%lu] in shred[id=%lu:%s]\n",
17951814 m_linepos, shred->xid, shred->name.c_str() );
17961815 goto done;
@@ -1839,7 +1858,7 @@ void Chuck_Instr_Add_int_string::execute( Chuck_VM * vm, Chuck_VM_Shred * shred · 42 unmodified lines
18391858
18401859 null_pointer:
18411860 // we have a problem
1842− CK_FPRINTF_STDERR(
1861+ CK_FPRINTF_STDERR(
18431862 "[chuck](VM): NullPointerException: (int + string) on line[%lu] in shred[id=%lu:%s]\n",
18441863 m_linepos, shred->xid, shred->name.c_str() );
18451864 goto done;
@@ -1888,7 +1907,7 @@ void Chuck_Instr_Add_float_string::execute( Chuck_VM * vm, Chuck_VM_Shred * shre · 42 unmodified lines
18881907
18891908 null_pointer:
18901909 // we have a problem
1891− CK_FPRINTF_STDERR(
1910+ CK_FPRINTF_STDERR(
18921911 "[chuck](VM): NullPointerException: (int + string) on line[%lu] in shred[id=%lu:%s]\n",
18931912 m_linepos, shred->xid, shred->name.c_str() );
18941913 goto done;
@@ -1933,7 +1952,7 @@ void Chuck_Instr_Add_int_string_Assign::execute( Chuck_VM * vm, Chuck_VM_Shred * · 38 unmodified lines
19331952
19341953 null_pointer:
19351954 // we have a problem
1936− CK_FPRINTF_STDERR(
1955+ CK_FPRINTF_STDERR(
19371956 "[chuck](VM): NullPointerException: () on line[%lu] in shred[id=%lu:%s]\n",
19381957 m_linepos, shred->xid, shred->name.c_str() );
19391958 goto done;
@@ -1978,7 +1997,7 @@ void Chuck_Instr_Add_float_string_Assign::execute( Chuck_VM * vm, Chuck_VM_Shred · 38 unmodified lines
19781997
19791998 null_pointer:
19801999 // we have a problem
1981− CK_FPRINTF_STDERR(
2000+ CK_FPRINTF_STDERR(
19822001 "[chuck](VM): NullPointerException: (float + string) on line[%lu] in shred[id=%lu:%s]\n",
19832002 m_linepos, shred->xid, shred->name.c_str() );
19842003 goto done;
@@ -2040,6 +2059,23 @@ void Chuck_Instr_Reg_Push_Imm4::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 55 unmodified lines
20402059
20412060
20422061
2062+//-----------------------------------------------------------------------------
2063+// name: execute()
2064+// desc: ...
2065+//-----------------------------------------------------------------------------
2066+void Chuck_Instr_Reg_Push_Zero::execute( Chuck_VM * vm, Chuck_VM_Shred * shred )
2067+{
2068+ t_CKBYTE *& reg_sp = (t_CKBYTE *&)shred->reg->sp;
2069+
2070+ // push val into reg stack
2071+ memset( reg_sp, 0, m_val );
2072+ // move stack pointer
2073+ reg_sp += m_val;
2074+}
2075+
2076+
2077+
2078+
20432079 //-----------------------------------------------------------------------------
20442080 // name: execute()
20452081 // desc: ...
@@ -2079,7 +2115,7 @@ void Chuck_Instr_Reg_Dup_Last_As_Pointer::execute( · 33 unmodified lines
20792115 {
20802116 t_CKUINT *& reg_sp = (t_CKUINT *&)shred->reg->sp;
20812117 t_CKBYTE * where = (t_CKBYTE *)shred->reg->sp;
2082−
2118+
20832119 // push pointer into reg stack
20842120 push_( reg_sp, (t_CKUINT)(where-(m_val*sz_WORD)) );
20852121 }
@@ -2125,7 +2161,7 @@ void Chuck_Instr_Reg_Push_This::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 39 unmodified lines
21252161 {
21262162 t_CKUINT *& reg_sp = (t_CKUINT *&)shred->reg->sp;
21272163 t_CKUINT *& mem_sp = (t_CKUINT *&)shred->mem->sp;
2128−
2164+
21292165 // push val into reg stack
21302166 push_( reg_sp, *(mem_sp) );
21312167 }
@@ -2157,7 +2193,7 @@ void Chuck_Instr_Reg_Push_Maybe::execute( Chuck_VM * vm, Chuck_VM_Shred * shred · 25 unmodified lines
21572193 t_CKINT *& reg_sp = (t_CKINT *&)shred->reg->sp;
21582194
21592195 // push val into reg stack
2160− float num = (float)rand() / (float)RAND_MAX;
2196+ t_CKFLOAT num = ck_random()/(t_CKFLOAT)CK_RANDOM_MAX;
21612197 push_( reg_sp, num > .5 );
21622198 }
21632199
@@ -2187,7 +2223,7 @@ void Chuck_Instr_Reg_Push_Deref::execute( Chuck_VM * vm, Chuck_VM_Shred * shred · 23 unmodified lines
21872223 void Chuck_Instr_Reg_Push_Deref2::execute( Chuck_VM * vm, Chuck_VM_Shred * shred )
21882224 {
21892225 t_CKFLOAT *& reg_sp = (t_CKFLOAT *&)shred->reg->sp;
2190−
2226+
21912227 // (added 1.3.1.0)
21922228 push_( reg_sp, *((t_CKFLOAT *)m_val) );
21932229 }
@@ -2251,7 +2287,7 @@ void Chuck_Instr_Reg_Push_Mem_Vec3::execute( Chuck_VM * vm, Chuck_VM_Shred * shr · 57 unmodified lines
22512287 {
22522288 t_CKBYTE *& mem_sp = (t_CKBYTE *&)(base?shred->base_ref->stack:shred->mem->sp);
22532289 t_CKVEC3 *& reg_sp = (t_CKVEC3 *&)shred->reg->sp;
2254−
2290+
22552291 // push mem stack content into reg stack
22562292 push_( reg_sp, *((t_CKVEC3 *)(mem_sp + m_val)) );
22572293 }
@@ -2267,7 +2303,7 @@ void Chuck_Instr_Reg_Push_Mem_Vec4::execute( Chuck_VM * vm, Chuck_VM_Shred * shr · 9 unmodified lines
22672303 {
22682304 t_CKBYTE *& mem_sp = (t_CKBYTE *&)(base?shred->base_ref->stack:shred->mem->sp);
22692305 t_CKVEC4 *& reg_sp = (t_CKVEC4 *&)shred->reg->sp;
2270−
2306+
22712307 // push mem stack content into reg stack
22722308 push_( reg_sp, *((t_CKVEC4 *)(mem_sp + m_val)) );
22732309 }
@@ -2288,7 +2324,7 @@ void Chuck_Instr_Reg_Push_Global::execute( Chuck_VM * vm, Chuck_VM_Shred * shred · 14 unmodified lines
22882324 // int pointer to registers
22892325 t_CKUINT *& reg_sp = (t_CKUINT *&)shred->reg->sp;
22902326 t_CKUINT val = (t_CKUINT) vm->globals_manager()->get_global_int_value( m_name );
2291−
2327+
22922328 // push global map content into int-reg stack
22932329 push_( reg_sp, val );
22942330 }
@@ -2298,7 +2334,7 @@ void Chuck_Instr_Reg_Push_Global::execute( Chuck_VM * vm, Chuck_VM_Shred * shred · 3 unmodified lines
22982334 // float pointer to registers
22992335 t_CKFLOAT *& reg_sp = (t_CKFLOAT *&)shred->reg->sp;
23002336 t_CKFLOAT val = (t_CKFLOAT) vm->globals_manager()->get_global_float_value( m_name );
2301−
2337+
23022338 // push global map content into float-reg stack
23032339 push_( reg_sp, val );
23042340 }
@@ -2308,7 +2344,7 @@ void Chuck_Instr_Reg_Push_Global::execute( Chuck_VM * vm, Chuck_VM_Shred * shred · 3 unmodified lines
23082344 // pointer to registers
23092345 t_CKUINT *& reg_sp = (t_CKUINT *&)shred->reg->sp;
23102346 t_CKUINT val = (t_CKUINT) vm->globals_manager()->get_global_string( m_name );
2311−
2347+
23122348 // push global map content into string-reg stack
23132349 push_( reg_sp, val );
23142350 }
@@ -2317,7 +2353,7 @@ void Chuck_Instr_Reg_Push_Global::execute( Chuck_VM * vm, Chuck_VM_Shred * shred · 2 unmodified lines
23172353 {
23182354 t_CKUINT *& reg_sp = (t_CKUINT *&)shred->reg->sp;
23192355 t_CKUINT val = (t_CKUINT) vm->globals_manager()->get_global_event( m_name );
2320−
2356+
23212357 // push global map content into event-reg stack
23222358 push_( reg_sp, val );
23232359 }
@@ -2332,10 +2368,10 @@ void Chuck_Instr_Reg_Push_Global::execute( Chuck_VM * vm, Chuck_VM_Shred * shred · 8 unmodified lines
23322368 m_linepos, shred->xid, shred->name.c_str());
23332369 goto error;
23342370 }
2335−
2371+
23362372 t_CKUINT *& reg_sp = (t_CKUINT *&)shred->reg->sp;
23372373 t_CKUINT val = (t_CKUINT) vm->globals_manager()->get_global_ugen( m_name );
2338−
2374+
23392375 // push global map content into ugen-reg stack
23402376 push_( reg_sp, val );
23412377 }
@@ -2350,10 +2386,10 @@ void Chuck_Instr_Reg_Push_Global::execute( Chuck_VM * vm, Chuck_VM_Shred * shred · 8 unmodified lines
23502386 m_linepos, shred->xid, shred->name.c_str());
23512387 goto error;
23522388 }
2353−
2389+
23542390 t_CKUINT *& reg_sp = (t_CKUINT *&)shred->reg->sp;
23552391 t_CKUINT val = (t_CKUINT) vm->globals_manager()->get_global_object( m_name );
2356−
2392+
23572393 // push global map content into object-reg stack
23582394 push_( reg_sp, val );
23592395 }
@@ -2364,21 +2400,21 @@ void Chuck_Instr_Reg_Push_Global::execute( Chuck_VM * vm, Chuck_VM_Shred * shred · 4 unmodified lines
23642400 // --> put exactly that on the stack
23652401 t_CKUINT *& reg_sp = (t_CKUINT *&)shred->reg->sp;
23662402 t_CKUINT val = (t_CKUINT) vm->globals_manager()->get_global_array( m_name );
2367−
2403+
23682404 // push global map content into object-reg stack
23692405 push_( reg_sp, val );
2370−
2406+
23712407 }
23722408 break;
23732409 }
2374−
2410+
23752411 return;
2376−
2412+
23772413 error:
23782414 // do something!
23792415 shred->is_running = FALSE;
23802416 shred->is_done = TRUE;
2381−
2417+
23822418 }
23832419
23842420
@@ -2407,7 +2443,7 @@ void Chuck_Instr_Reg_Push_Mem_Addr::execute( Chuck_VM * vm, Chuck_VM_Shred * shr · 22 unmodified lines
24072443 void Chuck_Instr_Reg_Push_Global_Addr::execute( Chuck_VM * vm, Chuck_VM_Shred * shred )
24082444 {
24092445 t_CKUINT *& reg_sp = (t_CKUINT *&)shred->reg->sp;
2410−
2446+
24112447 // find addr
24122448 t_CKUINT addr;
24132449 switch( m_type ) {
@@ -2433,7 +2469,7 @@ void Chuck_Instr_Reg_Push_Global_Addr::execute( Chuck_VM * vm, Chuck_VM_Shred * · 19 unmodified lines
24332469 case te_globalArraySymbol:
24342470 addr = (t_CKUINT) vm->globals_manager()->get_ptr_to_global_array( m_name );
24352471 break;
2436−
2472+
24372473 }
24382474
24392475 // push mem stack addr into reg stack
@@ -2469,7 +2505,7 @@ void Chuck_Instr_Reg_Pop_Word::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 29 unmodified lines
24692505 {
24702506 t_CKUINT *& reg_sp = (t_CKUINT *&)shred->reg->sp;
24712507
2472− // pop word from reg stack
2508+ // pop word from reg stack
24732509 pop_( reg_sp, 1 );
24742510 }
24752511
@@ -2484,7 +2520,7 @@ void Chuck_Instr_Reg_Pop_Word2::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 8 unmodified lines
24842520 {
24852521 t_CKFLOAT *& reg_sp = (t_CKFLOAT *&)shred->reg->sp;
24862522
2487− // pop word from reg stack
2523+ // pop word from reg stack
24882524 pop_( reg_sp, 1 );
24892525 }
24902526
@@ -2498,8 +2534,8 @@ void Chuck_Instr_Reg_Pop_Word2::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 7 unmodified lines
24982534 void Chuck_Instr_Reg_Pop_Word3::execute( Chuck_VM * vm, Chuck_VM_Shred * shred )
24992535 {
25002536 t_CKCOMPLEX *& reg_sp = (t_CKCOMPLEX *&)shred->reg->sp;
2501−
2502− // pop word from reg stack
2537+
2538+ // pop word from reg stack
25032539 pop_( reg_sp, 1 );
25042540 }
25052541
@@ -2532,7 +2568,7 @@ void Chuck_Instr_Reg_Pop_Word4::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 26 unmodified lines
25322568 void Chuck_Instr_Mem_Set_Imm::execute( Chuck_VM * vm, Chuck_VM_Shred * shred )
25332569 {
25342570 t_CKUINT * mem_sp = (t_CKUINT *)(shred->mem->sp + m_offset);
2535−
2571+
25362572 // set
25372573 *(mem_sp) = m_val;
25382574 }
@@ -2547,7 +2583,7 @@ void Chuck_Instr_Mem_Set_Imm::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 8 unmodified lines
25472583 void Chuck_Instr_Mem_Set_Imm2::execute( Chuck_VM * vm, Chuck_VM_Shred * shred )
25482584 {
25492585 t_CKFLOAT * mem_sp = (t_CKFLOAT *)(shred->mem->sp + m_offset);
2550−
2586+
25512587 // set
25522588 *(mem_sp) = m_val;
25532589 }
@@ -2562,8 +2598,8 @@ void Chuck_Instr_Mem_Set_Imm2::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 8 unmodified lines
25622598 void Chuck_Instr_Mem_Push_Imm::execute( Chuck_VM * vm, Chuck_VM_Shred * shred )
25632599 {
25642600 t_CKUINT *& mem_sp = (t_CKUINT *&)shred->mem->sp;
2565−
2566− // pop word from reg stack
2601+
2602+ // pop word from reg stack
25672603 push_( mem_sp, m_val );
25682604 }
25692605
@@ -2577,8 +2613,8 @@ void Chuck_Instr_Mem_Push_Imm::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 7 unmodified lines
25772613 void Chuck_Instr_Mem_Push_Imm2::execute( Chuck_VM * vm, Chuck_VM_Shred * shred )
25782614 {
25792615 t_CKFLOAT *& mem_sp = (t_CKFLOAT *&)shred->mem->sp;
2580−
2581− // pop word from reg stack
2616+
2617+ // pop word from reg stack
25822618 push_( mem_sp, m_val );
25832619 }
25842620
@@ -2592,8 +2628,8 @@ void Chuck_Instr_Mem_Push_Imm2::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 7 unmodified lines
25922628 void Chuck_Instr_Mem_Pop_Word::execute( Chuck_VM * vm, Chuck_VM_Shred * shred )
25932629 {
25942630 t_CKUINT *& mem_sp = (t_CKUINT *&)shred->mem->sp;
2595−
2596− // pop word from reg stack
2631+
2632+ // pop word from reg stack
25972633 pop_( mem_sp, 1 );
25982634 }
25992635
@@ -2607,8 +2643,8 @@ void Chuck_Instr_Mem_Pop_Word::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 7 unmodified lines
26072643 void Chuck_Instr_Mem_Pop_Word2::execute( Chuck_VM * vm, Chuck_VM_Shred * shred )
26082644 {
26092645 t_CKFLOAT *& mem_sp = (t_CKFLOAT *&)shred->mem->sp;
2610−
2611− // pop word from reg stack
2646+
2647+ // pop word from reg stack
26122648 pop_( mem_sp, 1 );
26132649 }
26142650
@@ -2622,8 +2658,8 @@ void Chuck_Instr_Mem_Pop_Word2::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 7 unmodified lines
26222658 void Chuck_Instr_Mem_Pop_Word3::execute( Chuck_VM * vm, Chuck_VM_Shred * shred )
26232659 {
26242660 t_CKUINT *& mem_sp = (t_CKUINT *&)shred->mem->sp;
2625−
2626− // pop word from reg stack
2661+
2662+ // pop word from reg stack
26272663 pop_( mem_sp, m_val );
26282664 }
26292665
@@ -3488,7 +3524,7 @@ void Chuck_Instr_Alloc_Vec3::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 858 unmodified lines
34883524 {
34893525 t_CKBYTE *& mem_sp = (t_CKBYTE *&)shred->mem->sp;
34903526 t_CKUINT *& reg_sp = (t_CKUINT *&)shred->reg->sp;
3491−
3527+
34923528 // zero out the memory stack
34933529 ( (t_CKVEC3 *)(mem_sp + m_val) )->x = 0.0;
34943530 ( (t_CKVEC3 *)(mem_sp + m_val) )->y = 0.0;
@@ -3508,7 +3544,7 @@ void Chuck_Instr_Alloc_Vec4::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 13 unmodified lines
35083544 {
35093545 t_CKBYTE *& mem_sp = (t_CKBYTE *&)shred->mem->sp;
35103546 t_CKUINT *& reg_sp = (t_CKUINT *&)shred->reg->sp;
3511−
3547+
35123548 // zero out the memory stack
35133549 ( (t_CKVEC4 *)(mem_sp + m_val) )->x = 0.0;
35143550 ( (t_CKVEC4 *)(mem_sp + m_val) )->y = 0.0;
@@ -3590,7 +3626,7 @@ void Chuck_Instr_Alloc_Member_Vec3::execute( Chuck_VM * vm, Chuck_VM_Shred * shr · 75 unmodified lines
35903626 {
35913627 t_CKUINT *& mem_sp = (t_CKUINT *&)shred->mem->sp;
35923628 t_CKUINT *& reg_sp = (t_CKUINT *&)shred->reg->sp;
3593−
3629+
35943630 // get the object
35953631 Chuck_Object * obj = (Chuck_Object *)*(mem_sp);
35963632 // zero out the memory stack
@@ -3612,7 +3648,7 @@ void Chuck_Instr_Alloc_Member_Vec4::execute( Chuck_VM * vm, Chuck_VM_Shred * shr · 15 unmodified lines
36123648 {
36133649 t_CKUINT *& mem_sp = (t_CKUINT *&)shred->mem->sp;
36143650 t_CKUINT *& reg_sp = (t_CKUINT *&)shred->reg->sp;
3615−
3651+
36163652 // get the object
36173653 Chuck_Object * obj = (Chuck_Object *)*(mem_sp);
36183654 // zero out the memory stack
@@ -3690,7 +3726,7 @@ void Chuck_Instr_Alloc_Word_Global::execute( Chuck_VM * vm, Chuck_VM_Shred * shr · 71 unmodified lines
36903726 EM_error2( 0, "(internal error) symbol-only global type used in allocation" );
36913727 goto error;
36923728 }
3693−
3729+
36943730 }
36953731 else
36963732 {
@@ -3728,11 +3764,11 @@ void Chuck_Instr_Alloc_Word_Global::execute( Chuck_VM * vm, Chuck_VM_Shred * shr · 31 unmodified lines
37283764 goto error;
37293765 }
37303766 }
3731−
3732−
3767+
3768+
37333769 // push addr onto operand stack
37343770 push_( reg_sp, addr );
3735−
3771+
37363772 // if we have ctors to execute, do it
37373773 if( m_should_execute_ctors &&
37383774 vm->globals_manager()->should_call_global_ctor( m_name, m_type ) )
@@ -3743,9 +3779,9 @@ void Chuck_Instr_Alloc_Word_Global::execute( Chuck_VM * vm, Chuck_VM_Shred * shr · 4 unmodified lines
37433779 // tell VM we did it so that it will never be done again for m_name
37443780 vm->globals_manager()->global_ctor_was_called( m_name, m_type );
37453781 }
3746−
3782+
37473783 return;
3748−
3784+
37493785 error:
37503786 // do something!
37513787 shred->is_running = FALSE;
@@ -3759,12 +3795,12 @@ error: · 7 unmodified lines
37593795
37603796
37613797 static Chuck_Instr_Func_Call g_func_call;
3762−static Chuck_Instr_Func_Call_Member g_func_call_member( 0 );
3798+static Chuck_Instr_Func_Call_Member g_func_call_member( 0, NULL );
37633799 //-----------------------------------------------------------------------------
37643800 // name: call_pre_constructor()
37653801 // desc: ...
37663802 //-----------------------------------------------------------------------------
3767−inline void call_pre_constructor( Chuck_VM * vm, Chuck_VM_Shred * shred,
3803+inline void call_pre_constructor( Chuck_VM * vm, Chuck_VM_Shred * shred,
37683804 Chuck_VM_Code * pre_ctor, t_CKUINT stack_offset )
37693805 {
37703806 t_CKUINT *& reg_sp = (t_CKUINT *&)shred->reg->sp;
@@ -3779,6 +3815,10 @@ inline void call_pre_constructor( Chuck_VM * vm, Chuck_VM_Shred * shred, · 8 unmodified lines
37793815 // push the stack offset
37803816 push_( reg_sp, stack_offset );
37813817
3818+ // NOTE (1.4.2.1): pre-constructors by their nature have no arguments...
3819+ // if they did, they would need to clean up argument list, in the built-in/native
3820+ // func case, by setting g_func_call_member.m_func_ref with the appropriate func
3821+
37823822 // call the function
37833823 if( pre_ctor->native_func != 0 )
37843824 g_func_call_member.execute( vm, shred );
@@ -3817,9 +3857,9 @@ t_CKBOOL initialize_object( Chuck_Object * object, Chuck_Type * type ) · 32 unmodified lines
38173857 // copy the object's virtual table
38183858 object->vtable->funcs = type->info->obj_v_table.funcs;
38193859 // set the type reference
3820− // TODO: reference count
38213860 object->type_ref = type;
3822− object->type_ref->add_ref();
3861+ // reference count
3862+ SAFE_ADD_REF(object->type_ref);
38233863 // get the size
38243864 object->size = type->obj_size;
38253865 // allocate memory
@@ -3845,7 +3885,7 @@ t_CKBOOL initialize_object( Chuck_Object * object, Chuck_Type * type ) · 19 unmodified lines
38453885 // TODO: another hack!
38463886 if( type->ugen_info->tock ) ((Chuck_UAna *)ugen)->tock = type->ugen_info->tock;
38473887 // allocate multi chan
3848− ugen->alloc_multi_chan( type->ugen_info->num_ins,
3888+ ugen->alloc_multi_chan( type->ugen_info->num_ins,
38493889 type->ugen_info->num_outs );
38503890 // allocate the channels
38513891 for( t_CKUINT i = 0; i < ugen->m_multi_chan_size; i++ )
@@ -3871,7 +3911,7 @@ t_CKBOOL initialize_object( Chuck_Object * object, Chuck_Type * type ) · 19 unmodified lines
38713911 out_of_memory:
38723912
38733913 // we have a problem
3874− CK_FPRINTF_STDERR(
3914+ CK_FPRINTF_STDERR(
38753915 "[chuck](VM): OutOfMemory: while instantiating object '%s'\n",
38763916 type->c_name() );
38773917
@@ -3932,9 +3972,9 @@ Chuck_Object * instantiate_and_initialize_object( Chuck_Type * type, Chuck_VM_Sh · 54 unmodified lines
39323972 // check type TODO: make this faster
39333973 if( type->allocator )
39343974 object = type->allocator( vm, shred, Chuck_DL_Api::Api::instance() );
3935− #ifndef __DISABLE_FILEIO__
3975+ // #ifndef __DISABLE_FILEIO__
39363976 else if( isa( type, vm->env()->t_fileio ) ) object = new Chuck_IO_File( vm );
3937− #endif
3977+ // #endif
39383978 else if( isa( type, vm->env()->t_event ) ) object = new Chuck_Event;
39393979 else if( isa( type, vm->env()->t_string ) ) object = new Chuck_String;
39403980 // TODO: is this ok?
@@ -3943,6 +3983,8 @@ Chuck_Object * instantiate_and_initialize_object( Chuck_Type * type, Chuck_VM_Sh · 2 unmodified lines
39433983 object = new Chuck_VM_Shred;
39443984 ((Chuck_VM_Shred * )object)->vm_ref = vm; // REFACTOR-2017
39453985 }
3986+ // 1.4.2.1 (ge) added -- here my feeble brain starts leaking out of my eyeballs
3987+ else if( isa( type, vm->env()->t_class ) ) object = new Chuck_Type( vm->env(), te_class, type->name, type, type->size );
39463988 // TODO: is this ok?
39473989 else object = new Chuck_Object;
39483990 }
@@ -3957,7 +3999,7 @@ Chuck_Object * instantiate_and_initialize_object( Chuck_Type * type, Chuck_VM_Sh · 8 unmodified lines
39573999 object = ugen = uana = new Chuck_UAna;
39584000 ugen->alloc_v( vm->shreduler()->m_max_block_size );
39594001 }
3960− else
4002+ else
39614003 {
39624004 object = ugen = new Chuck_UGen;
39634005 ugen->alloc_v( vm->shreduler()->m_max_block_size );
@@ -3968,11 +4010,11 @@ Chuck_Object * instantiate_and_initialize_object( Chuck_Type * type, Chuck_VM_Sh · 4 unmodified lines
39684010 ugen->shred = shred;
39694011 shred->add( ugen );
39704012 }
3971−
4013+
39724014 // REFACTOR-2017: added
39734015 ugen->vm = vm;
39744016 }
3975−
4017+
39764018 // check to see enough memory
39774019 if( !object ) goto out_of_memory;
39784020
@@ -3984,7 +4026,7 @@ Chuck_Object * instantiate_and_initialize_object( Chuck_Type * type, Chuck_VM_Sh · 5 unmodified lines
39844026 out_of_memory:
39854027
39864028 // we have a problem
3987− CK_FPRINTF_STDERR(
4029+ CK_FPRINTF_STDERR(
39884030 "[chuck](VM): OutOfMemory: while instantiating object '%s'\n",
39894031 type->c_name() );
39904032
@@ -4049,8 +4091,8 @@ void Chuck_Instr_Instantiate_Object::execute( Chuck_VM * vm, Chuck_VM_Shred * sh · 58 unmodified lines
40494091 //-----------------------------------------------------------------------------
40504092 const char * Chuck_Instr_Instantiate_Object::params() const
40514093 {
4052− static char buffer[256];
4053− sprintf( buffer, "%s", this->type->c_name() );
4094+ static char buffer[CK_PRINT_BUF_LENGTH];
4095+ snprintf( buffer, CK_PRINT_BUF_LENGTH, "%s", this->type->c_name() );
40544096 return buffer;
40554097 }
40564098
@@ -4063,8 +4105,8 @@ const char * Chuck_Instr_Instantiate_Object::params() const · 6 unmodified lines
40634105 //-----------------------------------------------------------------------------
40644106 const char * Chuck_Instr_Pre_Ctor_Array_Top::params() const
40654107 {
4066− static char buffer[256];
4067− sprintf( buffer, "val=%ld, type=\"%s\"", (long)m_val, type ? type->c_name() : "[empty]" );
4108+ static char buffer[CK_PRINT_BUF_LENGTH];
4109+ snprintf( buffer, CK_PRINT_BUF_LENGTH, "val=%ld, type=\"%s\"", (long)m_val, type ? type->c_name() : "[empty]" );
40684110 return buffer;
40694111 }
40704112
@@ -4102,7 +4144,7 @@ void Chuck_Instr_Pre_Ctor_Array_Bottom::execute( Chuck_VM * vm, Chuck_VM_Shred * · 31 unmodified lines
41024144
41034145 // pop the object
41044146 pop_( reg_sp, 1 );
4105−
4147+
41064148 // cast the object
41074149 Chuck_Object * obj = (Chuck_Object *)(*(reg_sp));
41084150
@@ -4194,7 +4236,7 @@ void Chuck_Instr_Assign_Primitive4::execute( Chuck_VM * vm, Chuck_VM_Shred * shr · 85 unmodified lines
41944236
41954237 // pop word from reg stack
41964238 pop_( reg_sp, 1 + (sz_COMPLEX / sz_UINT) ); // ISSUE: 64-bit (fixed 1.3.1.0)
4197− // copy popped value into mem stack
4239+ // copy popped value into mem stack
41984240 *( (t_CKCOMPLEX*)(*(reg_sp+(sz_COMPLEX/sz_UINT))) ) = *(t_CKCOMPLEX *)reg_sp; // ISSUE: 64-bit (fixed 1.3.1.0)
41994241
42004242 t_CKCOMPLEX *& sp_complex = (t_CKCOMPLEX *&)reg_sp;
@@ -4211,12 +4253,12 @@ void Chuck_Instr_Assign_Primitive4::execute( Chuck_VM * vm, Chuck_VM_Shred * shr · 10 unmodified lines
42114253 void Chuck_Instr_Assign_PrimitiveVec3::execute( Chuck_VM * vm, Chuck_VM_Shred * shred )
42124254 {
42134255 t_CKUINT *& reg_sp = (t_CKUINT *&)shred->reg->sp;
4214−
4256+
42154257 // pop word from reg stack
42164258 pop_( reg_sp, 1 + (sz_VEC3 / sz_UINT) );
42174259 // copy popped value into mem stack
42184260 *( (t_CKVEC3*)(*(reg_sp+(sz_VEC3/sz_UINT))) ) = *(t_CKVEC3 *)reg_sp;
4219−
4261+
42204262 t_CKVEC3 *& sp_vec3 = (t_CKVEC3 *&)reg_sp;
42214263 push_( sp_vec3, *sp_vec3 );
42224264 }
@@ -4231,12 +4273,12 @@ void Chuck_Instr_Assign_PrimitiveVec3::execute( Chuck_VM * vm, Chuck_VM_Shred * · 8 unmodified lines
42314273 void Chuck_Instr_Assign_PrimitiveVec4::execute( Chuck_VM * vm, Chuck_VM_Shred * shred )
42324274 {
42334275 t_CKUINT *& reg_sp = (t_CKUINT *&)shred->reg->sp;
4234−
4276+
42354277 // pop word from reg stack
42364278 pop_( reg_sp, 1 + (sz_VEC4 / sz_UINT) );
42374279 // copy popped value into mem stack
42384280 *( (t_CKVEC4*)(*(reg_sp+(sz_VEC4/sz_UINT))) ) = *(t_CKVEC4 *)reg_sp;
4239−
4281+
42404282 t_CKVEC4 *& sp_vec4 = (t_CKVEC4 *&)reg_sp;
42414283 push_( sp_vec4, *sp_vec4 );
42424284 }
@@ -4341,7 +4383,7 @@ void Chuck_Instr_AddRef_Object::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 98 unmodified lines
43414383 t_CKBYTE *& mem_sp = (t_CKBYTE *&)shred->mem->sp;
43424384 t_CKUINT *& reg_sp = (t_CKUINT *&)shred->reg->sp;
43434385 Chuck_VM_Object * obj = NULL;
4344−
4386+
43454387 // pop word from reg stack
43464388 pop_( reg_sp, 1 );
43474389 // copy popped value into mem stack
@@ -4365,7 +4407,7 @@ void Chuck_Instr_AddRef_Object2::execute( Chuck_VM * vm, Chuck_VM_Shred * shred · 17 unmodified lines
43654407 {
43664408 t_CKBYTE *& mem_sp = (t_CKBYTE *&)shred->mem->sp;
43674409 Chuck_VM_Object * obj = NULL;
4368−
4410+
43694411 // copy popped value into mem stack
43704412 obj = *( (Chuck_VM_Object **)(mem_sp + m_val) );
43714413 // check for NULL
@@ -4381,15 +4423,20 @@ void Chuck_Instr_AddRef_Object2::execute( Chuck_VM * vm, Chuck_VM_Shred * shred · 9 unmodified lines
43814423
43824424 //-----------------------------------------------------------------------------
43834425 // name: execute()
4384−// desc: add one reference on object (added 1.3.0.0)
4426+// desc: ref-count increment the top of the register stack (added 1.3.0.0)
4427+// 1.4.2.1 (ge) additional notes...
4428+// this is used to keep objects referenced while on stack;
4429+// relevant for cases like `return obj;` where obj may need to
4430+// released for the local stack AND need to be kept on the stack
4431+// to be return; in this case, we need this additional add_ref();
4432+// releasing obj from stack is responsibility of the caller
43854433 //-----------------------------------------------------------------------------
43864434 void Chuck_Instr_Reg_AddRef_Object3::execute( Chuck_VM * vm, Chuck_VM_Shred * shred )
43874435 {
4388− // ISSUE: 64-bit?
43894436 // NOTE: this pointer is NOT a reference pointer
43904437 t_CKUINT * reg_sp = (t_CKUINT *&)shred->reg->sp;
43914438 Chuck_VM_Object * obj = NULL;
4392−
4439+
43934440 // move word without popping
43944441 reg_sp--;
43954442 // copy popped value into mem stack
@@ -4397,7 +4444,7 @@ void Chuck_Instr_Reg_AddRef_Object3::execute( Chuck_VM * vm, Chuck_VM_Shred * sh · 1 unmodified line
43974444 // ge (2012 april): check for NULL (added 1.3.0.0)
43984445 if( obj != NULL )
43994446 {
4400− // release
4447+ // add reference
44014448 obj->add_ref();
44024449 }
44034450 }
@@ -4439,7 +4486,7 @@ void Chuck_Instr_Release_Object2::execute( Chuck_VM * vm, Chuck_VM_Shred * shred · 35 unmodified lines
44394486 {
44404487 t_CKBYTE *& mem_sp = (t_CKBYTE *&)shred->mem->sp;
44414488 Chuck_VM_Object * obj = NULL;
4442−
4489+
44434490 // copy popped value into mem stack
44444491 obj = *( (Chuck_VM_Object **)(mem_sp + m_val) );
44454492 // check for NULL
@@ -4452,13 +4499,70 @@ void Chuck_Instr_Release_Object2::execute( Chuck_VM * vm, Chuck_VM_Shred * shred · 6 unmodified lines
44524499
44534500
44544501
4502+
4503+//-----------------------------------------------------------------------------
4504+// name: execute()
4505+// desc: release object reference + pop from reg stack | 1.4.2.1 (ge) added
4506+// the variant assumes object pointer directly on stack (not offset)
4507+// used to release returned object pointer after a function call;
4508+// FYI the return value is conveyed on the reg stack; this undoes
4509+// the addref before the return; see Chuck_Instr_Reg_AddRef_Object3
4510+//-----------------------------------------------------------------------------
4511+void Chuck_Instr_Release_Object3_Pop_Word::execute( Chuck_VM * vm, Chuck_VM_Shred * shred )
4512+{
4513+ t_CKUINT *& reg_sp = (t_CKUINT *&)shred->reg->sp;
4514+ Chuck_VM_Object * obj = NULL;
4515+
4516+ // pop
4517+ pop_( reg_sp, 1 );
4518+ // copy popped value into mem stack
4519+ obj = *( (Chuck_VM_Object **)(reg_sp) );
4520+ // ge (2012 april): check for NULL (added 1.3.0.0)
4521+ if( obj != NULL )
4522+ {
4523+ // release
4524+ obj->release();
4525+ }
4526+}
4527+
4528+
4529+
4530+
4531+//-----------------------------------------------------------------------------
4532+// name: execute()
4533+// desc: release object reference from reg stack | 1.4.2.1 (ge) added
4534+// the variant assumes object pointer directly on stack (not offset)
4535+// used to release objects on function arguments, specifically for
4536+// built-in / imported (chugins) functions; code-defined functions
4537+// do their own argument cleanup
4538+//-----------------------------------------------------------------------------
4539+void Chuck_Instr_Release_Object4::execute( Chuck_VM * vm, Chuck_VM_Shred * shred )
4540+{
4541+ // NOTE: this pointer is NOT a reference pointer
4542+ t_CKBYTE * mem_sp = (t_CKBYTE *&)shred->mem->sp;
4543+ Chuck_VM_Object * obj = NULL;
4544+
4545+ // move it
4546+ mem_sp += m_val;
4547+ // copy popped value into mem stack
4548+ obj = *( (Chuck_VM_Object **)(mem_sp) );
4549+ if( obj != NULL )
4550+ {
4551+ // release
4552+ obj->release();
4553+ }
4554+}
4555+
4556+
4557+
4558+
44554559 #pragma mark === Function Calls ===
44564560
44574561
44584562
44594563 //-----------------------------------------------------------------------------
44604564 // name: execute()
4461−// desc: ...
4565+// desc: converts, in place on operand stack, a Func to its Code (instructions)
44624566 //-----------------------------------------------------------------------------
44634567 void Chuck_Instr_Func_To_Code::execute( Chuck_VM * vm, Chuck_VM_Shred * shred )
44644568 {
@@ -4476,6 +4580,57 @@ void Chuck_Instr_Func_To_Code::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 11 unmodified lines
44764580
44774581
44784582
4583+//-----------------------------------------------------------------------------
4584+// name: func_release_args() | 1.4.2.1 (ge) added
4585+// desc: helper function to release objects an function arg list
4586+// input: VM, args list, mem stack pointer
4587+// context: this is designed for builtin/imported functions
4588+// functions defined in chuck code do their own arg list cleanup
4589+//-----------------------------------------------------------------------------
4590+t_CKBOOL func_release_args( Chuck_VM * vm, a_Arg_List args, t_CKBYTE * mem_sp )
4591+{
4592+ // keep track of offset
4593+ t_CKUINT offset = 0;
4594+ // the type in question
4595+ Chuck_Type * type = NULL;
4596+ // object pointer
4597+ Chuck_VM_Object * object = NULL;
4598+
4599+ // loop over
4600+ while( args )
4601+ {
4602+ // get the type
4603+ type = args->type;
4604+ // check we have one!
4605+ if( type != NULL )
4606+ {
4607+ // is an object?
4608+ if( isobj( vm->env(), args->type) )
4609+ {
4610+ // get the object pointer
4611+ object = (Chuck_VM_Object *)(*(t_CKUINT *)(mem_sp+offset));
4612+ // check
4613+ if( object != NULL )
4614+ {
4615+ // release it
4616+ object->release();
4617+ }
4618+ }
4619+
4620+ // advance offset
4621+ offset += args->type->size;
4622+ }
4623+
4624+ // go
4625+ args = args->next;
4626+ }
4627+
4628+ return TRUE;
4629+}
4630+
4631+
4632+
4633+
44794634 //-----------------------------------------------------------------------------
44804635 // name: execute()
44814636 // desc: ...
@@ -4541,7 +4696,7 @@ void Chuck_Instr_Func_Call::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 59 unmodified lines
45414696 // one less word to copy
45424697 stack_depth--;
45434698 }
4544−
4699+
45454700 // push the arguments
45464701 for( t_CKUINT i = 0; i < stack_depth; i++ )
45474702 *mem_sp2++ = *reg_sp2++;
@@ -4553,7 +4708,7 @@ void Chuck_Instr_Func_Call::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 5 unmodified lines
45534708 return;
45544709
45554710 error_overflow:
4556−
4711+
45574712 handle_overflow( shred, vm );
45584713 }
45594714
@@ -4598,7 +4753,7 @@ void Chuck_Instr_Func_Call_Member::execute( Chuck_VM * vm, Chuck_VM_Shred * shre · 38 unmodified lines
45984753 // make copies
45994754 t_CKUINT * reg_sp2 = reg_sp;
46004755 t_CKUINT * mem_sp2 = mem_sp;
4601−
4756+
46024757 // need this
46034758 if( func->need_this )
46044759 {
@@ -4630,15 +4785,25 @@ void Chuck_Instr_Func_Call_Member::execute( Chuck_VM * vm, Chuck_VM_Shred * shre · 25 unmodified lines
46304785 // call the function (added 1.3.0.0 -- Chuck_DL_Api::Api::instance())
46314786 f( (Chuck_Object *)(*mem_sp), mem_sp + 1, &retval, vm, shred, Chuck_DL_Api::Api::instance() );
46324787 }
4633− // pop (TODO: check if this is right)
4634− mem_sp -= push;
4635−
4788+
46364789 // push the return
46374790 // 1.3.1.0: check type to use kind instead of size
46384791 if( m_val == kindof_INT ) // ISSUE: 64-bit (fixed: 1.3.1.0)
46394792 {
46404793 // push the return args
46414794 push_( reg_sp, retval.v_uint );
4795+
4796+ // 1.4.2.1 (ge) | added -- ensure ref count
4797+ if( m_func_ref && isobj(vm->env(), m_func_ref->def->ret_type) )
4798+ {
4799+ // get return value as object reference
4800+ Chuck_VM_Object * obj = (Chuck_VM_Object *) retval.v_uint;
4801+ if( obj )
4802+ {
4803+ // always add reference to returned objects (should release outside)
4804+ obj->add_ref();
4805+ }
4806+ }
46424807 }
46434808 else if( m_val == kindof_FLOAT ) // ISSUE: 64-bit (fixed 1.3.1.0)
46444809 {
@@ -4668,10 +4833,26 @@ void Chuck_Instr_Func_Call_Member::execute( Chuck_VM * vm, Chuck_VM_Shred * shre · 23 unmodified lines
46684833 else if( m_val == kindof_VOID ) { }
46694834 else assert( FALSE );
46704835
4836+ // if we have a func def | 1.4.2.1 (ge) added
4837+ if( m_func_ref != NULL )
4838+ {
4839+ // cleanup / release objects on the arg list
4840+ // context: this should be done here for builtin/import functions
4841+ // user-defined functions do their own arg list cleanup
4842+ // note: this is done after pushing the return value, in case the
4843+ // return value is one of these args being released;
4844+ // e.g., functions that pass through args;
4845+ // e.g., string Sndbuf.read(string)
4846+ func_release_args( vm, m_func_ref->def->arg_list, (t_CKBYTE *)(mem_sp+1) );
4847+ }
4848+
4849+ // pop the stack pointer
4850+ mem_sp -= push;
4851+
46714852 return;
46724853
46734854 error_overflow:
4674−
4855+
46754856 handle_overflow( shred, vm );
46764857 }
46774858
@@ -4701,7 +4882,7 @@ void Chuck_Instr_Func_Call_Static::execute( Chuck_VM * vm, Chuck_VM_Shred * shre · 23 unmodified lines
47014882 // get the stack depth of the callee function args
47024883 t_CKUINT stack_depth = ( func->stack_depth / sz_INT ) + ( func->stack_depth & 0x3 ? 1 : 0 ); // ISSUE: 64-bit (fixed 1.3.1.0)
47034884 // UNUSED: get the previous stack depth - caller function args
4704− // UNUSED: t_CKUINT prev_stack = ( *(mem_sp-1) >> 2 ) + ( *(mem_sp-1) & 0x3 ? 1 : 0 );
4885+ // UNUSED: t_CKUINT prev_stack = ( *(mem_sp-1) >> 2 ) + ( *(mem_sp-1) & 0x3 ? 1 : 0 );
47054886 // the amount to push in 4-byte words
47064887 t_CKUINT push = local_depth;
47074888 // push the mem stack past the current function variables and arguments
@@ -4716,7 +4897,7 @@ void Chuck_Instr_Func_Call_Static::execute( Chuck_VM * vm, Chuck_VM_Shred * shre · 8 unmodified lines
47164897 // make copies
47174898 t_CKUINT * reg_sp2 = reg_sp;
47184899 t_CKUINT * mem_sp2 = mem_sp;
4719−
4900+
47204901 // need type
47214902 if( func->is_static )
47224903 {
@@ -4737,8 +4918,6 @@ void Chuck_Instr_Func_Call_Static::execute( Chuck_VM * vm, Chuck_VM_Shred * shre · 14 unmodified lines
47374918 // (added 1.3.0.0 -- Chuck_DL_Api::Api::instance())
47384919 // (added 1.4.1.0 -- base_type)
47394920 f( (Chuck_Type *)(*mem_sp), mem_sp+1, &retval, vm, shred, Chuck_DL_Api::Api::instance() );
4740− // clean up memory stack
4741− mem_sp -= push;
47424921
47434922 // push the return
47444923 // 1.3.1.0: check type to use kind instead of size
@@ -4746,6 +4925,18 @@ void Chuck_Instr_Func_Call_Static::execute( Chuck_VM * vm, Chuck_VM_Shred * shre · 1 unmodified line
47464925 {
47474926 // push the return args
47484927 push_( reg_sp, retval.v_uint );
4928+
4929+ // 1.4.2.1 (ge) | added -- ensure ref count
4930+ if( m_func_ref && isobj(vm->env(), m_func_ref->def->ret_type) )
4931+ {
4932+ // get return value as object reference
4933+ Chuck_VM_Object * obj = (Chuck_VM_Object *) retval.v_uint;
4934+ if( obj )
4935+ {
4936+ // always add reference to returned objects (should release outside)
4937+ obj->add_ref();
4938+ }
4939+ }
47494940 }
47504941 else if( m_val == kindof_FLOAT ) // ISSUE: 64-bit (fixed 1.3.1.0)
47514942 {
@@ -4775,10 +4966,26 @@ void Chuck_Instr_Func_Call_Static::execute( Chuck_VM * vm, Chuck_VM_Shred * shre · 23 unmodified lines
47754966 else if( m_val == kindof_VOID ) { }
47764967 else assert( FALSE );
47774968
4969+ // if we have a func def | 1.4.2.1 (ge) added
4970+ if( m_func_ref != NULL )
4971+ {
4972+ // cleanup / release objects on the arg list
4973+ // context: this should be done here for builtin/import functions
4974+ // user-defined functions do their own arg list cleanup
4975+ // note: this is done after pushing the return value, in case the
4976+ // return value is one of these args being released;
4977+ // e.g., functions that pass through args;
4978+ // e.g., string Sndbuf.read(string)
4979+ func_release_args( vm, m_func_ref->def->arg_list, (t_CKBYTE *)(mem_sp+1) );
4980+ }
4981+
4982+ // pop the stack pointer
4983+ mem_sp -= push;
4984+
47784985 return;
47794986
47804987 error_overflow:
4781−
4988+
47824989 handle_overflow( shred, vm );
47834990 }
47844991
@@ -4805,7 +5012,7 @@ void Chuck_Instr_Func_Return::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 20 unmodified lines
48055012 // jump the prev stack
48065013 mem_sp -= *(mem_sp);
48075014
4808− // set the shred
5015+ // set the shred
48095016 shred->code = func;
48105017 shred->instr = func->instr;
48115018 }
@@ -4822,7 +5029,7 @@ void Chuck_Instr_Spork::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 10 unmodified lines
48225029 t_CKUINT *& reg_sp = (t_CKUINT *&)shred->reg->sp;
48235030 t_CKUINT this_ptr = 0;
48245031 t_CKUINT type_ptr = 0;
4825−
5032+
48265033 // pop the stack
48275034 pop_( reg_sp, 1 );
48285035 // get the code
@@ -4885,14 +5092,14 @@ void Chuck_Instr_Spork::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 56 unmodified lines
48855092 //void Chuck_Instr_Spork_Stmt::execute( Chuck_VM * vm, Chuck_VM_Shred * shred )
48865093 //{
48875094 // t_CKUINT *& reg_sp = (t_CKUINT *&)shred->reg->sp;
4888−//
5095+//
48895096 // // pop the stack
48905097 // pop_( reg_sp, 1 );
48915098 // // get the code
48925099 // Chuck_VM_Code * code = *(Chuck_VM_Code **)reg_sp;
48935100 // // spork it
48945101 // Chuck_VM_Shred * sh = vm->spork( code, shred );
4895−//
5102+//
48965103 // if( code->need_this )
48975104 // {
48985105 // // pop the stack
@@ -4900,7 +5107,7 @@ void Chuck_Instr_Spork::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 1 unmodified line
49005107 // // copy this from local stack to top of new shred mem
49015108 // *( ( t_CKUINT * ) sh->mem->sp ) = *reg_sp;
49025109 // }
4903−//
5110+//
49045111 // // push the stack
49055112 // push_( reg_sp, (t_CKUINT)sh );
49065113 //}
@@ -4923,7 +5130,7 @@ void Chuck_Instr_Time_Advance::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 16 unmodified lines
49235130 if( *sp < shred->now )
49245131 {
49255132 // we have a problem
4926− CK_FPRINTF_STDERR(
5133+ CK_FPRINTF_STDERR(
49275134 "[chuck](VM): DestTimeNegativeException: '%.6f' on line[%lu] in shred[id=%lu:%s]\n",
49285135 *sp, m_linepos, shred->xid, shred->name.c_str() );
49295136 // do something!
@@ -4970,7 +5177,7 @@ void Chuck_Instr_Event_Wait::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 40 unmodified lines
49705177
49715178 null_pointer:
49725179 // we have a problem
4973− CK_FPRINTF_STDERR(
5180+ CK_FPRINTF_STDERR(
49745181 "[chuck](VM): NullPointerException: (null Event wait) on line[%lu] in shred[id=%lu:%s]\n",
49755182 m_linepos, shred->xid, shred->name.c_str() );
49765183 goto done;
@@ -4996,12 +5203,17 @@ Chuck_Instr_Array_Init::Chuck_Instr_Array_Init( Chuck_Env * env, Chuck_Type * t, · 19 unmodified lines
49965203 m_length = length;
49975204 // copy
49985205 m_type_ref = t;
4999− // TODO: do this? remember?
5000− // m_type_ref->add_ref();
5206+ // add reference
5207+ m_type_ref->add_ref();
50015208 // type
50025209 m_param_str = new char[64];
50035210 // obj | REFACTOR-2017: added env
50045211 m_is_obj = isobj( env, m_type_ref );
5212+ // float | 1.4.2.0 (ge) added to differentiate between int and float arrays
5213+ // -- in situations where they are the same size
5214+ m_is_float = isa( t, env->t_float );
5215+
5216+ // copy type name
50055217 const char * str = m_type_ref->c_name();
50065218 t_CKUINT len = strlen( str );
50075219 // copy
@@ -5015,7 +5227,7 @@ Chuck_Instr_Array_Init::Chuck_Instr_Array_Init( Chuck_Env * env, Chuck_Type * t, · 7 unmodified lines
50155227
50165228 // append length
50175229 char buffer[16];
5018− sprintf( buffer, "[%ld]", (long)m_length );
5230+ snprintf( buffer, 16, "[%ld]", (long)m_length );
50195231 strcat( m_param_str, buffer );
50205232 }
50215233
@@ -5032,8 +5244,7 @@ Chuck_Instr_Array_Init::~Chuck_Instr_Array_Init() · 10 unmodified lines
50325244 delete [] m_param_str;
50335245 m_param_str = NULL;
50345246 // release
5035− //m_type_ref->release();
5036− m_type_ref = NULL;
5247+ SAFE_RELEASE( m_type_ref );
50375248 }
50385249
50395250
@@ -5049,7 +5260,8 @@ void Chuck_Instr_Array_Init::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 9 unmodified lines
50495260 t_CKUINT *& reg_sp = (t_CKUINT *&)shred->reg->sp;
50505261
50515262 // allocate the array
5052− if( m_type_ref->size == sz_INT ) // ISSUE: 64-bit (fixed 1.3.1.0)
5263+ // 1.4.2.0 (ge) | added: check for float explicitly
5264+ if( m_type_ref->size == sz_INT && !m_is_float ) // ISSUE: 64-bit (fixed 1.3.1.0)
50535265 {
50545266 // TODO: look at size and treat Chuck_Array4 as ChuckArrayInt
50555267 // pop the values
@@ -5059,6 +5271,7 @@ void Chuck_Instr_Array_Init::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 3 unmodified lines
50595271 // problem
50605272 if( !array ) goto out_of_memory;
50615273 // initialize object
5274+ // TODO: should it be this??? initialize_object( array, m_type_ref );
50625275 initialize_object( array, vm->env()->t_array );
50635276 // set array type
50645277 array->m_array_type = m_type_ref;
@@ -5163,14 +5376,20 @@ void Chuck_Instr_Array_Init::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 98 unmodified lines
51635376 // push the pointer
51645377 push_( reg_sp, (t_CKUINT)array );
51655378 }
5166− else assert( FALSE );
5379+ else
5380+ {
5381+ // we have a problem
5382+ CK_FPRINTF_STDERR(
5383+ "[chuck](VM): InvalidArrayTypeInfo: while initializing arrays on line[%lu]\n", m_linepos );
5384+ assert( FALSE );
5385+ }
51675386
51685387 return;
51695388
51705389 out_of_memory:
51715390
51725391 // we have a problem
5173− CK_FPRINTF_STDERR(
5392+ CK_FPRINTF_STDERR(
51745393 "[chuck](VM): OutOfMemory: while initializing arrays on line[%lu]\n", m_linepos );
51755394
51765395 // do something!
@@ -5183,26 +5402,35 @@ out_of_memory: · 6 unmodified lines
51835402
51845403 //-----------------------------------------------------------------------------
51855404 // name: Chuck_Instr_Array_Alloc()
5186−// desc: ...
5405+// desc: allocate a chuck array
51875406 //-----------------------------------------------------------------------------
5188−Chuck_Instr_Array_Alloc::Chuck_Instr_Array_Alloc( Chuck_Env * env, t_CKUINT depth, Chuck_Type * t,
5189− t_CKUINT offset, t_CKBOOL is_ref )
5407+Chuck_Instr_Array_Alloc::Chuck_Instr_Array_Alloc( Chuck_Env * env, t_CKUINT depth, Chuck_Type * contentType,
5408+ t_CKUINT offset, t_CKBOOL is_ref, Chuck_Type * arrayType )
51905409 {
51915410 // set
51925411 m_depth = depth;
5193− // copy
5194− m_type_ref = t;
5412+
5413+ // 1.4.2.1 (ge) now maintains two Chuck_Types: one for the array content;
5414+ // one for the array itself (which has depth > 0); the latter is so that
5415+ // array object can have a reference to the array type itself
5416+
5417+ // copy array content type, e.g., int
5418+ m_type_ref_content = contentType;
51955419 // remember
5196− // m_type_ref->add_ref();
5197− // type
5420+ SAFE_ADD_REF( m_type_ref_content );
5421+ // remember the type of the array itself, e.g., int[][]
5422+ m_type_ref_array = arrayType;
5423+ SAFE_ADD_REF( m_type_ref_array );
5424+
5425+ // parameter string
51985426 m_param_str = new char[64];
51995427 // obj | REFACTOR-2017: added env
5200− m_is_obj = isobj( env, m_type_ref );
5428+ m_is_obj = isobj( env, m_type_ref_content );
52015429 // offset for pre constructor
52025430 m_stack_offset = offset;
52035431 // is object ref
52045432 m_is_ref = is_ref;
5205− const char * str = m_type_ref->c_name();
5433+ const char * str = m_type_ref_content->c_name();
52065434 t_CKUINT len = strlen( str );
52075435 // copy
52085436 if( len < 64 )
@@ -5223,12 +5451,11 @@ Chuck_Instr_Array_Alloc::Chuck_Instr_Array_Alloc( Chuck_Env * env, t_CKUINT dept · 14 unmodified lines
52235451 //-----------------------------------------------------------------------------
52245452 Chuck_Instr_Array_Alloc::~Chuck_Instr_Array_Alloc()
52255453 {
5226− // delete
5227− delete [] m_param_str;
5228− m_param_str = NULL;
5229− // release
5230− //m_type_ref->release();
5231− m_type_ref = NULL;
5454+ // delete | 1.4.2.1 (ge) convert to macro
5455+ SAFE_DELETE_ARRAY( m_param_str );
5456+ // release | 1.4.2.1 (ge) added
5457+ SAFE_RELEASE(m_type_ref_content);
5458+ SAFE_RELEASE(m_type_ref_array);
52325459 }
52335460
52345461
@@ -5241,11 +5468,13 @@ Chuck_Instr_Array_Alloc::~Chuck_Instr_Array_Alloc() · 6 unmodified lines
52415468 Chuck_Object * do_alloc_array( Chuck_VM * vm, // REFACTOR-2017: added
52425469 t_CKINT * capacity, const t_CKINT * top,
52435470 t_CKUINT kind, t_CKBOOL is_obj,
5244− t_CKUINT * objs, t_CKINT & index )
5471+ t_CKUINT * objs, t_CKINT & index,
5472+ Chuck_Type * type )
52455473 {
52465474 // not top level
52475475 Chuck_Array4 * base = NULL;
52485476 Chuck_Object * next = NULL;
5477+ Chuck_Type * typeNext = NULL;
52495478 t_CKINT i = 0;
52505479
52515480 // capacity
@@ -5272,44 +5501,54 @@ Chuck_Object * do_alloc_array( Chuck_VM * vm, // REFACTOR-2017: added · 20 unmodified lines
52725501 }
52735502 }
52745503
5275− // initialize object
5276− initialize_object( base, vm->env()->t_array );
5504+ // initialize object | 1.4.2.1 (ge) use array type instead of base t_array
5505+ // for the object->type_ref to contain more specific information
5506+ initialize_object( base, type );
5507+ // initialize_object( base, vm->env()->t_array );
52775508 return base;
52785509 }
52795510 else if( kind == kindof_FLOAT ) // ISSUE: 64-bit (fixed 1.3.1.0)
52805511 {
52815512 Chuck_Array8 * base = new Chuck_Array8( *capacity );
52825513 if( !base ) goto out_of_memory;
5283−
5284− // initialize object
5285− initialize_object( base, vm->env()->t_array );
5514+
5515+ // initialize object | 1.4.2.1 (ge) use array type instead of base t_array
5516+ // for the object->type_ref to contain more specific information
5517+ initialize_object( base, type );
5518+ // initialize_object( base, vm->env()->t_array );
52865519 return base;
52875520 }
52885521 else if( kind == kindof_COMPLEX ) // ISSUE: 64-bit (fixed 1.3.1.0)
52895522 {
52905523 Chuck_Array16 * base = new Chuck_Array16( *capacity );
52915524 if( !base ) goto out_of_memory;
5292−
5293− // initialize object
5294− initialize_object( base, vm->env()->t_array );
5525+
5526+ // initialize object | 1.4.2.1 (ge) use array type instead of base t_array
5527+ // for the object->type_ref to contain more specific information
5528+ initialize_object( base, type );
5529+ // initialize_object( base, vm->env()->t_array );
52955530 return base;
52965531 }
52975532 else if( kind == kindof_VEC3 ) // 1.3.5.3
52985533 {
52995534 Chuck_Array24 * base = new Chuck_Array24( *capacity );
53005535 if( !base ) goto out_of_memory;
5301−
5302− // initialize object
5303− initialize_object( base, vm->env()->t_array );
5536+
5537+ // initialize object | 1.4.2.1 (ge) use array type instead of base t_array
5538+ // for the object->type_ref to contain more specific information
5539+ initialize_object( base, type );
5540+ // initialize_object( base, vm->env()->t_array );
53045541 return base;
53055542 }
53065543 else if( kind == kindof_VEC4 ) // 1.3.5.3
53075544 {
53085545 Chuck_Array32 * base = new Chuck_Array32( *capacity );
53095546 if( !base ) goto out_of_memory;
5310−
5311− // initialize object
5312− initialize_object( base, vm->env()->t_array );
5547+
5548+ // initialize object | 1.4.2.1 (ge) use array type instead of base t_array
5549+ // for the object->type_ref to contain more specific information
5550+ initialize_object( base, type );
5551+ // initialize_object( base, vm->env()->t_array );
53135552 return base;
53145553 }
53155554
@@ -5321,24 +5560,40 @@ Chuck_Object * do_alloc_array( Chuck_VM * vm, // REFACTOR-2017: added · 5 unmodified lines
53215560 base = new Chuck_Array4( TRUE, *capacity );
53225561 if( !base ) goto out_of_memory;
53235562
5563+ // construct type for next array level | 1.4.2.1 (ge) added
5564+ typeNext = type->copy( vm->env() );
5565+ // check
5566+ if( typeNext->array_depth == 0 ) goto internal_error_array_depth;
5567+ // minus the depth
5568+ typeNext->array_depth--;
5569+
53245570 // allocate the next level
53255571 for( i = 0; i < *capacity; i++ )
53265572 {
53275573 // the next | REFACTOR-2017: added vm
5328− next = do_alloc_array( vm, capacity+1, top, kind, is_obj, objs, index );
5574+ next = do_alloc_array( vm, capacity+1, top, kind, is_obj, objs, index, typeNext );
53295575 // error if NULL
53305576 if( !next ) goto error;
53315577 // set that, with ref count
53325578 base->set( i, (t_CKUINT)next );
53335579 }
53345580
5335− // initialize object
5336− initialize_object( base, vm->env()->t_array );
5581+ // initialize object | 1.4.2.1 (ge) use array type instead of base t_array
5582+ // for the object->type_ref to contain more specific information
5583+ initialize_object( base, type );
5584+ // initialize_object( base, vm->env()->t_array );
5585+
53375586 return base;
53385587
5588+internal_error_array_depth:
5589+ // we have a big problem
5590+ CK_FPRINTF_STDERR(
5591+ "[chuck](VM): internal error: multi-dimensional array depth mismatch while allocating arrays...\n" );
5592+ goto error;
5593+
53395594 out_of_memory:
53405595 // we have a problem
5341− CK_FPRINTF_STDERR(
5596+ CK_FPRINTF_STDERR(
53425597 "[chuck](VM): OutOfMemory: while allocating arrays...\n" );
53435598 goto error;
53445599
@@ -5427,9 +5682,8 @@ void Chuck_Instr_Array_Alloc::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 82 unmodified lines
54275682 ref = (t_CKUINT)do_alloc_array( vm,
54285683 (t_CKINT *)(reg_sp - m_depth),
54295684 (t_CKINT *)(reg_sp - 1),
5430− getkindof(vm->env(), m_type_ref), // 1.3.1.0: changed; was 'm_type_ref->size'
5431− m_is_obj,
5432− obj_array, index
5685+ getkindof(vm->env(), m_type_ref_content), // 1.3.1.0: changed; was 'm_type_ref->size'
5686+ m_is_obj, obj_array, index, m_type_ref_array // 1.4.2.1: added m_type_ref_array
54335687 );
54345688
54355689 // pop the indices - this protects the contents of the stack
@@ -5466,12 +5720,12 @@ overflow: · 30 unmodified lines
54665720
54675721 out_of_memory:
54685722 // we have a problem
5469− CK_FPRINTF_STDERR(
5723+ CK_FPRINTF_STDERR(
54705724 "[chuck](VM): OutOfMemory: while allocating arrays...\n" );
54715725 goto error;
54725726
54735727 error:
5474− CK_FPRINTF_STDERR(
5728+ CK_FPRINTF_STDERR(
54755729 "[chuck](VM): (note: on line[%lu] in shred[id=%lu:%s])\n",
54765730 m_linepos, shred->xid, shred->name.c_str() );
54775731
@@ -5483,6 +5737,22 @@ error: · 5 unmodified lines
54835737
54845738
54855739
5740+//-----------------------------------------------------------------------------
5741+// name: normalize_index()
5742+// desc: normalize index to allow for negative array indexing
5743+// 1.4.2.1 (nshaheed) added
5744+//-----------------------------------------------------------------------------
5745+static t_CKINT normalize_index( t_CKINT i, t_CKINT len )
5746+{
5747+ // a normal array index
5748+ if( i >= 0 ) return i;
5749+ // start with len-1 and keep going down
5750+ return len + i;
5751+}
5752+
5753+
5754+
5755+
54865756 //-----------------------------------------------------------------------------
54875757 // name: execute()
54885758 // desc: ...
@@ -5493,6 +5763,7 @@ void Chuck_Instr_Array_Access::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 4 unmodified lines
54935763 t_CKUINT *& sp = (t_CKUINT *&)shred->reg->sp;
54945764 // UNUSED: t_CKUINT *& reg_sp = sp;
54955765 t_CKINT i = 0;
5766+ t_CKINT ni = 0; // normalized
54965767 t_CKUINT val = 0;
54975768 t_CKFLOAT fval = 0;
54985769 t_CKCOMPLEX cval;
@@ -5515,17 +5786,19 @@ void Chuck_Instr_Array_Access::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 16 unmodified lines
55155786 Chuck_Array4 * arr = (Chuck_Array4 *)(*sp);
55165787 // get index
55175788 i = (t_CKINT)(*(sp+1));
5789+ // normalize index to allow for negative indexing | 1.4.2.1 (nshaheed) added
5790+ ni = normalize_index( i, arr->size() );
55185791 // check if writing
55195792 if( m_emit_addr ) {
55205793 // get the addr
5521− val = arr->addr( i );
5794+ val = arr->addr( ni );
55225795 // exception
55235796 if( !val ) goto array_out_of_bound;
55245797 // push the addr
55255798 push_( sp, val );
55265799 } else {
55275800 // get the value
5528− if( !arr->get( i, &val ) )
5801+ if( !arr->get( ni, &val ) )
55295802 goto array_out_of_bound;
55305803 // push the value
55315804 push_( sp, val );
@@ -5537,17 +5810,19 @@ void Chuck_Instr_Array_Access::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 5 unmodified lines
55375810 Chuck_Array8 * arr = (Chuck_Array8 *)(*sp);
55385811 // get index
55395812 i = (t_CKINT)(*(sp+1));
5813+ // normalize index to allow for negative indexing
5814+ ni = normalize_index( i, arr->size() );
55405815 // check if writing
55415816 if( m_emit_addr ) {
55425817 // get the addr
5543− val = arr->addr( i );
5818+ val = arr->addr( ni );
55445819 // exception
55455820 if( !val ) goto array_out_of_bound;
55465821 // push the addr
55475822 push_( sp, val );
55485823 } else {
55495824 // get the value
5550− if( !arr->get( i, &fval ) )
5825+ if( !arr->get( ni, &fval ) )
55515826 goto array_out_of_bound;
55525827 // push the value
55535828 push_( ((t_CKFLOAT *&)sp), fval );
@@ -5559,17 +5834,19 @@ void Chuck_Instr_Array_Access::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 5 unmodified lines
55595834 Chuck_Array16 * arr = (Chuck_Array16 *)(*sp);
55605835 // get index
55615836 i = (t_CKINT)(*(sp+1));
5837+ // normalize index to allow for negative indexing
5838+ ni = normalize_index( i, arr->size() );
55625839 // check if writing
55635840 if( m_emit_addr ) {
55645841 // get the addr
5565− val = arr->addr( i );
5842+ val = arr->addr( ni );
55665843 // exception
55675844 if( !val ) goto array_out_of_bound;
55685845 // push the addr
55695846 push_( sp, val );
55705847 } else {
55715848 // get the value
5572− if( !arr->get( i, &cval ) )
5849+ if( !arr->get( ni, &cval ) )
55735850 goto array_out_of_bound;
55745851 // push the value
55755852 push_( ((t_CKCOMPLEX *&)sp), cval );
@@ -5580,18 +5857,20 @@ void Chuck_Instr_Array_Access::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 4 unmodified lines
55805857 // get array
55815858 Chuck_Array24 * arr = (Chuck_Array24 *)(*sp);
55825859 // get index
5583− i = (t_CKINT)(*(sp+1));
5860+ i = (t_CKINT)(*(sp + 1));
5861+ // normalize index to allow for negative indexing
5862+ ni = normalize_index( i, arr->size() );
55845863 // check if writing
55855864 if( m_emit_addr ) {
55865865 // get the addr
5587− val = arr->addr( i );
5866+ val = arr->addr( ni );
55885867 // exception
55895868 if( !val ) goto array_out_of_bound;
55905869 // push the addr
55915870 push_( sp, val );
55925871 } else {
55935872 // get the value
5594− if( !arr->get( i, &v3 ) )
5873+ if( !arr->get( ni, &v3 ) )
55955874 goto array_out_of_bound;
55965875 // push the value
55975876 push_( ((t_CKVEC3 *&)sp), v3 );
@@ -5603,17 +5882,19 @@ void Chuck_Instr_Array_Access::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 5 unmodified lines
56035882 Chuck_Array32 * arr = (Chuck_Array32 *)(*sp);
56045883 // get index
56055884 i = (t_CKINT)(*(sp+1));
5885+ // normalize index to allow for negative indexing
5886+ ni = normalize_index( i, arr->size() );
56065887 // check if writing
56075888 if( m_emit_addr ) {
56085889 // get the addr
5609− val = arr->addr( i );
5890+ val = arr->addr( ni );
56105891 // exception
56115892 if( !val ) goto array_out_of_bound;
56125893 // push the addr
56135894 push_( sp, val );
56145895 } else {
56155896 // get the value
5616− if( !arr->get( i, &v4 ) )
5897+ if( !arr->get( ni, &v4 ) )
56175898 goto array_out_of_bound;
56185899 // push the value
56195900 push_( ((t_CKVEC4 *&)sp), v4 );
@@ -5626,14 +5907,14 @@ void Chuck_Instr_Array_Access::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 6 unmodified lines
56265907
56275908 null_pointer:
56285909 // we have a problem
5629− CK_FPRINTF_STDERR(
5910+ CK_FPRINTF_STDERR(
56305911 "[chuck](VM): NullPointerException: (array access) on line[%lu] in shred[id=%lu:%s]\n",
56315912 m_linepos, shred->xid, shred->name.c_str() ); // shred->pc removed
56325913 goto done;
56335914
56345915 array_out_of_bound:
56355916 // we have a problem
5636− CK_FPRINTF_STDERR(
5917+ CK_FPRINTF_STDERR(
56375918 "[chuck](VM): ArrayOutofBounds: on line[%lu] in shred[id=%lu:%s], index=[%ld]\n",
56385919 m_linepos, shred->xid, shred->name.c_str(), i ); // shred->pc removed
56395920 // go to done
@@ -5790,14 +6071,14 @@ void Chuck_Instr_Array_Map_Access::execute( Chuck_VM * vm, Chuck_VM_Shred * shre · 150 unmodified lines
57906071
57916072 null_pointer:
57926073 // we have a problem
5793− CK_FPRINTF_STDERR(
6074+ CK_FPRINTF_STDERR(
57946075 "[chuck](VM): NullPointerException: (map access) on line[%lu] in shred[id=%lu:%s]\n",
57956076 m_linepos, shred->xid, shred->name.c_str() ); // shred->pc
57966077 goto done;
57976078
57986079 error:
57996080 // we have a problem
5800− CK_FPRINTF_STDERR(
6081+ CK_FPRINTF_STDERR(
58016082 "[chuck](VM): InternalArrayMapError: on line[%lu] in shred[id=%lu:%s], index=[%s]\n",
58026083 m_linepos, shred->xid, shred->name.c_str(), key->str().c_str() ); // shred->pc
58036084 goto done;
@@ -5858,7 +6139,7 @@ void Chuck_Instr_Array_Access_Multi::execute( Chuck_VM * vm, Chuck_VM_Shred * sh · 54 unmodified lines
58586139 {
58596140 // get the array
58606141 if( !base->get( i, &val ) )
5861− goto array_out_of_bound;
6142+ goto array_out_of_bound;
58626143 }
58636144
58646145 // set the array
@@ -5991,16 +6272,16 @@ void Chuck_Instr_Array_Access_Multi::execute( Chuck_VM * vm, Chuck_VM_Shred * sh · 126 unmodified lines
59916272
59926273 null_pointer:
59936274 // we have a problem
5994− CK_FPRINTF_STDERR(
6275+ CK_FPRINTF_STDERR(
59956276 "[chuck](VM): NullPointerException: (array access) on line[%lu] in shred[id=%lu:%s]\n",
59966277 m_linepos, shred->xid, shred->name.c_str() ); // shred->pc
5997− CK_FPRINTF_STDERR(
6278+ CK_FPRINTF_STDERR(
59986279 "[chuck](VM): (array dimension where exception occurred: %lu)\n", index );
59996280 goto done;
60006281
60016282 array_out_of_bound:
60026283 // we have a problem
6003− CK_FPRINTF_STDERR(
6284+ CK_FPRINTF_STDERR(
60046285 "[chuck](VM): ArrayOutofBounds: on line[%lu] in shred[id=%lu:%s], index=[%ld]\n",
60056286 m_linepos, shred->xid, shred->name.c_str(), i ); // shred->pc
60066287 // go to done
@@ -6114,7 +6395,7 @@ void Chuck_Instr_Array_Append::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 107 unmodified lines
61146395
61156396 null_pointer:
61166397 // we have a problem
6117− CK_FPRINTF_STDERR(
6398+ CK_FPRINTF_STDERR(
61186399 "[chuck](VM): NullPointerException: (array append) on line[%lu] in shred[id=%lu:%s]\n",
61196400 m_linepos, shred->xid, shred->name.c_str() );
61206401 goto done;
@@ -6139,7 +6420,7 @@ void Chuck_Instr_Dot_Member_Data::execute( Chuck_VM * vm, Chuck_VM_Shred * shred · 18 unmodified lines
61396420 t_CKUINT *& sp = (t_CKUINT *&)shred->reg->sp;
61406421 // the pointer
61416422 t_CKUINT data;
6142−
6423+
61436424 // pop the object pointer
61446425 pop_( sp, 1 );
61456426 // get the object pointer
@@ -6148,7 +6429,7 @@ void Chuck_Instr_Dot_Member_Data::execute( Chuck_VM * vm, Chuck_VM_Shred * shred · 2 unmodified lines
61486429 if( !obj ) goto error;
61496430 // calculate the data pointer
61506431 data = (t_CKUINT)(obj->data + m_offset);
6151−
6432+
61526433 // emit addr or value
61536434 if( m_emit_addr )
61546435 {
@@ -6171,7 +6452,7 @@ void Chuck_Instr_Dot_Member_Data::execute( Chuck_VM * vm, Chuck_VM_Shred * shred · 16 unmodified lines
61716452
61726453 error:
61736454 // we have a problem
6174− CK_FPRINTF_STDERR(
6455+ CK_FPRINTF_STDERR(
61756456 "[chuck](VM): NullPointerException: on line[%lu] in shred[id=%lu:%s]\n",
61766457 m_linepos, shred->xid, shred->name.c_str() );
61776458
@@ -6193,7 +6474,7 @@ void Chuck_Instr_Dot_Member_Func::execute( Chuck_VM * vm, Chuck_VM_Shred * shred · 15 unmodified lines
61936474 t_CKUINT *& sp = (t_CKUINT *&)shred->reg->sp;
61946475 // the pointer
61956476 t_CKUINT data;
6196−
6477+
61976478 // pop the object pointer
61986479 pop_( sp, 1 );
61996480 // get the object pointer
@@ -6204,7 +6485,7 @@ void Chuck_Instr_Dot_Member_Func::execute( Chuck_VM * vm, Chuck_VM_Shred * shred · 4 unmodified lines
62046485 assert( m_offset < obj->vtable->funcs.size() );
62056486 // calculate the data pointer
62066487 data = (t_CKUINT)(obj->vtable->funcs[m_offset]);
6207−
6488+
62086489 // push the address
62096490 push_( sp, data );
62106491
@@ -6212,7 +6493,7 @@ void Chuck_Instr_Dot_Member_Func::execute( Chuck_VM * vm, Chuck_VM_Shred * shred · 1 unmodified line
62126493
62136494 error:
62146495 // we have a problem
6215− CK_FPRINTF_STDERR(
6496+ CK_FPRINTF_STDERR(
62166497 "[chuck](VM): NullPointerException: on line[%lu] in shred[id=%lu:%s]\n",
62176498 m_linepos, shred->xid, shred->name.c_str() );
62186499
@@ -6232,10 +6513,10 @@ void Chuck_Instr_Dot_Primitive_Func::execute( Chuck_VM * vm, Chuck_VM_Shred * sh · 13 unmodified lines
62326513 {
62336514 // register stack pointer
62346515 t_CKUINT *& sp = (t_CKUINT *&)shred->reg->sp;
6235−
6516+
62366517 // pop the primitive pointer
62376518 pop_( sp, 1 );
6238−
6519+
62396520 // push the function address address
62406521 push_( sp, m_native_func );
62416522 }
@@ -6253,7 +6534,7 @@ void Chuck_Instr_Dot_Static_Data::execute( Chuck_VM * vm, Chuck_VM_Shred * shred · 11 unmodified lines
62536534 t_CKUINT *& sp = (t_CKUINT *&)shred->reg->sp;
62546535 // the pointer
62556536 t_CKUINT data;
6256−
6537+
62576538 // pop the type pointer
62586539 pop_( sp, 1 );
62596540 // get the object pointer
@@ -6262,7 +6543,7 @@ void Chuck_Instr_Dot_Static_Data::execute( Chuck_VM * vm, Chuck_VM_Shred * shred · 2 unmodified lines
62626543 assert( (m_offset + m_size) <= t_class->info->class_data_size );
62636544 // calculate the data pointer
62646545 data = (t_CKUINT)(t_class->info->class_data + m_offset);
6265−
6546+
62666547 // emit addr or value
62676548 if( m_emit_addr )
62686549 {
@@ -6293,7 +6574,7 @@ void Chuck_Instr_Dot_Static_Import_Data::execute( Chuck_VM * vm, Chuck_VM_Shred · 24 unmodified lines
62936574 {
62946575 // register stack pointer
62956576 t_CKUINT *& sp = (t_CKUINT *&)shred->reg->sp;
6296−
6577+
62976578 // emit addr or value
62986579 if( m_emit_addr )
62996580 {
@@ -6328,7 +6609,7 @@ void Chuck_Instr_Dot_Static_Func::execute( Chuck_VM * vm, Chuck_VM_Shred * shred · 28 unmodified lines
63286609 // 1.4.1.0 (ge): leave the base type on the operand stack
63296610 // commented out: pop the type pointer
63306611 // pop_( sp, 1 );
6331−
6612+
63326613 // push the address
63336614 push_( sp, (t_CKUINT)(m_func) );
63346615 }
@@ -6733,7 +7014,7 @@ void Chuck_Instr_Op_string::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 398 unmodified lines
67337014
67347015 null_pointer:
67357016 // we have a problem
6736− CK_FPRINTF_STDERR(
7017+ CK_FPRINTF_STDERR(
67377018 "[chuck](VM): NullPointerException: (string op) on line[%lu] in shred[id=%lu:%s]\n",
67387019 m_linepos, shred->xid, shred->name.c_str() );
67397020 goto done;
@@ -6840,7 +7121,7 @@ Chuck_Instr_UGen_Link::Chuck_Instr_UGen_Link( t_CKBOOL isUpChuck ) · 100 unmodified lines
68407121 void Chuck_Instr_UGen_Link::execute( Chuck_VM * vm, Chuck_VM_Shred * shred )
68417122 {
68427123 Chuck_UGen **& sp = (Chuck_UGen **&)shred->reg->sp;
6843−
7124+
68447125 // pop
68457126 pop_( sp, 2 );
68467127 // check for null
@@ -6849,15 +7130,15 @@ void Chuck_Instr_UGen_Link::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 2 unmodified lines
68497130 (*(sp + 1))->add( *sp, m_isUpChuck );
68507131 // push the second
68517132 push_( sp, *(sp + 1) );
6852−
7133+
68537134 return;
6854−
7135+
68557136 null_pointer:
68567137 // we have a problem
68577138 CK_FPRINTF_STDERR(
68587139 "[chuck](VM): NullPointerException: (UGen link) on line[%lu] in shred[id=%lu:%s]\n",
68597140 m_linepos, shred->xid, shred->name.c_str() );
6860−
7141+
68617142 // do something!
68627143 shred->is_running = FALSE;
68637144 shred->is_done = TRUE;
@@ -6874,15 +7155,15 @@ void Chuck_Instr_UGen_Array_Link::execute( Chuck_VM * vm, Chuck_VM_Shred * shred · 10 unmodified lines
68747155 Chuck_Object **& sp = (Chuck_Object **&)shred->reg->sp;
68757156 Chuck_Object *src_obj, *dst_obj;
68767157 t_CKINT num_in;
6877−
7158+
68787159 // pop
68797160 pop_( sp, 2 );
68807161 // check for null
68817162 if( !*(sp+1) || !(*sp) ) goto null_pointer;
6882−
7163+
68837164 src_obj = *sp;
68847165 dst_obj = (*(sp + 1));
6885−
7166+
68867167 // go for it
68877168 num_in = ugen_generic_num_in(dst_obj, m_dstIsArray);
68887169 for( int i = 0; i < num_in; i++ )
@@ -6893,18 +7174,18 @@ void Chuck_Instr_UGen_Array_Link::execute( Chuck_VM * vm, Chuck_VM_Shred * shred · 4 unmodified lines
68937174 goto null_pointer;
68947175 dst_ugen->add( src_ugen, FALSE);
68957176 }
6896−
7177+
68977178 // push the second
68987179 push_( sp, *(sp + 1) );
6899−
7180+
69007181 return;
6901−
7182+
69027183 null_pointer:
69037184 // we have a problem
69047185 CK_FPRINTF_STDERR(
69057186 "[chuck](VM): NullPointerException: (UGen link) on line[%lu] in shred[id=%lu:%s]\n",
69067187 m_linepos, shred->xid, shred->name.c_str() );
6907−
7188+
69087189 // do something!
69097190 shred->is_running = FALSE;
69107191 shred->is_done = TRUE;
@@ -6921,7 +7202,7 @@ null_pointer: · 10 unmodified lines
69217202 void Chuck_Instr_UGen_UnLink::execute( Chuck_VM * vm, Chuck_VM_Shred * shred )
69227203 {
69237204 Chuck_UGen **& sp = (Chuck_UGen **&)shred->reg->sp;
6924−
7205+
69257206 pop_( sp, 2 );
69267207 (*(sp+1))->remove( *sp );
69277208 push_( sp, *(sp + 1) );
@@ -6937,7 +7218,7 @@ void Chuck_Instr_UGen_UnLink::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 9 unmodified lines
69377218 void Chuck_Instr_UGen_Ctrl::execute( Chuck_VM * vm, Chuck_VM_Shred * shred )
69387219 {
69397220 t_CKUINT *& sp = (t_CKUINT *&)shred->reg->sp;
6940−
7221+
69417222 pop_( sp, 4 );
69427223 Chuck_UGen * ugen = (Chuck_UGen *)*(sp+1);
69437224 f_ctrl ctrl = (f_ctrl)*(sp+2);
@@ -6983,7 +7264,7 @@ void Chuck_Instr_UGen_CGet::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 39 unmodified lines
69837264 void Chuck_Instr_UGen_Ctrl2::execute( Chuck_VM * vm, Chuck_VM_Shred * shred )
69847265 {
69857266 t_CKUINT *& sp = (t_CKUINT *&)shred->reg->sp;
6986−
7267+
69877268 pop_( sp, 4 );
69887269 Chuck_UGen * ugen = (Chuck_UGen *)*(sp+1);
69897270 f_ctrl ctrl = (f_ctrl)*(sp+2);
@@ -7030,11 +7311,11 @@ void Chuck_Instr_UGen_CGet2::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 40 unmodified lines
70307311 void Chuck_Instr_UGen_PMsg::execute( Chuck_VM * vm, Chuck_VM_Shred * shred )
70317312 {
70327313 Chuck_UGen **& sp = (Chuck_UGen **&)shred->reg->sp;
7033−
7314+
70347315 pop_( sp, 2 );
7035−
7316+
70367317 // (*(sp + 1))->pmsg( shred->now, *sp );
7037−
7318+
70387319 push_( sp, *(sp + 1) );
70397320 }
70407321
@@ -7048,13 +7329,13 @@ void Chuck_Instr_UGen_PMsg::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 7 unmodified lines
70487329 void Chuck_Instr_Init_Loop_Counter::execute( Chuck_VM * vm, Chuck_VM_Shred * shred )
70497330 {
70507331 t_CKINT *& sp = (t_CKINT *&)shred->reg->sp;
7051−
7332+
70527333 // pop the value
70537334 pop_( sp, 1 );
7054−
7335+
70557336 // allocate counter
70567337 t_CKUINT * p = shred->pushLoopCounter();
7057−
7338+
70587339 // copy it
70597340 *p = (t_CKUINT)(*sp >= 0 ? *sp : -*sp);
70607341 }
@@ -7070,23 +7351,23 @@ void Chuck_Instr_Dec_Loop_Counter::execute( Chuck_VM * vm, Chuck_VM_Shred * shre · 9 unmodified lines
70707351 {
70717352 // get topmost
70727353 t_CKUINT * p = shred->currentLoopCounter();
7073−
7354+
70747355 // check
70757356 if( p == NULL ) goto error;
7076−
7357+
70777358 // decrement
70787359 (*p)--;
7079−
7360+
70807361 // done
70817362 return;
7082−
7363+
70837364 error:
70847365 // we have a problem
70857366 CK_FPRINTF_STDERR(
70867367 "[chuck](VM): LoopCounterError: on line[%lu] in shred[id=%lu:%s]\n",
70877368 m_linepos, shred->xid, shred->name.c_str() );
70887369 goto done;
7089−
7370+
70907371 done:
70917372 // do something!
70927373 shred->is_running = FALSE;
@@ -7103,26 +7384,26 @@ done: · 10 unmodified lines
71037384 void Chuck_Instr_Reg_Push_Loop_Counter_Deref::execute( Chuck_VM * vm, Chuck_VM_Shred * shred )
71047385 {
71057386 t_CKUINT *& reg_sp = (t_CKUINT *&)shred->reg->sp;
7106−
7387+
71077388 // get topmost
71087389 t_CKUINT * p = shred->currentLoopCounter();
7109−
7390+
71107391 // check
71117392 if( p == NULL ) goto error;
7112−
7393+
71137394 // push
71147395 push_( reg_sp, *p );
7115−
7396+
71167397 // done
71177398 return;
7118−
7399+
71197400 error:
71207401 // we have a problem
71217402 CK_FPRINTF_STDERR(
71227403 "[chuck](VM): LoopCounterError: on line[%lu] in shred[id=%lu:%s]\n",
71237404 m_linepos, shred->xid, shred->name.c_str() );
71247405 goto done;
7125−
7406+
71267407 done:
71277408 // do something!
71287409 shred->is_running = FALSE;
@@ -7157,28 +7438,28 @@ void Chuck_Instr_Pop_Loop_Counter::execute( Chuck_VM * vm, Chuck_VM_Shred * shre · 28 unmodified lines
71577438 void Chuck_Instr_IO_in_int::execute( Chuck_VM * vm, Chuck_VM_Shred * shred )
71587439 {
71597440 t_CKINT *& sp = (t_CKINT *&)shred->reg->sp;
7160−
7441+
71617442 // pop the value
71627443 pop_( sp, 2 );
7163−
7444+
71647445 // ISSUE: 64-bit?
71657446 // the IO
71667447 Chuck_IO **& ppIO = (Chuck_IO **&)sp;
71677448
71687449 // check it
71697450 if( *(ppIO) == NULL ) goto null_pointer;
7170−
7451+
71717452 // read into the variable
71727453 **(t_CKINT **)(sp+1) = (*ppIO)->readInt( Chuck_IO::INT32 );
7173−
7454+
71747455 // push the IO
71757456 push_( sp, (t_CKINT)(*(ppIO)) );
7176−
7457+
71777458 return;
71787459
71797460 null_pointer:
71807461 // we have a problem
7181− CK_FPRINTF_STDERR(
7462+ CK_FPRINTF_STDERR(
71827463 "[chuck](VM): NullPointerException: (IO input int) on line[%lu] in shred[id=%lu:%s]\n",
71837464 m_linepos, shred->xid, shred->name.c_str() );
71847465 goto done;
@@ -7199,28 +7480,28 @@ done: · 14 unmodified lines
71997480 void Chuck_Instr_IO_in_float::execute( Chuck_VM * vm, Chuck_VM_Shred * shred )
72007481 {
72017482 t_CKINT *& sp = (t_CKINT *&)shred->reg->sp;
7202−
7483+
72037484 // issue: 64-bit
72047485 // pop the value (fixed 1.3.0.0 -- changed from 3 to 2, note it's a float POINTER)
72057486 pop_( sp, 2 );
7206−
7487+
72077488 // the IO
72087489 Chuck_IO **& ppIO = (Chuck_IO **&)sp;
7209−
7490+
72107491 // check it
72117492 if( *(ppIO) == NULL ) goto null_pointer;
7212−
7493+
72137494 // read into the variable
72147495 **(t_CKFLOAT **)(sp+1) = (*ppIO)->readFloat();
7215−
7496+
72167497 // push the IO
72177498 push_( sp, (t_CKINT)(*(ppIO)) );
7218−
7499+
72197500 return;
72207501
72217502 null_pointer:
72227503 // we have a problem
7223− CK_FPRINTF_STDERR(
7504+ CK_FPRINTF_STDERR(
72247505 "[chuck](VM): NullPointerException: (IO input float) on line[%lu] in shred[id=%lu:%s]\n",
72257506 m_linepos, shred->xid, shred->name.c_str() );
72267507 goto done;
@@ -7241,36 +7522,36 @@ done: · 14 unmodified lines
72417522 void Chuck_Instr_IO_in_string::execute( Chuck_VM * vm, Chuck_VM_Shred * shred )
72427523 {
72437524 t_CKINT *& sp = (t_CKINT *&)shred->reg->sp;
7244−
7525+
72457526 // pop the value
72467527 pop_( sp, 2 );
7247−
7528+
72487529 // issue: 64-bit
72497530 // the IO
72507531 Chuck_IO ** ppIO = (Chuck_IO **)sp;
72517532 // the string
72527533 Chuck_String ** ppStr = (Chuck_String **)(sp+1);
72537534 std::string s; // = (*ppStr)->str();
7254−
7535+
72557536 // CK_FPRINTF_STDERR( "ppIO: 0x%08x\n", ppIO );
72567537 // CK_FPRINTF_STDERR( "ppStr: 0x%08x\n", ppStr );
72577538 // CK_FPRINTF_STDERR( "*ppStr: 0x%08x\n", *ppStr );
7258−
7539+
72597540 // check it
72607541 if( *(ppIO) == NULL || *(ppStr) == NULL ) goto null_pointer;
7261−
7542+
72627543 // read into the variable
72637544 (*ppIO)->readString( s );
72647545 (*ppStr)->set( s );
7265−
7546+
72667547 // push the IO
72677548 push_( sp, (t_CKINT)(*(ppIO)) );
7268−
7549+
72697550 return;
7270−
7551+
72717552 null_pointer:
72727553 // we have a problem
7273− CK_FPRINTF_STDERR(
7554+ CK_FPRINTF_STDERR(
72747555 "[chuck](VM): NullPointerException: (IO input string) on line[%lu] in shred[id=%lu:%s]\n",
72757556 m_linepos, shred->xid, shred->name.c_str() );
72767557 goto done;
@@ -7291,32 +7572,32 @@ done: · 14 unmodified lines
72917572 void Chuck_Instr_IO_out_int::execute( Chuck_VM * vm, Chuck_VM_Shred * shred )
72927573 {
72937574 t_CKINT *& sp = (t_CKINT *&)shred->reg->sp;
7294−
7575+
72957576 // pop the value
72967577 pop_( sp, 2 );
7297−
7578+
72987579 // issue: 64-bit
72997580 // the IO
73007581 Chuck_IO **& ppIO = (Chuck_IO **&)sp;
7301−
7582+
73027583 // check it
73037584 if( *(ppIO) == NULL ) goto null_pointer;
7304−
7585+
73057586 // write the value
73067587 (*ppIO)->write( *(sp+1) );
7307−
7588+
73087589 // push the IO
73097590 push_( sp, (t_CKINT)(*(ppIO)) );
7310−
7591+
73117592 return;
73127593
73137594 null_pointer:
73147595 // we have a problem
7315− CK_FPRINTF_STDERR(
7596+ CK_FPRINTF_STDERR(
73167597 "[chuck](VM): NullPointerException: (IO output int) on line[%lu] in shred[id=%lu:%s]\n",
73177598 m_linepos, shred->xid, shred->name.c_str() );
73187599 goto done;
7319−
7600+
73207601 done:
73217602 // do something!
73227603 shred->is_running = FALSE;
@@ -7333,32 +7614,32 @@ done: · 10 unmodified lines
73337614 void Chuck_Instr_IO_out_float::execute( Chuck_VM * vm, Chuck_VM_Shred * shred )
73347615 {
73357616 t_CKINT *& sp = (t_CKINT *&)shred->reg->sp;
7336−
7617+
73377618 // pop the value
73387619 pop_( sp, 1 + (sz_FLOAT / sz_INT) ); // ISSUE: 64-bit (fixed 1.3.1.0)
7339−
7620+
73407621 // ISSUE: 64-bit
73417622 // the IO
73427623 Chuck_IO **& ppIO = (Chuck_IO **&)sp;
7343−
7624+
73447625 // check it
73457626 if( *(ppIO) == NULL ) goto null_pointer;
7346−
7627+
73477628 // write the value
73487629 (*ppIO)->write( *((t_CKFLOAT *)(sp+1)) );
7349−
7630+
73507631 // push the IO
73517632 push_( sp, (t_CKINT)(*(ppIO)) );
7352−
7633+
73537634 return;
7354−
7635+
73557636 null_pointer:
73567637 // we have a problem
7357− CK_FPRINTF_STDERR(
7638+ CK_FPRINTF_STDERR(
73587639 "[chuck](VM): NullPointerException: (IO output float) on line[%lu] in shred[id=%lu:%s]\n",
73597640 m_linepos, shred->xid, shred->name.c_str() );
73607641 goto done;
7361−
7642+
73627643 done:
73637644 // do something!
73647645 shred->is_running = FALSE;
@@ -7375,34 +7656,34 @@ done: · 10 unmodified lines
73757656 void Chuck_Instr_IO_out_string::execute( Chuck_VM * vm, Chuck_VM_Shred * shred )
73767657 {
73777658 t_CKINT *& sp = (t_CKINT *&)shred->reg->sp;
7378−
7659+
73797660 // pop the value
73807661 pop_( sp, 2 );
7381−
7662+
73827663 // ISSUE: 64-bit
73837664 // the IO
73847665 Chuck_IO ** ppIO = (Chuck_IO **)sp;
73857666 // the string
73867667 Chuck_String ** ppStr = (Chuck_String **)(sp+1);
7387−
7668+
73887669 // check it
73897670 if( *(ppIO) == NULL || *(ppStr) == NULL ) goto null_pointer;
7390−
7671+
73917672 // write the variable
73927673 (*ppIO)->write( (*ppStr)->str().c_str() );
7393−
7674+
73947675 // push the IO
73957676 push_( sp, (t_CKINT)(*(ppIO)) );
7396−
7677+
73977678 return;
7398−
7679+
73997680 null_pointer:
74007681 // we have a problem
7401− CK_FPRINTF_STDERR(
7682+ CK_FPRINTF_STDERR(
74027683 "[chuck](VM): NullPointerException: (IO output string) on line[%lu] in shred[id=%lu:%s]\n",
74037684 m_linepos, shred->xid, shred->name.c_str() );
74047685 goto done;
7405−
7686+
74067687 done:
74077688 // do something!
74087689 shred->is_running = FALSE;
@@ -7430,17 +7711,27 @@ void Chuck_Instr_Hack::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 21 unmodified lines
74307711 if( m_type_ref->size == sz_INT && iskindofint(vm->env(), m_type_ref) ) // ISSUE: 64-bit (fixed 1.3.1.0)
74317712 {
74327713 t_CKINT * sp = (t_CKINT *)shred->reg->sp;
7433− if( !isa( m_type_ref, vm->env()->t_string ) || *(sp-1) == 0 )
7714+ Chuck_Object * obj = ((Chuck_Object *)*(sp-1));
7715+ if( !isa( m_type_ref, vm->env()->t_string ) || *(sp-1) == 0 )
74347716 {
74357717 // print it
7436− if( *(sp-1) == 0 && isa( m_type_ref, vm->env()->t_object ) )
7437− CK_FPRINTF_STDERR( "null :(%s)\n", m_type_ref->c_name() );
7718+ if( isa( m_type_ref, vm->env()->t_object ) )
7719+ {
7720+ if( obj == NULL )
7721+ {
7722+ CK_FPRINTF_STDERR( "null :(%s)\n", m_type_ref->c_name() );
7723+ }
7724+ else
7725+ {
7726+ CK_FPRINTF_STDERR( "0x%lx :(%s|refcount=%d)\n", *(sp-1), m_type_ref->c_name(), obj->m_ref_count );
7727+ }
7728+ }
74387729 else
7439− CK_FPRINTF_STDERR( "%ld :(%s)\n", *(sp-1), m_type_ref->c_name() );
7730+ CK_FPRINTF_STDERR( "%d :(%s)\n", *(sp-1), m_type_ref->c_name() );
74407731 }
74417732 else
74427733 {
7443− CK_FPRINTF_STDERR( "\"%s\" : (%s)\n", ((Chuck_String *)*(sp-1))->str().c_str(), m_type_ref->c_name() );
7734+ CK_FPRINTF_STDERR( "\"%s\" :(%s)\n", ((Chuck_String *)obj)->str().c_str(), m_type_ref->c_name() );
74447735 }
74457736 }
74467737 else if( m_type_ref->size == sz_FLOAT ) // ISSUE: 64-bit (fixed 1.3.1.0)
@@ -7507,8 +7798,8 @@ void Chuck_Instr_Hack::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 60 unmodified lines
75077798
75087799 const char * Chuck_Instr_Hack::params() const
75097800 {
7510− static char buffer[256];
7511− sprintf( buffer, "(%s)", m_type_ref->c_name() );
7801+ static char buffer[CK_PRINT_BUF_LENGTH];
7802+ snprintf( buffer, CK_PRINT_BUF_LENGTH, "(%s)", m_type_ref->c_name() );
75127803 return buffer;
75137804 }
75147805
@@ -7562,11 +7853,12 @@ void Chuck_Instr_Gack::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 47 unmodified lines
75627853 {
75637854 if( isa( type, vm->env()->t_object ) )
75647855 {
7856+ Chuck_Object * obj = ((Chuck_Object *)(*sp));
75657857 // print it
75667858 if( *(sp) == 0 )
75677859 CK_FPRINTF_STDERR( "null " );
75687860 else
7569− CK_FPRINTF_STDERR( "0x%lx ", *(sp) );
7861+ CK_FPRINTF_STDERR( "0x%lx (refcount=%d)", *(sp), obj->m_ref_count );
75707862 }
75717863 else
75727864 {
@@ -7608,7 +7900,7 @@ void Chuck_Instr_Gack::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 35 unmodified lines
76087900 if( type->xid == te_vec3 )
76097901 // print it
76107902 CK_FPRINTF_STDERR( "#(%.4f,%.4f,%.4f) ", *(sp), *(sp+1), *(sp+2) );
7611−
7903+
76127904 the_sp += sz_VEC3; // ISSUE: 64-bit (fixed 1.3.1.0)
76137905 }
76147906 else if( type->size == sz_VEC4 ) // 1.3.5.3
@@ -7617,7 +7909,7 @@ void Chuck_Instr_Gack::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 2 unmodified lines
76177909 if( type->xid == te_vec4 )
76187910 // print it
76197911 CK_FPRINTF_STDERR( "#(%.4f,%.4f,%.4f,%.4f) ", *(sp), *(sp+1), *(sp+2), *(sp+3) );
7620−
7912+
76217913 the_sp += sz_VEC4; // ISSUE: 64-bit (fixed 1.3.1.0)
76227914 }
76237915 else if( type->size == 0 )
@@ -7629,15 +7921,15 @@ void Chuck_Instr_Gack::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) · 5 unmodified lines
76297921 }
76307922
76317923 CK_FPRINTF_STDERR( "\n" );
7632−
7924+
76337925 // flush
76347926 CK_FFLUSH_STDERR();
76357927 }
76367928
76377929 const char * Chuck_Instr_Gack::params() const
76387930 {
7639− static char buffer[256];
7640− sprintf( buffer, "( many types )" );
7931+ static char buffer[CK_PRINT_BUF_LENGTH];
7932+ snprintf( buffer, CK_PRINT_BUF_LENGTH, "( many types )" );
76417933 return buffer;
76427934 }
76437935
src/core/chuck_instr.h+162−92
@@ -44,6 +44,9 @@ struct Chuck_VM_Shred; · 43 unmodified lines
4444 struct Chuck_Type;
4545 struct Chuck_Func;
4646
47+// 1.4.2.0 (ge) | added for switching from snprintf()
48+#define CK_PRINT_BUF_LENGTH 256
49+
4750
4851
4952
@@ -55,19 +58,25 @@ struct Chuck_Instr · 5 unmodified lines
5558 {
5659 public:
5760 Chuck_Instr();
58− virtual ~Chuck_Instr() { }
61+ virtual ~Chuck_Instr() { SAFE_DELETE(m_codestr); }
5962
6063 public:
6164 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) = 0;
6265
6366 public:
6467 virtual const char * name() const;
65− virtual const char * params() const
68+ virtual const char * params() const
6669 { return ""; }
6770
6871 public:
72+ // store line position for error messages
6973 void set_linepos( t_CKUINT linepos );
7074 t_CKUINT m_linepos;
75+
76+ // set codestr associated with this instruction
77+ void set_codestr( const std::string & str );
78+ // (used in instruction dump) | 1.4.2.1 (ge) added
79+ std::string * m_codestr;
7180 };
7281
7382
@@ -84,7 +93,7 @@ public: · 10 unmodified lines
8493
8594 public:
8695 virtual const char * params() const
87− { static char buffer[256]; sprintf( buffer, "%ld", (long)m_jmp ); return buffer; }
96+ { static char buffer[CK_PRINT_BUF_LENGTH]; snprintf( buffer, CK_PRINT_BUF_LENGTH, "%ld", (long)m_jmp ); return buffer; }
8897
8998 protected:
9099 t_CKUINT m_jmp;
@@ -105,7 +114,7 @@ public: · 14 unmodified lines
105114
106115 public:
107116 virtual const char * params() const
108− { static char buffer[256]; sprintf( buffer, "%ld", (long)m_val ); return buffer; }
117+ { static char buffer[CK_PRINT_BUF_LENGTH]; snprintf( buffer, CK_PRINT_BUF_LENGTH, "%ld", (long)m_val ); return buffer; }
109118
110119 protected:
111120 t_CKUINT m_val;
@@ -126,7 +135,7 @@ public: · 14 unmodified lines
126135
127136 public:
128137 virtual const char * params() const
129− { static char buffer[256]; sprintf( buffer, "%.6f", m_val ); return buffer; }
138+ { static char buffer[CK_PRINT_BUF_LENGTH]; snprintf( buffer, CK_PRINT_BUF_LENGTH, "%.6f", m_val ); return buffer; }
130139
131140 protected:
132141 t_CKFLOAT m_val;
@@ -2014,6 +2023,23 @@ protected: · 1881 unmodified lines
20142023
20152024
20162025
2026+//-----------------------------------------------------------------------------
2027+// name: struct Chuck_Instr_Reg_Push_Zero
2028+// desc: push immediate value 0 to reg stack with specific width
2029+//-----------------------------------------------------------------------------
2030+struct Chuck_Instr_Reg_Push_Zero : public Chuck_Instr_Unary_Op
2031+{
2032+public:
2033+ Chuck_Instr_Reg_Push_Zero( t_CKUINT sizeInBytes )
2034+ { this->set( sizeInBytes ); }
2035+
2036+public:
2037+ virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
2038+};
2039+
2040+
2041+
2042+
20172043 //-----------------------------------------------------------------------------
20182044 // name: struct Chuck_Instr_Reg_Dup_Last
20192045 // desc: duplicate last value on reg stack
@@ -2133,8 +2159,8 @@ public: · 113 unmodified lines
21332159 public:
21342160 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
21352161 virtual const char * params() const
2136− { static char buffer[256];
2137− sprintf( buffer, "src=%ld, base=%ld", (long)m_val, (long)base );
2162+ { static char buffer[CK_PRINT_BUF_LENGTH];
2163+ snprintf( buffer, CK_PRINT_BUF_LENGTH, "src=%ld, base=%ld", (long)m_val, (long)base );
21382164 return buffer; }
21392165
21402166 protected:
@@ -2158,8 +2184,8 @@ public: · 17 unmodified lines
21582184 public:
21592185 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
21602186 virtual const char * params() const
2161− { static char buffer[256];
2162− sprintf( buffer, "src=%ld, base=%ld", (long)m_val, (long)base );
2187+ { static char buffer[CK_PRINT_BUF_LENGTH];
2188+ snprintf( buffer, CK_PRINT_BUF_LENGTH, "src=%ld, base=%ld", (long)m_val, (long)base );
21632189 return buffer; }
21642190
21652191 protected:
@@ -2183,8 +2209,8 @@ public: · 17 unmodified lines
21832209 public:
21842210 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
21852211 virtual const char * params() const
2186− { static char buffer[256];
2187− sprintf( buffer, "src=%ld, base=%ld", (long)m_val, (long)base );
2212+ { static char buffer[CK_PRINT_BUF_LENGTH];
2213+ snprintf( buffer, CK_PRINT_BUF_LENGTH, "src=%ld, base=%ld", (long)m_val, (long)base );
21882214 return buffer; }
21892215
21902216 protected:
@@ -2204,14 +2230,14 @@ struct Chuck_Instr_Reg_Push_Mem_Vec3 : public Chuck_Instr_Unary_Op · 13 unmodified lines
22042230 public:
22052231 Chuck_Instr_Reg_Push_Mem_Vec3( t_CKUINT src, t_CKBOOL use_base = FALSE )
22062232 { this->set( src ); base = use_base; }
2207−
2233+
22082234 public:
22092235 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
22102236 virtual const char * params() const
2211− { static char buffer[256];
2212− sprintf( buffer, "src=%ld, base=%ld", (long)m_val, (long)base );
2237+ { static char buffer[CK_PRINT_BUF_LENGTH];
2238+ snprintf( buffer, CK_PRINT_BUF_LENGTH, "src=%ld, base=%ld", (long)m_val, (long)base );
22132239 return buffer; }
2214−
2240+
22152241 protected:
22162242 // use global stack base
22172243 t_CKBOOL base;
@@ -2229,14 +2255,14 @@ struct Chuck_Instr_Reg_Push_Mem_Vec4 : public Chuck_Instr_Unary_Op · 11 unmodified lines
22292255 public:
22302256 Chuck_Instr_Reg_Push_Mem_Vec4( t_CKUINT src, t_CKBOOL use_base = FALSE )
22312257 { this->set( src ); base = use_base; }
2232−
2258+
22332259 public:
22342260 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
22352261 virtual const char * params() const
2236− { static char buffer[256];
2237− sprintf( buffer, "src=%ld, base=%ld", (long)m_val, (long)base );
2262+ { static char buffer[CK_PRINT_BUF_LENGTH];
2263+ snprintf( buffer, CK_PRINT_BUF_LENGTH, "src=%ld, base=%ld", (long)m_val, (long)base );
22382264 return buffer; }
2239−
2265+
22402266 protected:
22412267 // use global stack base
22422268 t_CKBOOL base;
@@ -2258,8 +2284,8 @@ public: · 15 unmodified lines
22582284 public:
22592285 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
22602286 virtual const char * params() const
2261− { static char buffer[256];
2262− sprintf( buffer, "name='%s'", m_name.c_str() );
2287+ { static char buffer[CK_PRINT_BUF_LENGTH];
2288+ snprintf( buffer, CK_PRINT_BUF_LENGTH, "name='%s'", m_name.c_str() );
22632289 return buffer; }
22642290
22652291 public:
@@ -2283,8 +2309,8 @@ public: · 17 unmodified lines
22832309 public:
22842310 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
22852311 virtual const char * params() const
2286− { static char buffer[256];
2287− sprintf( buffer, "src=%ld, base=%ld", (long)m_val, (long)base );
2312+ { static char buffer[CK_PRINT_BUF_LENGTH];
2313+ snprintf( buffer, CK_PRINT_BUF_LENGTH, "src=%ld, base=%ld", (long)m_val, (long)base );
22882314 return buffer; }
22892315
22902316 protected:
@@ -2308,8 +2334,8 @@ public: · 17 unmodified lines
23082334 public:
23092335 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
23102336 virtual const char * params() const
2311− { static char buffer[256];
2312− sprintf( buffer, "name='%s'", m_name.c_str() );
2337+ { static char buffer[CK_PRINT_BUF_LENGTH];
2338+ snprintf( buffer, CK_PRINT_BUF_LENGTH, "name='%s'", m_name.c_str() );
23132339 return buffer; }
23142340
23152341 protected:
@@ -2364,12 +2390,12 @@ struct Chuck_Instr_Mem_Set_Imm : public Chuck_Instr · 48 unmodified lines
23642390 public:
23652391 Chuck_Instr_Mem_Set_Imm( t_CKUINT offset, t_CKUINT val )
23662392 { m_offset = offset; m_val = val; }
2367−
2393+
23682394 public:
23692395 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
23702396 virtual const char * params() const
2371− { static char buffer[256];
2372− sprintf( buffer, "offset=%ld, value=%ld", (long)m_offset, (long)m_val );
2397+ { static char buffer[CK_PRINT_BUF_LENGTH];
2398+ snprintf( buffer, CK_PRINT_BUF_LENGTH, "offset=%ld, value=%ld", (long)m_offset, (long)m_val );
23732399 return buffer; }
23742400
23752401 protected:
@@ -2389,12 +2415,12 @@ struct Chuck_Instr_Mem_Set_Imm2 : public Chuck_Instr_Unary_Op · 13 unmodified lines
23892415 public:
23902416 Chuck_Instr_Mem_Set_Imm2( t_CKUINT offset, t_CKFLOAT val )
23912417 { m_offset = offset; m_val = val; }
2392−
2418+
23932419 public:
23942420 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
23952421 virtual const char * params() const
2396− { static char buffer[256];
2397− sprintf( buffer, "offset=%ld, value=%f", (long)m_offset, m_val );
2422+ { static char buffer[CK_PRINT_BUF_LENGTH];
2423+ snprintf( buffer, CK_PRINT_BUF_LENGTH, "offset=%ld, value=%f", (long)m_offset, m_val );
23982424 return buffer; }
23992425
24002426 protected:
@@ -2414,7 +2440,7 @@ struct Chuck_Instr_Mem_Push_Imm : public Chuck_Instr_Unary_Op · 13 unmodified lines
24142440 public:
24152441 Chuck_Instr_Mem_Push_Imm( t_CKUINT src )
24162442 { this->set( src ); }
2417−
2443+
24182444 public:
24192445 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
24202446 };
@@ -2430,7 +2456,7 @@ struct Chuck_Instr_Mem_Push_Imm2 : public Chuck_Instr_Unary_Op2 · 9 unmodified lines
24302456 public:
24312457 Chuck_Instr_Mem_Push_Imm2( t_CKFLOAT src )
24322458 { this->set( src ); }
2433−
2459+
24342460 public:
24352461 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
24362462 };
@@ -2513,10 +2539,10 @@ public: · 76 unmodified lines
25132539 // (added 1.3.0.0 -- is_object)
25142540 Chuck_Instr_Alloc_Word( t_CKUINT offset, t_CKBOOL is_object )
25152541 { this->set( offset ); m_is_object = is_object; }
2516−
2542+
25172543 // was this object reference? (added 1.3.0.0)
25182544 t_CKBOOL m_is_object;
2519−
2545+
25202546 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
25212547 };
25222548
@@ -2532,7 +2558,7 @@ struct Chuck_Instr_Alloc_Word2 : public Chuck_Instr_Unary_Op · 9 unmodified lines
25322558 public:
25332559 Chuck_Instr_Alloc_Word2( t_CKUINT offset )
25342560 { this->set( offset ); }
2535−
2561+
25362562 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
25372563 };
25382564
@@ -2564,7 +2590,7 @@ struct Chuck_Instr_Alloc_Vec3 : public Chuck_Instr_Unary_Op · 25 unmodified lines
25642590 public:
25652591 Chuck_Instr_Alloc_Vec3( t_CKUINT offset )
25662592 { this->set( offset ); }
2567−
2593+
25682594 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
25692595 };
25702596
@@ -2580,7 +2606,7 @@ struct Chuck_Instr_Alloc_Vec4 : public Chuck_Instr_Unary_Op · 9 unmodified lines
25802606 public:
25812607 Chuck_Instr_Alloc_Vec4( t_CKUINT offset )
25822608 { this->set( offset ); }
2583−
2609+
25842610 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
25852611 };
25862612
@@ -2644,7 +2670,7 @@ struct Chuck_Instr_Alloc_Member_Vec3 : public Chuck_Instr_Unary_Op · 57 unmodified lines
26442670 public:
26452671 Chuck_Instr_Alloc_Member_Vec3( t_CKUINT offset )
26462672 { this->set( offset ); }
2647−
2673+
26482674 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
26492675 };
26502676
@@ -2660,7 +2686,7 @@ struct Chuck_Instr_Alloc_Member_Vec4 : public Chuck_Instr_Unary_Op · 9 unmodified lines
26602686 public:
26612687 Chuck_Instr_Alloc_Member_Vec4( t_CKUINT offset )
26622688 { this->set( offset ); }
2663−
2689+
26642690 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
26652691 };
26662692
@@ -2678,22 +2704,22 @@ public: · 11 unmodified lines
26782704 Chuck_Instr_Alloc_Word_Global()
26792705 { this->set( 0 ); m_stack_offset = 0; m_chuck_type = NULL;
26802706 m_should_execute_ctors = FALSE; m_is_array = FALSE; }
2681−
2707+
26822708 virtual const char * params() const
2683− { static char buffer[256];
2684− sprintf( buffer, "name='%s'", m_name.c_str() );
2709+ { static char buffer[CK_PRINT_BUF_LENGTH];
2710+ snprintf( buffer, CK_PRINT_BUF_LENGTH, "name='%s'", m_name.c_str() );
26852711 return buffer; }
2686−
2712+
26872713 // global name and type
26882714 std::string m_name;
26892715 te_GlobalType m_type;
26902716 t_CKBOOL m_is_array;
2691−
2717+
26922718 // for objects
26932719 t_CKBOOL m_should_execute_ctors;
26942720 t_CKUINT m_stack_offset;
26952721 Chuck_Type * m_chuck_type;
2696−
2722+
26972723 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
26982724 };
26992725
@@ -2946,7 +2972,7 @@ struct Chuck_Instr_AddRef_Object2 : public Chuck_Instr_Unary_Op · 246 unmodified lines
29462972 public:
29472973 Chuck_Instr_AddRef_Object2( t_CKUINT offset )
29482974 { this->set( offset ); }
2949−
2975+
29502976 public:
29512977 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
29522978 };
@@ -2957,6 +2983,7 @@ public: · 4 unmodified lines
29572983 //-----------------------------------------------------------------------------
29582984 // name: struct Chuck_Instr_Reg_AddRef_Object3
29592985 // desc: added 1.3.0.0 -- does the ref add in-place
2986+// operates on top of the register stack
29602987 //-----------------------------------------------------------------------------
29612988 struct Chuck_Instr_Reg_AddRef_Object3 : public Chuck_Instr
29622989 {
@@ -2969,7 +2996,7 @@ public: · 6 unmodified lines
29692996
29702997 //-----------------------------------------------------------------------------
29712998 // name: struct Chuck_Instr_Release_Object
2972−// desc: ...
2999+// desc: release object on stack by its offset
29733000 //-----------------------------------------------------------------------------
29743001 struct Chuck_Instr_Release_Object : public Chuck_Instr
29753002 {
@@ -2998,6 +3025,38 @@ public: · 22 unmodified lines
29983025
29993026
30003027
3028+//-----------------------------------------------------------------------------
3029+// name: struct Chuck_Instr_Release_Object3_Pop_Word
3030+// desc: release object reference + pop from reg stack | 1.4.2.1 (ge) added
3031+// the variant assumes object pointer directly on stack (not offset)
3032+//-----------------------------------------------------------------------------
3033+struct Chuck_Instr_Release_Object3_Pop_Word : public Chuck_Instr
3034+{
3035+public:
3036+ virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
3037+};
3038+
3039+
3040+
3041+
3042+//-----------------------------------------------------------------------------
3043+// name: struct Chuck_Instr_Release_Object4
3044+// desc: release object reference from reg stack (no pop) | 1.4.2.1 (ge) added
3045+// the variant assumes object pointer directly on stack (not offset)
3046+//-----------------------------------------------------------------------------
3047+struct Chuck_Instr_Release_Object4 : public Chuck_Instr_Unary_Op
3048+{
3049+public:
3050+ Chuck_Instr_Release_Object4( t_CKUINT offset )
3051+ { this->set( offset ); }
3052+
3053+public:
3054+ virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
3055+};
3056+
3057+
3058+
3059+
30013060 //-----------------------------------------------------------------------------
30023061 // name: struct Chuck_Instr_Func_To_Code
30033062 // desc: Chuck_Func * to Chuck_VM_Code *
@@ -3031,11 +3090,14 @@ public: · 27 unmodified lines
30313090 struct Chuck_Instr_Func_Call_Member : public Chuck_Instr_Unary_Op
30323091 {
30333092 public:
3034− Chuck_Instr_Func_Call_Member( t_CKUINT ret_size )
3035− { this->set( ret_size ); }
3093+ Chuck_Instr_Func_Call_Member( t_CKUINT ret_size, Chuck_Func * func_ref )
3094+ { this->set( ret_size ); m_func_ref = func_ref; }
30363095
30373096 public:
30383097 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
3098+
3099+public:
3100+ Chuck_Func * m_func_ref; // 1.4.2.1 (ge) | added for arg list cleanup
30393101 };
30403102
30413103
@@ -3048,11 +3110,14 @@ public: · 6 unmodified lines
30483110 struct Chuck_Instr_Func_Call_Static : public Chuck_Instr_Unary_Op
30493111 {
30503112 public:
3051− Chuck_Instr_Func_Call_Static( t_CKUINT ret_size )
3052− { this->set( ret_size ); }
3113+ Chuck_Instr_Func_Call_Static( t_CKUINT ret_size, Chuck_Func * func_ref )
3114+ { this->set( ret_size ); m_func_ref = func_ref; }
30533115
30543116 public:
30553117 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
3118+
3119+public:
3120+ Chuck_Func * m_func_ref; // 1.4.2.1 (ge) | added for arg list cleanup
30563121 };
30573122
30583123
@@ -3145,6 +3210,7 @@ protected: · 86 unmodified lines
31453210 Chuck_Type * m_type_ref;
31463211 t_CKINT m_length;
31473212 t_CKBOOL m_is_obj;
3213+ t_CKBOOL m_is_float;
31483214 char * m_param_str;
31493215 };
31503216
@@ -3158,8 +3224,9 @@ protected: · 7 unmodified lines
31583224 struct Chuck_Instr_Array_Alloc : public Chuck_Instr
31593225 {
31603226 public: // REFACTOR-2017: added env
3161− Chuck_Instr_Array_Alloc( Chuck_Env * env, t_CKUINT depth, Chuck_Type * the_type,
3162− t_CKUINT offset, t_CKBOOL ref );
3227+ Chuck_Instr_Array_Alloc( Chuck_Env * env, t_CKUINT depth,
3228+ Chuck_Type * contentType, t_CKUINT offset, t_CKBOOL ref,
3229+ Chuck_Type * arrayType );
31633230 virtual ~Chuck_Instr_Array_Alloc();
31643231
31653232 public:
@@ -3168,7 +3235,8 @@ public: · 2 unmodified lines
31683235
31693236 protected:
31703237 t_CKUINT m_depth;
3171− Chuck_Type * m_type_ref;
3238+ Chuck_Type * m_type_ref_content;
3239+ Chuck_Type * m_type_ref_array; // 1.4.2.1 (ge) added
31723240 t_CKBOOL m_is_obj;
31733241 char * m_param_str;
31743242 t_CKUINT m_stack_offset;
@@ -3185,15 +3253,15 @@ protected: · 10 unmodified lines
31853253 struct Chuck_Instr_Array_Access : public Chuck_Instr
31863254 {
31873255 public:
3188− Chuck_Instr_Array_Access( t_CKUINT kind, t_CKUINT emit_addr,
3256+ Chuck_Instr_Array_Access( t_CKUINT kind, t_CKUINT emit_addr,
31893257 t_CKUINT istr = FALSE )
31903258 { m_kind = kind; m_emit_addr = emit_addr; m_istr = istr; }
31913259
31923260 public:
31933261 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
31943262 virtual const char * params() const
3195− { static char buffer[256];
3196− sprintf( buffer, "kind=%ld, emit_addr=%p istr=%ld",
3263+ { static char buffer[CK_PRINT_BUF_LENGTH];
3264+ snprintf( buffer, CK_PRINT_BUF_LENGTH, "kind=%ld, emit_addr=%p istr=%ld",
31973265 (long)m_kind, (void *)m_emit_addr, (long)m_istr );
31983266 return buffer; }
31993267
@@ -3219,8 +3287,8 @@ public: · 19 unmodified lines
32193287 public:
32203288 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
32213289 virtual const char * params() const
3222− { static char buffer[256];
3223− sprintf( buffer, "kind=%ld, emit_addr=%p", (long)m_kind, (void *)m_emit_addr );
3290+ { static char buffer[CK_PRINT_BUF_LENGTH];
3291+ snprintf( buffer, CK_PRINT_BUF_LENGTH, "kind=%ld, emit_addr=%p", (long)m_kind, (void *)m_emit_addr );
32243292 return buffer; }
32253293
32263294 protected:
@@ -3246,15 +3314,15 @@ public: · 19 unmodified lines
32463314 public:
32473315 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
32483316 virtual const char * params() const
3249− { static char buffer[256];
3250− sprintf( buffer, "depth=%ld, kind=%ld, emit_addr=%p", (long)m_depth, (long)m_kind, (void *)m_emit_addr );
3317+ { static char buffer[CK_PRINT_BUF_LENGTH];
3318+ snprintf( buffer, CK_PRINT_BUF_LENGTH, "depth=%ld, kind=%ld, emit_addr=%p", (long)m_depth, (long)m_kind, (void *)m_emit_addr );
32513319 return buffer; }
32523320
32533321 protected:
32543322 t_CKUINT m_depth;
32553323 t_CKUINT m_kind;
32563324 t_CKUINT m_emit_addr;
3257−
3325+
32583326 // 1.3.1.0 list of types of indices
32593327 std::vector<t_CKBOOL> m_indexIsAssociative;
32603328 };
@@ -3275,8 +3343,8 @@ public: · 14 unmodified lines
32753343 public:
32763344 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
32773345 virtual const char * params() const
3278− { static char buffer[256];
3279− sprintf( buffer, "offset=%ld, kind=%ld, emit_addr=%p", (long)m_offset, (long)m_kind, (void *)m_emit_addr );
3346+ { static char buffer[CK_PRINT_BUF_LENGTH];
3347+ snprintf( buffer, CK_PRINT_BUF_LENGTH, "offset=%ld, kind=%ld, emit_addr=%p", (long)m_offset, (long)m_kind, (void *)m_emit_addr );
32803348 return buffer; }
32813349
32823350 protected:
@@ -3301,8 +3369,8 @@ public: · 18 unmodified lines
33013369 public:
33023370 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
33033371 virtual const char * params() const
3304− { static char buffer[256];
3305− sprintf( buffer, "offset=%ld", (long)m_offset );
3372+ { static char buffer[CK_PRINT_BUF_LENGTH];
3373+ snprintf( buffer, CK_PRINT_BUF_LENGTH, "offset=%ld", (long)m_offset );
33063374 return buffer; }
33073375
33083376 protected:
@@ -3321,14 +3389,14 @@ struct Chuck_Instr_Dot_Primitive_Func : public Chuck_Instr · 12 unmodified lines
33213389 public:
33223390 Chuck_Instr_Dot_Primitive_Func( t_CKUINT native_func )
33233391 { m_native_func = native_func; }
3324−
3392+
33253393 public:
33263394 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
33273395 virtual const char * params() const
3328− { static char buffer[256];
3329− sprintf( buffer, "native_func=%p", (void *)m_native_func );
3396+ { static char buffer[CK_PRINT_BUF_LENGTH];
3397+ snprintf( buffer, CK_PRINT_BUF_LENGTH, "native_func=%p", (void *)m_native_func );
33303398 return buffer; }
3331−
3399+
33323400 protected:
33333401 t_CKUINT m_native_func;
33343402 };
@@ -3349,8 +3417,9 @@ public: · 14 unmodified lines
33493417 public:
33503418 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
33513419 virtual const char * params() const
3352− { static char buffer[256];
3353− sprintf( buffer, "offset=%ld, size=%ld, kind=%ld, emit_addr=%p", (long)m_offset, (long)m_size, (long)m_kind, (void *)m_emit_addr );
3420+ { static char buffer[CK_PRINT_BUF_LENGTH];
3421+ snprintf( buffer, CK_PRINT_BUF_LENGTH, "offset=%ld, size=%ld, kind=%ld, emit_addr=%p",
3422+ (long)m_offset, (long)m_size, (long)m_kind, (void *)m_emit_addr );
33543423 return buffer; }
33553424
33563425 protected:
@@ -3376,8 +3445,9 @@ public: · 19 unmodified lines
33763445 public:
33773446 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
33783447 virtual const char * params() const
3379− { static char buffer[256];
3380− sprintf( buffer, "addr=%p, kind=%ld, emit_addr=%p", (void *)m_addr, (long)m_kind, (void *)m_emit_addr );
3448+ { static char buffer[CK_PRINT_BUF_LENGTH];
3449+ snprintf( buffer, CK_PRINT_BUF_LENGTH, "addr=%p, kind=%ld, emit_addr=%p",
3450+ (void *)m_addr, (long)m_kind, (void *)m_emit_addr );
33813451 return buffer; }
33823452
33833453 protected:
@@ -3402,8 +3472,8 @@ public: · 18 unmodified lines
34023472 public:
34033473 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
34043474 virtual const char * params() const
3405− { static char buffer[256];
3406− sprintf( buffer, "func=%p", (void *)m_func );
3475+ { static char buffer[CK_PRINT_BUF_LENGTH];
3476+ snprintf( buffer, CK_PRINT_BUF_LENGTH, "func=%p", (void *)m_func );
34073477 return buffer; }
34083478
34093479 protected:
@@ -3426,8 +3496,8 @@ public: · 16 unmodified lines
34263496 public:
34273497 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
34283498 virtual const char * params() const
3429− { static char buffer[256];
3430− sprintf( buffer, "is_mem=%ld, emit_addr=%p", (long)m_is_mem, (void *)m_emit_addr );
3499+ { static char buffer[CK_PRINT_BUF_LENGTH];
3500+ snprintf( buffer, CK_PRINT_BUF_LENGTH, "is_mem=%ld, emit_addr=%p", (long)m_is_mem, (void *)m_emit_addr );
34313501 return buffer; }
34323502
34333503 protected:
@@ -3451,8 +3521,8 @@ public: · 17 unmodified lines
34513521 public:
34523522 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
34533523 virtual const char * params() const
3454− { static char buffer[256];
3455− sprintf( buffer, "is_mem=%ld, emit_addr=%p", (long)m_is_mem, (void *)m_emit_addr );
3524+ { static char buffer[CK_PRINT_BUF_LENGTH];
3525+ snprintf( buffer, CK_PRINT_BUF_LENGTH, "is_mem=%ld, emit_addr=%p", (long)m_is_mem, (void *)m_emit_addr );
34563526 return buffer; }
34573527
34583528 protected:
@@ -3472,14 +3542,14 @@ struct Chuck_Instr_Dot_Cmp_Third : public Chuck_Instr · 13 unmodified lines
34723542 public:
34733543 Chuck_Instr_Dot_Cmp_Third( t_CKUINT is_mem, t_CKUINT emit_addr )
34743544 { m_is_mem = is_mem; m_emit_addr = emit_addr; }
3475−
3545+
34763546 public:
34773547 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
34783548 virtual const char * params() const
3479− { static char buffer[256];
3480− sprintf( buffer, "is_mem=%ld, emit_addr=%p", (long)m_is_mem, (void *)m_emit_addr );
3549+ { static char buffer[CK_PRINT_BUF_LENGTH];
3550+ snprintf( buffer, CK_PRINT_BUF_LENGTH, "is_mem=%ld, emit_addr=%p", (long)m_is_mem, (void *)m_emit_addr );
34813551 return buffer; }
3482−
3552+
34833553 protected:
34843554 t_CKUINT m_is_mem;
34853555 t_CKUINT m_emit_addr;
@@ -3497,14 +3567,14 @@ struct Chuck_Instr_Dot_Cmp_Fourth : public Chuck_Instr · 11 unmodified lines
34973567 public:
34983568 Chuck_Instr_Dot_Cmp_Fourth( t_CKUINT is_mem, t_CKUINT emit_addr )
34993569 { m_is_mem = is_mem; m_emit_addr = emit_addr; }
3500−
3570+
35013571 public:
35023572 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
35033573 virtual const char * params() const
3504− { static char buffer[256];
3505− sprintf( buffer, "is_mem=%ld, emit_addr=%p", (long)m_is_mem, (void *)m_emit_addr );
3574+ { static char buffer[CK_PRINT_BUF_LENGTH];
3575+ snprintf( buffer, CK_PRINT_BUF_LENGTH, "is_mem=%ld, emit_addr=%p", (long)m_is_mem, (void *)m_emit_addr );
35063576 return buffer; }
3507−
3577+
35083578 protected:
35093579 t_CKUINT m_is_mem;
35103580 t_CKUINT m_emit_addr;
@@ -3586,10 +3656,10 @@ struct Chuck_Instr_UGen_Link : public Chuck_Instr · 75 unmodified lines
35863656 {
35873657 public:
35883658 Chuck_Instr_UGen_Link( t_CKBOOL isUpChuck = FALSE );
3589−
3659+
35903660 public:
35913661 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
3592−
3662+
35933663 protected:
35943664 t_CKBOOL m_isUpChuck;
35953665 };
@@ -3609,7 +3679,7 @@ public: · 13 unmodified lines
36093679 { }
36103680
36113681 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
3612−
3682+
36133683 protected:
36143684 t_CKBOOL m_srcIsArray, m_dstIsArray;
36153685 };
src/core/chuck_io.cpp+664−640
@@ -69,7 +69,7 @@ typedef WORD uint16_t; · 68 unmodified lines
6969 typedef __int32 int32_t; // 1.4.1.0 (ge) added
7070 typedef DWORD uint32_t;
7171 #endif
72−#endif
72+#endif
7373
7474 #ifdef __PLATFORM_LINUX__
7575 #include <stdint.h>
@@ -89,79 +89,79 @@ t_CKBOOL init_class_io( Chuck_Env * env, Chuck_Type * type ) · 13 unmodified lines
8989 {
9090 // init as base class
9191 Chuck_DL_Func * func = NULL;
92−
92+
9393 // log
9494 EM_log( CK_LOG_SEVERE, "class 'IO'" );
95−
95+
9696 // init as base class
9797 // TODO: ctor/dtor?
9898 // TODO: replace dummy with pure function
9999 if( !type_engine_import_class_begin( env, type, env->global(), NULL, NULL ) )
100100 return FALSE;
101−
101+
102102 // add good()
103103 func = make_new_mfun( "int", "good", io_dummy );
104104 if( !type_engine_import_mfun( env, func ) ) goto error;
105−
105+
106106 // add close()
107107 func = make_new_mfun( "void", "close", io_dummy );
108108 if( !type_engine_import_mfun( env, func ) ) goto error;
109−
109+
110110 // add flush()
111111 func = make_new_mfun( "void", "flush", io_dummy );
112112 if( !type_engine_import_mfun( env, func ) ) goto error;
113−
113+
114114 // add mode(int)
115115 func = make_new_mfun( "int", "mode", io_dummy );
116116 func->add_arg( "int", "flag" );
117117 if( !type_engine_import_mfun( env, func ) ) goto error;
118−
118+
119119 // add mode()
120120 func = make_new_mfun( "int", "mode", io_dummy );
121121 if( !type_engine_import_mfun( env, func ) ) goto error;
122−
122+
123123 // TODO: add this later?
124124 // add read()
125125 // func = make_new_mfun( "string", "read", io_dummy );
126126 // func->add_arg( "int", "length" );
127127 // if( !type_engine_import_mfun( env, func ) ) goto error;
128−
128+
129129 // add readLine()
130130 func = make_new_mfun( "string", "readLine", io_dummy );
131131 if( !type_engine_import_mfun( env, func ) ) goto error;
132−
132+
133133 // add readInt()
134134 func = make_new_mfun( "int", "readInt", io_dummy );
135135 func->add_arg( "int", "flags" );
136136 if( !type_engine_import_mfun( env, func ) ) goto error;
137−
137+
138138 // add readFloat()
139139 // func = make_new_mfun( "float", "readFloat", io_dummy );
140140 // if( !type_engine_import_mfun( env, func ) ) goto error;
141−
141+
142142 // add eof()
143143 func = make_new_mfun( "int", "eof", io_dummy );
144144 if( !type_engine_import_mfun( env, func ) ) goto error;
145−
145+
146146 // add more()
147147 func = make_new_mfun( "int", "more", io_dummy );
148148 if( !type_engine_import_mfun( env, func ) ) goto error;
149−
149+
150150 // add write(string)
151151 func = make_new_mfun( "void", "write", io_dummy );
152152 func->add_arg( "string", "val" );
153153 if( !type_engine_import_mfun( env, func ) ) goto error;
154−
154+
155155 // add write(int)
156156 func = make_new_mfun( "void", "write", io_dummy );
157157 func->add_arg( "int", "val" );
158158 if( !type_engine_import_mfun( env, func ) ) goto error;
159−
159+
160160 // add write(float)
161161 func = make_new_mfun( "void", "write", io_dummy );
162162 func->add_arg( "float", "val" );
163163 if( !type_engine_import_mfun( env, func ) ) goto error;
164−
164+
165165 // add newline
166166 func = make_new_sfun( "string", "newline", io_newline );
167167 if( !type_engine_import_sfun( env, func ) ) goto error;
@@ -171,56 +171,69 @@ t_CKBOOL init_class_io( Chuck_Env * env, Chuck_Type * type ) · 3 unmodified lines
171171 if( !type_engine_import_sfun( env, func ) ) goto error;
172172 initialize_object( g_newline, env->t_string );
173173 g_newline->set( "\n" );
174−
175− // add READ_INT32
176− if( !type_engine_import_svar( env, "int", "READ_INT32",
177− TRUE, (t_CKUINT)&Chuck_IO::INT32 ) ) goto error;
178−
179− // add READ_INT16
180− if( !type_engine_import_svar( env, "int", "READ_INT16",
181− TRUE, (t_CKUINT)&Chuck_IO::INT16 ) ) goto error;
182−
183− // add READ_INT8
184− if( !type_engine_import_svar( env, "int", "READ_INT8",
174+
175+ // add TYPE_ASCII
176+ if( !type_engine_import_svar( env, "int", "ASCII",
177+ TRUE, (t_CKUINT)&Chuck_IO::TYPE_ASCII ) ) goto error;
178+ // add TYPE_BINARY
179+ if( !type_engine_import_svar( env, "int", "BINARY",
180+ TRUE, (t_CKUINT)&Chuck_IO::TYPE_BINARY ) ) goto error;
181+ // add INT8
182+ if( !type_engine_import_svar( env, "int", "INT8",
185183 TRUE, (t_CKUINT)&Chuck_IO::INT8 ) ) goto error;
186−
187− // add INT32
188− if( !type_engine_import_svar( env, "int", "INT32",
189− TRUE, (t_CKUINT)&Chuck_IO::INT32 ) ) goto error;
190−
191184 // add INT16
192185 if( !type_engine_import_svar( env, "int", "INT16",
193186 TRUE, (t_CKUINT)&Chuck_IO::INT16 ) ) goto error;
194−
195− // add INT8
196− if( !type_engine_import_svar( env, "int", "INT8",
187+ // add INT32
188+ if( !type_engine_import_svar( env, "int", "INT32",
189+ TRUE, (t_CKUINT)&Chuck_IO::INT32 ) ) goto error;
190+ // add READ_INT8
191+ if( !type_engine_import_svar( env, "int", "READ_INT8",
197192 TRUE, (t_CKUINT)&Chuck_IO::INT8 ) ) goto error;
198−
193+ // add READ_INT16
194+ if( !type_engine_import_svar( env, "int", "READ_INT16",
195+ TRUE, (t_CKUINT)&Chuck_IO::INT16 ) ) goto error;
196+ // add READ_INT32
197+ if( !type_engine_import_svar( env, "int", "READ_INT32",
198+ TRUE, (t_CKUINT)&Chuck_IO::INT32 ) ) goto error;
199199 // add MODE_SYNC
200200 if( !type_engine_import_svar( env, "int", "MODE_SYNC",
201201 TRUE, (t_CKUINT)&Chuck_IO::MODE_SYNC ) ) goto error;
202−
202+#ifndef __DISABLE_FILEIO__
203203 // add MODE_ASYNC
204204 if( !type_engine_import_svar( env, "int", "MODE_ASYNC",
205205 TRUE, (t_CKUINT)&Chuck_IO::MODE_ASYNC ) ) goto error;
206−
206+#endif
207+ // add FLAG_READONLY
208+ if( !type_engine_import_svar( env, "int", "READ",
209+ TRUE, (t_CKUINT)&Chuck_IO::FLAG_READONLY ) ) goto error;
210+ // add FLAG_WRITEONLY
211+ if( !type_engine_import_svar( env, "int", "WRITE",
212+ TRUE, (t_CKUINT)&Chuck_IO::FLAG_WRITEONLY ) ) goto error;
213+ // add FLAG_APPEND
214+ if( !type_engine_import_svar( env, "int", "APPEND",
215+ TRUE, (t_CKUINT)&Chuck_IO::FLAG_APPEND ) ) goto error;
216+ // add FLAG_READ_WRITE
217+ if( !type_engine_import_svar( env, "int", "READ_WRITE",
218+ TRUE, (t_CKUINT)&Chuck_IO::FLAG_READ_WRITE ) ) goto error;
219+
207220 // end the class import
208221 type_engine_import_class_end( env );
209−
222+
210223 return TRUE;
211−
224+
212225 error:
213−
226+
214227 // end the class import
215228 type_engine_import_class_end( env );
216−
229+
217230 return FALSE;
218231 }
219232
220233
221234
222235
223−#ifndef __DISABLE_FILEIO__
236+// #ifndef __DISABLE_FILEIO__
224237 //-----------------------------------------------------------------------------
225238 // name: init_class_fileio()
226239 // desc: ...
@@ -229,157 +242,144 @@ t_CKBOOL init_class_fileio( Chuck_Env * env, Chuck_Type * type ) · 2 unmodified lines
229242 {
230243 // init as base class
231244 Chuck_DL_Func * func = NULL;
232−
245+
233246 // log
234247 EM_log( CK_LOG_SEVERE, "class 'FileIO'" );
235−
248+
236249 // init as base class
237250 // TODO: ctor/dtor?
238251 // TODO: replace dummy with pure function
239252 if( !type_engine_import_class_begin( env, type, env->global(), fileio_ctor, fileio_dtor ) )
240253 return FALSE;
241−
254+
242255 // add open(string)
243256 func = make_new_mfun( "int", "open", fileio_open );
244257 func->add_arg( "string", "path" );
245258 if( !type_engine_import_mfun( env, func ) ) goto error;
246−
259+
247260 // add open(string, flags)
248261 func = make_new_mfun( "int", "open", fileio_openflags );
249262 func->add_arg( "string", "path" );
250263 func->add_arg( "int", "flags" );
251264 if( !type_engine_import_mfun( env, func ) ) goto error;
252−
265+
253266 // add good()
254267 func = make_new_mfun( "int", "good", fileio_good );
255268 if( !type_engine_import_mfun( env, func ) ) goto error;
256−
269+
257270 // add close()
258271 func = make_new_mfun( "void", "close", fileio_close );
259272 if( !type_engine_import_mfun( env, func ) ) goto error;
260−
273+
261274 // add flush()
262275 func = make_new_mfun( "void", "flush", fileio_flush );
263276 if( !type_engine_import_mfun( env, func ) ) goto error;
264−
277+
265278 // add mode()
266279 func = make_new_mfun( "int", "mode", fileio_getmode );
267280 if( !type_engine_import_mfun( env, func ) ) goto error;
268−
281+
269282 // add mode(int)
270283 func = make_new_mfun( "int", "mode", fileio_setmode );
271284 func->add_arg( "int", "flag" );
272285 if( !type_engine_import_mfun( env, func ) ) goto error;
273−
286+
274287 // add size()
275288 func = make_new_mfun( "int", "size", fileio_size );
276289 if( !type_engine_import_mfun( env, func ) ) goto error;
277−
290+
278291 // add seek(int)
279292 func = make_new_mfun( "void", "seek", fileio_seek );
280293 func->add_arg( "int", "pos" );
281294 if( !type_engine_import_mfun( env, func ) ) goto error;
282−
295+
283296 // add tell()
284297 func = make_new_mfun( "int", "tell", fileio_tell );
285298 if( !type_engine_import_mfun( env, func ) ) goto error;
286−
299+
287300 // add isDir()
288301 func = make_new_mfun( "int", "isDir", fileio_isdir );
289302 if( !type_engine_import_mfun( env, func ) ) goto error;
290−
303+
291304 // add dirList()
292305 func = make_new_mfun( "string[]", "dirList", fileio_dirlist );
293306 if( !type_engine_import_mfun( env, func ) ) goto error;
294−
307+
295308 // add read()
296309 // func = make_new_mfun( "string", "read", fileio_read );
297310 // func->add_arg( "int", "length" );
298311 // if( !type_engine_import_mfun( env, func ) ) goto error;
299−
312+
300313 // add readLine()
301314 func = make_new_mfun( "string", "readLine", fileio_readline );
302315 if( !type_engine_import_mfun( env, func ) ) goto error;
303−
316+
304317 // add readInt()
305318 // func = make_new_mfun( "int", "readInt", fileio_readint );
306319 // if( !type_engine_import_mfun( env, func ) ) goto error;
307−
320+
308321 // add readInt(int)
309322 func = make_new_mfun( "int", "readInt", fileio_readintflags );
310323 func->add_arg( "int", "flags" );
311324 if( !type_engine_import_mfun( env, func ) ) goto error;
312−
325+
313326 // add readFloat()
314327 // func = make_new_mfun( "float", "readFloat", fileio_readfloat );
315328 // if( !type_engine_import_mfun( env, func ) ) goto error;
316−
329+
317330 // add eof()
318331 func = make_new_mfun( "int", "eof", fileio_eof );
319332 if( !type_engine_import_mfun( env, func ) ) goto error;
320−
333+
321334 // add more()
322335 func = make_new_mfun( "int", "more", fileio_more );
323336 if( !type_engine_import_mfun( env, func ) ) goto error;
324−
337+
325338 // add write(string)
326339 func = make_new_mfun( "void", "write", fileio_writestring );
327340 func->add_arg( "string", "val" );
328341 if( !type_engine_import_mfun( env, func ) ) goto error;
329−
342+
330343 // add write(int)
331344 func = make_new_mfun( "void", "write", fileio_writeint );
332345 func->add_arg( "int", "val" );
333346 if( !type_engine_import_mfun( env, func ) ) goto error;
334−
347+
335348 // add write(int,flags)
336349 func = make_new_mfun( "void", "write", fileio_writeintflags );
337350 func->add_arg( "int", "val" );
338351 func->add_arg( "int", "flags" );
339352 if( !type_engine_import_mfun( env, func ) ) goto error;
340−
353+
341354 // add write(float)
342355 func = make_new_mfun( "void", "write", fileio_writefloat );
343356 func->add_arg( "float", "val" );
344357 if( !type_engine_import_mfun( env, func ) ) goto error;
345−
346− // add FLAG_READ_WRITE
347− if( !type_engine_import_svar( env, "int", "READ_WRITE",
348− TRUE, (t_CKUINT)&Chuck_IO_File::FLAG_READ_WRITE ) ) goto error;
349−
350− // add FLAG_READONLY
351− if( !type_engine_import_svar( env, "int", "READ",
352− TRUE, (t_CKUINT)&Chuck_IO_File::FLAG_READONLY ) ) goto error;
353−
354− // add FLAG_WRITEONLY
355− if( !type_engine_import_svar( env, "int", "WRITE",
356− TRUE, (t_CKUINT)&Chuck_IO_File::FLAG_WRITEONLY ) ) goto error;
357−
358− // add FLAG_APPEND
359− if( !type_engine_import_svar( env, "int", "APPEND",
360− TRUE, (t_CKUINT)&Chuck_IO_File::FLAG_APPEND ) ) goto error;
361−
362− // add TYPE_ASCII
363− if( !type_engine_import_svar( env, "int", "ASCII",
364− TRUE, (t_CKUINT)&Chuck_IO_File::TYPE_ASCII ) ) goto error;
365−
366− // add TYPE_BINARY
367− if( !type_engine_import_svar( env, "int", "BINARY",
368− TRUE, (t_CKUINT)&Chuck_IO_File::TYPE_BINARY ) ) goto error;
369−
358+
359+ if( !type_engine_import_add_ex( env, "io/chout.ck" ) ) goto error;
360+ if( !type_engine_import_add_ex( env, "io/read-byte.ck" ) ) goto error;
361+ if( !type_engine_import_add_ex( env, "io/read-float.ck" ) ) goto error;
362+ if( !type_engine_import_add_ex( env, "io/read-int.ck" ) ) goto error;
363+ if( !type_engine_import_add_ex( env, "io/read-line.ck" ) ) goto error;
364+ if( !type_engine_import_add_ex( env, "io/read-str.ck" ) ) goto error;
365+ if( !type_engine_import_add_ex( env, "io/read-tokens.ck" ) ) goto error;
366+ if( !type_engine_import_add_ex( env, "io/seek.ck" ) ) goto error;
367+ if( !type_engine_import_add_ex( env, "io/write-byte.ck" ) ) goto error;
368+ if( !type_engine_import_add_ex( env, "io/write.ck" ) ) goto error;
369+ if( !type_engine_import_add_ex( env, "io/write2.ck" ) ) goto error;
370370 // end the class import
371371 type_engine_import_class_end( env );
372−
372+
373373 return TRUE;
374−
374+
375375 error:
376−
376+
377377 // end the class import
378378 type_engine_import_class_end( env );
379−
379+
380380 return FALSE;
381381 }
382−#endif // __DISABLE_FILEIO__
382+// #endif // __DISABLE_FILEIO__
383383
384384
385385
@@ -392,85 +392,85 @@ t_CKBOOL init_class_chout( Chuck_Env * env, Chuck_Type * type ) · 6 unmodified lines
392392 {
393393 // init as base class
394394 Chuck_DL_Func * func = NULL;
395−
395+
396396 // log
397397 EM_log( CK_LOG_SEVERE, "class 'chout'" );
398−
398+
399399 // TODO: ctor/dtor?
400400 if( !type_engine_import_class_begin( env, type, env->global(), NULL, NULL ) )
401401 return FALSE;
402−
402+
403403 // add good()
404404 func = make_new_mfun( "int", "good", chout_good );
405405 if( !type_engine_import_mfun( env, func ) ) goto error;
406−
406+
407407 // add close()
408408 func = make_new_mfun( "void", "close", chout_close );
409409 if( !type_engine_import_mfun( env, func ) ) goto error;
410−
410+
411411 // add flush()
412412 func = make_new_mfun( "void", "flush", chout_flush );
413413 if( !type_engine_import_mfun( env, func ) ) goto error;
414−
414+
415415 // add mode()
416416 func = make_new_mfun( "int", "mode", chout_getmode );
417417 if( !type_engine_import_mfun( env, func ) ) goto error;
418−
418+
419419 // add mode(int)
420420 func = make_new_mfun( "int", "mode", chout_setmode );
421421 func->add_arg( "int", "flag" );
422422 if( !type_engine_import_mfun( env, func ) ) goto error;
423−
423+
424424 // add readLine()
425425 func = make_new_mfun( "string", "readLine", chout_readline );
426426 if( !type_engine_import_mfun( env, func ) ) goto error;
427−
427+
428428 // add readInt()
429429 // func = make_new_mfun( "int", "readInt", chout_readint );
430430 // if( !type_engine_import_mfun( env, func ) ) goto error;
431−
431+
432432 // add readInt(int)
433433 func = make_new_mfun( "int", "readInt", chout_readintflags );
434434 func->add_arg( "int", "flags" );
435435 if( !type_engine_import_mfun( env, func ) ) goto error;
436−
436+
437437 // add readFloat()
438438 // func = make_new_mfun( "float", "readFloat", chout_readfloat );
439439 // if( !type_engine_import_mfun( env, func ) ) goto error;
440−
440+
441441 // add eof()
442442 func = make_new_mfun( "int", "eof", chout_eof );
443443 if( !type_engine_import_mfun( env, func ) ) goto error;
444−
444+
445445 // add more()
446446 func = make_new_mfun( "int", "more", chout_more );
447447 if( !type_engine_import_mfun( env, func ) ) goto error;
448−
448+
449449 // add write(string)
450450 func = make_new_mfun( "void", "write", chout_writestring );
451451 func->add_arg( "string", "val" );
452452 if( !type_engine_import_mfun( env, func ) ) goto error;
453−
453+
454454 // add write(int)
455455 func = make_new_mfun( "void", "write", chout_writeint );
456456 func->add_arg( "int", "val" );
457457 if( !type_engine_import_mfun( env, func ) ) goto error;
458−
458+
459459 // add write(float)
460460 func = make_new_mfun( "void", "write", chout_writefloat );
461461 func->add_arg( "float", "val" );
462462 if( !type_engine_import_mfun( env, func ) ) goto error;
463−
463+
464464 // end the class import
465465 type_engine_import_class_end( env );
466−
466+
467467 return TRUE;
468−
468+
469469 error:
470−
470+
471471 // end the class import
472472 type_engine_import_class_end( env );
473−
473+
474474 return FALSE;
475475 }
476476
@@ -485,85 +485,85 @@ t_CKBOOL init_class_cherr( Chuck_Env * env, Chuck_Type * type ) · 8 unmodified lines
485485 {
486486 // init as base class
487487 Chuck_DL_Func * func = NULL;
488−
488+
489489 // log
490490 EM_log( CK_LOG_SEVERE, "class 'cherr'" );
491−
491+
492492 // TODO: ctor/dtor?
493493 if( !type_engine_import_class_begin( env, type, env->global(), NULL, NULL ) )
494494 return FALSE;
495−
495+
496496 // add good()
497497 func = make_new_mfun( "int", "good", cherr_good );
498498 if( !type_engine_import_mfun( env, func ) ) goto error;
499−
499+
500500 // add close()
501501 func = make_new_mfun( "void", "close", cherr_close );
502502 if( !type_engine_import_mfun( env, func ) ) goto error;
503−
503+
504504 // add flush()
505505 func = make_new_mfun( "void", "flush", cherr_flush );
506506 if( !type_engine_import_mfun( env, func ) ) goto error;
507−
507+
508508 // add mode()
509509 func = make_new_mfun( "int", "mode", cherr_getmode );
510510 if( !type_engine_import_mfun( env, func ) ) goto error;
511−
511+
512512 // add mode(int)
513513 func = make_new_mfun( "int", "mode", cherr_setmode );
514514 func->add_arg( "int", "flag" );
515515 if( !type_engine_import_mfun( env, func ) ) goto error;
516−
516+
517517 // add readLine()
518518 func = make_new_mfun( "string", "readLine", cherr_readline );
519519 if( !type_engine_import_mfun( env, func ) ) goto error;
520−
520+
521521 // add readInt()
522522 // func = make_new_mfun( "int", "readInt", cherr_readint );
523523 // if( !type_engine_import_mfun( env, func ) ) goto error;
524−
524+
525525 // add readInt(int)
526526 func = make_new_mfun( "int", "readInt", cherr_readintflags );
527527 func->add_arg( "int", "flags" );
528528 if( !type_engine_import_mfun( env, func ) ) goto error;
529−
529+
530530 // add readFloat()
531531 // func = make_new_mfun( "float", "readFloat", cherr_readfloat );
532532 // if( !type_engine_import_mfun( env, func ) ) goto error;
533−
533+
534534 // add eof()
535535 func = make_new_mfun( "int", "eof", cherr_eof );
536536 if( !type_engine_import_mfun( env, func ) ) goto error;
537−
537+
538538 // add more()
539539 func = make_new_mfun( "int", "more", cherr_more );
540540 if( !type_engine_import_mfun( env, func ) ) goto error;
541−
541+
542542 // add write(string)
543543 func = make_new_mfun( "void", "write", cherr_writestring );
544544 func->add_arg( "string", "val" );
545545 if( !type_engine_import_mfun( env, func ) ) goto error;
546−
546+
547547 // add write(int)
548548 func = make_new_mfun( "void", "write", cherr_writeint );
549549 func->add_arg( "int", "val" );
550550 if( !type_engine_import_mfun( env, func ) ) goto error;
551−
551+
552552 // add write(float)
553553 func = make_new_mfun( "void", "write", cherr_writefloat );
554554 func->add_arg( "float", "val" );
555555 if( !type_engine_import_mfun( env, func ) ) goto error;
556−
556+
557557 // end the class import
558558 type_engine_import_class_end( env );
559−
559+
560560 return TRUE;
561−
561+
562562 error:
563−
563+
564564 // end the class import
565565 type_engine_import_class_end( env );
566−
566+
567567 return FALSE;
568568 }
569569
@@ -586,134 +586,134 @@ static t_CKUINT MidiOut_offset_data = 0; · 16 unmodified lines
586586 t_CKBOOL init_class_Midi( Chuck_Env * env )
587587 {
588588 Chuck_DL_Func * func = NULL;
589−
589+
590590 // init base class
591591 // TODO: ctor/dtor?
592592 if( !type_engine_import_class_begin( env, "MidiMsg", "Object",
593593 env->global(), NULL, NULL ) )
594594 return FALSE;
595−
595+
596596 // add member variable
597597 MidiMsg_offset_data1 = type_engine_import_mvar( env, "int", "data1", FALSE );
598598 if( MidiMsg_offset_data1 == CK_INVALID_OFFSET ) goto error;
599−
599+
600600 // add member variable
601601 MidiMsg_offset_data2 = type_engine_import_mvar( env, "int", "data2", FALSE );
602602 if( MidiMsg_offset_data2 == CK_INVALID_OFFSET ) goto error;
603−
603+
604604 // add member variable
605605 MidiMsg_offset_data3 = type_engine_import_mvar( env, "int", "data3", FALSE );
606606 if( MidiMsg_offset_data3 == CK_INVALID_OFFSET ) goto error;
607−
607+
608608 // add member variable
609609 MidiMsg_offset_when = type_engine_import_mvar( env, "dur", "when", FALSE );
610610 if( MidiMsg_offset_when == CK_INVALID_OFFSET ) goto error;
611−
611+
612612 // end the class import
613613 type_engine_import_class_end( env );
614−
614+
615615 #ifndef __DISABLE_MIDI__
616616 // init base class
617617 if( !type_engine_import_class_begin( env, "MidiIn", "Event",
618618 env->global(), MidiIn_ctor, MidiIn_dtor ) )
619619 return FALSE;
620−
620+
621621 // add open()
622622 func = make_new_mfun( "int", "open", MidiIn_open );
623623 func->add_arg( "int", "port" );
624624 if( !type_engine_import_mfun( env, func ) ) goto error;
625−
625+
626626 // add open() (added 1.3.0.0)
627627 func = make_new_mfun( "int", "open", MidiIn_open_named );
628628 func->add_arg( "string", "name" );
629629 if( !type_engine_import_mfun( env, func ) ) goto error;
630−
630+
631631 // add good()
632632 func = make_new_mfun( "int", "good", MidiIn_good );
633633 if( !type_engine_import_mfun( env, func ) ) goto error;
634−
634+
635635 // add num()
636636 func = make_new_mfun( "int", "num", MidiIn_num );
637637 if( !type_engine_import_mfun( env, func ) ) goto error;
638−
638+
639639 // add name()
640640 func = make_new_mfun( "string", "name", MidiIn_name );
641641 if( !type_engine_import_mfun( env, func ) ) goto error;
642−
642+
643643 // add printerr()
644644 func = make_new_mfun( "void", "printerr", MidiIn_printerr );
645645 func->add_arg( "int", "print_or_not" );
646646 if( !type_engine_import_mfun( env, func ) ) goto error;
647−
647+
648648 // add recv()
649649 func = make_new_mfun( "int", "recv", MidiIn_recv );
650650 func->add_arg( "MidiMsg", "msg" );
651651 if( !type_engine_import_mfun( env, func ) ) goto error;
652−
652+
653653 // add can_wait()
654654 func = make_new_mfun( "int", "can_wait", MidiIn_can_wait );
655655 if( !type_engine_import_mfun( env, func ) ) goto error;
656−
656+
657657 // add member variable
658658 MidiIn_offset_data = type_engine_import_mvar( env, "int", "@MidiIn_data", FALSE );
659659 if( MidiIn_offset_data == CK_INVALID_OFFSET ) goto error;
660−
660+
661661 // end the class import
662662 type_engine_import_class_end( env );
663−
663+
664664 // init base class
665665 if( !type_engine_import_class_begin( env, "MidiOut", "Object",
666666 env->global(), MidiOut_ctor, MidiOut_dtor ) )
667667 return FALSE;
668−
668+
669669 // add open()
670670 func = make_new_mfun( "int", "open", MidiOut_open );
671671 func->add_arg( "int", "port" );
672672 if( !type_engine_import_mfun( env, func ) ) goto error;
673−
673+
674674 // add open() (added 1.3.0.0)
675675 func = make_new_mfun( "int", "open", MidiOut_open_named );
676676 func->add_arg( "string", "name" );
677677 if( !type_engine_import_mfun( env, func ) ) goto error;
678−
678+
679679 // add good()
680680 func = make_new_mfun( "int", "good", MidiOut_good );
681681 if( !type_engine_import_mfun( env, func ) ) goto error;
682−
682+
683683 // add num()
684684 func = make_new_mfun( "int", "num", MidiOut_num );
685685 if( !type_engine_import_mfun( env, func ) ) goto error;
686−
686+
687687 // add name()
688688 func = make_new_mfun( "string", "name", MidiOut_name );
689689 if( !type_engine_import_mfun( env, func ) ) goto error;
690−
690+
691691 // add printerr()
692692 func = make_new_mfun( "void", "printerr", MidiOut_printerr );
693693 func->add_arg( "int", "print_or_not" );
694694 if( !type_engine_import_mfun( env, func ) ) goto error;
695−
695+
696696 // add send()
697697 func = make_new_mfun( "int", "send", MidiOut_send );
698698 func->add_arg( "MidiMsg", "msg" );
699699 if( !type_engine_import_mfun( env, func ) ) goto error;
700−
700+
701701 // add member variable
702702 MidiOut_offset_data = type_engine_import_mvar( env, "int", "@MidiOut_data", FALSE );
703703 if( MidiOut_offset_data == CK_INVALID_OFFSET ) goto error;
704−
704+
705705 // end the class import
706706 type_engine_import_class_end( env );
707−
707+
708708 #endif // __DISABLE_MIDI__
709−
709+
710710 return TRUE;
711−
711+
712712 error:
713−
713+
714714 // end the class import
715715 type_engine_import_class_end( env );
716−
716+
717717 return FALSE;
718718 }
719719
@@ -759,401 +759,401 @@ static t_CKUINT HidOut_offset_data = 0; · 39 unmodified lines
759759 t_CKBOOL init_class_HID( Chuck_Env * env )
760760 {
761761 Chuck_DL_Func * func = NULL;
762−
762+
763763 // init base class
764764 if( !type_engine_import_class_begin( env, "HidMsg", "Object",
765765 env->global(), NULL, NULL ) )
766766 return FALSE;
767−
767+
768768 // add member variable
769769 HidMsg_offset_device_type = type_engine_import_mvar( env, "int", "deviceType", FALSE );
770770 if( HidMsg_offset_device_type == CK_INVALID_OFFSET ) goto error;
771−
771+
772772 // add member variable
773773 HidMsg_offset_device_num = type_engine_import_mvar( env, "int", "deviceNum", FALSE );
774774 if( HidMsg_offset_device_num == CK_INVALID_OFFSET ) goto error;
775−
775+
776776 // add member variable
777777 HidMsg_offset_type = type_engine_import_mvar( env, "int", "type", FALSE );
778778 if( HidMsg_offset_type == CK_INVALID_OFFSET ) goto error;
779−
779+
780780 // add member variable
781781 HidMsg_offset_which = type_engine_import_mvar( env, "int", "which", FALSE );
782782 if( HidMsg_offset_which == CK_INVALID_OFFSET ) goto error;
783−
783+
784784 // add member variable
785785 HidMsg_offset_idata = type_engine_import_mvar( env, "int", "idata", FALSE );
786786 if( HidMsg_offset_idata == CK_INVALID_OFFSET ) goto error;
787−
787+
788788 // add member variable
789789 HidMsg_offset_fdata = type_engine_import_mvar( env, "float", "fdata", FALSE );
790790 if( HidMsg_offset_fdata == CK_INVALID_OFFSET ) goto error;
791−
791+
792792 // add member variable
793793 HidMsg_offset_when = type_engine_import_mvar( env, "time", "when", FALSE );
794794 if( HidMsg_offset_when == CK_INVALID_OFFSET ) goto error;
795−
795+
796796 // add member variable
797797 HidMsg_offset_deltax = type_engine_import_mvar( env, "int", "deltaX", FALSE );
798798 if( HidMsg_offset_deltax == CK_INVALID_OFFSET ) goto error;
799−
799+
800800 // add member variable
801801 HidMsg_offset_deltay = type_engine_import_mvar( env, "int", "deltaY", FALSE );
802802 if( HidMsg_offset_deltay == CK_INVALID_OFFSET ) goto error;
803−
803+
804804 // add member variable
805805 HidMsg_offset_cursorx = type_engine_import_mvar( env, "int", "cursorX", FALSE );
806806 if( HidMsg_offset_cursorx == CK_INVALID_OFFSET ) goto error;
807−
807+
808808 // add member variable
809809 HidMsg_offset_cursory = type_engine_import_mvar( env, "int", "cursorY", FALSE );
810810 if( HidMsg_offset_cursory == CK_INVALID_OFFSET ) goto error;
811−
811+
812812 // add member variable
813813 HidMsg_offset_scaledcursorx = type_engine_import_mvar( env, "float", "scaledCursorX", FALSE );
814814 if( HidMsg_offset_scaledcursorx == CK_INVALID_OFFSET ) goto error;
815−
815+
816816 // add member variable
817817 HidMsg_offset_scaledcursory = type_engine_import_mvar( env, "float", "scaledCursorY", FALSE );
818818 if( HidMsg_offset_scaledcursory == CK_INVALID_OFFSET ) goto error;
819−
819+
820820 // add member variable
821821 HidMsg_offset_x = type_engine_import_mvar( env, "int", "x", FALSE );
822822 if( HidMsg_offset_x == CK_INVALID_OFFSET ) goto error;
823−
823+
824824 // add member variable
825825 HidMsg_offset_y = type_engine_import_mvar( env, "int", "y", FALSE );
826826 if( HidMsg_offset_y == CK_INVALID_OFFSET ) goto error;
827−
827+
828828 // add member variable
829829 HidMsg_offset_z = type_engine_import_mvar( env, "int", "z", FALSE );
830830 if( HidMsg_offset_z == CK_INVALID_OFFSET ) goto error;
831−
831+
832832 // add member variable (added 1.3.0.0)
833833 HidMsg_offset_touchx = type_engine_import_mvar( env, "float", "touchX", FALSE );
834834 if( HidMsg_offset_touchx == CK_INVALID_OFFSET ) goto error;
835−
835+
836836 // add member variable (added 1.3.0.0)
837837 HidMsg_offset_touchy = type_engine_import_mvar( env, "float", "touchY", FALSE );
838838 if( HidMsg_offset_touchy == CK_INVALID_OFFSET ) goto error;
839−
839+
840840 // add member variable (added 1.3.0.0)
841841 HidMsg_offset_touchsize = type_engine_import_mvar( env, "float", "touchSize", FALSE );
842842 if( HidMsg_offset_touchsize == CK_INVALID_OFFSET ) goto error;
843−
843+
844844 // add member variable
845845 HidMsg_offset_axis_position = type_engine_import_mvar( env, "int", "axis_position", FALSE );
846846 if( HidMsg_offset_axis_position == CK_INVALID_OFFSET ) goto error;
847−
847+
848848 // add member variable
849849 HidMsg_offset_axis_position2 = type_engine_import_mvar( env, "float", "axisPosition", FALSE );
850850 if( HidMsg_offset_axis_position2 == CK_INVALID_OFFSET ) goto error;
851−
851+
852852 // add member variable
853853 HidMsg_offset_hat_position = type_engine_import_mvar( env, "int", "hatPosition", FALSE );
854854 if( HidMsg_offset_hat_position == CK_INVALID_OFFSET ) goto error;
855−
855+
856856 // add member variable
857857 HidMsg_offset_ascii = type_engine_import_mvar( env, "int", "ascii", FALSE );
858858 if( HidMsg_offset_ascii == CK_INVALID_OFFSET ) goto error;
859−
859+
860860 // add member variable
861861 HidMsg_offset_key = type_engine_import_mvar( env, "int", "key", FALSE );
862862 if( HidMsg_offset_key == CK_INVALID_OFFSET ) goto error;
863−
863+
864864 // add member variable
865865 HidMsg_offset_scaled_axis_position = type_engine_import_mvar( env, "float", "scaled_axis_position", FALSE );
866866 if( HidMsg_offset_scaled_axis_position == CK_INVALID_OFFSET ) goto error;
867−
867+
868868 // add is_axis_motion()
869869 func = make_new_mfun( "int", "is_axis_motion", HidMsg_is_axis_motion ); // deprecated
870870 if( !type_engine_import_mfun( env, func ) ) goto error;
871−
871+
872872 // add isAxisMotion()
873873 func = make_new_mfun( "int", "isAxisMotion", HidMsg_is_axis_motion );
874874 if( !type_engine_import_mfun( env, func ) ) goto error;
875−
875+
876876 // add is_button_down()
877877 func = make_new_mfun( "int", "is_button_down", HidMsg_is_button_down ); // deprecated
878878 if( !type_engine_import_mfun( env, func ) ) goto error;
879−
879+
880880 // add isButtonDown()
881881 func = make_new_mfun( "int", "isButtonDown", HidMsg_is_button_down );
882882 if( !type_engine_import_mfun( env, func ) ) goto error;
883−
883+
884884 // add is_button_up()
885885 func = make_new_mfun( "int", "is_button_up", HidMsg_is_button_up ); // deprecated
886886 if( !type_engine_import_mfun( env, func ) ) goto error;
887−
887+
888888 // add isButtonUp()
889889 func = make_new_mfun( "int", "isButtonUp", HidMsg_is_button_up );
890890 if( !type_engine_import_mfun( env, func ) ) goto error;
891−
891+
892892 // add is_mouse_motion()
893893 func = make_new_mfun( "int", "is_mouse_motion", HidMsg_is_mouse_motion ); // deprecated
894894 if( !type_engine_import_mfun( env, func ) ) goto error;
895−
895+
896896 // add isMouseMotion()
897897 func = make_new_mfun( "int", "isMouseMotion", HidMsg_is_mouse_motion );
898898 if( !type_engine_import_mfun( env, func ) ) goto error;
899−
899+
900900 // add is_hat_motion()
901901 func = make_new_mfun( "int", "is_hat_motion", HidMsg_is_hat_motion ); // deprecated
902902 if( !type_engine_import_mfun( env, func ) ) goto error;
903−
903+
904904 // add isHatMotion()
905905 func = make_new_mfun( "int", "isHatMotion", HidMsg_is_hat_motion );
906906 if( !type_engine_import_mfun( env, func ) ) goto error;
907−
907+
908908 // add isWheelMotion()
909909 func = make_new_mfun( "int", "isWheelMotion", HidMsg_is_wheel_motion );
910910 if( !type_engine_import_mfun( env, func ) ) goto error;
911−
911+
912912 // end the class import
913913 type_engine_import_class_end( env );
914−
915−
914+
915+
916916 // register deprecate
917917 type_engine_register_deprecate( env, "HidIn", "Hid" );
918−
918+
919919 // init base class Hid (copy of HidIn + constants)
920920 if( !type_engine_import_class_begin( env, "Hid", "Event",
921921 env->global(), HidIn_ctor, HidIn_dtor ) )
922922 return FALSE;
923−
923+
924924 // add open()
925925 func = make_new_mfun( "int", "open", HidIn_open );
926926 func->add_arg( "int", "type" );
927927 func->add_arg( "int", "num" );
928928 if( !type_engine_import_mfun( env, func ) ) goto error;
929−
929+
930930 // add open()
931931 func = make_new_mfun( "int", "open", HidIn_open_named );
932932 func->add_arg( "string", "name" );
933933 if( !type_engine_import_mfun( env, func ) ) goto error;
934−
934+
935935 // add openJoystick()
936936 func = make_new_mfun( "int", "openJoystick", HidIn_open_joystick );
937937 func->add_arg( "int", "num" );
938938 if( !type_engine_import_mfun( env, func ) ) goto error;
939−
939+
940940 // add openMouse()
941941 func = make_new_mfun( "int", "openMouse", HidIn_open_mouse );
942942 func->add_arg( "int", "num" );
943943 if( !type_engine_import_mfun( env, func ) ) goto error;
944−
944+
945945 // add openKeyboard()
946946 func = make_new_mfun( "int", "openKeyboard", HidIn_open_keyboard );
947947 func->add_arg( "int", "num" );
948948 if( !type_engine_import_mfun( env, func ) ) goto error;
949−
949+
950950 // add openTiltSensor()
951951 func = make_new_mfun( "int", "openTiltSensor", HidIn_open_tiltsensor );
952952 if( !type_engine_import_mfun( env, func ) ) goto error;
953−
953+
954954 // add good()
955955 func = make_new_mfun( "int", "good", HidIn_good );
956956 if( !type_engine_import_mfun( env, func ) ) goto error;
957−
957+
958958 // add num()
959959 func = make_new_mfun( "int", "num", HidIn_num );
960960 if( !type_engine_import_mfun( env, func ) ) goto error;
961−
961+
962962 // add name()
963963 func = make_new_mfun( "string", "name", HidIn_name );
964964 if( !type_engine_import_mfun( env, func ) ) goto error;
965−
965+
966966 // add printerr()
967967 func = make_new_mfun( "void", "printerr", HidIn_printerr );
968968 func->add_arg( "int", "print_or_not" );
969969 if( !type_engine_import_mfun( env, func ) ) goto error;
970−
970+
971971 // add recv()
972972 func = make_new_mfun( "int", "recv", HidIn_recv );
973973 func->add_arg( "HidMsg", "msg" );
974974 if( !type_engine_import_mfun( env, func ) ) goto error;
975−
975+
976976 // add read()
977977 func = make_new_mfun( "int", "read", HidIn_read );
978978 func->add_arg( "int", "type" );
979979 func->add_arg( "int", "which" );
980980 func->add_arg( "HidMsg", "msg" );
981981 if( !type_engine_import_mfun( env, func ) ) goto error;
982−
982+
983983 // add send()
984984 func = make_new_mfun( "int", "send", HidIn_send );
985985 func->add_arg( "HidMsg", "msg" );
986986 if( !type_engine_import_mfun( env, func ) ) goto error;
987−
987+
988988 // add can_wait()
989989 func = make_new_mfun( "int", "can_wait", HidIn_can_wait );
990990 if( !type_engine_import_mfun( env, func ) ) goto error;
991−
991+
992992 // add readTiltSensor()
993993 func = make_new_sfun( "int[]", "readTiltSensor", HidIn_read_tilt_sensor );
994994 if( !type_engine_import_sfun( env, func ) ) goto error;
995−
995+
996996 // add globalTiltPollRate()
997997 func = make_new_sfun( "dur", "globalTiltPollRate", HidIn_ctrl_tiltPollRate );
998998 func->add_arg( "dur", "d" );
999999 if( !type_engine_import_sfun( env, func ) ) goto error;
1000−
1000+
10011001 // add globalTiltPollRate()
10021002 func = make_new_sfun( "dur", "globalTiltPollRate", HidIn_cget_tiltPollRate );
10031003 if( !type_engine_import_sfun( env, func ) ) goto error;
1004−
1004+
10051005 // add startCursorTrack()
10061006 func = make_new_sfun( "int", "startCursorTrack", HidIn_start_cursor_track );
10071007 if( !type_engine_import_sfun( env, func ) ) goto error;
1008−
1008+
10091009 // add stopCursorTrack()
10101010 func = make_new_sfun( "int", "stopCursorTrack", HidIn_stop_cursor_track );
10111011 if( !type_engine_import_sfun( env, func ) ) goto error;
1012−
1012+
10131013 // add member variable
10141014 HidIn_offset_data = type_engine_import_mvar( env, "int", "@Hid_data", FALSE );
10151015 if( HidIn_offset_data == CK_INVALID_OFFSET ) goto error;
1016−
1016+
10171017 // add static member variable joystick
10181018 if( type_engine_import_svar( env, "int", "JOYSTICK", TRUE,
10191019 ( t_CKUINT ) &CK_HID_DEV_JOYSTICK ) == FALSE )
10201020 goto error;
1021−
1021+
10221022 // add static member variable keyboard
10231023 if( type_engine_import_svar( env, "int", "KEYBOARD", TRUE,
10241024 ( t_CKUINT ) &CK_HID_DEV_KEYBOARD ) == FALSE )
10251025 goto error;
1026−
1026+
10271027 // add static member variable mouse
10281028 if( type_engine_import_svar( env, "int", "MOUSE", TRUE,
10291029 ( t_CKUINT ) &CK_HID_DEV_MOUSE ) == FALSE )
10301030 goto error;
1031−
1031+
10321032 // add static member variable wii_remote
10331033 if( type_engine_import_svar( env, "int", "WII_REMOTE", TRUE,
10341034 ( t_CKUINT ) &CK_HID_DEV_WIIREMOTE ) == FALSE )
10351035 goto error;
1036−
1036+
10371037 // add static member variable wii_remote
10381038 if( type_engine_import_svar( env, "int", "TILT_SENSOR", TRUE,
10391039 ( t_CKUINT ) &CK_HID_DEV_TILTSENSOR ) == FALSE )
10401040 goto error;
1041−
1041+
10421042 // add static member variable tablet
10431043 if( type_engine_import_svar( env, "int", "TABLET", TRUE,
10441044 ( t_CKUINT ) &CK_HID_DEV_TABLET ) == FALSE )
10451045 goto error;
1046−
1046+
10471047 // add static member variable axisMotion
10481048 if( type_engine_import_svar( env, "int", "AXIS_MOTION", TRUE,
10491049 ( t_CKUINT ) &CK_HID_JOYSTICK_AXIS ) == FALSE )
10501050 goto error;
1051−
1051+
10521052 // add static member variable buttonDown
10531053 if( type_engine_import_svar( env, "int", "BUTTON_DOWN", TRUE,
10541054 ( t_CKUINT ) &CK_HID_BUTTON_DOWN ) == FALSE )
10551055 goto error;
1056−
1056+
10571057 // add static member variable buttonUp
10581058 if( type_engine_import_svar( env, "int", "BUTTON_UP", TRUE,
10591059 ( t_CKUINT ) &CK_HID_BUTTON_UP ) == FALSE )
10601060 goto error;
1061−
1061+
10621062 // add static member variable joystickHat
10631063 if( type_engine_import_svar( env, "int", "JOYSTICK_HAT", TRUE,
10641064 ( t_CKUINT ) &CK_HID_JOYSTICK_HAT ) == FALSE )
10651065 goto error;
1066−
1066+
10671067 // add static member variable JOYSTICK_BALL
10681068 if( type_engine_import_svar( env, "int", "JOYSTICK_BALL", TRUE,
10691069 ( t_CKUINT ) &CK_HID_JOYSTICK_BALL ) == FALSE )
10701070 goto error;
1071−
1071+
10721072 // add static member variable mouseMotion
10731073 if( type_engine_import_svar( env, "int", "MOUSE_MOTION", TRUE,
10741074 ( t_CKUINT ) &CK_HID_MOUSE_MOTION ) == FALSE )
10751075 goto error;
1076−
1076+
10771077 // add static member variable mouseWheel
10781078 if( type_engine_import_svar( env, "int", "MOUSE_WHEEL", TRUE,
10791079 ( t_CKUINT ) &CK_HID_MOUSE_WHEEL ) == FALSE )
10801080 goto error;
1081−
1081+
10821082 // add static member variable DEVICE_CONNECTED
10831083 if( type_engine_import_svar( env, "int", "DEVICE_CONNECTED", TRUE,
10841084 ( t_CKUINT ) &CK_HID_DEVICE_CONNECTED ) == FALSE )
10851085 goto error;
1086−
1086+
10871087 // add static member variable DEVICE_DISCONNECTED
10881088 if( type_engine_import_svar( env, "int", "DEVICE_DISCONNECTED", TRUE,
10891089 ( t_CKUINT ) &CK_HID_DEVICE_DISCONNECTED ) == FALSE )
10901090 goto error;
1091−
1091+
10921092 // add static member variable ACCELEROMETER
10931093 if( type_engine_import_svar( env, "int", "ACCELEROMETER", TRUE,
10941094 ( t_CKUINT ) &CK_HID_ACCELEROMETER ) == FALSE )
10951095 goto error;
1096−
1096+
10971097 // add static member variable LED
10981098 if( type_engine_import_svar( env, "int", "LED", TRUE,
10991099 ( t_CKUINT ) &CK_HID_LED ) == FALSE )
11001100 goto error;
1101−
1101+
11021102 // add static member variable LED
11031103 if( type_engine_import_svar( env, "int", "FORCE_FEEDBACK", TRUE,
11041104 ( t_CKUINT ) &CK_HID_FORCE_FEEDBACK ) == FALSE )
11051105 goto error;
1106−
1106+
11071107 // end the class import
11081108 type_engine_import_class_end( env );
1109−
1109+
11101110 /*
11111111 // init base class
11121112 if( !type_engine_import_class_begin( env, "HidOut", "Object",
11131113 env->global(), HidOut_ctor ) )
11141114 return FALSE;
1115−
1115+
11161116 // add open()
11171117 func = make_new_mfun( "int", "open", HidOut_open );
11181118 func->add_arg( "int", "port" );
11191119 if( !type_engine_import_mfun( env, func ) ) goto error;
1120−
1120+
11211121 // add good()
11221122 func = make_new_mfun( "int", "good", HidOut_good );
11231123 if( !type_engine_import_mfun( env, func ) ) goto error;
1124−
1124+
11251125 // add num()
11261126 func = make_new_mfun( "int", "num", HidOut_num );
11271127 if( !type_engine_import_mfun( env, func ) ) goto error;
1128−
1128+
11291129 // add name()
11301130 func = make_new_mfun( "string", "name", HidOut_name );
11311131 if( !type_engine_import_mfun( env, func ) ) goto error;
1132−
1132+
11331133 // add printerr()
11341134 func = make_new_mfun( "void", "printerr", HidOut_printerr );
11351135 func->add_arg( "int", "print_or_not" );
11361136 if( !type_engine_import_mfun( env, func ) ) goto error;
1137−
1137+
11381138 // add send()
11391139 func = make_new_mfun( "int", "send", HidOut_send );
11401140 func->add_arg( "HidMsg", "msg" );
11411141 if( !type_engine_import_mfun( env, func ) ) goto error;
1142−
1142+
11431143 // add member variable
11441144 HidOut_offset_data = type_engine_import_mvar( env, "int", "@HidOut_data", FALSE );
11451145 if( HidOut_offset_data == CK_INVALID_OFFSET ) goto error;
1146−
1146+
11471147 // end the class import
11481148 type_engine_import_class_end( env );
11491149 */
11501150 return TRUE;
1151−
1151+
11521152 error:
1153−
1153+
11541154 // end the class import
11551155 type_engine_import_class_end( env );
1156−
1156+
11571157 return FALSE;
11581158 }
11591159 #endif // __DISABLE_HID__
@@ -1174,104 +1174,104 @@ static t_CKUINT MidiMsgIn_offset_data = 0; · 14 unmodified lines
11741174 t_CKBOOL init_class_MidiRW( Chuck_Env * env )
11751175 {
11761176 Chuck_DL_Func * func = NULL;
1177−
1177+
11781178 // init base class
11791179 if( !type_engine_import_class_begin( env, "MidiRW", "Object",
11801180 env->global(), MidiRW_ctor, MidiRW_dtor ) )
11811181 return FALSE;
1182−
1182+
11831183 // add open()
11841184 func = make_new_mfun( "int", "open", MidiRW_open );
11851185 func->add_arg( "string", "filename" );
11861186 if( !type_engine_import_mfun( env, func ) ) goto error;
1187−
1187+
11881188 // add close()
11891189 func = make_new_mfun( "int", "close", MidiRW_close );
11901190 if( !type_engine_import_mfun( env, func ) ) goto error;
1191−
1191+
11921192 // add write()
11931193 func = make_new_mfun( "int", "write", MidiRW_write );
11941194 func->add_arg( "MidiMsg", "msg" );
11951195 func->add_arg( "time", "t" );
11961196 if( !type_engine_import_mfun( env, func ) ) goto error;
1197−
1197+
11981198 // add read()
11991199 func = make_new_mfun( "int", "read", MidiRW_read );
12001200 func->add_arg( "MidiMsg", "msg" );
12011201 //func->add_arg( "time", "t" );
12021202 if( !type_engine_import_mfun( env, func ) ) goto error;
1203−
1203+
12041204 // add member variable
12051205 MidiRW_offset_data = type_engine_import_mvar( env, "int", "@MidiRW_data", FALSE );
12061206 if( MidiRW_offset_data == CK_INVALID_OFFSET ) goto error;
1207−
1207+
12081208 // end the class import
12091209 type_engine_import_class_end( env );
1210−
1210+
12111211 // init base class
12121212 if( !type_engine_import_class_begin( env, "MidiMsgOut", "Object",
12131213 env->global(), MidiMsgOut_ctor, MidiMsgOut_dtor ) )
12141214 return FALSE;
1215−
1215+
12161216 // add open()
12171217 func = make_new_mfun( "int", "open", MidiMsgOut_open );
12181218 func->add_arg( "string", "filename" );
12191219 if( !type_engine_import_mfun( env, func ) ) goto error;
1220−
1220+
12211221 // add close()
12221222 func = make_new_mfun( "int", "close", MidiMsgOut_close );
12231223 if( !type_engine_import_mfun( env, func ) ) goto error;
1224−
1224+
12251225 // add write()
12261226 func = make_new_mfun( "int", "write", MidiMsgOut_write );
12271227 func->add_arg( "MidiMsg", "msg" );
12281228 func->add_arg( "time", "t" );
12291229 if( !type_engine_import_mfun( env, func ) ) goto error;
1230−
1230+
12311231 // add member variable
12321232 MidiMsgOut_offset_data = type_engine_import_mvar( env, "int", "@MidiMsgOut_data", FALSE );
12331233 if( MidiMsgOut_offset_data == CK_INVALID_OFFSET ) goto error;
1234−
1234+
12351235 // end the class import
12361236 type_engine_import_class_end( env );
1237−
1237+
12381238 // init base class
12391239 if( !type_engine_import_class_begin( env, "MidiMsgIn", "Object",
12401240 env->global(), MidiMsgIn_ctor, MidiMsgIn_dtor ) )
12411241 return FALSE;
1242−
1242+
12431243 // add open()
12441244 func = make_new_mfun( "int", "open", MidiMsgIn_open );
12451245 func->add_arg( "string", "filename" );
12461246 if( !type_engine_import_mfun( env, func ) ) goto error;
1247−
1247+
12481248 // add close()
12491249 func = make_new_mfun( "int", "close", MidiMsgIn_close );
12501250 if( !type_engine_import_mfun( env, func ) ) goto error;
1251−
1251+
12521252 // add read()
12531253 func = make_new_mfun( "int", "read", MidiMsgIn_read );
12541254 func->add_arg( "MidiMsg", "msg" );
12551255 //func->add_arg( "time", "t" );
12561256 if( !type_engine_import_mfun( env, func ) ) goto error;
1257−
1257+
12581258 // add member variable
12591259 MidiMsgIn_offset_data = type_engine_import_mvar( env, "int", "@MidiMsgIn_data", FALSE );
12601260 if( MidiMsgIn_offset_data == CK_INVALID_OFFSET ) goto error;
1261−
1261+
12621262 // end the class import
12631263 type_engine_import_class_end( env );
1264−
1264+
12651265 // initialize
12661266 // HidInManager::init();
1267−
1267+
12681268 return TRUE;
1269−
1269+
12701270 error:
1271−
1271+
12721272 // end the class import
12731273 type_engine_import_class_end( env );
1274−
1274+
12751275 return FALSE;
12761276 }
12771277 #endif // __DISABLE_MIDI__
@@ -1298,7 +1298,7 @@ CK_DLL_SFUN( io_newline ) · 20 unmodified lines
12981298 }
12991299
13001300
1301−#ifndef __DISABLE_FILEIO__
1301+// #ifndef __DISABLE_FILEIO__
13021302 //-----------------------------------------------------------------------------
13031303 // FileIO API
13041304 //-----------------------------------------------------------------------------
@@ -1313,8 +1313,8 @@ CK_DLL_MFUN( fileio_open ) · 8 unmodified lines
13131313 std::string filename = GET_NEXT_STRING(ARGS)->str();
13141314 Chuck_IO_File * f = (Chuck_IO_File *)SELF;
13151315 t_CKINT default_flags =
1316− Chuck_IO_File::FLAG_READ_WRITE | Chuck_IO_File::TYPE_ASCII;
1317−
1316+ Chuck_IO::FLAG_READ_WRITE | Chuck_IO::TYPE_ASCII;
1317+
13181318 RETURN->v_int = f->open(filename, default_flags);
13191319 }
13201320
@@ -1323,7 +1323,7 @@ CK_DLL_MFUN( fileio_openflags ) · 2 unmodified lines
13231323 Chuck_IO_File * f = (Chuck_IO_File *)SELF;
13241324 std::string filename = GET_NEXT_STRING(ARGS)->str();
13251325 t_CKINT flags = GET_NEXT_INT(ARGS);
1326−
1326+
13271327 RETURN->v_int = f->open(filename, flags);
13281328 }
13291329
@@ -1354,7 +1354,7 @@ CK_DLL_MFUN( fileio_getmode ) · 24 unmodified lines
13541354 CK_DLL_MFUN( fileio_setmode )
13551355 {
13561356 t_CKINT flag = GET_NEXT_INT(ARGS);
1357−
1357+
13581358 Chuck_IO_File * f = (Chuck_IO_File *)SELF;
13591359 f->mode( flag );
13601360 RETURN->v_int = 0;
@@ -1369,7 +1369,7 @@ CK_DLL_MFUN( fileio_size ) · 8 unmodified lines
13691369 CK_DLL_MFUN( fileio_seek )
13701370 {
13711371 t_CKINT pos = GET_NEXT_INT(ARGS);
1372−
1372+
13731373 Chuck_IO_File * f = (Chuck_IO_File *)SELF;
13741374 f->seek(pos);
13751375 }
@@ -1398,7 +1398,7 @@ CK_DLL_MFUN( fileio_dirlist ) · 22 unmodified lines
13981398 {
13991399 t_CKINT len = GET_NEXT_INT(ARGS);
14001400 Chuck_IO_File * f = (Chuck_IO_File *)SELF;
1401−
1401+
14021402 Chuck_String * s = f->read( len );
14031403 RETURN->v_object = s;
14041404 }
@@ -1415,31 +1415,34 @@ CK_DLL_MFUN( fileio_readint ) · 10 unmodified lines
14151415 {
14161416 Chuck_IO_File * f = (Chuck_IO_File *)SELF;
14171417 t_CKINT defaultflags = Chuck_IO::INT32;
1418−
1418+
14191419 /* (ATODO: doesn't look like asynchronous reading will work)
1420− if (f->mode() == Chuck_IO::MODE_ASYNC)
1421− {
1422− // set up arguments
1423− Chuck_IO::async_args *args = new Chuck_IO::async_args;
1424− args->RETURN = (void *)RETURN;
1425− args->fileio_obj = f;
1426− args->intArg = defaultflags;
1427− // set shred to wait for I/O completion
1428− f->m_asyncEvent->wait( SHRED, SHRED->vm_ref );
1429− // start thread
1430− bool ret = f->m_thread->start( f->readInt_thread, (void *)args );
1431− if (!ret) {
1432− cerr << "m_thread->start failed; recreating m_thread" << endl;
1433− delete f->m_thread;
1434− f->m_thread = new XThread;
1435− ret = f->m_thread->start( f->readInt_thread, (void *)args );
1436− if (!ret) {
1437− EM_error3( "(FileIO): failed to start thread for asynchronous mode I/O" );
1438− }
1439− }
1440− } else {*/
1420+ if (f->mode() == Chuck_IO::MODE_ASYNC)
1421+ {
1422+ // set up arguments
1423+ Chuck_IO::async_args *args = new Chuck_IO::async_args;
1424+ args->RETURN = (void *)RETURN;
1425+ args->fileio_obj = f;
1426+ args->intArg = defaultflags;
1427+ // set shred to wait for I/O completion
1428+ f->m_asyncEvent->wait( SHRED, SHRED->vm_ref );
1429+ // start thread
1430+ bool ret = f->m_thread->start( f->readInt_thread, (void *)args );
1431+ if (!ret)
1432+ {
1433+ cerr << "m_thread->start failed; recreating m_thread" << endl;
1434+ delete f->m_thread;
1435+ f->m_thread = new XThread;
1436+ ret = f->m_thread->start( f->readInt_thread, (void *)args );
1437+ if (!ret) {
1438+ EM_error3( "(FileIO): failed to start thread for asynchronous mode I/O" );
1439+ }
1440+ }
1441+ } else {*/
1442+
14411443 t_CKINT ret = f->readInt( defaultflags );
14421444 RETURN->v_int = ret;
1445+
14431446 //}
14441447 // ATODO: Debug
14451448 //sleep(1);
@@ -1449,10 +1452,8 @@ CK_DLL_MFUN( fileio_readint ) · 3 unmodified lines
14491452 CK_DLL_MFUN( fileio_readintflags )
14501453 {
14511454 t_CKINT flags = GET_NEXT_INT(ARGS);
1452−
14531455 Chuck_IO_File * f = (Chuck_IO_File *)SELF;
14541456 t_CKINT ret = f->readInt( flags );
1455−
14561457 RETURN->v_int = ret;
14571458 }
14581459
@@ -1480,8 +1481,9 @@ CK_DLL_MFUN( fileio_more ) · 21 unmodified lines
14801481 CK_DLL_MFUN( fileio_writestring )
14811482 {
14821483 std::string val = GET_NEXT_STRING(ARGS)->str();
1483−
14841484 Chuck_IO_File * f = (Chuck_IO_File *)SELF;
1485+
1486+#ifndef __DISABLE_FILEIO__ // 1.4.2.1 (ge) | made more granular (e.g., for WebChucK)
14851487 if (f->mode() == Chuck_IO::MODE_ASYNC)
14861488 {
14871489 // set up arguments
@@ -1507,13 +1509,17 @@ CK_DLL_MFUN( fileio_writestring ) · 19 unmodified lines
15071509 } else {
15081510 f->write(val);
15091511 }
1512+#else
1513+ f->write(val);
1514+#endif // __DISABLE_FILEIO__
15101515 }
15111516
15121517 CK_DLL_MFUN( fileio_writeint )
15131518 {
15141519 t_CKINT val = GET_NEXT_INT(ARGS);
1515−
15161520 Chuck_IO_File * f = (Chuck_IO_File *)SELF;
1521+
1522+#ifndef __DISABLE_FILEIO__ // 1.4.2.1 (ge) | made more granular (e.g., for WebChucK)
15171523 if (f->mode() == Chuck_IO::MODE_ASYNC)
15181524 {
15191525 // set up arguments
@@ -1539,14 +1545,18 @@ CK_DLL_MFUN( fileio_writeint ) · 19 unmodified lines
15391545 } else {
15401546 f->write(val);
15411547 }
1548+#else
1549+ f->write(val);
1550+#endif // __DISABLE_FILEIO__
15421551 }
15431552
15441553 CK_DLL_MFUN( fileio_writeintflags )
15451554 {
15461555 t_CKINT val = GET_NEXT_INT(ARGS);
15471556 t_CKINT flags = GET_NEXT_INT(ARGS);
1548−
15491557 Chuck_IO_File * f = (Chuck_IO_File *)SELF;
1558+
1559+#ifndef __DISABLE_FILEIO__ // 1.4.2.1 (ge) | made more granular (e.g., for WebChucK)
15501560 if (f->mode() == Chuck_IO::MODE_ASYNC)
15511561 {
15521562 // TODO: pass flags in args
@@ -1573,13 +1583,18 @@ CK_DLL_MFUN( fileio_writeintflags ) · 20 unmodified lines
15731583 } else {
15741584 f->write(val, flags);
15751585 }
1586+#else
1587+ f->write(val, flags);
1588+#endif // __DISABLE_FILEIO__
1589+
15761590 }
15771591
15781592 CK_DLL_MFUN( fileio_writefloat )
15791593 {
15801594 t_CKFLOAT val = GET_NEXT_FLOAT(ARGS);
1581−
15821595 Chuck_IO_File * f = (Chuck_IO_File *)SELF;
1596+
1597+#ifndef __DISABLE_FILEIO__ // 1.4.2.1 (ge) | made more granular (e.g., for WebChucK)
15831598 if (f->mode() == Chuck_IO::MODE_ASYNC)
15841599 {
15851600 // set up arguments
@@ -1605,8 +1620,14 @@ CK_DLL_MFUN( fileio_writefloat ) · 19 unmodified lines
16051620 } else {
16061621 f->write(val);
16071622 }
1623+#else
1624+ f->write(val);
1625+#endif //__DISABLE_FILEIO__
16081626 }
1609−#endif // __DISABLE_FILEIO__
1627+
1628+// #endif // __DISABLE_FILEIO__
1629+
1630+
16101631
16111632
16121633 //-----------------------------------------------------------------------------
@@ -1651,7 +1672,7 @@ CK_DLL_MFUN( chout_setmode ) · 38 unmodified lines
16511672 {
16521673 t_CKINT len = GET_NEXT_INT(ARGS);
16531674 Chuck_IO_File * f = (Chuck_IO_File *)SELF;
1654−
1675+
16551676 Chuck_String * s = f->read( len );
16561677 RETURN->v_object = s;
16571678 }
@@ -1673,10 +1694,10 @@ CK_DLL_MFUN( chout_readint ) · 15 unmodified lines
16731694 CK_DLL_MFUN( chout_readintflags )
16741695 {
16751696 t_CKINT flags = GET_NEXT_INT(ARGS);
1676−
1697+
16771698 Chuck_IO_Chout * c = SHRED->vm_ref->chout();
16781699 t_CKINT ret = c->readInt( flags );
1679−
1700+
16801701 RETURN->v_int = ret;
16811702 }
16821703
@@ -1704,15 +1725,18 @@ CK_DLL_MFUN( chout_more ) · 21 unmodified lines
17041725 CK_DLL_MFUN( chout_writestring )
17051726 {
17061727 std::string val = GET_NEXT_STRING(ARGS)->str();
1707−
1728+
17081729 Chuck_IO_Chout * c = SHRED->vm_ref->chout();
17091730 c->write( val );
1731+
1732+ // 1.4.2.1 | (ge) added a single newline -> trigger chout flush
1733+ if( val == "\n" ) c->flush();
17101734 }
17111735
17121736 CK_DLL_MFUN( chout_writeint )
17131737 {
17141738 t_CKINT val = GET_NEXT_INT(ARGS);
1715−
1739+
17161740 Chuck_IO_Chout * c = SHRED->vm_ref->chout();
17171741 c->write(val);
17181742 }
@@ -1720,7 +1744,7 @@ CK_DLL_MFUN( chout_writeint ) · 1 unmodified line
17201744 CK_DLL_MFUN( chout_writefloat )
17211745 {
17221746 t_CKFLOAT val = GET_NEXT_FLOAT(ARGS);
1723−
1747+
17241748 Chuck_IO_Chout * c = SHRED->vm_ref->chout();
17251749 c->write(val);
17261750 }
@@ -1770,7 +1794,7 @@ CK_DLL_MFUN( cherr_setmode ) · 43 unmodified lines
17701794 {
17711795 t_CKINT len = GET_NEXT_INT(ARGS);
17721796 Chuck_IO_File * f = (Chuck_IO_File *)SELF;
1773−
1797+
17741798 Chuck_String * s = f->read( len );
17751799 RETURN->v_object = s;
17761800 }
@@ -1792,10 +1816,10 @@ CK_DLL_MFUN( cherr_readint ) · 15 unmodified lines
17921816 CK_DLL_MFUN( cherr_readintflags )
17931817 {
17941818 t_CKINT flags = GET_NEXT_INT(ARGS);
1795−
1819+
17961820 Chuck_IO_Cherr * c = SHRED->vm_ref->cherr();
17971821 t_CKINT ret = c->readInt( flags );
1798−
1822+
17991823 RETURN->v_int = ret;
18001824 }
18011825
@@ -1823,7 +1847,7 @@ CK_DLL_MFUN( cherr_more ) · 21 unmodified lines
18231847 CK_DLL_MFUN( cherr_writestring )
18241848 {
18251849 std::string val = GET_NEXT_STRING(ARGS)->str();
1826−
1850+
18271851 Chuck_IO_Cherr * c = SHRED->vm_ref->cherr();
18281852 c->write( val );
18291853 }
@@ -1831,7 +1855,7 @@ CK_DLL_MFUN( cherr_writestring ) · 1 unmodified line
18311855 CK_DLL_MFUN( cherr_writeint )
18321856 {
18331857 t_CKINT val = GET_NEXT_INT(ARGS);
1834−
1858+
18351859 Chuck_IO_Chout * c = SHRED->vm_ref->chout();
18361860 c->write(val);
18371861 }
@@ -1839,7 +1863,7 @@ CK_DLL_MFUN( cherr_writeint ) · 1 unmodified line
18391863 CK_DLL_MFUN( cherr_writefloat )
18401864 {
18411865 t_CKFLOAT val = GET_NEXT_FLOAT(ARGS);
1842−
1866+
18431867 Chuck_IO_Cherr * c = SHRED->vm_ref->cherr();
18441868 c->write(val);
18451869 }
@@ -2149,7 +2173,7 @@ CK_DLL_MFUN( HidIn_recv ) · 303 unmodified lines
21492173 OBJ_MEMBER_INT(fake_msg, HidMsg_offset_which) = the_msg.eid;
21502174 OBJ_MEMBER_INT(fake_msg, HidMsg_offset_idata) = the_msg.idata[0];
21512175 OBJ_MEMBER_FLOAT(fake_msg, HidMsg_offset_fdata) = the_msg.fdata[0];
2152−
2176+
21532177 // mouse motion specific member variables
21542178 OBJ_MEMBER_INT(fake_msg, HidMsg_offset_deltax) = the_msg.idata[0];
21552179 OBJ_MEMBER_INT(fake_msg, HidMsg_offset_deltay) = the_msg.idata[1];
@@ -2157,24 +2181,24 @@ CK_DLL_MFUN( HidIn_recv ) · 1 unmodified line
21572181 OBJ_MEMBER_INT(fake_msg, HidMsg_offset_cursory) = the_msg.idata[3];
21582182 OBJ_MEMBER_FLOAT(fake_msg, HidMsg_offset_scaledcursorx) = the_msg.fdata[0];
21592183 OBJ_MEMBER_FLOAT(fake_msg, HidMsg_offset_scaledcursory) = the_msg.fdata[1];
2160−
2184+
21612185 // axis motion specific member variables
21622186 OBJ_MEMBER_INT(fake_msg, HidMsg_offset_axis_position) = the_msg.idata[0];
21632187 OBJ_MEMBER_FLOAT(fake_msg, HidMsg_offset_scaled_axis_position) = the_msg.fdata[0];
21642188 OBJ_MEMBER_FLOAT(fake_msg, HidMsg_offset_axis_position2) = the_msg.fdata[0];
2165−
2189+
21662190 // hat motion specific variables
21672191 OBJ_MEMBER_INT(fake_msg, HidMsg_offset_hat_position) = the_msg.idata[0];
2168−
2192+
21692193 // keyboard specific variables
21702194 OBJ_MEMBER_INT(fake_msg, HidMsg_offset_key) = the_msg.idata[1];
21712195 OBJ_MEMBER_INT(fake_msg, HidMsg_offset_ascii) = the_msg.idata[2];
2172−
2196+
21732197 // accelerometer (tilt sensor, wii remote) specific members
21742198 OBJ_MEMBER_INT(fake_msg, HidMsg_offset_x) = the_msg.idata[0];
21752199 OBJ_MEMBER_INT(fake_msg, HidMsg_offset_y) = the_msg.idata[1];
21762200 OBJ_MEMBER_INT(fake_msg, HidMsg_offset_z) = the_msg.idata[2];
2177−
2201+
21782202 // multitouch stuff - added 1.3.0.0
21792203 OBJ_MEMBER_FLOAT(fake_msg, HidMsg_offset_touchx) = the_msg.fdata[0];
21802204 OBJ_MEMBER_FLOAT(fake_msg, HidMsg_offset_touchy) = the_msg.fdata[1];
@@ -2188,21 +2212,21 @@ CK_DLL_MFUN( HidIn_read ) · 7 unmodified lines
21882212 t_CKINT type = GET_NEXT_INT(ARGS);
21892213 t_CKINT num = GET_NEXT_INT(ARGS);
21902214 Chuck_Object * fake_msg = GET_NEXT_OBJECT(ARGS);
2191−
2215+
21922216 HidMsg the_msg;
2193−
2217+
21942218 RETURN->v_int = min->read( type, num, &the_msg );
2195−
2219+
21962220 if( RETURN->v_int )
21972221 {
21982222 OBJ_MEMBER_INT(fake_msg, HidMsg_offset_device_type) = the_msg.device_type;
21992223 OBJ_MEMBER_INT(fake_msg, HidMsg_offset_device_num) = the_msg.device_num;
22002224 OBJ_MEMBER_INT(fake_msg, HidMsg_offset_type) = the_msg.type;
22012225 OBJ_MEMBER_INT(fake_msg, HidMsg_offset_which) = the_msg.eid;
2202−
2226+
22032227 OBJ_MEMBER_INT(fake_msg, HidMsg_offset_idata) = the_msg.idata[0];
22042228 OBJ_MEMBER_FLOAT(fake_msg, HidMsg_offset_fdata) = the_msg.fdata[0];
2205−
2229+
22062230 // mouse motion specific member members
22072231 OBJ_MEMBER_INT(fake_msg, HidMsg_offset_deltax) = the_msg.idata[0];
22082232 OBJ_MEMBER_INT(fake_msg, HidMsg_offset_deltay) = the_msg.idata[1];
@@ -2210,19 +2234,19 @@ CK_DLL_MFUN( HidIn_read ) · 1 unmodified line
22102234 OBJ_MEMBER_INT(fake_msg, HidMsg_offset_cursory) = the_msg.idata[3];
22112235 OBJ_MEMBER_FLOAT(fake_msg, HidMsg_offset_scaledcursorx) = the_msg.fdata[0];
22122236 OBJ_MEMBER_FLOAT(fake_msg, HidMsg_offset_scaledcursory) = the_msg.fdata[1];
2213−
2237+
22142238 // joystick axis specific member members
22152239 OBJ_MEMBER_INT(fake_msg, HidMsg_offset_axis_position) = the_msg.idata[0];
22162240 OBJ_MEMBER_FLOAT(fake_msg, HidMsg_offset_scaled_axis_position) = the_msg.fdata[0];
22172241 OBJ_MEMBER_FLOAT(fake_msg, HidMsg_offset_axis_position2) = the_msg.fdata[0];
2218−
2242+
22192243 // joystick hat specific member members
22202244 OBJ_MEMBER_INT(fake_msg, HidMsg_offset_hat_position) = the_msg.idata[0];
2221−
2245+
22222246 // keyboard specific members
22232247 OBJ_MEMBER_INT(fake_msg, HidMsg_offset_key) = the_msg.idata[1];
22242248 OBJ_MEMBER_INT(fake_msg, HidMsg_offset_ascii) = the_msg.idata[2];
2225−
2249+
22262250 // accelerometer (tilt sensor, wii remote) specific members
22272251 OBJ_MEMBER_INT(fake_msg, HidMsg_offset_x) = the_msg.idata[0];
22282252 OBJ_MEMBER_INT(fake_msg, HidMsg_offset_y) = the_msg.idata[1];
@@ -2234,14 +2258,14 @@ CK_DLL_MFUN( HidIn_send ) · 5 unmodified lines
22342258 {
22352259 HidIn * min = (HidIn *)OBJ_MEMBER_INT(SELF, HidIn_offset_data);
22362260 Chuck_Object * fake_msg = GET_NEXT_OBJECT(ARGS);
2237−
2261+
22382262 HidMsg the_msg;
22392263 the_msg.device_type = OBJ_MEMBER_INT( fake_msg, HidMsg_offset_device_type );
22402264 the_msg.device_num = OBJ_MEMBER_INT( fake_msg, HidMsg_offset_device_num );
22412265 the_msg.type = OBJ_MEMBER_INT( fake_msg, HidMsg_offset_type );
22422266 the_msg.eid = OBJ_MEMBER_INT( fake_msg, HidMsg_offset_which );
22432267 the_msg.idata[0] = OBJ_MEMBER_INT( fake_msg, HidMsg_offset_idata );
2244−
2268+
22452269 RETURN->v_int = min->send( &the_msg );
22462270 }
22472271
@@ -2255,19 +2279,19 @@ CK_DLL_SFUN( HidIn_read_tilt_sensor ) · 7 unmodified lines
22552279 {
22562280 static HidIn * hi;
22572281 static t_CKBOOL hi_good = TRUE;
2258−
2282+
22592283 Chuck_Array4 * array = new Chuck_Array4( FALSE, 3 );
22602284 array->set( 0, 0 );
22612285 array->set( 1, 0 );
22622286 array->set( 2, 0 );
2263−
2287+
22642288 // TODO: reference count?
22652289 array->add_ref();
22662290 RETURN->v_object = array;
2267−
2291+
22682292 if( hi_good == FALSE )
22692293 return;
2270−
2294+
22712295 if( !hi )
22722296 {
22732297 hi = new HidIn;
@@ -2277,14 +2301,14 @@ CK_DLL_SFUN( HidIn_read_tilt_sensor ) · 3 unmodified lines
22772301 return;
22782302 }
22792303 }
2280−
2304+
22812305 HidMsg msg;
2282−
2306+
22832307 if( !hi->read( CK_HID_ACCELEROMETER, 0, &msg ) )
22842308 {
22852309 return;
22862310 }
2287−
2311+
22882312 array->set( 0, msg.idata[0] );
22892313 array->set( 1, msg.idata[1] );
22902314 array->set( 2, msg.idata[2] );
@@ -2301,16 +2325,16 @@ CK_DLL_SFUN( HidIn_ctrl_tiltPollRate ) · 10 unmodified lines
23012325 return;
23022326 }
23032327 t_CKFLOAT srate = SHRED->vm_ref->srate();
2304−
2328+
23052329 // get arg
23062330 t_CKDUR v = GET_NEXT_DUR( ARGS );
2307−
2331+
23082332 // get in microseconds
23092333 t_CKINT usec = (t_CKINT)( v / srate * 1000000 );
2310−
2334+
23112335 // make sure it's nonnegative
23122336 if( usec < 0 ) usec = 0;
2313−
2337+
23142338 // go
23152339 RETURN->v_dur = TiltSensor_setPollRate( usec ) * srate / 1000000;
23162340 }
@@ -2326,7 +2350,7 @@ CK_DLL_SFUN( HidIn_cget_tiltPollRate ) · 9 unmodified lines
23262350 return;
23272351 }
23282352 t_CKFLOAT srate = SHRED->vm_ref->srate();
2329−
2353+
23302354 RETURN->v_dur = TiltSensor_getPollRate() * srate / 1000000;
23312355 }
23322356
@@ -2617,18 +2641,18 @@ CK_DLL_MFUN(serialio_canWait); · 284 unmodified lines
26172641 void * Chuck_IO_Serial::shell_read_cb( void *_this )
26182642 {
26192643 Chuck_IO_Serial *cereal = (Chuck_IO_Serial *) _this;
2620−
2644+
26212645 cereal->read_cb();
2622−
2646+
26232647 return NULL;
26242648 }
26252649
26262650 void * Chuck_IO_Serial::shell_write_cb( void *_this )
26272651 {
26282652 Chuck_IO_Serial *cereal = (Chuck_IO_Serial *) _this;
2629−
2653+
26302654 cereal->write_cb();
2631−
2655+
26322656 return NULL;
26332657 }
26342658
@@ -2651,24 +2675,24 @@ m_writeBuffer(1024) · 16 unmodified lines
26512675 {
26522676 m_fd = -1;
26532677 m_cfd = NULL;
2654−
2678+
26552679 m_io_buf_max = CHUCK_IO_DEFAULT_BUFSIZE;
26562680 m_io_buf = new unsigned char[m_io_buf_max];
26572681 m_io_buf_pos = m_io_buf_available = 0;
2658−
2682+
26592683 m_tmp_buf_max = CHUCK_IO_DEFAULT_BUFSIZE;
26602684 m_tmp_buf = new unsigned char[m_tmp_buf_max];
2661−
2685+
26622686 m_read_thread = NULL;
26632687 m_event_buffer = NULL;
2664−
2688+
26652689 m_write_thread = NULL;
26662690 m_do_write_thread = TRUE;
26672691
26682692 m_do_exit = FALSE;
2669−
2693+
26702694 s_serials.push_back(this);
2671−
2695+
26722696 m_vmRef = vm;
26732697 }
26742698
@@ -2679,16 +2703,16 @@ Chuck_IO_Serial::~Chuck_IO_Serial() · 4 unmodified lines
26792703 SAFE_DELETE(m_read_thread);
26802704 if( m_event_buffer )
26812705 m_vmRef->destroy_event_buffer( m_event_buffer );
2682−
2706+
26832707 close();
2684−
2708+
26852709 SAFE_DELETE(m_io_buf);
26862710 m_io_buf_max = 0;
26872711 m_io_buf_pos = m_io_buf_available = 0;
2688−
2712+
26892713 SAFE_DELETE(m_tmp_buf);
26902714 m_tmp_buf_max = 0;
2691−
2715+
26922716 s_serials.remove(this);
26932717 }
26942718
@@ -2699,9 +2723,9 @@ t_CKBOOL Chuck_IO_Serial::ready() · 4 unmodified lines
26992723 pollfds.fd = m_fd;
27002724 pollfds.events = POLLIN;
27012725 pollfds.revents = 0;
2702−
2726+
27032727 int result = poll(&pollfds, 1, 0);
2704−
2728+
27052729 if( result > 0 && (pollfds.revents & POLLIN) ) return TRUE;
27062730 else return FALSE; // TODO: error handling
27072731 #else
@@ -2712,11 +2736,11 @@ t_CKBOOL Chuck_IO_Serial::ready() · 4 unmodified lines
27122736 t_CKBOOL Chuck_IO_Serial::open( const t_CKUINT i, t_CKINT flags, t_CKUINT baud )
27132737 {
27142738 vector<string> ports = SerialIOManager::availableSerialDevices();
2715−
2739+
27162740 if( i < ports.size() )
27172741 {
27182742 const string &path = ports[i];
2719−
2743+
27202744 open(path, flags, baud);
27212745 }
27222746 else
@@ -2724,47 +2748,47 @@ t_CKBOOL Chuck_IO_Serial::open( const t_CKUINT i, t_CKINT flags, t_CKUINT baud ) · 1 unmodified line
27242748 EM_log(CK_LOG_WARNING, "(Serial.open): error: invalid port number");
27252749 return FALSE;
27262750 }
2727−
2751+
27282752 return TRUE;
27292753 }
27302754
27312755
27322756 t_CKBOOL Chuck_IO_Serial::open( const std::string & path, t_CKINT flags, t_CKUINT baud )
27332757 {
2734− if( flags & Chuck_IO_File::TYPE_BINARY )
2758+ if( flags & Chuck_IO::TYPE_BINARY )
27352759 {
2736− m_flags = Chuck_IO_File::TYPE_BINARY;
2760+ m_flags = Chuck_IO::TYPE_BINARY;
27372761 }
2738− else if( flags & Chuck_IO_File::TYPE_ASCII )
2762+ else if( flags & Chuck_IO::TYPE_ASCII )
27392763 {
2740− m_flags = Chuck_IO_File::TYPE_ASCII;
2764+ m_flags = Chuck_IO::TYPE_ASCII;
27412765 }
27422766 else
27432767 {
27442768 EM_log(CK_LOG_WARNING, "(Serial.open): warning: invalid binary/ASCII flag requested, defaulting to ASCII");
2745− m_flags = Chuck_IO_File::TYPE_ASCII;
2769+ m_flags = Chuck_IO::TYPE_ASCII;
27462770 }
2747−
2771+
27482772 int fd = ::open( path.c_str(), O_RDWR );
27492773 if( fd < 0 )
27502774 {
27512775 EM_log(CK_LOG_WARNING, "(Serial.open): error: unable to open file at '%s'", path.c_str());
27522776 return FALSE;
27532777 }
2754−
2778+
27552779 m_fd = fd;
27562780 m_path = path;
2757−
2781+
27582782 // set default baud rate
27592783 setBaudRate(baud);
2760−
2784+
27612785 m_cfd = fdopen(fd, "a+");
27622786 m_iomode = MODE_ASYNC;
27632787 #ifndef WIN32
27642788 fcntl(m_fd, F_SETFL, O_NONBLOCK);
27652789 #endif
27662790 m_eof = FALSE;
2767−
2791+
27682792 return TRUE;
27692793 }
27702794
@@ -2795,7 +2819,7 @@ void Chuck_IO_Serial::close() · 24 unmodified lines
27952819 void Chuck_IO_Serial::close_int()
27962820 {
27972821 EM_log(CK_LOG_INFO, "(Serial.close): closing serial device '%s'", m_path.c_str());
2798−
2822+
27992823 if(good())
28002824 {
28012825 if(m_cfd)
@@ -2844,23 +2868,23 @@ t_CKINT Chuck_IO_Serial::readInt( t_CKINT flags ) · 42 unmodified lines
28442868 EM_log(CK_LOG_WARNING, "(Serial.readInt): warning: file not open");
28452869 return 0;
28462870 }
2847−
2871+
28482872 if( m_iomode == MODE_ASYNC )
28492873 {
28502874 EM_log(CK_LOG_WARNING, "(Serial.readInt): warning: calling synchronous read function on asynchronous file");
28512875 return 0;
28522876 }
2853−
2877+
28542878 long i = 0; // 1.4.1.1 (ge) changed from t_CKUINT; to clear warning for fscanf using %li
2855−
2856− if( m_flags & Chuck_IO_File::TYPE_BINARY )
2879+
2880+ if( m_flags & Chuck_IO::TYPE_BINARY )
28572881 {
28582882 if( flags & INT8 )
28592883 {
28602884 uint8_t byte = 0;
28612885 if(!fread(&byte, 1, 1, m_cfd))
28622886 EM_log(CK_LOG_WARNING, "(Serial.readInt): error: read failed");
2863−
2887+
28642888 i = byte;
28652889 }
28662890 else if( flags & INT16 )
@@ -2868,7 +2892,7 @@ t_CKINT Chuck_IO_Serial::readInt( t_CKINT flags ) · 1 unmodified line
28682892 uint16_t word = 0;
28692893 if(!fread(&word, 2, 1, m_cfd))
28702894 EM_log(CK_LOG_WARNING, "(Serial.readInt): error: read failed");
2871−
2895+
28722896 i = word;
28732897 }
28742898 else if( flags & INT32 )
@@ -2876,7 +2900,7 @@ t_CKINT Chuck_IO_Serial::readInt( t_CKINT flags ) · 1 unmodified line
28762900 uint32_t dword = 0;
28772901 if(!fread(&dword, 4, 1, m_cfd))
28782902 EM_log(CK_LOG_WARNING, "(Serial.readInt): error: read failed");
2879−
2903+
28802904 i = dword;
28812905 }
28822906 }
@@ -2885,7 +2909,7 @@ t_CKINT Chuck_IO_Serial::readInt( t_CKINT flags ) · 2 unmodified lines
28852909 if(!fscanf(m_cfd, "%li", &i))
28862910 EM_log(CK_LOG_WARNING, "(Serial.readInt): error: read failed");
28872911 }
2888−
2912+
28892913 return i;
28902914 }
28912915
@@ -2896,16 +2920,16 @@ t_CKFLOAT Chuck_IO_Serial::readFloat() · 4 unmodified lines
28962920 EM_log(CK_LOG_WARNING, "(Serial.readFloat): warning: file not open");
28972921 return 0;
28982922 }
2899−
2923+
29002924 if( m_iomode == MODE_ASYNC )
29012925 {
29022926 EM_log(CK_LOG_WARNING, "(Serial.readFloat): warning: calling synchronous read function on asynchronous file");
29032927 return 0;
29042928 }
2905−
2929+
29062930 t_CKFLOAT f = 0;
2907−
2908− if( m_flags & Chuck_IO_File::TYPE_BINARY )
2931+
2932+ if( m_flags & Chuck_IO::TYPE_BINARY )
29092933 {
29102934 if(!fread(&f, 4, 1, m_cfd))
29112935 EM_log(CK_LOG_WARNING, "(Serial.readFloat): error: read failed");
@@ -2915,7 +2939,7 @@ t_CKFLOAT Chuck_IO_Serial::readFloat() · 3 unmodified lines
29152939 if(!fscanf(m_cfd, "%lf", &f))
29162940 EM_log(CK_LOG_WARNING, "(Serial.readFloat): error: read failed");
29172941 }
2918−
2942+
29192943 return f;
29202944 }
29212945
@@ -2926,27 +2950,27 @@ t_CKBOOL Chuck_IO_Serial::readString( std::string & str ) · 4 unmodified lines
29262950 EM_log(CK_LOG_WARNING, "(Serial.readString): warning: file not open");
29272951 return FALSE;
29282952 }
2929−
2953+
29302954 if( m_iomode == MODE_ASYNC )
29312955 {
29322956 EM_log(CK_LOG_WARNING, "(Serial.readString): warning: calling synchronous read function on asynchronous file");
29332957 return FALSE;
29342958 }
2935−
2936− if( m_flags & Chuck_IO_File::TYPE_BINARY )
2959+
2960+ if( m_flags & Chuck_IO::TYPE_BINARY )
29372961 {
29382962 EM_log(CK_LOG_WARNING, "(Serial.readString): warning: cannot read string from binary file");
29392963 return FALSE;
29402964 }
2941−
2965+
29422966 if(!fscanf(m_cfd, CHUCK_IO_SCANF_STRING, &m_tmp_buf))
29432967 {
29442968 EM_log(CK_LOG_WARNING, "(Serial.readFloat): error: read failed");
29452969 return FALSE;
29462970 }
2947−
2971+
29482972 str = (char *) m_tmp_buf;
2949−
2973+
29502974 return TRUE;
29512975 }
29522976
@@ -2958,31 +2982,30 @@ Chuck_String * Chuck_IO_Serial::readLine() · 5 unmodified lines
29582982 EM_log(CK_LOG_WARNING, "(Serial.readLine): warning: file not open");
29592983 return NULL;
29602984 }
2961−
2985+
29622986 if( m_iomode == MODE_ASYNC )
29632987 {
29642988 EM_log(CK_LOG_WARNING, "(Serial.readLine): warning: calling synchronous read function on asynchronous file");
29652989 return NULL;
29662990 }
2967−
2968− if( m_flags & Chuck_IO_File::TYPE_BINARY )
2991+
2992+ if( m_flags & Chuck_IO::TYPE_BINARY )
29692993 {
29702994 EM_log(CK_LOG_WARNING, "(Serial.readLine): warning: cannot read line from binary file");
29712995 return NULL;
29722996 }
2973−
2974−
2975− if(!fgets((char *)m_tmp_buf, m_tmp_buf_max, m_cfd))
2997+
2998+ if(!fgets((char *)m_tmp_buf, (int)m_tmp_buf_max, m_cfd))
29762999 {
29773000 EM_log(CK_LOG_WARNING, "(Serial.readLine): error: from fgets");
29783001 return NULL;
29793002 }
2980−
3003+
29813004 Chuck_String * str = new Chuck_String;
29823005 initialize_object(str, m_vmRef->env()->t_string);
2983−
3006+
29843007 str->set( string((char *)m_tmp_buf) );
2985−
3008+
29863009 return str;
29873010 }
29883011
@@ -2994,7 +3017,7 @@ t_CKBOOL Chuck_IO_Serial::eof() · 5 unmodified lines
29943017 EM_log(CK_LOG_WARNING, "(Serial.eof): warning: file not open");
29953018 return FALSE;
29963019 }
2997−
3020+
29983021 if( MODE_SYNC )
29993022 return (m_eof = feof( m_cfd ));
30003023 else
@@ -3010,22 +3033,22 @@ void Chuck_IO_Serial::write( const std::string & val ) · 9 unmodified lines
30103033 EM_log(CK_LOG_WARNING, "(Serial.write): warning: file not open");
30113034 return;
30123035 }
3013−
3036+
30143037 if( m_iomode == MODE_ASYNC )
30153038 {
30163039 start_read_thread();
3017−
3040+
30183041 t_CKUINT len = val.length();
30193042 for(t_CKUINT i = 0; i < len; i++)
30203043 // TODO: efficiency
30213044 m_writeBuffer.put(val[i]);
3022−
3045+
30233046 Request r;
30243047 r.m_type = TYPE_WRITE;
30253048 r.m_val = 0;
30263049 r.m_num = 0;
30273050 r.m_status = Request::RQ_STATUS_PENDING;
3028−
3051+
30293052 m_asyncWriteRequests.put(r);
30303053 }
30313054 else if( m_iomode == MODE_SYNC )
@@ -3048,18 +3071,18 @@ void Chuck_IO_Serial::write( t_CKINT val, t_CKINT size ) · 16 unmodified lines
30483071 EM_log(CK_LOG_WARNING, "(Serial.write): warning: file not open");
30493072 return;
30503073 }
3051−
3074+
30523075 if(!(size == 1 || size == 2 || size == 4 || size == 8))
30533076 {
30543077 EM_log(CK_LOG_WARNING, "(Serial.write): warning: invalid int size %li, ignoring write request", size);
30553078 return;
30563079 }
3057−
3080+
30583081 if( m_iomode == MODE_ASYNC )
30593082 {
30603083 start_read_thread();
3061−
3062− if( m_flags & Chuck_IO_File::TYPE_ASCII )
3084+
3085+ if( m_flags & Chuck_IO::TYPE_ASCII )
30633086 {
30643087 // TODO: don't use m_tmp_buf (thread safety?)
30653088 #ifdef WIN32
@@ -3067,40 +3090,40 @@ void Chuck_IO_Serial::write( t_CKINT val, t_CKINT size ) · 1 unmodified line
30673090 m_tmp_buf[m_tmp_buf_max - 1] = '\0'; // force NULL terminator -- see http://www.di-mgt.com.au/cprog.html#snprintf
30683091 #else
30693092 snprintf((char *)m_tmp_buf, m_tmp_buf_max, "%li", val);
3070−#endif
3093+#endif
30713094 t_CKUINT len = strlen((char *)m_tmp_buf);
30723095 for(t_CKUINT i = 0; i < len; i++)
30733096 // TODO: efficiency
30743097 m_writeBuffer.put(m_tmp_buf[i]);
3075−
3098+
30763099 Request r;
30773100 r.m_type = TYPE_WRITE;
30783101 r.m_val = 0;
30793102 r.m_num = 0;
30803103 r.m_status = Request::RQ_STATUS_PENDING;
3081−
3104+
30823105 m_asyncWriteRequests.put(r);
30833106 }
30843107 else
30853108 {
30863109 char * buf = (char *)&val;
3087−
3110+
30883111 // assume 4-byte int
30893112 for(int i = 0; i < size; i++)
30903113 m_writeBuffer.put(buf[i]);
3091−
3114+
30923115 Request r;
30933116 r.m_type = TYPE_WRITE;
30943117 r.m_val = 0;
30953118 r.m_num = 0;
30963119 r.m_status = Request::RQ_STATUS_PENDING;
3097−
3120+
30983121 m_asyncWriteRequests.put(r);
30993122 }
31003123 }
31013124 else if( m_iomode == MODE_SYNC )
31023125 {
3103− if( m_flags & Chuck_IO_File::TYPE_ASCII )
3126+ if( m_flags & Chuck_IO::TYPE_ASCII )
31043127 {
31053128 fprintf( m_cfd, "%li", (long)val );
31063129 }
@@ -3120,53 +3143,53 @@ void Chuck_IO_Serial::write( t_CKFLOAT val ) · 13 unmodified lines
31203143 EM_log(CK_LOG_WARNING, "(Serial.write): warning: file not open");
31213144 return;
31223145 }
3123−
3146+
31243147 if( m_iomode == MODE_ASYNC )
31253148 {
31263149 start_read_thread();
3127−
3128− if( m_flags & Chuck_IO_File::TYPE_ASCII )
3150+
3151+ if( m_flags & Chuck_IO::TYPE_ASCII )
31293152 {
31303153 #ifdef WIN32
31313154 _snprintf((char *)m_tmp_buf, m_tmp_buf_max, "%f", val);
31323155 m_tmp_buf[m_tmp_buf_max - 1] = '\0'; // force NULL terminator -- see http://www.di-mgt.com.au/cprog.html#snprintf
31333156 #else
31343157 snprintf((char *)m_tmp_buf, m_tmp_buf_max, "%f", val);
3135−#endif
3136−
3158+#endif
3159+
31373160 t_CKUINT len = strlen((char *)m_tmp_buf);
31383161 for(t_CKUINT i = 0; i < len; i++)
31393162 // TODO: efficiency
31403163 m_writeBuffer.put(m_tmp_buf[i]);
3141−
3164+
31423165 Request r;
31433166 r.m_type = TYPE_WRITE;
31443167 r.m_val = 0;
31453168 r.m_num = 0;
31463169 r.m_status = Request::RQ_STATUS_PENDING;
3147−
3170+
31483171 m_asyncWriteRequests.put(r);
31493172 }
31503173 else
31513174 {
31523175 char * buf = (char *) &val;
3153−
3176+
31543177 // assume 4-byte float
31553178 for(int i = 0; i < 4; i++)
31563179 m_writeBuffer.put(buf[i]);
3157−
3180+
31583181 Request r;
31593182 r.m_type = TYPE_WRITE;
31603183 r.m_val = 0;
31613184 r.m_num = 0;
31623185 r.m_status = Request::RQ_STATUS_PENDING;
3163−
3186+
31643187 m_asyncWriteRequests.put(r);
31653188 }
31663189 }
31673190 else if( m_iomode == MODE_SYNC )
31683191 {
3169− if( m_flags & Chuck_IO_File::TYPE_ASCII )
3192+ if( m_flags & Chuck_IO::TYPE_ASCII )
31703193 {
31713194 fprintf( m_cfd, "%f", val );
31723195 }
@@ -3187,12 +3210,12 @@ void Chuck_IO_Serial::writeBytes( Chuck_Array4 * arr ) · 14 unmodified lines
31873210 EM_log(CK_LOG_WARNING, "(Serial.writeBytes): warning: file not open");
31883211 return;
31893212 }
3190−
3213+
31913214 if( m_iomode == MODE_ASYNC )
31923215 {
31933216 start_read_thread();
3194−
3195− int len = arr->size();
3217+
3218+ t_CKINT len = arr->size();
31963219 for(int i = 0; i < len; i++)
31973220 {
31983221 // TODO: efficiency
@@ -3200,18 +3223,18 @@ void Chuck_IO_Serial::writeBytes( Chuck_Array4 * arr ) · 1 unmodified line
32003223 arr->get(i, &byte);
32013224 m_writeBuffer.put((char) byte);
32023225 }
3203−
3226+
32043227 Request r;
32053228 r.m_type = TYPE_WRITE;
32063229 r.m_val = 0;
32073230 r.m_num = 0;
32083231 r.m_status = Request::RQ_STATUS_PENDING;
3209−
3232+
32103233 m_asyncWriteRequests.put(r);
32113234 }
32123235 else if( m_iomode == MODE_SYNC )
32133236 {
3214− int len = arr->size();
3237+ t_CKINT len = arr->size();
32153238 for(int i = 0; i < len; i++)
32163239 {
32173240 // TODO: efficiency
@@ -3231,7 +3254,7 @@ void Chuck_IO_Serial::start_read_thread() · 13 unmodified lines
32313254 m_read_thread->start((unsigned int (__stdcall *)(void*))shell_read_cb, this);
32323255 #else
32333256 m_read_thread->start(shell_read_cb, this);
3234−#endif
3257+#endif
32353258 assert(m_event_buffer == NULL);
32363259 m_event_buffer = m_vmRef->create_event_buffer();
32373260 }
@@ -3245,15 +3268,15 @@ t_CKBOOL Chuck_IO_Serial::readAsync( t_CKUINT type, t_CKUINT num ) · 7 unmodified lines
32453268 EM_log(CK_LOG_WARNING, "(Serial.readAsync): warning: file not open");
32463269 return FALSE;
32473270 }
3248−
3271+
32493272 start_read_thread();
3250−
3273+
32513274 Request read;
32523275 read.m_type = type;
32533276 read.m_num = num;
32543277 read.m_val = 0;
32553278 read.m_status = Request::RQ_STATUS_PENDING;
3256−
3279+
32573280 if(!m_asyncRequests.atMaximum() )
32583281 {
32593282 m_asyncRequests.put(read);
@@ -3263,7 +3286,7 @@ t_CKBOOL Chuck_IO_Serial::readAsync( t_CKUINT type, t_CKUINT num ) · 3 unmodified lines
32633286 EM_log(CK_LOG_SEVERE, "(SerialIO.readAsync): warning: request buffer overflow, dropping read");
32643287 return FALSE;
32653288 }
3266−
3289+
32673290 return TRUE;
32683291 }
32693292
@@ -3274,18 +3297,18 @@ Chuck_String * Chuck_IO_Serial::getLine() · 4 unmodified lines
32743297 EM_log(CK_LOG_WARNING, "(Serial.getLine): warning: file not open");
32753298 return NULL;
32763299 }
3277−
3300+
32783301 Request r;
3279−
3302+
32803303 Chuck_String * str = NULL;
3281−
3304+
32823305 if(m_asyncResponses.peek(r, 1) &&
32833306 r.m_type == TYPE_LINE && r.m_status == Request::RQ_STATUS_SUCCESS)
32843307 {
32853308 str = (Chuck_String *) r.m_val;
32863309 m_asyncResponses.get(r);
32873310 }
3288−
3311+
32893312 return str;
32903313 }
32913314
@@ -3297,11 +3320,11 @@ t_CKINT Chuck_IO_Serial::getByte() · 5 unmodified lines
32973320 EM_log(CK_LOG_WARNING, "(Serial.getByte): warning: file not open");
32983321 return 0;
32993322 }
3300−
3323+
33013324 Request r;
3302−
3325+
33033326 t_CKINT i = 0;
3304−
3327+
33053328 if(m_asyncResponses.peek(r, 1) &&
33063329 r.m_type == TYPE_BYTE && r.m_num == 1 &&
33073330 r.m_status == Request::RQ_STATUS_SUCCESS)
@@ -3309,7 +3332,7 @@ t_CKINT Chuck_IO_Serial::getByte() · 1 unmodified line
33093332 i = (t_CKINT) r.m_val;
33103333 m_asyncResponses.get(r);
33113334 }
3312−
3335+
33133336 return i;
33143337 }
33153338
@@ -3320,11 +3343,11 @@ Chuck_Array * Chuck_IO_Serial::getBytes() · 4 unmodified lines
33203343 EM_log(CK_LOG_WARNING, "(Serial.getBytes): warning: file not open");
33213344 return NULL;
33223345 }
3323−
3346+
33243347 Request r;
3325−
3348+
33263349 Chuck_Array * arr = NULL;
3327−
3350+
33283351 if(m_asyncResponses.peek(r, 1) &&
33293352 r.m_type == TYPE_BYTE && r.m_num > 1 &&
33303353 r.m_status == Request::RQ_STATUS_SUCCESS)
@@ -3333,7 +3356,7 @@ Chuck_Array * Chuck_IO_Serial::getBytes() · 2 unmodified lines
33333356 initialize_object(arr, m_vmRef->env()->t_array);
33343357 m_asyncResponses.get(r);
33353358 }
3336−
3359+
33373360 return arr;
33383361 }
33393362
@@ -3346,9 +3369,9 @@ Chuck_Array * Chuck_IO_Serial::getInts() · 6 unmodified lines
33463369 }
33473370
33483371 Request r;
3349−
3372+
33503373 Chuck_Array * arr = NULL;
3351−
3374+
33523375 if(m_asyncResponses.peek(r, 1) &&
33533376 r.m_type == TYPE_INT && r.m_status == Request::RQ_STATUS_SUCCESS)
33543377 {
@@ -3356,7 +3379,7 @@ Chuck_Array * Chuck_IO_Serial::getInts() · 1 unmodified line
33563379 initialize_object(arr, m_vmRef->env()->t_array);
33573380 m_asyncResponses.get(r);
33583381 }
3359−
3382+
33603383 return arr;
33613384 }
33623385
@@ -3369,9 +3392,9 @@ Chuck_Array * Chuck_IO_Serial::getFloats() · 6 unmodified lines
33693392 }
33703393
33713394 Request r;
3372−
3395+
33733396 Chuck_Array * arr = NULL;
3374−
3397+
33753398 if(m_asyncResponses.peek(r, 1) &&
33763399 r.m_type == TYPE_FLOAT && r.m_status == Request::RQ_STATUS_SUCCESS)
33773400 {
@@ -3379,7 +3402,7 @@ Chuck_Array * Chuck_IO_Serial::getFloats() · 1 unmodified line
33793402 initialize_object(arr, m_vmRef->env()->t_array);
33803403 m_asyncResponses.get(r);
33813404 }
3382−
3405+
33833406 return arr;
33843407 }
33853408
@@ -3390,35 +3413,35 @@ Chuck_String * Chuck_IO_Serial::getString() · 4 unmodified lines
33903413 EM_log(CK_LOG_WARNING, "(Serial.getString): warning: file not open");
33913414 return NULL;
33923415 }
3393−
3416+
33943417 Request r;
3395−
3418+
33963419 Chuck_String * str = NULL;
3397−
3420+
33983421 if(m_asyncResponses.peek(r, 1) &&
33993422 r.m_type == TYPE_STRING && r.m_status == Request::RQ_STATUS_SUCCESS)
34003423 {
34013424 str = (Chuck_String *) r.m_val;
34023425 m_asyncResponses.get(r);
34033426 }
3404−
3427+
34053428 return str;
34063429 }
34073430
34083431
34093432 t_CKBOOL Chuck_IO_Serial::get_buffer(t_CKINT timeout_ms)
34103433 {
3411−#ifndef WIN32
3434+#ifndef WIN32
34123435 fd_set fds;
34133436 FD_ZERO(&fds);
34143437 FD_SET(m_fd, &fds);
3415−
3438+
34163439 timeval tv;
34173440 tv.tv_sec = timeout_ms/1000;
34183441 tv.tv_usec = 1000 * (timeout_ms%1000);
3419−
3442+
34203443 int result = select(m_fd+1, &fds, NULL, NULL, &tv);
3421−
3444+
34223445 if(result > 0 && FD_ISSET(m_fd, &fds))
34233446 {
34243447 result = ::read(m_fd, m_io_buf, m_io_buf_max);
@@ -3426,9 +3449,9 @@ t_CKBOOL Chuck_IO_Serial::get_buffer(t_CKINT timeout_ms) · 1 unmodified line
34263449 {
34273450 m_io_buf_available = result;
34283451 m_io_buf_pos = 0;
3429−
3452+
34303453 EM_log(CK_LOG_FINE, "(SerialIO::get_buffer): read() returned %i bytes", result);
3431−
3454+
34323455 return TRUE;
34333456 }
34343457 else
@@ -3440,9 +3463,9 @@ t_CKBOOL Chuck_IO_Serial::get_buffer(t_CKINT timeout_ms) · 5 unmodified lines
34403463 {
34413464 EM_log(CK_LOG_FINE, "(SerialIO::get_buffer): select() timeout");
34423465 }
3443−
3466+
34443467 return FALSE;
3445−
3468+
34463469 #else
34473470
34483471 int result = ::read(m_fd, m_io_buf, m_io_buf_max);
@@ -3450,7 +3473,7 @@ t_CKBOOL Chuck_IO_Serial::get_buffer(t_CKINT timeout_ms) · 1 unmodified line
34503473 {
34513474 m_io_buf_available = result;
34523475 m_io_buf_pos = 0;
3453−
3476+
34543477 return TRUE;
34553478 }
34563479
@@ -3465,17 +3488,17 @@ t_CKBOOL Chuck_IO_Serial::get_buffer(t_CKINT timeout_ms) · 8 unmodified lines
34653488 t_CKINT Chuck_IO_Serial::peek_buffer()
34663489 {
34673490 // CK_FPRINTF_STDERR( "Chuck_IO_Serial::peek_buffer %i/%i\n", m_io_buf_pos, m_io_buf_available);
3468−
3491+
34693492 if(m_io_buf_pos >= m_io_buf_available)
34703493 {
34713494 // refresh data
34723495 while(!m_do_exit && !m_eof && !get_buffer(5))
34733496 ;
3474−
3497+
34753498 if(m_do_exit || m_eof)
34763499 return -1;
34773500 }
3478−
3501+
34793502 return m_io_buf[m_io_buf_pos];
34803503 }
34813504
@@ -3484,17 +3507,17 @@ t_CKINT Chuck_IO_Serial::peek_buffer() · 2 unmodified lines
34843507 t_CKINT Chuck_IO_Serial::pull_buffer()
34853508 {
34863509 // CK_FPRINTF_STDERR( "Chuck_IO_Serial::pull_buffer %i/%i\n", m_io_buf_pos, m_io_buf_available);
3487−
3510+
34883511 if(m_io_buf_pos >= m_io_buf_available)
34893512 {
34903513 // refresh data
34913514 while(!m_do_exit && !m_eof && !get_buffer(5))
34923515 ;
3493−
3516+
34943517 if(m_do_exit || m_eof)
34953518 return -1;
34963519 }
3497−
3520+
34983521 return m_io_buf[m_io_buf_pos++];
34993522 }
35003523
@@ -3506,10 +3529,10 @@ t_CKINT Chuck_IO_Serial::buffer_bytes_to_tmp(t_CKINT num_bytes) · 5 unmodified lines
35063529 {
35073530 if(peek_buffer() == -1)
35083531 break;
3509−
3532+
35103533 m_tmp_buf[len++] = pull_buffer();
35113534 }
3512−
3535+
35133536 return len;
35143537 }
35153538
@@ -3518,12 +3541,12 @@ t_CKBOOL Chuck_IO_Serial::handle_line(Chuck_IO_Serial::Request &r) · 2 unmodified lines
35183541 {
35193542 t_CKUINT len = 0;
35203543 Chuck_String * str = NULL;
3521−
3544+
35223545 while(!m_do_exit)
35233546 {
35243547 if(peek_buffer() == -1)
35253548 break;
3526−
3549+
35273550 if(peek_buffer() == '\r')
35283551 {
35293552 // consume newline character
@@ -3531,7 +3554,7 @@ t_CKBOOL Chuck_IO_Serial::handle_line(Chuck_IO_Serial::Request &r) · 1 unmodified line
35313554 if(peek_buffer() == '\n') pull_buffer(); // handle \r\n
35323555 break;
35333556 }
3534−
3557+
35353558 if(peek_buffer() == '\n')
35363559 {
35373560 // consume newline character
@@ -3539,40 +3562,40 @@ t_CKBOOL Chuck_IO_Serial::handle_line(Chuck_IO_Serial::Request &r) · 1 unmodified line
35393562 if(peek_buffer() == '\r') pull_buffer(); // handle \n\r (unlikely)
35403563 break;
35413564 }
3542−
3565+
35433566 m_tmp_buf[len++] = pull_buffer();
3544−
3567+
35453568 if(len >= m_tmp_buf_max)
35463569 {
35473570 EM_log(CK_LOG_WARNING, "(Serial.handle_line): warning: line exceeds buffer length, truncating to %i characters", m_tmp_buf_max);
35483571 break;
35493572 }
35503573 }
3551−
3574+
35523575 if(m_do_exit)
35533576 goto error;
35543577 // TODO: eof
3555−
3578+
35563579 str = new Chuck_String;
35573580 str->set( std::string((char *)m_tmp_buf, len) );
3558−
3581+
35593582 r.m_val = (t_CKUINT) str;
35603583 r.m_status = Chuck_IO_Serial::Request::RQ_STATUS_SUCCESS;
35613584
35623585 return TRUE;
3563−
3586+
35643587 error:
35653588 r.m_val = 0;
35663589 r.m_status = Chuck_IO_Serial::Request::RQ_STATUS_FAILURE;
3567−
3590+
35683591 #ifdef WIN32
35693592 HANDLE hFile = (HANDLE) _get_osfhandle(m_fd);
35703593 DWORD error;
35713594 ClearCommError(hFile, &error, NULL);
3572−
3595+
35733596 PurgeComm(hFile, PURGE_RXCLEAR);
35743597 #endif
3575−
3598+
35763599 return TRUE;
35773600 }
35783601
@@ -3586,19 +3609,19 @@ t_CKBOOL Chuck_IO_Serial::handle_float_ascii(Chuck_IO_Serial::Request & r) · 7 unmodified lines
35863609 t_CKFLOAT val = 0;
35873610 int numRead = 0;
35883611 Chuck_Array8 * array = new Chuck_Array8(0);
3589−
3612+
35903613 for(int i = 0; i < r.m_num && !m_do_exit; i++)
35913614 {
35923615 t_CKUINT len = 0;
3593−
3616+
35943617 while(!m_do_exit)
35953618 {
35963619 if(peek_buffer() == -1)
35973620 break;
3598−
3621+
35993622 // TODO: '\r'?
3600− int c = peek_buffer();
3601−
3623+ int c = (int)peek_buffer();
3624+
36023625 if(isdigit(c) || c=='.' || (len==0 && (c=='-' || c=='+')))
36033626 {
36043627 m_tmp_buf[len++] = pull_buffer();
@@ -3607,29 +3630,29 @@ t_CKBOOL Chuck_IO_Serial::handle_float_ascii(Chuck_IO_Serial::Request & r) · 2 unmodified lines
36073630 {
36083631 m_tmp_buf[len++] = '\0';
36093632 val = strtod((char *)m_tmp_buf, NULL);
3610−
3633+
36113634 numRead++;
36123635 array->push_back(val);
3613−
3636+
36143637 break;
36153638 }
36163639 }
36173640 }
3618−
3641+
36193642 if(m_do_exit || m_eof)
36203643 goto error;
36213644
36223645 r.m_num = numRead;
36233646 r.m_val = (t_CKUINT) array;
36243647 r.m_status = Request::RQ_STATUS_SUCCESS;
3625−
3648+
36263649 return TRUE;
3627−
3650+
36283651 error:
36293652 SAFE_DELETE(array);
36303653 r.m_val = 0;
36313654 r.m_status = Chuck_IO_Serial::Request::RQ_STATUS_FAILURE;
3632−
3655+
36333656 return TRUE;
36343657 }
36353658
@@ -3641,14 +3664,14 @@ t_CKBOOL Chuck_IO_Serial::handle_int_ascii(Chuck_IO_Serial::Request & r) · 5 unmodified lines
36413664 for(int i = 0; i < r.m_num; i++)
36423665 {
36433666 t_CKUINT len = 0;
3644−
3667+
36453668 while(!m_do_exit)
36463669 {
36473670 if(peek_buffer() == -1)
36483671 break;
3649−
3650− int c = pull_buffer();
3651−
3672+
3673+ int c = (int)pull_buffer();
3674+
36523675 if(isdigit(c) || (len==0 && (c=='-' || c=='+')))
36533676 {
36543677 m_tmp_buf[len++] = c;
@@ -3657,39 +3680,39 @@ t_CKBOOL Chuck_IO_Serial::handle_int_ascii(Chuck_IO_Serial::Request & r) · 2 unmodified lines
36573680 {
36583681 m_tmp_buf[len++] = '\0';
36593682 val = strtol((char *)m_tmp_buf, NULL, 10);
3660−
3683+
36613684 numRead++;
36623685 array->push_back(val);
3663−
3686+
36643687 break;
36653688 }
36663689 }
36673690 }
3668−
3691+
36693692 if(m_do_exit || m_eof)
36703693 goto error;
3671−
3694+
36723695 r.m_num = numRead;
36733696 r.m_val = (t_CKUINT) array;
36743697 r.m_status = Request::RQ_STATUS_SUCCESS;
3675−
3698+
36763699 return TRUE;
3677−
3700+
36783701 error:
36793702 SAFE_DELETE(array);
36803703 r.m_val = 0;
36813704 r.m_status = Chuck_IO_Serial::Request::RQ_STATUS_FAILURE;
3682−
3705+
36833706 return TRUE;
36843707 }
36853708
36863709 t_CKBOOL Chuck_IO_Serial::handle_byte(Chuck_IO_Serial::Request & r)
36873710 {
36883711 // binary
3689− int size = 1;
3712+ int size = 1;
36903713 int num = r.m_num;
36913714 t_CKUINT val = 0;
3692−
3715+
36933716 if(size*num > m_tmp_buf_max)
36943717 {
36953718 int new_num = (int) floorf(((float)m_tmp_buf_max)/size);
@@ -3697,14 +3720,14 @@ t_CKBOOL Chuck_IO_Serial::handle_byte(Chuck_IO_Serial::Request & r) · 1 unmodified line
36973720 num, size*num, new_num);
36983721 num = new_num;
36993722 }
3700−
3723+
37013724 t_CKINT len = buffer_bytes_to_tmp(num);
3702−
3725+
37033726 if(m_do_exit || m_eof)
37043727 goto error;
37053728
37063729 r.m_num = len;
3707−
3730+
37083731 if(r.m_num == 1)
37093732 val = m_tmp_buf[0];
37103733 else
@@ -3714,19 +3737,19 @@ t_CKBOOL Chuck_IO_Serial::handle_byte(Chuck_IO_Serial::Request & r) · 3 unmodified lines
37143737 {
37153738 array->set(i, m_tmp_buf[i]);
37163739 }
3717−
3740+
37183741 val = (t_CKUINT) array;
37193742 }
3720−
3743+
37213744 r.m_val = val;
37223745 r.m_status = Request::RQ_STATUS_SUCCESS;
3723−
3746+
37243747 return TRUE;
3725−
3748+
37263749 error:
37273750 r.m_val = 0;
37283751 r.m_status = Chuck_IO_Serial::Request::RQ_STATUS_FAILURE;
3729−
3752+
37303753 return TRUE;
37313754 }
37323755
@@ -3735,9 +3758,9 @@ t_CKBOOL Chuck_IO_Serial::handle_float_binary(Chuck_IO_Serial::Request & r) · 2 unmodified lines
37353758 // binary
37363759 int size = 4; // SPENCERTODO: should these be based on arch (64 bit)?
37373760 assert(sizeof(t_CKSINGLE) == 4);
3738−
3761+
37393762 int num = r.m_num;
3740−
3763+
37413764 if(size*num > m_tmp_buf_max)
37423765 {
37433766 int new_num = (int) floorf(((float)m_tmp_buf_max)/size);
@@ -3745,23 +3768,23 @@ t_CKBOOL Chuck_IO_Serial::handle_float_binary(Chuck_IO_Serial::Request & r) · 1 unmodified line
37453768 num, size*num, new_num);
37463769 num = new_num;
37473770 }
3748−
3771+
37493772 r.m_num = buffer_bytes_to_tmp(size*num)/size;
3750−
3773+
37513774 t_CKUINT val = 0;
37523775 t_CKSINGLE * m_floats = (t_CKSINGLE *) m_tmp_buf;
3753−
3776+
37543777 Chuck_Array8 * array = new Chuck_Array8(r.m_num);
37553778 for(int i = 0; i < r.m_num; i++)
37563779 {
37573780 array->set(i, m_floats[i]);
37583781 }
3759−

521 more lines aren’t shown here.

src/core/chuck_io.h+29−29

This diff is large: its 189 lines aren’t shown here.

src/core/chuck_lang.cpp+749−151

This diff is large: its 1642 lines aren’t shown here.

src/core/chuck_lang.h+36−2

This diff is large: its 70 lines aren’t shown here.

src/core/chuck_oo.cpp+219−62

This diff is large: its 540 lines aren’t shown here.

src/core/chuck_oo.h+66−43

This diff is large: its 330 lines aren’t shown here.

src/core/chuck_otf.cpp+29−28

This diff is large: its 193 lines aren’t shown here.

src/core/chuck_otf.h+1−1

This diff is large: its 9 lines aren’t shown here.

src/core/chuck_parse.cpp+468−12

This diff is large: its 542 lines aren’t shown here.

src/core/chuck_parse.h+7−5

This diff is large: its 40 lines aren’t shown here.

src/core/chuck_scan.cpp+209−125

This diff is large: its 990 lines aren’t shown here.

src/core/chuck_scan.h+2−2

This diff is large: its 16 lines aren’t shown here.

src/core/chuck_shell.cpp+252−252

This diff is large: its 1682 lines aren’t shown here.

src/core/chuck_shell.h+80−80

This diff is large: its 458 lines aren’t shown here.

src/core/chuck_stats.cpp+10−10

This diff is large: its 90 lines aren’t shown here.

src/core/chuck_stats.h+10−10

This diff is large: its 75 lines aren’t shown here.

src/core/chuck_symbol.cpp+9−9

This diff is large: its 58 lines aren’t shown here.

src/core/chuck_symbol.h+1−1

This diff is large: its 9 lines aren’t shown here.

src/core/chuck_table.cpp+6−6

This diff is large: its 47 lines aren’t shown here.

src/core/chuck_table.h+2−2

This diff is large: its 18 lines aren’t shown here.

src/core/chuck_type.cpp+586−344

This diff is large: its 2601 lines aren’t shown here.

src/core/chuck_type.h+121−56

This diff is large: its 482 lines aren’t shown here.

src/core/chuck_ugen.cpp+78−78

This diff is large: its 545 lines aren’t shown here.

src/core/chuck_ugen.h+6−6

This diff is large: its 43 lines aren’t shown here.

src/core/chuck_utils.cpp+3−3

This diff is large: its 20 lines aren’t shown here.

src/core/chuck_utils.h+1−1

This diff is large: its 9 lines aren’t shown here.

src/core/chuck_vm.cpp+70−70

This diff is large: its 570 lines aren’t shown here.

src/core/chuck_vm.h+18−18

This diff is large: its 138 lines aren’t shown here.

src/core/chuck_win32.h+2−2

This diff is large: its 18 lines aren’t shown here.

src/core/dirent_win32.h+37−37

This diff is large: its 142 lines aren’t shown here.

src/core/hidio_sdl.cpp+100−100

This diff is large: its 639 lines aren’t shown here.

src/core/hidio_sdl.h+4−4

This diff is large: its 30 lines aren’t shown here.

src/core/lo/config.h+200−200

This diff is large: its 401 lines aren’t shown here.

src/core/lo/lo.h+16−16

This diff is large: its 107 lines aren’t shown here.

src/core/lo/lo_endian.h+32−32

This diff is large: its 120 lines aren’t shown here.

src/core/lo/lo_lowlevel.h+14−14

This diff is large: its 92 lines aren’t shown here.

src/core/lo/lo_macros.h+3−3

This diff is large: its 19 lines aren’t shown here.

src/core/lo/lo_osc_types.h+48−48

This diff is large: its 131 lines aren’t shown here.

src/core/lo/lo_types.h+2−2

This diff is large: its 11 lines aren’t shown here.

src/core/lo/lo_types_internal.h+52−52

This diff is large: its 154 lines aren’t shown here.

src/core/makefile+15−10

This diff is large: its 74 lines aren’t shown here.

src/core/makefile.x/makefile.alsa+8−2

This diff is large: its 13 lines aren’t shown here.

src/core/makefile.x/makefile.jack+8−2

This diff is large: its 13 lines aren’t shown here.

src/core/makefile.x/makefile.mac+5−5

This diff is large: its 18 lines aren’t shown here.

src/core/makefile.x/makefile.pulse+8−2

This diff is large: its 13 lines aren’t shown here.

src/core/midiio_rtmidi.cpp+123−123

This diff is large: its 877 lines aren’t shown here.

src/core/midiio_rtmidi.h+15−15

This diff is large: its 121 lines aren’t shown here.

src/core/regex/config.h+185−185

This diff is large: its 372 lines aren’t shown here.

src/core/regex/regex.h+4−4

This diff is large: its 15 lines aren’t shown here.

src/core/regex/tre-ast.h+14−14

This diff is large: its 72 lines aren’t shown here.

src/core/regex/tre-config.h+52−52

This diff is large: its 105 lines aren’t shown here.

src/core/regex/tre-internal.h+31−31

This diff is large: its 103 lines aren’t shown here.

src/core/regex/tre-match-utils.h+149−149

This diff is large: its 344 lines aren’t shown here.

src/core/regex/tre-mem.h+4−4

This diff is large: its 22 lines aren’t shown here.

src/core/regex/tre-parse.h+1−1

This diff is large: its 9 lines aren’t shown here.

src/core/regex/tre-stack.h+20−20

This diff is large: its 72 lines aren’t shown here.

src/core/regex/tre.h+54−54

This diff is large: its 225 lines aren’t shown here.

src/core/regex/xmalloc.h+14−14

This diff is large: its 66 lines aren’t shown here.

src/core/rtmidi.cpp+12−12

This diff is large: its 104 lines aren’t shown here.

src/core/rtmidi.h+10−10

This diff is large: its 58 lines aren’t shown here.

src/core/uana_extract.cpp+1435−180

This diff is large: its 2169 lines aren’t shown here.

src/core/uana_xform.cpp+218−212

This diff is large: its 1320 lines aren’t shown here.

src/core/ugen_filter.cpp+239−163

This diff is large: its 971 lines aren’t shown here.

src/core/ugen_osc.cpp+101−101

This diff is large: its 725 lines aren’t shown here.

src/core/ugen_osc.h+2−2

This diff is large: its 14 lines aren’t shown here.

src/core/ugen_stk.cpp+901−854

This diff is large: its 6118 lines aren’t shown here.

src/core/ugen_stk.h+139−141

This diff is large: its 1114 lines aren’t shown here.

src/core/ugen_xxx.cpp+595−553

This diff is large: its 3187 lines aren’t shown here.

src/core/ulib_ai.cpp+6921−0

This diff is large: its 6922 lines aren’t shown here.

src/core/ulib_ai.h+370−0

This diff is large: its 371 lines aren’t shown here.

src/core/ulib_machine.cpp+236−31

This diff is large: its 384 lines aren’t shown here.

src/core/ulib_machine.h+6−10

This diff is large: its 29 lines aren’t shown here.

src/core/ulib_math.cpp+389−51

This diff is large: its 661 lines aren’t shown here.

src/core/ulib_math.h+11−6

This diff is large: its 24 lines aren’t shown here.

src/core/ulib_opsc.cpp+292−286

This diff is large: its 1504 lines aren’t shown here.

src/core/ulib_regex.cpp+76−77

This diff is large: its 412 lines aren’t shown here.

src/core/ulib_regex.h+4−4

This diff is large: its 26 lines aren’t shown here.

src/core/ulib_std.cpp+101−99

This diff is large: its 443 lines aren’t shown here.

src/core/util_buffers.cpp+26−26

This diff is large: its 196 lines aren’t shown here.

src/core/util_buffers.h+52−52

This diff is large: its 353 lines aren’t shown here.

src/core/util_console.cpp+32−52

This diff is large: its 149 lines aren’t shown here.

src/core/util_hid.cpp+1310−1313

This diff is large: its 6769 lines aren’t shown here.

src/core/util_hid.h+4−2

This diff is large: its 27 lines aren’t shown here.

src/core/util_math.c+15−1

This diff is large: its 30 lines aren’t shown here.

src/core/util_math.h+18−4

This diff is large: its 48 lines aren’t shown here.

src/core/util_network.c+1−1

This diff is large: its 9 lines aren’t shown here.

src/core/util_opsc.cpp+254−275

This diff is large: its 1441 lines aren’t shown here.

src/core/util_opsc.h+51−51

This diff is large: its 318 lines aren’t shown here.

src/core/util_platforms.cpp+5−5

This diff is large: its 35 lines aren’t shown here.

src/core/util_platforms.h+4−4

This diff is large: its 26 lines aren’t shown here.

src/core/util_serial.cpp+15−17

This diff is large: its 117 lines aren’t shown here.

src/core/util_serial.h+3−1

This diff is large: its 18 lines aren’t shown here.

src/core/util_sndfile.c+154−147

This diff is large: its 807 lines aren’t shown here.

src/core/util_sndfile.h+103−97

This diff is large: its 555 lines aren’t shown here.

src/core/util_string.cpp+39−41

This diff is large: its 243 lines aren’t shown here.

src/core/util_string.h+1−1

This diff is large: its 9 lines aren’t shown here.

src/core/util_thread.cpp+39−39

This diff is large: its 256 lines aren’t shown here.

src/core/util_thread.h+18−18

This diff is large: its 104 lines aren’t shown here.

src/core/util_xforms.c+2−2

This diff is large: its 18 lines aren’t shown here.

src/host/chuck_audio.cpp+91−73

This diff is large: its 236 lines aren’t shown here.

src/host/chuck_audio.h+4−5

This diff is large: its 23 lines aren’t shown here.

src/host/chuck_main.cpp+24−5

This diff is large: its 57 lines aren’t shown here.

src/host_web/README.txt+58−0

This diff is large: its 59 lines aren’t shown here.

src/host_web/chuck_emscripten.cpp+9−6

This diff is large: its 36 lines aren’t shown here.

src/host_web/chuck_emscripten.h+0−0

File mode changed from 100755 to 100644.

src/makefile+23−19

This diff is large: its 122 lines aren’t shown here.

src/test/01-Basic/113.ck+7−0

This diff is large: its 8 lines aren’t shown here.

src/test/01-Basic/113.txt+1−0

This diff is large: its 2 lines aren’t shown here.

src/test/01-Basic/114.ck+5−0

This diff is large: its 6 lines aren’t shown here.

src/test/01-Basic/114.txt+1−0

This diff is large: its 2 lines aren’t shown here.

src/test/01-Basic/115.ck+10−0

This diff is large: its 11 lines aren’t shown here.

src/test/01-Basic/116.ck+15−0

This diff is large: its 16 lines aren’t shown here.

src/test/01-Basic/116.txt+1−0

This diff is large: its 2 lines aren’t shown here.

src/test/01-Basic/117.ck+6−0

This diff is large: its 7 lines aren’t shown here.

src/test/01-Basic/118.ck+29−0

This diff is large: its 30 lines aren’t shown here.

src/test/01-Basic/119.ck+12−0

This diff is large: its 13 lines aren’t shown here.

src/test/01-Basic/120.ck+20−0

This diff is large: its 21 lines aren’t shown here.

src/test/01-Basic/120.txt+1−0

This diff is large: its 2 lines aren’t shown here.

src/test/01-Basic/121.ck+7−0

This diff is large: its 8 lines aren’t shown here.

src/test/01-Basic/122.ck+9−0

This diff is large: its 10 lines aren’t shown here.

src/test/01-Basic/122.txt+1−0

This diff is large: its 2 lines aren’t shown here.

src/test/01-Basic/123.ck+17−0

This diff is large: its 18 lines aren’t shown here.

src/test/01-Basic/124.ck+50−0

This diff is large: its 51 lines aren’t shown here.

src/test/01-Basic/94.ck+75−0

This diff is large: its 76 lines aren’t shown here.

src/test/01-Basic/95.ck+8−0

This diff is large: its 9 lines aren’t shown here.

src/test/01-Basic/95.txt+1−0

This diff is large: its 2 lines aren’t shown here.

src/test/01-Basic/96.ck+12−0

This diff is large: its 13 lines aren’t shown here.

src/test/01-Basic/96.txt+1−0

This diff is large: its 2 lines aren’t shown here.

src/test/01-Basic/97.ck+7−0

This diff is large: its 8 lines aren’t shown here.

src/test/01-Basic/97.txt+1−0

This diff is large: its 2 lines aren’t shown here.

src/test/01-Basic/98.ck+45−0

This diff is large: its 46 lines aren’t shown here.

src/test/01-Basic/99.ck+13−0

This diff is large: its 14 lines aren’t shown here.

src/test/05-Global/01b.txt+1−1

This diff is large: its 3 lines aren’t shown here.

src/test/05-Global/102a.txt+3−3

This diff is large: its 9 lines aren’t shown here.

src/test/05-Global/113.ck+10−0

This diff is large: its 11 lines aren’t shown here.

src/test/05-Global/95.ck+5−0

This diff is large: its 6 lines aren’t shown here.

src/test/05-Global/95.txt+1−0

This diff is large: its 2 lines aren’t shown here.

src/test/05-Global/96.ck+12−0

This diff is large: its 13 lines aren’t shown here.

src/test/05-Global/96.txt+1−0

This diff is large: its 2 lines aren’t shown here.

src/test/05-Global/97.ck+7−0

This diff is large: its 8 lines aren’t shown here.

src/test/05-Global/97.txt+1−0

This diff is large: its 2 lines aren’t shown here.

src/test/README+19−6

This diff is large: its 30 lines aren’t shown here.

src/test/test.py+8−4

This diff is large: its 35 lines aren’t shown here.

src/visual-studio/chuck-vs10.vcxproj+532−530

This diff is large: its 1063 lines aren’t shown here.

src/visual-studio/chuck.dsp+17−0

This diff is large: its 31 lines aren’t shown here.

src/visual-studio/chuck.vcxproj+7−5

This diff is large: its 56 lines aren’t shown here.

src/visual-studio/chuck.vcxproj.filters+7−1

This diff is large: its 26 lines aren’t shown here.

src/xcode/chuck.xcodeproj/project.pbxproj+12−2

This diff is large: its 70 lines aren’t shown here.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t