index.vwf.yaml 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  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: "spot"
  28. position: [-2.5, 1, 1.5]
  29. rotation: [0, -40, 0]
  30. myLight2:
  31. extends: http://vwf.example.com/aframe/alight.vwf
  32. properties:
  33. type: "spot"
  34. position: [2, 1.8, 6.5]
  35. rotation: [25, 25, -40]
  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 = [
  79. {beat:0, msg: 0},
  80. {beat:15, msg: 0}
  81. ];
  82. drumSeq.forEach(el=>{
  83. if(el.beat/rate == obj.beat){
  84. let msg = {
  85. address: "/trigger/sample01",
  86. args: [this.time, 'bd_haus', 2]
  87. };
  88. this.sendOSC(msg);
  89. this.changeVisual();
  90. }
  91. })
  92. hitstartEventMethod:
  93. body: |
  94. this.material.opacity = 0.7
  95. hitendEventMethod:
  96. body: |
  97. this.material.opacity = 1.0
  98. clickEventMethod:
  99. body: |
  100. this.globalBeat = !this.globalBeat
  101. children:
  102. aabb-collider-listener:
  103. extends: http://vwf.example.com/aframe/app-aabb-collider-listener-component.vwf
  104. type: "component"
  105. cursor-listener:
  106. extends: http://vwf.example.com/aframe/app-cursor-listener-component.vwf
  107. type: "component"
  108. material:
  109. extends: http://vwf.example.com/aframe/aMaterialComponent.vwf
  110. properties:
  111. color: "red"
  112. hatt:
  113. extends: http://vwf.example.com/aframe/acone.vwf
  114. properties:
  115. position: "-2 0 -3"
  116. rotation: "0 0 0"
  117. radius: 0.5
  118. height: 1
  119. class: "hit clickable"
  120. globalBeat: true
  121. methods:
  122. changeVisual:
  123. body: |
  124. this.material.color = "white";
  125. this.scale = "1.1 1.1 1.1";
  126. this.future(0.1).resetVisual();
  127. resetVisual:
  128. body: |
  129. this.material.color = "blue";
  130. this.scale = "1 1 1";
  131. onGlobalBeat:
  132. parameters:
  133. - obj
  134. body: |
  135. let transportNode = this.find('//' + obj.name)[0];
  136. let rate = transportNode.animationRate; // 1 by default
  137. let drumSeq = [
  138. {beat:10, msg: 0},
  139. {beat:20, msg: 0}
  140. ];
  141. drumSeq.forEach(el=>{
  142. if(el.beat/rate == obj.beat){
  143. let msg = {
  144. address: "/trigger/sample02",
  145. args: [this.time, 'bass_hit_c', 1]
  146. };
  147. this.sendOSC(msg);
  148. this.changeVisual();
  149. }
  150. })
  151. hitstartEventMethod:
  152. body: |
  153. this.material.opacity = 0.7
  154. hitendEventMethod:
  155. body: |
  156. this.material.opacity = 1.0
  157. clickEventMethod:
  158. body: |
  159. this.globalBeat = !this.globalBeat
  160. children:
  161. aabb-collider-listener:
  162. extends: http://vwf.example.com/aframe/app-aabb-collider-listener-component.vwf
  163. type: "component"
  164. cursor-listener:
  165. extends: http://vwf.example.com/aframe/app-cursor-listener-component.vwf
  166. type: "component"
  167. material:
  168. extends: http://vwf.example.com/aframe/aMaterialComponent.vwf
  169. properties:
  170. color: "red"
  171. synth:
  172. extends: http://vwf.example.com/aframe/asphere.vwf
  173. properties:
  174. position: "2 0 -3"
  175. rotation: "0 0 0"
  176. radius: 0.5
  177. class: "hit clickable"
  178. globalBeat: true
  179. methods:
  180. changeVisual:
  181. body: |
  182. this.material.color = "white";
  183. this.scale = "1.1 1.1 1.1";
  184. this.future(0.1).resetVisual();
  185. resetVisual:
  186. body: |
  187. this.material.color = "green";
  188. this.scale = "1 1 1";
  189. onGlobalBeat:
  190. parameters:
  191. - obj
  192. body: |
  193. let transportNode = this.find('//' + obj.name)[0];
  194. let rate = transportNode.animationRate; // 1 by default
  195. let drumSeq = [
  196. {beat:0, msg: "C3"},
  197. {beat:5, msg: "D3"},
  198. {beat:10, msg: "E3"},
  199. {beat:15, msg: "G3"},
  200. {beat:20, msg: "A3"},
  201. {beat:25, msg: "B3"}
  202. ];
  203. drumSeq.forEach(el=>{
  204. if(el.beat/rate == obj.beat){
  205. let msg = {
  206. address: "/trigger/synth01",
  207. args: [this.time, 'pluck', el.msg, 0.1, 0.01, 0.6]
  208. };
  209. this.sendOSC(msg);
  210. this.changeVisual();
  211. }
  212. })
  213. hitstartEventMethod:
  214. body: |
  215. this.material.opacity = 0.7
  216. hitendEventMethod:
  217. body: |
  218. this.material.opacity = 1.0
  219. clickEventMethod:
  220. body: |
  221. this.globalBeat = !this.globalBeat
  222. children:
  223. aabb-collider-listener:
  224. extends: http://vwf.example.com/aframe/app-aabb-collider-listener-component.vwf
  225. type: "component"
  226. cursor-listener:
  227. extends: http://vwf.example.com/aframe/app-cursor-listener-component.vwf
  228. type: "component"
  229. material:
  230. extends: http://vwf.example.com/aframe/aMaterialComponent.vwf
  231. properties:
  232. color: "#e0e014"
  233. wireframe: true
  234. sky:
  235. extends: http://vwf.example.com/aframe/asky.vwf
  236. properties:
  237. children:
  238. material:
  239. extends: http://vwf.example.com/aframe/aMaterialComponent.vwf
  240. properties:
  241. src: "#sky"
  242. side: "back"
  243. fog: false
  244. groundPlane:
  245. extends: http://vwf.example.com/aframe/aplane.vwf
  246. properties:
  247. height: 50
  248. width: 50
  249. rotation: "-90 0 0"
  250. children:
  251. material:
  252. extends: http://vwf.example.com/aframe/aMaterialComponent.vwf
  253. properties:
  254. repeat: "10 10"
  255. color: "white"
  256. src: "#bg2"
  257. shadow:
  258. extends: http://vwf.example.com/aframe/shadowComponent.vwf
  259. properties:
  260. receive: true
  261. methods:
  262. initialize:
  263. body: |
  264. this.globalTransport.init();
  265. console.log("INIT TRANSPORT!!!");