index.vwf.yaml 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. # A-Frame & VWF simple scene
  2. # Copyright 2017 Krestianstvo.org project
  3. ---
  4. extends: http://vwf.example.com/aframe/ascene.vwf
  5. properties:
  6. transparent: true
  7. assets: "assets.json"
  8. children:
  9. assetBG:
  10. extends: http://vwf.example.com/aframe/a-asset-image-item.vwf
  11. properties:
  12. itemID: "bg"
  13. itemSrc: "/defaults/assets/bg.jpg"
  14. assetSky:
  15. extends: http://vwf.example.com/aframe/a-asset-image-item.vwf
  16. properties:
  17. itemID: "sky"
  18. itemSrc: "/defaults/assets/skyes/sky3.jpg"
  19. assetBG2:
  20. extends: http://vwf.example.com/aframe/a-asset-image-item.vwf
  21. properties:
  22. itemID: "bg2"
  23. itemSrc: "/defaults/assets/checker.jpg"
  24. myLight:
  25. extends: http://vwf.example.com/aframe/alight.vwf
  26. properties:
  27. type: "directional"
  28. intensity: 0.5
  29. position: "0.5 2.0 1.0"
  30. castShadow: true
  31. myLight2:
  32. extends: http://vwf.example.com/aframe/alight.vwf
  33. properties:
  34. type: "ambient"
  35. intensity: 0.5
  36. spaceText:
  37. extends: http://vwf.example.com/aframe/atext.vwf
  38. properties:
  39. value: "Collaborative Orchestra"
  40. color: "#ddd"
  41. position: "-2 2.5 -2"
  42. spaceText2:
  43. extends: http://vwf.example.com/aframe/atext.vwf
  44. properties:
  45. value: "Project by LiveCoding.space"
  46. color: "#aaa"
  47. position: "1 3 -4"
  48. globalTransport:
  49. extends: http://vwf.example.com/aframe/transport.vwf
  50. properties:
  51. position: "2 2 -3"
  52. bdrum:
  53. extends: http://vwf.example.com/aframe/abox.vwf
  54. properties:
  55. position: "0 0 -3"
  56. rotation: "0 0 0"
  57. depth: 1
  58. height: 1
  59. width: 1
  60. class: "hit clickable"
  61. globalBeat: true
  62. methods:
  63. changeVisual:
  64. body: |
  65. this.material.color = "white";
  66. this.scale = "1.1 1.1 1.1";
  67. this.future(0.1).resetVisual();
  68. resetVisual:
  69. body: |
  70. this.material.color = "red";
  71. this.scale = "1 1 1";
  72. onGlobalBeat:
  73. parameters:
  74. - obj
  75. body: |
  76. let transportNode = this.find('//' + obj.name)[0];
  77. let rate = transportNode.animationRate; // 1 by default
  78. let drumSeq = [{beat:0, msg: 0}];
  79. drumSeq.forEach(el=>{
  80. if(el.beat/rate == obj.beat){
  81. let msg = {
  82. address: "/trigger/sample01",
  83. args: [this.time, 'bd_808', 3]
  84. };
  85. this.sendOSC(msg);
  86. this.changeVisual();
  87. }
  88. })
  89. hitstartEventMethod:
  90. body: |
  91. this.material.opacity = 0.7
  92. hitendEventMethod:
  93. body: |
  94. this.material.opacity = 1.0
  95. clickEventMethod:
  96. body: |
  97. this.globalBeat = !this.globalBeat
  98. children:
  99. aabb-collider-listener:
  100. extends: http://vwf.example.com/aframe/app-aabb-collider-listener-component.vwf
  101. type: "component"
  102. cursor-listener:
  103. extends: http://vwf.example.com/aframe/app-cursor-listener-component.vwf
  104. type: "component"
  105. material:
  106. extends: http://vwf.example.com/aframe/aMaterialComponent.vwf
  107. properties:
  108. color: "red"
  109. hatt:
  110. extends: http://vwf.example.com/aframe/acone.vwf
  111. properties:
  112. position: "-2 0 -3"
  113. rotation: "0 0 0"
  114. radius: 0.5
  115. height: 1
  116. class: "hit clickable"
  117. globalBeat: true
  118. methods:
  119. changeVisual:
  120. body: |
  121. this.material.color = "white";
  122. this.scale = "1.1 1.1 1.1";
  123. this.future(0.1).resetVisual();
  124. resetVisual:
  125. body: |
  126. this.material.color = "blue";
  127. this.scale = "1 1 1";
  128. onGlobalBeat:
  129. parameters:
  130. - obj
  131. body: |
  132. let transportNode = this.find('//' + obj.name)[0];
  133. let rate = transportNode.animationRate; // 1 by default
  134. let drumSeq = [
  135. {beat:0, msg: 0},
  136. {beat:15, msg: 0},
  137. {beat:30, msg: 0},
  138. {beat:45, msg: 0}];
  139. drumSeq.forEach(el=>{
  140. if(el.beat/rate == obj.beat){
  141. let msg = {
  142. address: "/trigger/sample02",
  143. args: [this.time, 'drum_cymbal_closed', 0.5]
  144. };
  145. this.sendOSC(msg);
  146. this.changeVisual();
  147. }
  148. })
  149. hitstartEventMethod:
  150. body: |
  151. this.material.opacity = 0.7
  152. hitendEventMethod:
  153. body: |
  154. this.material.opacity = 1.0
  155. clickEventMethod:
  156. body: |
  157. this.globalBeat = !this.globalBeat
  158. children:
  159. aabb-collider-listener:
  160. extends: http://vwf.example.com/aframe/app-aabb-collider-listener-component.vwf
  161. type: "component"
  162. cursor-listener:
  163. extends: http://vwf.example.com/aframe/app-cursor-listener-component.vwf
  164. type: "component"
  165. material:
  166. extends: http://vwf.example.com/aframe/aMaterialComponent.vwf
  167. properties:
  168. color: "red"
  169. synth:
  170. extends: http://vwf.example.com/aframe/asphere.vwf
  171. properties:
  172. position: "2 0 -3"
  173. rotation: "0 0 0"
  174. radius: 0.5
  175. class: "hit clickable"
  176. globalBeat: true
  177. methods:
  178. changeVisual:
  179. body: |
  180. this.material.color = "white";
  181. this.scale = "1.1 1.1 1.1";
  182. this.future(0.1).resetVisual();
  183. resetVisual:
  184. body: |
  185. this.material.color = "green";
  186. this.scale = "1 1 1";
  187. onGlobalBeat:
  188. parameters:
  189. - obj
  190. body: |
  191. let transportNode = this.find('//' + obj.name)[0];
  192. let rate = transportNode.animationRate; // 1 by default
  193. let drumSeq = [
  194. {beat:0, msg: "C3"},
  195. {beat:15, msg: "E3"},
  196. {beat:30, msg: "G3"},
  197. {beat:45, msg: "A3"}];
  198. drumSeq.forEach(el=>{
  199. if(el.beat/rate == obj.beat){
  200. let msg = {
  201. address: "/trigger/synth01",
  202. args: [this.time, 'pluck', el.msg, 0.1, 0.01]
  203. };
  204. this.sendOSC(msg);
  205. this.changeVisual();
  206. }
  207. })
  208. hitstartEventMethod:
  209. body: |
  210. this.material.opacity = 0.7
  211. hitendEventMethod:
  212. body: |
  213. this.material.opacity = 1.0
  214. clickEventMethod:
  215. body: |
  216. this.globalBeat = !this.globalBeat
  217. children:
  218. aabb-collider-listener:
  219. extends: http://vwf.example.com/aframe/app-aabb-collider-listener-component.vwf
  220. type: "component"
  221. cursor-listener:
  222. extends: http://vwf.example.com/aframe/app-cursor-listener-component.vwf
  223. type: "component"
  224. material:
  225. extends: http://vwf.example.com/aframe/aMaterialComponent.vwf
  226. properties:
  227. color: "#e0e014"
  228. wireframe: true
  229. sky:
  230. extends: http://vwf.example.com/aframe/asky.vwf
  231. properties:
  232. children:
  233. material:
  234. extends: http://vwf.example.com/aframe/aMaterialComponent.vwf
  235. properties:
  236. src: "#sky"
  237. side: "back"
  238. fog: false
  239. groundPlane:
  240. extends: http://vwf.example.com/aframe/aplane.vwf
  241. properties:
  242. height: 50
  243. width: 50
  244. rotation: "-90 0 0"
  245. children:
  246. material:
  247. extends: http://vwf.example.com/aframe/aMaterialComponent.vwf
  248. properties:
  249. repeat: "10 10"
  250. color: "white"
  251. src: "#bg2"
  252. shadow:
  253. extends: http://vwf.example.com/aframe/shadowComponent.vwf
  254. properties:
  255. receive: true
  256. methods:
  257. initialize:
  258. body: |
  259. this.globalTransport.init();
  260. console.log("INIT TRANSPORT!!!");