nodeskini 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (215) hide show
  1. package/README.md +31 -0
  2. package/client/archive/bundle.js +11528 -0
  3. package/client/archive/golem.html +60 -0
  4. package/client/archive/golemClient.js +595 -0
  5. package/client/archive/golembundle.js +11634 -0
  6. package/client/archive/sequencer.html +43 -0
  7. package/client/archive/sequenceurClient.js +815 -0
  8. package/client/archive/stylegolem.css +158 -0
  9. package/client/archive/stylesequenceur.css +204 -0
  10. package/client/clientListe/Sortable-master/.circleci/config.yml +33 -0
  11. package/client/clientListe/Sortable-master/.editorconfig +15 -0
  12. package/client/clientListe/Sortable-master/.github/ISSUE_TEMPLATE/bug-report.md +73 -0
  13. package/client/clientListe/Sortable-master/.github/ISSUE_TEMPLATE/custom-template.md +48 -0
  14. package/client/clientListe/Sortable-master/.github/ISSUE_TEMPLATE/feature-request.md +41 -0
  15. package/client/clientListe/Sortable-master/.jshintrc +25 -0
  16. package/client/clientListe/Sortable-master/.testcaferc.json +7 -0
  17. package/client/clientListe/Sortable-master/CONTRIBUTING.md +26 -0
  18. package/client/clientListe/Sortable-master/LICENSE +21 -0
  19. package/client/clientListe/Sortable-master/README.md +813 -0
  20. package/client/clientListe/Sortable-master/Sortable.js +3709 -0
  21. package/client/clientListe/Sortable-master/Sortable.min.js +2 -0
  22. package/client/clientListe/Sortable-master/Sortable.min.old.js +2 -0
  23. package/client/clientListe/Sortable-master/Sortable.min.old.old.js +2 -0
  24. package/client/clientListe/Sortable-master/babel.config.js +27 -0
  25. package/client/clientListe/Sortable-master/bower.json +30 -0
  26. package/client/clientListe/Sortable-master/entry/entry-complete.js +8 -0
  27. package/client/clientListe/Sortable-master/entry/entry-core.js +19 -0
  28. package/client/clientListe/Sortable-master/entry/entry-defaults.js +19 -0
  29. package/client/clientListe/Sortable-master/index.html +460 -0
  30. package/client/clientListe/Sortable-master/modular/sortable.complete.esm.js +3701 -0
  31. package/client/clientListe/Sortable-master/modular/sortable.core.esm.js +3698 -0
  32. package/client/clientListe/Sortable-master/modular/sortable.esm.js +3699 -0
  33. package/client/clientListe/Sortable-master/package-lock.json +5704 -0
  34. package/client/clientListe/Sortable-master/package.json +56 -0
  35. package/client/clientListe/Sortable-master/plugins/AutoScroll/AutoScroll.js +270 -0
  36. package/client/clientListe/Sortable-master/plugins/AutoScroll/README.md +80 -0
  37. package/client/clientListe/Sortable-master/plugins/AutoScroll/index.js +1 -0
  38. package/client/clientListe/Sortable-master/plugins/MultiDrag/MultiDrag.js +617 -0
  39. package/client/clientListe/Sortable-master/plugins/MultiDrag/README.md +96 -0
  40. package/client/clientListe/Sortable-master/plugins/MultiDrag/index.js +1 -0
  41. package/client/clientListe/Sortable-master/plugins/OnSpill/OnSpill.js +79 -0
  42. package/client/clientListe/Sortable-master/plugins/OnSpill/README.md +60 -0
  43. package/client/clientListe/Sortable-master/plugins/OnSpill/index.js +1 -0
  44. package/client/clientListe/Sortable-master/plugins/README.md +178 -0
  45. package/client/clientListe/Sortable-master/plugins/Swap/README.md +55 -0
  46. package/client/clientListe/Sortable-master/plugins/Swap/Swap.js +90 -0
  47. package/client/clientListe/Sortable-master/plugins/Swap/index.js +1 -0
  48. package/client/clientListe/Sortable-master/scripts/banner.js +8 -0
  49. package/client/clientListe/Sortable-master/scripts/build.js +17 -0
  50. package/client/clientListe/Sortable-master/scripts/esm-build.js +28 -0
  51. package/client/clientListe/Sortable-master/scripts/minify.js +11 -0
  52. package/client/clientListe/Sortable-master/scripts/test-compat.js +30 -0
  53. package/client/clientListe/Sortable-master/scripts/test.js +21 -0
  54. package/client/clientListe/Sortable-master/scripts/umd-build.js +15 -0
  55. package/client/clientListe/Sortable-master/src/Animation.js +175 -0
  56. package/client/clientListe/Sortable-master/src/BrowserInfo.js +12 -0
  57. package/client/clientListe/Sortable-master/src/EventDispatcher.js +57 -0
  58. package/client/clientListe/Sortable-master/src/PluginManager.js +87 -0
  59. package/client/clientListe/Sortable-master/src/Sortable.js +1971 -0
  60. package/client/clientListe/Sortable-master/src/utils.js +556 -0
  61. package/client/clientListe/Sortable-master/st/app.js +224 -0
  62. package/client/clientListe/Sortable-master/st/iframe/frame.html +32 -0
  63. package/client/clientListe/Sortable-master/st/iframe/index.html +49 -0
  64. package/client/clientListe/Sortable-master/st/logo.png +0 -0
  65. package/client/clientListe/Sortable-master/st/og-image.png +0 -0
  66. package/client/clientListe/Sortable-master/st/prettify/prettify.css +1 -0
  67. package/client/clientListe/Sortable-master/st/prettify/prettify.js +46 -0
  68. package/client/clientListe/Sortable-master/st/prettify/run_prettify.js +64 -0
  69. package/client/clientListe/Sortable-master/st/saucelabs.svg +1 -0
  70. package/client/clientListe/Sortable-master/st/theme.css +254 -0
  71. package/client/clientListe/Sortable-master/tests/Sortable.compat.test.js +39 -0
  72. package/client/clientListe/Sortable-master/tests/Sortable.test.js +386 -0
  73. package/client/clientListe/Sortable-master/tests/dual-list.html +34 -0
  74. package/client/clientListe/Sortable-master/tests/empty-list.html +30 -0
  75. package/client/clientListe/Sortable-master/tests/filter.html +27 -0
  76. package/client/clientListe/Sortable-master/tests/handles.html +27 -0
  77. package/client/clientListe/Sortable-master/tests/nested.html +67 -0
  78. package/client/clientListe/Sortable-master/tests/single-list.html +25 -0
  79. package/client/clientListe/Sortable-master/tests/style.css +18 -0
  80. package/client/clientListe/clientListe.html +148 -0
  81. package/client/clientListe/clientListe.js +1508 -0
  82. package/client/clientListe/clientListebundle.js +13164 -0
  83. package/client/clientListe/images/poubelle.png +0 -0
  84. package/client/clientListe/images/start.png +0 -0
  85. package/client/clientListe/images/stop.png +0 -0
  86. package/client/clientListe/images/submit.png +0 -0
  87. package/client/clientListe/sortable-theme-bootstrap.css +90 -0
  88. package/client/configurateur/configReact.js +273 -0
  89. package/client/configurateur/configReactbundle.js +295 -0
  90. package/client/configurateur/configurateur.css +95 -0
  91. package/client/configurateur/configurateur.html +48 -0
  92. package/client/configurateur/lib/jexcel.css +755 -0
  93. package/client/configurateur/lib/jexcel.js +14970 -0
  94. package/client/configurateur/lib/jsuites.css +2801 -0
  95. package/client/configurateur/lib/jsuites.js +11822 -0
  96. package/client/configurateur/lib/react-dom.production.min.js +239 -0
  97. package/client/configurateur/lib/react.production.min.js +32 -0
  98. package/client/configurateur/src/configReact.js +247 -0
  99. package/client/controleur/clientcontroleur.js +536 -0
  100. package/client/controleur/clientcontroleur.test.js +282 -0
  101. package/client/controleur/controleur.html +51 -0
  102. package/client/controleur/controleurbundle.js +565 -0
  103. package/client/controleur/stylecontroleur.css +236 -0
  104. package/client/controleurHH/controleurHH.html +71 -0
  105. package/client/controleurHH/controleurHH.js +252 -0
  106. package/client/controleurHH/styles/index.css +320 -0
  107. package/client/controleurHH/styles/material.css +11552 -0
  108. package/client/parametrage/paramReact.js +473 -0
  109. package/client/parametrage/paramReactbundle.js +500 -0
  110. package/client/parametrage/parametrage.css +111 -0
  111. package/client/parametrage/parametrage.html +163 -0
  112. package/client/parametrage/src/paramReact.js +459 -0
  113. package/client/score/hash.js +83 -0
  114. package/client/score/p5.min.js +3 -0
  115. package/client/score/parto1.js +1171 -0
  116. package/client/score/parto1bundle.js +1181 -0
  117. package/client/score/processing.min.js +431 -0
  118. package/client/score/score.html +15 -0
  119. package/client/score/score.js +34 -0
  120. package/client/simulateurListe/simulateurFork.js +750 -0
  121. package/client/simulateurListe/simulateurFork.mjs +681 -0
  122. package/client/simulateurListe/simulateurForkSansReorg.js +569 -0
  123. package/client/simulateurListe/simulateurListe.js +628 -0
  124. package/myReact/archive/Nodeemitvaluedlocal1.hh.js +52 -0
  125. package/myReact/archive/abort-parNode.js +79 -0
  126. package/myReact/archive/abroNode.js +169 -0
  127. package/myReact/archive/abroNode2.js +80 -0
  128. package/myReact/archive/atom.compile.hh.js +51 -0
  129. package/myReact/archive/await-countNode.js +67 -0
  130. package/myReact/archive/await-nowvalNode.js +44 -0
  131. package/myReact/archive/callHH.js +96 -0
  132. package/myReact/archive/emit-if2.hh.compiled.js +113 -0
  133. package/myReact/archive/every1Node.js +35 -0
  134. package/myReact/archive/if-runNode.js +74 -0
  135. package/myReact/archive/if1Node.js +43 -0
  136. package/myReact/archive/makeawait.js +0 -0
  137. package/myReact/archive/myReact.old.js +684 -0
  138. package/myReact/archive/orchestration.js +281 -0
  139. package/myReact/archive/orchestration1.js +132 -0
  140. package/myReact/archive/orchestration1.xml +465 -0
  141. package/myReact/archive/orchestration2.js +161 -0
  142. package/myReact/archive/orchestrationHH.mano.js +280 -0
  143. package/myReact/archive/orchestrationHHTest.js +428 -0
  144. package/myReact/archive/orchestrationHHTest.xml +234 -0
  145. package/myReact/archive/orchestrationHHTestRun.js +104 -0
  146. package/myReact/archive/orchestrationHHTestRun.xml +34 -0
  147. package/myReact/archive/orchestrationTest0.js +178 -0
  148. package/myReact/archive/orchestrationTest1.js +181 -0
  149. package/myReact/archive/orchestrationTest2.js +281 -0
  150. package/myReact/archive/run3pointsNode.js +59 -0
  151. package/myReact/archive/runNode.js +123 -0
  152. package/myReact/archive/runNode2.js +91 -0
  153. package/myReact/archive/testAwait1.js +141 -0
  154. package/myReact/archive/testAwait1.xml +86 -0
  155. package/myReact/archive/testEvery1.js +122 -0
  156. package/myReact/archive/testEvery1.xml +79 -0
  157. package/myReact/archive/testHH1.js +135 -0
  158. package/myReact/archive/testHH1.xml +86 -0
  159. package/myReact/archive/testHH1revu.js +104 -0
  160. package/myReact/archive/testHH2.js +122 -0
  161. package/myReact/archive/testHH2.xml +79 -0
  162. package/myReact/archive/testHH3.js +130 -0
  163. package/myReact/archive/testHH3.xml +86 -0
  164. package/myReact/archive/testHHabort.js +121 -0
  165. package/myReact/archive/testHHabort.xml +83 -0
  166. package/myReact/archive/testMakeawait.js +202 -0
  167. package/myReact/archive/testRun1.js +168 -0
  168. package/myReact/archive/testRun1.xml +142 -0
  169. package/myReact/archive/titi.js +28 -0
  170. package/myReact/archive/titi.xml +110 -0
  171. package/myReact/archive/toto.js +73 -0
  172. package/myReact/archive/toto.xml +198 -0
  173. package/myReact/archive/trap-await-parallelNode.js +123 -0
  174. package/myReact/inutiles/hiver2022.xml +804 -0
  175. package/myReact/inutiles/hopeNode.xml +459 -0
  176. package/myReact/inutiles/mars2022.xml +871 -0
  177. package/myReact/inutiles/mystique1.xml +318 -0
  178. package/myReact/inutiles/mystiqueOSC.xml +277 -0
  179. package/myReact/inutiles/opus5Node.xml +1271 -0
  180. package/myReact/inutiles/opus5NodeLinux.xml +1241 -0
  181. package/myReact/inutiles/orchestrationHH.xml +541 -0
  182. package/myReact/inutiles/orchestrationHH2.xml +547 -0
  183. package/myReact/inutiles/testHH.xml +95 -0
  184. package/myReact/inutiles/trouveLaPercuTenor.xml +349 -0
  185. package/myReact/myReact.js +744 -0
  186. package/myReact/myReact.min.js +1 -0
  187. package/myReact/orchestrationHH.js +311 -0
  188. package/myReact/orchestrationHH.mjs +436 -0
  189. package/myReact/orchestrationHH.mjs.map +1 -0
  190. package/package.json +46 -0
  191. package/serveur/OSCandMidi.mjs +361 -0
  192. package/serveur/computeScore.mjs +415 -0
  193. package/serveur/controleDAW.mjs +1149 -0
  194. package/serveur/defaultSession.csv +2 -0
  195. package/serveur/defaultSkiniParametres.js +119 -0
  196. package/serveur/gameOSC.mjs +96 -0
  197. package/serveur/groupeClientsSons.mjs +1014 -0
  198. package/serveur/ipConfig.json +24 -0
  199. package/serveur/ipConfig127.json +19 -0
  200. package/serveur/ipConfig75.json +17 -0
  201. package/serveur/ipConfigBH.json +19 -0
  202. package/serveur/ipConfigLocal.json +19 -0
  203. package/serveur/midiConfig.json +26 -0
  204. package/serveur/midiConfigBH.json +26 -0
  205. package/serveur/midiConfigVoid.json +3 -0
  206. package/serveur/midimix.mjs +570 -0
  207. package/serveur/saveParam.mjs +159 -0
  208. package/serveur/skiniParametres.good.js +132 -0
  209. package/serveur/skiniParametres.js +106 -0
  210. package/serveur/utilsHHSkini.hh.js +64 -0
  211. package/serveur/utilsSkini.mjs +137 -0
  212. package/serveur/websocketServer.mjs +2052 -0
  213. package/serveur/workerInterfaceZ.mjs +327 -0
  214. package/serveur/workerSynchro.mjs +49 -0
  215. package/skini.mjs +141 -0
