index.vwf.json 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372
  1. {
  2. "extends": "proxy/aframe/ascene.vwf",
  3. "properties": {
  4. "transparent": true
  5. },
  6. "methods": {
  7. "initialize": {
  8. "body": " this.globalTransport.init();\n console.log(\"INIT TRANSPORT!!!\");\n",
  9. "type": "application/javascript"
  10. }
  11. },
  12. "children": {
  13. "assetBG": {
  14. "extends": "proxy/aframe/a-asset-image-item.vwf",
  15. "properties": {
  16. "itemID": "bg",
  17. "itemSrc": "/defaults/assets/bg.jpg"
  18. }
  19. },
  20. "assetSky": {
  21. "extends": "proxy/aframe/a-asset-image-item.vwf",
  22. "properties": {
  23. "itemID": "sky",
  24. "itemSrc": "/defaults/assets/skyes/sky3.jpg"
  25. }
  26. },
  27. "assetBG2": {
  28. "extends": "proxy/aframe/a-asset-image-item.vwf",
  29. "properties": {
  30. "itemID": "bg2",
  31. "itemSrc": "/defaults/assets/checker.jpg"
  32. }
  33. },
  34. "myLight": {
  35. "extends": "proxy/aframe/alight.vwf",
  36. "properties": {
  37. "type": "spot",
  38. "position": [
  39. -2.5,
  40. 1,
  41. 1.5
  42. ],
  43. "rotation": [
  44. 0,
  45. -40,
  46. 0
  47. ]
  48. }
  49. },
  50. "myLight2": {
  51. "extends": "proxy/aframe/alight.vwf",
  52. "properties": {
  53. "type": "spot",
  54. "position": [
  55. 2,
  56. 1.7999999523162842,
  57. 6.5
  58. ],
  59. "rotation": [
  60. 25,
  61. 25,
  62. -40
  63. ]
  64. }
  65. },
  66. "spaceText": {
  67. "extends": "proxy/aframe/atext.vwf",
  68. "properties": {
  69. "value": "Collaborative Orchestra",
  70. "color": "#ddd",
  71. "position": [
  72. -2,
  73. 2.5,
  74. -2
  75. ]
  76. }
  77. },
  78. "spaceText2": {
  79. "extends": "proxy/aframe/atext.vwf",
  80. "properties": {
  81. "value": "Project by LiveCoding.space",
  82. "color": "#aaa",
  83. "position": [
  84. 1,
  85. 3,
  86. -4
  87. ]
  88. }
  89. },
  90. "globalTransport": {
  91. "extends": "proxy/aframe/transport.vwf",
  92. "properties": {
  93. "position": [
  94. 2,
  95. 2,
  96. -3
  97. ],
  98. "beat": 0,
  99. "animationLoop": true,
  100. "animationDuration": 1,
  101. "animationDurationSIM": 1,
  102. "animationRate": 1,
  103. "animationTPS": 30
  104. },
  105. "children": {
  106. "vis": {
  107. "extends": "proxy/aframe/abox.vwf",
  108. "properties": {
  109. "height": "0.3",
  110. "width": "0.3",
  111. "depth": "0.3",
  112. "class": "clickable"
  113. },
  114. "methods": {
  115. "clickEventMethod": {
  116. "body": " if (this.parent.animationPlaying) {\n this.parent.stop();\n } else {\n this.parent.play();\n }\n",
  117. "type": "application/javascript"
  118. }
  119. },
  120. "children": {
  121. "material": {
  122. "extends": "proxy/aframe/aMaterialComponent.vwf",
  123. "type": "component",
  124. "properties": {
  125. "color": "red"
  126. }
  127. },
  128. "cursor-listener": {
  129. "extends": "proxy/aframe/app-cursor-listener-component.vwf",
  130. "type": "component"
  131. }
  132. }
  133. }
  134. }
  135. },
  136. "bdrum": {
  137. "extends": "proxy/aframe/abox.vwf",
  138. "properties": {
  139. "position": [
  140. 0,
  141. 0,
  142. -3
  143. ],
  144. "rotation": [
  145. 0,
  146. 0,
  147. 0
  148. ],
  149. "depth": "1",
  150. "height": "1",
  151. "width": "1",
  152. "class": "hit clickable",
  153. "globalBeat": true
  154. },
  155. "methods": {
  156. "changeVisual": {
  157. "body": " this.material.color = \"white\";\n this.scale = \"1.1 1.1 1.1\";\n this.future(0.1).resetVisual();\n",
  158. "type": "application/javascript"
  159. },
  160. "resetVisual": {
  161. "body": " this.material.color = \"red\";\n this.scale = \"1 1 1\";\n",
  162. "type": "application/javascript"
  163. },
  164. "onGlobalBeat": {
  165. "parameters": [
  166. "obj"
  167. ],
  168. "body": " let transportNode = this.find('//' + obj.name)[0];\n let rate = transportNode.animationRate; // 1 by default\n let drumSeq = [\n {beat:0, msg: 0},\n {beat:15, msg: 0}\n ];\n drumSeq.forEach(el=>{\n if(el.beat/rate == obj.beat){\n let msg = {\n address: \"/trigger/sample01\",\n args: [this.time, 'bd_haus', 2]\n };\n this.sendOSC(msg); \n this.changeVisual();\n }\n })\n",
  169. "type": "application/javascript"
  170. },
  171. "hitstartEventMethod": {
  172. "body": " this.material.opacity = 0.7\n",
  173. "type": "application/javascript"
  174. },
  175. "hitendEventMethod": {
  176. "body": " this.material.opacity = 1.0\n",
  177. "type": "application/javascript"
  178. },
  179. "clickEventMethod": {
  180. "body": " this.globalBeat = !this.globalBeat\n",
  181. "type": "application/javascript"
  182. }
  183. },
  184. "children": {
  185. "aabb-collider-listener": {
  186. "extends": "proxy/aframe/app-aabb-collider-listener-component.vwf",
  187. "type": "component"
  188. },
  189. "cursor-listener": {
  190. "extends": "proxy/aframe/app-cursor-listener-component.vwf",
  191. "type": "component"
  192. },
  193. "material": {
  194. "extends": "proxy/aframe/aMaterialComponent.vwf",
  195. "properties": {
  196. "color": "red"
  197. }
  198. }
  199. }
  200. },
  201. "hatt": {
  202. "extends": "proxy/aframe/acone.vwf",
  203. "properties": {
  204. "position": [
  205. -2,
  206. 0,
  207. -3
  208. ],
  209. "rotation": [
  210. 0,
  211. 0,
  212. 0
  213. ],
  214. "radius": 0.5,
  215. "height": "1",
  216. "class": "hit clickable",
  217. "globalBeat": true
  218. },
  219. "methods": {
  220. "changeVisual": {
  221. "body": " this.material.color = \"white\";\n this.scale = \"1.1 1.1 1.1\";\n this.future(0.1).resetVisual();\n",
  222. "type": "application/javascript"
  223. },
  224. "resetVisual": {
  225. "body": " this.material.color = \"blue\";\n this.scale = \"1 1 1\";\n",
  226. "type": "application/javascript"
  227. },
  228. "onGlobalBeat": {
  229. "parameters": [
  230. "obj"
  231. ],
  232. "body": " let transportNode = this.find('//' + obj.name)[0];\n let rate = transportNode.animationRate; // 1 by default\n let drumSeq = [\n {beat:10, msg: 0},\n {beat:20, msg: 0}\n ];\n drumSeq.forEach(el=>{\n if(el.beat/rate == obj.beat){\n let msg = {\n address: \"/trigger/sample02\",\n args: [this.time, 'bass_hit_c', 1]\n };\n this.sendOSC(msg); \n this.changeVisual();\n }\n })\n",
  233. "type": "application/javascript"
  234. },
  235. "hitstartEventMethod": {
  236. "body": " this.material.opacity = 0.7\n",
  237. "type": "application/javascript"
  238. },
  239. "hitendEventMethod": {
  240. "body": " this.material.opacity = 1.0\n",
  241. "type": "application/javascript"
  242. },
  243. "clickEventMethod": {
  244. "body": " this.globalBeat = !this.globalBeat\n",
  245. "type": "application/javascript"
  246. }
  247. },
  248. "children": {
  249. "aabb-collider-listener": {
  250. "extends": "proxy/aframe/app-aabb-collider-listener-component.vwf",
  251. "type": "component"
  252. },
  253. "cursor-listener": {
  254. "extends": "proxy/aframe/app-cursor-listener-component.vwf",
  255. "type": "component"
  256. },
  257. "material": {
  258. "extends": "proxy/aframe/aMaterialComponent.vwf",
  259. "properties": {
  260. "color": "red"
  261. }
  262. }
  263. }
  264. },
  265. "synth": {
  266. "extends": "proxy/aframe/asphere.vwf",
  267. "properties": {
  268. "position": [
  269. 2,
  270. 0,
  271. -3
  272. ],
  273. "rotation": [
  274. 0,
  275. 0,
  276. 0
  277. ],
  278. "radius": "0.5",
  279. "class": "hit clickable",
  280. "globalBeat": true
  281. },
  282. "methods": {
  283. "changeVisual": {
  284. "body": " this.material.color = \"white\";\n this.scale = \"1.1 1.1 1.1\";\n this.future(0.1).resetVisual();\n",
  285. "type": "application/javascript"
  286. },
  287. "resetVisual": {
  288. "body": " this.material.color = \"green\";\n this.scale = \"1 1 1\";\n",
  289. "type": "application/javascript"
  290. },
  291. "onGlobalBeat": {
  292. "parameters": [
  293. "obj"
  294. ],
  295. "body": " let transportNode = this.find('//' + obj.name)[0];\n let rate = transportNode.animationRate; // 1 by default\n let drumSeq = [\n {beat:0, msg: \"C3\"},\n {beat:5, msg: \"D3\"},\n {beat:10, msg: \"E3\"},\n {beat:15, msg: \"G3\"},\n {beat:20, msg: \"A3\"},\n {beat:25, msg: \"B3\"}\n ];\n drumSeq.forEach(el=>{\n if(el.beat/rate == obj.beat){\n let msg = {\n address: \"/trigger/synth01\",\n args: [this.time, 'pluck', el.msg, 0.1, 0.01, 0.6]\n };\n this.sendOSC(msg); \n this.changeVisual();\n }\n })\n",
  296. "type": "application/javascript"
  297. },
  298. "hitstartEventMethod": {
  299. "body": " this.material.opacity = 0.7\n",
  300. "type": "application/javascript"
  301. },
  302. "hitendEventMethod": {
  303. "body": " this.material.opacity = 1.0\n",
  304. "type": "application/javascript"
  305. },
  306. "clickEventMethod": {
  307. "body": " this.globalBeat = !this.globalBeat\n",
  308. "type": "application/javascript"
  309. }
  310. },
  311. "children": {
  312. "aabb-collider-listener": {
  313. "extends": "proxy/aframe/app-aabb-collider-listener-component.vwf",
  314. "type": "component"
  315. },
  316. "cursor-listener": {
  317. "extends": "proxy/aframe/app-cursor-listener-component.vwf",
  318. "type": "component"
  319. },
  320. "material": {
  321. "extends": "proxy/aframe/aMaterialComponent.vwf",
  322. "properties": {
  323. "color": "#e0e014",
  324. "wireframe": true
  325. }
  326. }
  327. }
  328. },
  329. "sky": {
  330. "extends": "proxy/aframe/asky.vwf",
  331. "children": {
  332. "material": {
  333. "extends": "proxy/aframe/aMaterialComponent.vwf",
  334. "properties": {
  335. "src": "#sky",
  336. "side": "back",
  337. "fog": false,
  338. "shader": "flat"
  339. }
  340. }
  341. }
  342. },
  343. "groundPlane": {
  344. "extends": "proxy/aframe/aplane.vwf",
  345. "properties": {
  346. "height": "50",
  347. "width": "50",
  348. "rotation": [
  349. -90,
  350. 0,
  351. 0
  352. ]
  353. },
  354. "children": {
  355. "material": {
  356. "extends": "proxy/aframe/aMaterialComponent.vwf",
  357. "properties": {
  358. "repeat": "10 10",
  359. "color": "white",
  360. "src": "#bg2"
  361. }
  362. },
  363. "shadow": {
  364. "extends": "proxy/aframe/shadowComponent.vwf",
  365. "properties": {
  366. "receive": true
  367. }
  368. }
  369. }
  370. }
  371. }
  372. }