@@ -0,0 +1 @@
1
+ "use strict";var signals=[];var debug=false;var debug1=true;var program;function createSignal(sig,val){var oneSignal={name:sig,value:val,action:undefined};signals.push(oneSignal)}exports.createSignal=createSignal;function addEventListener(sig,action){for(var i=0;i<signals.length;i++){if(signals[i].name===sig){signals[i].action=action;return true}}console.log("ERR: addEventListener: signal inconnu:",sig);return-1}exports.addEventListener=addEventListener;function playEventListener(sig,val){for(var i=0;i<signals.length;i++){if(signals[i].name===sig){if(signals[i].action!==undefined){signals[i].action(val);return true}else{return true}}}console.log("ERR: playEventListener: signal inconnu:",sig,val);return-1}exports.playEventListener=playEventListener;function setSignalValue(val){for(var i=0;i<signals.length;i++){if(signals[i].name===sig){signals[i].value=val;return true}}console.log("ERR: setSignalValue: signal inconnu:",sig);return-1}exports.setSignalValue=setSignalValue;function isSignalActivatedInInstruction(instr,signal){if(instr.signal===signal){if(instr.signalActivated)return true}return false}function activateSignal(sig,val){if(debug)console.log("activateSignal",sig,val);setSignalAll(program,sig,val,true);return true}exports.activateSignal=activateSignal;function setSignal(instr,sig,value,activated){if(instr===undefined)return;for(var i=0;i<instr.length;i++){if(instr[i].signal===sig){instr[i].signalActivated=activated;instr[i].nowval=value}if(debug)console.log("-- setSignal",instr[i].name,instr[i].signal,instr[i].signalActivated);setSignal(instr[i].nextInstr,sig,value,activated)}}function setSignalAll(prog,sig,value,activated){if(debug)console.log("- setSignalAll");setSignal(prog.instructions,sig,value,activated)}exports.printProgram=printProgram;var instrIndex=0;function createInstruction(name,signal,nowval,count,action,nextInstr){var instruction={name:name,signal:signal,signalActivated:false,nowval:nowval,count:0,countMax:count,action:action,burnt:false,broadcast:false,nextInstr:nextInstr,index:instrIndex};instrIndex++;return instruction}exports.createInstruction=createInstruction;function execInstruction(command,branch){if(debug)console.log("execInstruction: Instruction :",command.name,command.signal);if(!command.burnt){switch(command.name){case"abort":if(debug)console.log("abort: signal",command.signal,", abort burnt:",command.burnt,", abort index:",command.index);if(isSignalActivatedInInstruction(command,command.signal)){command.count++;if(command.count>=command.countMax){command.count=0;command.burnt=true;if(debug)console.log("abort brulé car signal actif:",command);return true}else{for(var i=0;i<command.nextInstr.length;i++){if(!runBranch(command.nextInstr[i],command.nextInstr)){command.burnt=false;return false}if(i===command.nextInstr.length-1){command.count=0;command.burnt=true;return true}}}}else{for(var i=0;i<command.nextInstr.length;i++){if(!runBranch(command.nextInstr[i],branch)){command.burnt=false;return false}if(i===command.nextInstr.length-1){command.count=0;command.burnt=true;return true}}}break;case"atom":if(debug)console.log("atom");command.action();command.burnt=true;return true;case"await":if(isSignalActivatedInInstruction(command,command.signal)){command.count++;if(command.count>=command.countMax){command.count=0;command.signalActivated=false;if(debug)console.log("await dans la branche:",branch);setSignal(branch,command.signal,command.nowval,false);command.burnt=true;return true}}else{command.burnt=false;return false}break;case"await_do":if(debug)console.log("await_do: ",command.signal,signals);if(isSignalActivatedInInstruction(command,command.signal)){command.count++;if(command.count>=command.countMax){command.action();command.count=0;command.signalActivated=false;setSignal(branch,command.signal,command.nowval,false);command.burnt=true;return true}}else{command.burnt=false;return false}case"emit":if(debug)console.log("-- emit --");activateSignal(command.signal,command.nowval);playEventListener(command.signal,command.nowval);if(debug)console.log("-- emit activé : ",command.signal,command.burnt);command.burnt=true;return true;case"every":if(isSignalActivatedInInstruction(command,command.signal)){command.count++;if(command.count>=command.countMax){command.count=0;if(debug)console.log("every: command.branch",i,command.nextInstr[0]);setSignal(branch,command.signal,command.nowval,false);unburnBranch(command.nextInstr);for(var i=0;i<command.nextInstr.length;i++){if(debug)console.log("every: seq command.branch",i,command.nextInstr[i].name);if(!runBranch(command.nextInstr[i],command.nextInstr)){return false}if(i===command.nextInstr.length-1){command.burnt=false;return false}}}else{command.burnt=false;return false}}else{command.burnt=false;return false}case"loop":if(debug)console.log("loop command.branch",command.nextInstr);for(var i=0;i<command.nextInstr.length;i++){if(debug)console.log("seq command.branch",i,command.nextInstr[i]);if(!runBranch(command.nextInstr[i],command.nextInstr)){return false}if(i===command.nextInstr.length-1){unburnBranch(command.nextInstr);command.burnt=false;return false}}break;case"par":var countBranch=0;for(var i=0;i<command.nextInstr.length;i++){if(runBranch(command.nextInstr[i],command.nextInstr)){if(debug)console.log("Par:",i);countBranch++}}if(countBranch===command.nextInstr.length){command.burnt=true;return true}else{return false}break;case"restart":if(debug1)console.log("restart:");command.burnt=true;reRunProg();return true;case"run":case"seq":if(debug)console.log("seq command.branch",command.nextInstr);for(var i=0;i<command.nextInstr.length;i++){if(debug)console.log("seq command.branch",i,command.nextInstr[i]);if(!runBranch(command.nextInstr[i],command.nextInstr)){return false}if(i===command.nextInstr.length-1){command.burnt=true;return true}}break;case"printSignals":if(debug)console.log("printSignals");command.action();command.burnt=true;return true;default:console.log("Instruction inconnue")}}else{if(debug)console.log("execInstruction: Instruction :",command.name,"déjà jouée");return true}}function runProg(){if(debug)console.log("\nrunProg",prog.length);runBranch(program.instructions,undefined)}exports.runProg=runProg;function reRunProg(){if(debug)console.log("\nreRunProg",program);if(program!==undefined){runBranch(program.instructions,undefined)}}function createModule(instr){var module={name:"Program",signal:undefined,signalActivated:undefined,burnt:false,instructions:instr};program=module;return module}exports.createModule=createModule;function runBranch(instructions,branch){if(debug)console.log("\nrunBranch: length: ",instructions.length);if(instructions.length===undefined){if(debug)console.log("runBranch: instruction seule:",instructions.name);if(!execInstruction(instructions,branch)){return false}return true}for(var i=0;i<instructions.length;i++){if(debug)console.log("-- runBranch: tableau d'instructions:",i,instructions[i].name,instructions[i].index);if(!execInstruction(instructions[i],instructions)){return false}}return true}function unburnBranch(instructions){if(instructions===undefined){return true}if(instructions.length===undefined){if(debug)console.log("unburnBranch 1:",instructions);instructions.burnt=false;return true}for(var i=0;i<instructions.length;i++){if(debug)console.log("\n--- unburnBranch",i,instructions[i].name);if(instructions[i].burnt!==undefined){if(debug)console.log("unburnBranch 2:",instructions[i].name);instructions[i].burnt=false;unburnBranch(instructions[i].nextInstr)}else{unburnBranch(instructions[i].nextInstr)}}return true}function printInstructions(instr,option){if(instr===undefined)return;for(var i=0;i<instr.length;i++){if(option===true){console.log(instr[i]);console.log("------------------------------")}else{console.log("-> ",instr[i].name,": index:",instr[i].index)}printInstructions(instr[i].nextInstr,option)}}function printProgram(prog,option){console.log("------ PROGRAM ---------------");printInstructions(prog.instructions,option);console.log("------------------------------")}exports.printProgram=printProgram;function _emit(signal,value){return createInstruction("emit",signal,value,undefined,undefined,undefined)}exports._emit=_emit;function _await(signal,count){return createInstruction("await",signal,undefined,count,undefined,undefined)}exports._await=_await;function _await_do(signal,count,action){return createInstruction("await_do",signal,undefined,count,action,undefined)}exports._await_do=_await_do;function _abort(signal,count,instructions){return createInstruction("abort",signal,undefined,count,undefined,instructions)}exports._abort=_abort;function _every(signal,count,instructions){return createInstruction("every",signal,undefined,count,undefined,instructions)}exports._every=_every;function _seq(instructions){return createInstruction("seq",undefined,undefined,undefined,undefined,instructions)}exports._seq=_seq;function _par(instructions){return createInstruction("par",undefined,undefined,undefined,undefined,instructions)}exports._par=_par;function _loop(instructions){return createInstruction("loop",undefined,undefined,undefined,undefined,instructions)}exports._loop=_loop;function _run(module){return createInstruction("run",undefined,undefined,undefined,undefined,module)}exports._run=_run;function _atom(action){return createInstruction("atom",undefined,undefined,undefined,action,undefined)}exports._atom=_atom;function _printSignals(){return createInstruction("printSignals",undefined,undefined,undefined,()=>{console.log(signals)},undefined)}exports._printSignals=_printSignals;function _restart(){return createInstruction("restart",undefined,undefined,undefined,undefined,undefined)}exports._restart=_restart;
@@ -0,0 +1,311 @@
1
+ var tick;
2
+
3
+
4
+
5
+ "use strict";
6
+
7
+ var hh = require("../hiphop/hiphop.js");
8
+
9
+ // C'est la seule façon d'échanger les paramètres nécessaires à la compilation
10
+ // lors de la création des signaux.
11
+ var par = require('../serveur/skiniParametres');
12
+
13
+ var midimix;
14
+ var oscMidiLocal;
15
+
16
+ var gcs;
17
+ var DAW;
18
+ var serveur;
19
+
20
+ var debug = false;
21
+ var debug1 = true;
22
+
23
+ // Avec des valeurs initiales
24
+ var CCChannel = 1;
25
+ var CCTempo = 100;
26
+ var tempoMax = 160;
27
+ var tempoMin = 40;
28
+ var tempoGlobal = 60;
29
+
30
+ function setServ(ser, daw, groupeCS, oscMidi, mix){
31
+ if(debug1) console.log("hh_ORCHESTRATION: setServ");
32
+ DAW = daw;
33
+ serveur = ser;
34
+ gcs = groupeCS;
35
+ oscMidiLocal = oscMidi;
36
+ midimix = mix;
37
+ }
38
+ exports.setServ = setServ;
39
+
40
+ function setTempo(value){
41
+ tempoGlobal = value;
42
+
43
+ if(midimix.getAbletonLinkStatus()) {
44
+ if(debug) console.log("ORCHESTRATION: set tempo Link:", value);
45
+ midimix.setTempoLink(value);
46
+ return;
47
+ }
48
+ if ( value > tempoMax || value < tempoMin) {
49
+ console.log("ERR: Tempo set out of range:", value, "Should be between:", tempoMin, "and", tempoMax);
50
+ return;
51
+ }
52
+ var tempo = Math.round(127/(tempoMax - tempoMin) * (value - tempoMin));
53
+ if (debug) {
54
+ console.log("Set tempo blockly:", value, par.busMidiDAW, CCChannel, CCTempo, tempo, oscMidiLocal.getMidiPortClipToDAW() );
55
+ }
56
+ oscMidiLocal.sendControlChange(par.busMidiDAW, CCChannel, CCTempo, tempo);
57
+ }
58
+
59
+ var tempoValue = 0;
60
+ var tempoRythme = 0;
61
+ var tempoLimit = 0;
62
+ var tempoIncrease = true;
63
+ var transposeValue = 0;
64
+ var ratioTranspose = 1.763;
65
+ var offsetTranspose = 63.5;
66
+
67
+ function moveTempo(value, limit){
68
+
69
+ if(tempoLimit >= limit){
70
+ tempoLimit = 0;
71
+ tempoIncrease = !tempoIncrease;
72
+ }
73
+
74
+ if(tempoIncrease){
75
+ tempoGlobal += value;
76
+ }else{
77
+ tempoGlobal -= value;
78
+ }
79
+ if(debug) console.log("moveTempo:", tempoGlobal);
80
+ setTempo(tempoGlobal);
81
+ tempoLimit++;
82
+ }
83
+
84
+ // Création des signaux OUT de contrôle de la matrice des possibles
85
+ // Ici et immédiatement.
86
+ var signals = [];
87
+ var halt, start, emptyQueueSignal, patternSignal, stopReservoir, stopMoveTempo;
88
+ var tickCounter = 0;
89
+
90
+ for (var i=0; i < par.groupesDesSons.length; i++) {
91
+ if(par.groupesDesSons[i][0] !== "") {
92
+ var signame = par.groupesDesSons[i][0] + "OUT";
93
+
94
+ if(debug1) console.log("Signal Orchestration:", signame);
95
+
96
+ var signal = hh.SIGNAL({
97
+ "%location":{},
98
+ "direction":"OUT",
99
+ "name":signame,
100
+ "init_func":function (){return [false, -1];}
101
+ });
102
+ signals.push(signal);
103
+ }
104
+ }
105
+
106
+ // Création des signaux IN de sélection de patterns
107
+ for (var i=0; i < par.groupesDesSons.length; i++) {
108
+ if(par.groupesDesSons[i][0] !== "") {
109
+ var signame = par.groupesDesSons[i][0] + "IN";
110
+
111
+ if(debug1) console.log("Signal Orchestration:", signame);
112
+
113
+ var signal = hh.SIGNAL({
114
+ "%location":{},
115
+ "direction":"IN",
116
+ "name":signame
117
+ });
118
+ signals.push(signal);
119
+ }
120
+ }
121
+
122
+
123
+
124
+
125
+
126
+ var orchestration = hh.MODULE(
127
+ {"id":"Orchestration","%location":{},"%tag":"module"},
128
+ signals,
129
+
130
+ hh.SIGNAL({"%location":{},"direction":"IN","name":"start"}),
131
+ hh.SIGNAL({"%location":{},"direction":"IN","name":"halt"}),
132
+ hh.SIGNAL({"%location":{},"direction":"IN","name":"tick"}),
133
+ hh.SIGNAL({"%location":{},"direction":"IN","name":"DAWON"}),
134
+ hh.SIGNAL({"%location":{},"direction":"IN","name":"patternSignal"}),
135
+ hh.SIGNAL({"%location":{},"direction":"IN","name":"controlFromVideo"}),
136
+ hh.SIGNAL({"%location":{},"direction":"IN","name":"pulsation"}),
137
+ hh.SIGNAL({"%location":{},"direction":"IN","name":"midiSignal"}),
138
+ hh.SIGNAL({"%location":{},"direction":"IN","name":"emptyQueueSignal"}),
139
+ hh.SIGNAL({"%location":{},"direction":"IN","name":"INTERFACEZ_RC"}),
140
+ hh.SIGNAL({"%location":{},"direction":"IN","name":"INTERFACEZ_RC0"}),
141
+ hh.SIGNAL({"%location":{},"direction":"IN","name":"INTERFACEZ_RC1"}),
142
+ hh.SIGNAL({"%location":{},"direction":"IN","name":"INTERFACEZ_RC2"}),
143
+ hh.SIGNAL({"%location":{},"direction":"IN","name":"INTERFACEZ_RC3"}),
144
+ hh.SIGNAL({"%location":{},"direction":"IN","name":"INTERFACEZ_RC4"}),
145
+ hh.SIGNAL({"%location":{},"direction":"IN","name":"INTERFACEZ_RC5"}),
146
+ hh.SIGNAL({"%location":{},"direction":"IN","name":"INTERFACEZ_RC6"}),
147
+ hh.SIGNAL({"%location":{},"direction":"IN","name":"INTERFACEZ_RC7"}),
148
+ hh.SIGNAL({"%location":{},"direction":"IN","name":"INTERFACEZ_RC8"}),
149
+ hh.SIGNAL({"%location":{},"direction":"IN","name":"INTERFACEZ_RC9"}),
150
+ hh.SIGNAL({"%location":{},"direction":"IN","name":"INTERFACEZ_RC10"}),
151
+ hh.SIGNAL({"%location":{},"direction":"IN","name":"INTERFACEZ_RC11"}),
152
+ hh.SIGNAL({"%location":{},"direction":"INOUT","name":"stopReservoir"}),
153
+ hh.SIGNAL({"%location":{},"direction":"INOUT","name":"stopMoveTempo"}),
154
+
155
+
156
+ hh.LOOP(
157
+ {
158
+ "%location":{loop: 1},
159
+ "%tag":"loop"
160
+ },
161
+ hh.ABORT(
162
+ {
163
+ "%location":{abort: halt},
164
+ "%tag":"abort",
165
+ "immediate":false,
166
+ "apply": function (){return ((() => {
167
+ const halt=this["halt"];
168
+ return halt.now;
169
+ })());},
170
+ "countapply":function (){ return 1;}
171
+ },
172
+ hh.SIGACCESS({
173
+ "signame":"halt",
174
+ "pre":false,
175
+ "val":false,
176
+ "cnt":false
177
+ }),
178
+
179
+ hh.AWAIT(
180
+ {
181
+ "%location":{},
182
+ "%tag":"await",
183
+ "immediate":true,
184
+ "apply":function () {
185
+ return ((() => {
186
+ const start=this["start"];
187
+ return start.now;
188
+ })());
189
+ },
190
+ },
191
+ hh.SIGACCESS({
192
+ "signame":"start",
193
+ "pre":false,
194
+ "val":false,
195
+ "cnt":false
196
+ })
197
+ ),
198
+
199
+ hh.FORK(
200
+ {"%location":{},"%tag":"fork"},
201
+ hh.SEQUENCE(
202
+ {"%location":{},"%tag":"fork"},
203
+
204
+
205
+ hh.ABORT(
206
+ {
207
+ "%location":{abort: tick},
208
+ "%tag":"abort",
209
+ "immediate":false,
210
+ "apply": function (){return ((() => {
211
+ const tick=this["tick"];
212
+ return tick.now;
213
+ })());},
214
+ "countapply":function (){ return 4;}
215
+ },
216
+ hh.SIGACCESS({
217
+ "signame":"tick",
218
+ "pre":false,
219
+ "val":false,
220
+ "cnt":false
221
+ }),
222
+
223
+ hh.LOOP(
224
+ {
225
+ "%location":{loop: 1},
226
+ "%tag":"loop"
227
+ },
228
+
229
+ hh.AWAIT(
230
+ {
231
+ "%location":{},
232
+ "%tag":"await",
233
+ "immediate":true,
234
+ "apply":function () {
235
+ return ((() => {
236
+ const tick=this["tick"];
237
+ return tick.now;
238
+ })());
239
+ }
240
+ },
241
+ hh.SIGACCESS({
242
+ "signame":"tick",
243
+ "pre":false,
244
+ "val":false,
245
+ "cnt":false
246
+ })
247
+ ),
248
+
249
+ hh.ATOM(
250
+ {
251
+ "%location":{},
252
+ "%tag":"node",
253
+ "apply":function () {console.log('foo tuto5 3eme');}
254
+ }
255
+ ),
256
+
257
+ hh.PAUSE(
258
+ {
259
+ "%location":{},
260
+ "%tag":"yield"
261
+ }
262
+ ),
263
+
264
+ ),
265
+
266
+ ),
267
+
268
+ ),
269
+ hh.SEQUENCE(
270
+ {"%location":{},"%tag":"fork"},
271
+ hh.EVERY(
272
+ {
273
+ "%location":{},
274
+ "%tag":"every",
275
+ "immediate":false,
276
+ "apply": function (){return ((() => {
277
+ const tick = this["tick"];
278
+ return tick.now;
279
+ })());},
280
+ },
281
+ hh.SIGACCESS({
282
+ "signame":"tick",
283
+ "pre":false,
284
+ "val":false,
285
+ "cnt":false
286
+ }),
287
+ hh.ATOM(
288
+ {
289
+ "%location":{},
290
+ "%tag":"node",
291
+ "apply":function () {
292
+ gcs.setTickOnControler(tickCounter);
293
+ tickCounter++;
294
+ }
295
+ }
296
+ )
297
+ )
298
+ )
299
+ )
300
+ )
301
+ )
302
+ );
303
+ exports.orchestration = orchestration;
304
+
305
+ function setSignals(){
306
+ //console.log("INFO: setSignals: Orchestration:", );
307
+ var machine = new hh.ReactiveMachine( orchestration, {sweep:true, tracePropagation: false, traceReactDuration: false});
308
+ console.log("INFO: setSignals: Number of nets in Orchestration:",machine.nets.length);
309
+ return machine;
310
+ }
311
+ exports.setSignals = setSignals;