Check-in [941581eece]
Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Comment: | Cleanup post presentation Worklet code |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
941581eecee2bc7037e154fae330ae0e |
User & Date: | dev 2022-02-15 23:20:56 |
2022-03-27
| ||
22:44 | Updating JUCE link and build scripts check-in: 4cb0fff742 user: dev tags: trunk | |
2022-02-15
| ||
23:20 | Cleanup post presentation Worklet code check-in: 941581eece user: dev tags: trunk | |
2021-11-16
| ||
10:11 | Cleanup of Docs check-in: a03a381331 user: dev tags: trunk | |
Changes to build/html/alternate-implementation.html.
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 ... 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 ... 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 |
<script src="_static/jquery.js"></script> <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script src="_static/sphinx-book-theme.12a9622fbb08dcb3a2a40b2c02b83a57.js"></script> <script src="_static/analytics.js"></script> <link rel="index" title="Index" href="genindex.html" /> <link rel="search" title="Search" href="search.html" /> <link rel="next" title="Saving and other limitations" href="limitations.html" /> <link rel="prev" title="Code Walkthrough" href="main.html" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="docsearch:language" content="en" /> </head> <body data-spy="scroll" data-target="#bd-toc-nav" data-offset="80"> ................................................................................ </li> <li class="toctree-l1 current active"> <a class="current reference internal" href="#"> Alternate Implementations </a> </li> <li class="toctree-l1"> <a class="reference internal" href="limitations.html"> Saving and other limitations </a> </li> <li class="toctree-l1"> <a class="reference internal" href="credits.html"> Credits </a> </li> ................................................................................ </div> <div class='prev-next-bottom'> <a class='left-prev' id="prev-link" href="main.html" title="previous page">Code Walkthrough</a> <a class='right-next' id="next-link" href="limitations.html" title="next page">Saving and other limitations</a> </div> </div> </div> <footer class="footer mt-5 mt-md-0"> <div class="container"> |
| | | | |
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 ... 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 ... 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 |
<script src="_static/jquery.js"></script> <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script src="_static/sphinx-book-theme.12a9622fbb08dcb3a2a40b2c02b83a57.js"></script> <script src="_static/analytics.js"></script> <link rel="index" title="Index" href="genindex.html" /> <link rel="search" title="Search" href="search.html" /> <link rel="next" title="Saving / Recording / Streaming" href="saving.html" /> <link rel="prev" title="Code Walkthrough" href="main.html" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="docsearch:language" content="en" /> </head> <body data-spy="scroll" data-target="#bd-toc-nav" data-offset="80"> ................................................................................ </li> <li class="toctree-l1 current active"> <a class="current reference internal" href="#"> Alternate Implementations </a> </li> <li class="toctree-l1"> <a class="reference internal" href="saving.html"> Saving / Recording / Streaming </a> </li> <li class="toctree-l1"> <a class="reference internal" href="credits.html"> Credits </a> </li> ................................................................................ </div> <div class='prev-next-bottom'> <a class='left-prev' id="prev-link" href="main.html" title="previous page">Code Walkthrough</a> <a class='right-next' id="next-link" href="saving.html" title="next page">Saving / Recording / Streaming</a> </div> </div> </div> <footer class="footer mt-5 mt-md-0"> <div class="container"> |
Changes to build/html/bookmarks.html.
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 ... 185 186 187 188 189 190 191 192 193 194 195 196 197 198 ... 221 222 223 224 225 226 227 228 229 230 231 232 233 234 ... 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 ... 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 ... 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 ... 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 |
</li> <li class="toctree-l1"> <a class="reference internal" href="alternate-implementation.html"> Alternate Implementations </a> </li> <li class="toctree-l1"> <a class="reference internal" href="limitations.html"> Saving and other limitations </a> </li> <li class="toctree-l1"> <a class="reference internal" href="credits.html"> Credits </a> </li> ................................................................................ </div> <nav id="bd-toc-nav"> <ul class="visible nav section-nav flex-column"> <li class="toc-h2 nav-item toc-entry"> <a class="reference internal nav-link" href="#webaudio"> WebAudio </a> </li> <li class="toc-h2 nav-item toc-entry"> <a class="reference internal nav-link" href="#obsevers"> Obsevers </a> </li> <li class="toc-h2 nav-item toc-entry"> ................................................................................ </a> </li> <li class="toc-h2 nav-item toc-entry"> <a class="reference internal nav-link" href="#algorithmic-music"> Algorithmic Music </a> </li> </ul> </nav> </div> </div> </div> <div id="main-content" class="row"> ................................................................................ <a class="reference external" href="https://catarak.github.io/blog/2014/12/02/web-audio-timing-tutorial/">https://catarak.github.io/blog/2014/12/02/web-audio-timing-tutorial/</a><br /> <a class="reference external" href="https://github.com/ideoforms/isobar">https://github.com/ideoforms/isobar</a><br /> <a class="reference external" href="https://github.com/tmhglnd/mercury/blob/master/docs/reference.md">https://github.com/tmhglnd/mercury/blob/master/docs/reference.md</a><br /> <a class="reference external" href="https://github.com/thedjinn/js303">https://github.com/thedjinn/js303</a><br /> <a class="reference external" href="https://www.sitepoint.com/creating-accurate-timers-in-javascript/">https://www.sitepoint.com/creating-accurate-timers-in-javascript/</a><br /> <a class="reference external" href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Advanced_techniques">https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Advanced_techniques</a><br /> <a class="reference external" href="https://webaudiodemos.appspot.com/">https://webaudiodemos.appspot.com/</a><br /> <a class="reference external" href="https://www.html5rocks.com/en/tutorials/audio/scheduling/">https://www.html5rocks.com/en/tutorials/audio/scheduling/</a></p> </div> <div class="section" id="obsevers"> <h2>Obsevers<a class="headerlink" href="#obsevers" title="Permalink to this headline">¶</a></h2> <p><a class="reference external" href="https://github.com/rsimmons/plinth">https://github.com/rsimmons/plinth</a><br /> <a class="reference external" href="https://github.com/gullerya/object-observer">https://github.com/gullerya/object-observer</a><br /> <a class="reference external" href="https://awesomeopensource.com/project/nx-js/observer-util">https://awesomeopensource.com/project/nx-js/observer-util</a><br /> <a class="reference external" href="https://doc.esdoc.org/github.com/jstoolkit/dom-observer/">https://doc.esdoc.org/github.com/jstoolkit/dom-observer/</a><br /> ................................................................................ <a class="reference external" href="https://medium.com/swlh/building-a-audio-visualizer-with-javascript-324b8d420e7">https://medium.com/swlh/building-a-audio-visualizer-with-javascript-324b8d420e7</a><br /> <a class="reference external" href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Visualizations_with_Web_Audio_API">https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Visualizations_with_Web_Audio_API</a><br /> <a class="reference external" href="https://www.airtightinteractive.com/2013/10/making-audio-reactive-visuals/">https://www.airtightinteractive.com/2013/10/making-audio-reactive-visuals/</a><br /> <a class="reference external" href="https://1mb.club/">https://1mb.club/</a></p> </div> <div class="section" id="misc"> <h2>Misc<a class="headerlink" href="#misc" title="Permalink to this headline">¶</a></h2> <p><a class="reference external" href="https://gist.github.com/sroccaserra/5bacbdb3e000a54dbae0972c346021d4">https://gist.github.com/sroccaserra/5bacbdb3e000a54dbae0972c346021d4</a></p> <p><a class="reference external" href="https://teropa.info/blog/2016/08/10/frequency-and-pitch.html">https://teropa.info/blog/2016/08/10/frequency-and-pitch.html</a><br /> <a class="reference external" href="http://www.pawfal.org/fluxus/documentation/">http://www.pawfal.org/fluxus/documentation/</a><br /> <a class="reference external" href="https://music.tutsplus.com/tutorials/how-to-create-acid-synth-sequences--audio-3000">https://music.tutsplus.com/tutorials/how-to-create-acid-synth-sequences–audio-3000</a><br /> <a class="reference external" href="https://acidvoice.com/tb_303_famous_patterns.php">https://acidvoice.com/tb_303_famous_patterns.php</a><br /> <a class="reference external" href="https://www.adsrsounds.com/ni-massive-tutorials/dub-techno-synth-stab-tutorial/">https://www.adsrsounds.com/ni-massive-tutorials/dub-techno-synth-stab-tutorial/</a><br /> <a class="reference external" href="https://medias.ircam.fr/x9d4352">https://medias.ircam.fr/x9d4352</a><br /> <a class="reference external" href="https://vuejsexamples.com/a-drum-synthesizer-sequencer-built-with-tone-js-and-vue-js/js">https://vuejsexamples.com/a-drum-synthesizer-sequencer-built-with-tone-js-and-vue-js/js</a><br /> <a class="reference external" href="https://areknawo.com/10-libraries-for-web-audio-stuff/">https://areknawo.com/10-libraries-for-web-audio-stuff/</a><br /> ................................................................................ <a class="reference external" href="https://github.com/kevincennis/TinyMusic">https://github.com/kevincennis/TinyMusic</a><br /> <a class="reference external" href="https://github.com/pixicoder/PS">https://github.com/pixicoder/PS</a><br /> <a class="reference external" href="https://github.com/swallez/livecoding-webaudio-tonejs">https://github.com/swallez/livecoding-webaudio-tonejs</a><br /> <a class="reference external" href="https://padenot.github.io/litsynth/">https://padenot.github.io/litsynth/</a></p> </div> <div class="section" id="inspiration"> <h2>Inspiration<a class="headerlink" href="#inspiration" title="Permalink to this headline">¶</a></h2> <p><a class="reference external" href="https://github.com/AuburnSounds/Dplug/wiki/Dplug-VST2-Guide">https://github.com/AuburnSounds/Dplug/wiki/Dplug-VST2-Guide</a><br /> <a class="reference external" href="https://github.com/tmhglnd/mercury">https://github.com/tmhglnd/mercury</a><br /> <a class="reference external" href="https://www.mazbox.com/synths/dubstep/">https://www.mazbox.com/synths/dubstep/</a><br /> <a class="reference external" href="https://cdm.link/2019/04/automated-techno-eternal-flow/">https://cdm.link/2019/04/automated-techno-eternal-flow/</a><br /> <a class="reference external" href="https://survios.com/electronauts/">https://survios.com/electronauts/</a><br /> <a class="reference external" href="https://liv3c0der.com/">https://liv3c0der.com/</a><br /> <a class="reference external" href="http://wavepot.com/">http://wavepot.com/</a><br /> <a class="reference external" href="https://glicol.web.app/">https://glicol.web.app/</a><br /> ................................................................................ <a class="reference external" href="https://tweakable.org/">https://tweakable.org/</a> <a class="reference external" href="https://foxdot.org/docs/pattern-functions/">https://foxdot.org/docs/pattern-functions/</a><br /> <a class="reference external" href="https://faustdoc.grame.fr/">https://faustdoc.grame.fr/</a><br /> <a class="reference external" href="https://www.fsynth.com/">https://www.fsynth.com/</a><br /> <a class="reference external" href="https://errozero.co.uk/acid-machine/">https://errozero.co.uk/acid-machine/</a><br /> <a class="reference external" href="https://the.wubmachine.com/">https://the.wubmachine.com/</a><br /> <a class="reference external" href="https://scribbletune.com/documentation/browser/browser-clip">https://scribbletune.com/documentation/browser/browser-clip</a><br /> <a class="reference external" href="https://djen.co/">https://djen.co/</a></p> </div> <div class="section" id="music"> <h2>Music<a class="headerlink" href="#music" title="Permalink to this headline">¶</a></h2> <p><a class="reference external" href="http://www.p01.org/256b_woman_farmer/">http://www.p01.org/256b_woman_farmer/</a><br /> <a class="reference external" href="https://aem1k.com/">https://aem1k.com/</a><br /> <a class="reference external" href="https://ludotune.com/">https://ludotune.com/</a><br /> <a class="reference external" href="https://www.mazbox.com/synths/dubstep/">https://www.mazbox.com/synths/dubstep/</a></p> </div> <div class="section" id="algorithmic-music"> <h2>Algorithmic Music<a class="headerlink" href="#algorithmic-music" title="Permalink to this headline">¶</a></h2> <p><a class="reference external" href="https://cmsw.mit.edu/algorithmic-music-experience-composing-wolframtones/">https://cmsw.mit.edu/algorithmic-music-experience-composing-wolframtones/</a><br /> <a class="reference external" href="https://ccrma.stanford.edu/~blackrse/algorithm.html">https://ccrma.stanford.edu/~blackrse/algorithm.html</a><br /> <a class="reference external" href="https://oeis.org/">https://oeis.org/</a><br /> <a class="reference external" href="https://www.cs.cmu.edu/~music/cmsip/readings/MIDI%20tutorial%20for%20programmers.html">https://www.cs.cmu.edu/~music/cmsip/readings/MIDI%20tutorial%20for%20programmers.html</a> <a class="reference external" href="https://en.wikipedia.org/wiki/Computational_creativity">https://en.wikipedia.org/wiki/Computational_creativity</a><br /> <a class="reference external" href="https://en.wikipedia.org/wiki/Algorithmic_composition">https://en.wikipedia.org/wiki/Algorithmic_composition</a><br /> <a class="reference external" href="https://en.wikipedia.org/wiki/Constraint_programming">https://en.wikipedia.org/wiki/Constraint_programming</a><br /> <a class="reference external" href="https://www.bipscript.org/">https://www.bipscript.org/</a><br /> <a class="reference external" href="http://commonmusic.sourceforge.net/cm/res/doc/cm.html">http://commonmusic.sourceforge.net/cm/res/doc/cm.html</a><br /> <a class="reference external" href="https://bolprocessor.sourceforge.io/docs/">https://bolprocessor.sourceforge.io/docs/</a><br /> <a class="reference external" href="https://en.wikipedia.org/wiki/Music_Macro_Language">https://en.wikipedia.org/wiki/Music_Macro_Language</a><br /> <a class="reference external" href="https://github.com/IjzerenHein/kiwi.js/">https://github.com/IjzerenHein/kiwi.js/</a></p> </div> </div> </div> |
| | > > > > > > > > > > > > > > > | > > > > > > > > > > > > > > > > > | > | > | | > > | | > > > > > > > > > > > > > > > > > > > > > > |
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 ... 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 ... 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 ... 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 ... 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 ... 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 ... 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 |
</li> <li class="toctree-l1"> <a class="reference internal" href="alternate-implementation.html"> Alternate Implementations </a> </li> <li class="toctree-l1"> <a class="reference internal" href="saving.html"> Saving / Recording / Streaming </a> </li> <li class="toctree-l1"> <a class="reference internal" href="credits.html"> Credits </a> </li> ................................................................................ </div> <nav id="bd-toc-nav"> <ul class="visible nav section-nav flex-column"> <li class="toc-h2 nav-item toc-entry"> <a class="reference internal nav-link" href="#webaudio"> WebAudio </a> </li> <li class="toc-h2 nav-item toc-entry"> <a class="reference internal nav-link" href="#audio-worklets-and-wasm"> Audio Worklets and Wasm </a> </li> <li class="toc-h2 nav-item toc-entry"> <a class="reference internal nav-link" href="#obsevers"> Obsevers </a> </li> <li class="toc-h2 nav-item toc-entry"> ................................................................................ </a> </li> <li class="toc-h2 nav-item toc-entry"> <a class="reference internal nav-link" href="#algorithmic-music"> Algorithmic Music </a> </li> <li class="toc-h2 nav-item toc-entry"> <a class="reference internal nav-link" href="#sound-design"> Sound Design </a> </li> <li class="toc-h2 nav-item toc-entry"> <a class="reference internal nav-link" href="#clocks"> Clocks </a> </li> </ul> </nav> </div> </div> </div> <div id="main-content" class="row"> ................................................................................ <a class="reference external" href="https://catarak.github.io/blog/2014/12/02/web-audio-timing-tutorial/">https://catarak.github.io/blog/2014/12/02/web-audio-timing-tutorial/</a><br /> <a class="reference external" href="https://github.com/ideoforms/isobar">https://github.com/ideoforms/isobar</a><br /> <a class="reference external" href="https://github.com/tmhglnd/mercury/blob/master/docs/reference.md">https://github.com/tmhglnd/mercury/blob/master/docs/reference.md</a><br /> <a class="reference external" href="https://github.com/thedjinn/js303">https://github.com/thedjinn/js303</a><br /> <a class="reference external" href="https://www.sitepoint.com/creating-accurate-timers-in-javascript/">https://www.sitepoint.com/creating-accurate-timers-in-javascript/</a><br /> <a class="reference external" href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Advanced_techniques">https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Advanced_techniques</a><br /> <a class="reference external" href="https://webaudiodemos.appspot.com/">https://webaudiodemos.appspot.com/</a><br /> <a class="reference external" href="https://www.html5rocks.com/en/tutorials/audio/scheduling/">https://www.html5rocks.com/en/tutorials/audio/scheduling/</a><br /> <a class="reference external" href="https://github.com/jshanley/blip">https://github.com/jshanley/blip</a><br /> <a class="reference external" href="https://github.com/alemangui/pizzicato">https://github.com/alemangui/pizzicato</a></p> </div> <div class="section" id="audio-worklets-and-wasm"> <h2>Audio Worklets and Wasm<a class="headerlink" href="#audio-worklets-and-wasm" title="Permalink to this headline">¶</a></h2> <p><a class="reference external" href="https://sol.gfxile.net/soloud/">https://sol.gfxile.net/soloud/</a><br /> <a class="reference external" href="https://github.com/micknoise/Maximilian">https://github.com/micknoise/Maximilian</a><br /> <a class="reference external" href="https://mod.haxor.fi/Uncle_Tom/mod.occ-san-geen">https://mod.haxor.fi/Uncle_Tom/mod.occ-san-geen</a><br /> <a class="reference external" href="https://github.com/divideconcept/FluidLite">https://github.com/divideconcept/FluidLite</a><br /> <a class="reference external" href="https://github.com/mmontag/chip-player-js">https://github.com/mmontag/chip-player-js</a><br /> <a class="reference external" href="https://github.com/cutterbl/SoundTouchJS">https://github.com/cutterbl/SoundTouchJS</a><br /> <a class="reference external" href="https://github.com/AnthumChris/opus-bitrates">https://github.com/AnthumChris/opus-bitrates</a><br /> <a class="reference external" href="https://github.com/warpdesign/modplayer-js/">https://github.com/warpdesign/modplayer-js/</a><br /> <a class="reference external" href="https://github.com/fspa/AudioWorkletPolySynth">https://github.com/fspa/AudioWorkletPolySynth</a><br /> <a class="reference external" href="https://www.youtube.com/watch?v=x9RP-M6q2Mg">https://www.youtube.com/watch?v=x9RP-M6q2Mg</a><br /> <a class="reference external" href="https://www.youtube.com/watch?v=zgOGZgAPUjQ">https://www.youtube.com/watch?v=zgOGZgAPUjQ</a><br /> <a class="reference external" href="https://soundprogramming.net/programming/tutorial-using-sdl2-and-sdl_mixer-to-play-samples/">https://soundprogramming.net/programming/tutorial-using-sdl2-and-sdl_mixer-to-play-samples/</a></p> </div> <div class="section" id="obsevers"> <h2>Obsevers<a class="headerlink" href="#obsevers" title="Permalink to this headline">¶</a></h2> <p><a class="reference external" href="https://github.com/rsimmons/plinth">https://github.com/rsimmons/plinth</a><br /> <a class="reference external" href="https://github.com/gullerya/object-observer">https://github.com/gullerya/object-observer</a><br /> <a class="reference external" href="https://awesomeopensource.com/project/nx-js/observer-util">https://awesomeopensource.com/project/nx-js/observer-util</a><br /> <a class="reference external" href="https://doc.esdoc.org/github.com/jstoolkit/dom-observer/">https://doc.esdoc.org/github.com/jstoolkit/dom-observer/</a><br /> ................................................................................ <a class="reference external" href="https://medium.com/swlh/building-a-audio-visualizer-with-javascript-324b8d420e7">https://medium.com/swlh/building-a-audio-visualizer-with-javascript-324b8d420e7</a><br /> <a class="reference external" href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Visualizations_with_Web_Audio_API">https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Visualizations_with_Web_Audio_API</a><br /> <a class="reference external" href="https://www.airtightinteractive.com/2013/10/making-audio-reactive-visuals/">https://www.airtightinteractive.com/2013/10/making-audio-reactive-visuals/</a><br /> <a class="reference external" href="https://1mb.club/">https://1mb.club/</a></p> </div> <div class="section" id="misc"> <h2>Misc<a class="headerlink" href="#misc" title="Permalink to this headline">¶</a></h2> <p><a class="reference external" href="https://gist.github.com/sroccaserra/5bacbdb3e000a54dbae0972c346021d4">https://gist.github.com/sroccaserra/5bacbdb3e000a54dbae0972c346021d4</a><br /> <a class="reference external" href="https://awesomeopensource.com/project/syncopika/piano_roll_browser">https://awesomeopensource.com/project/syncopika/piano_roll_browser</a><br /> <a class="reference external" href="https://teropa.info/blog/2016/08/10/frequency-and-pitch.html">https://teropa.info/blog/2016/08/10/frequency-and-pitch.html</a><br /> <a class="reference external" href="http://www.pawfal.org/fluxus/documentation/">http://www.pawfal.org/fluxus/documentation/</a><br /> <a class="reference external" href="https://music.tutsplus.com/tutorials/how-to-create-acid-synth-sequences--audio-3000">https://music.tutsplus.com/tutorials/how-to-create-acid-synth-sequences–audio-3000</a><br /> <a class="reference external" href="https://acidvoice.com/tb_303_famous_patterns.php">https://acidvoice.com/tb_303_famous_patterns.php</a><br /> <a class="reference external" href="https://www.adsrsounds.com/ni-massive-tutorials/dub-techno-synth-stab-tutorial/">https://www.adsrsounds.com/ni-massive-tutorials/dub-techno-synth-stab-tutorial/</a><br /> <a class="reference external" href="https://medias.ircam.fr/x9d4352">https://medias.ircam.fr/x9d4352</a><br /> <a class="reference external" href="https://vuejsexamples.com/a-drum-synthesizer-sequencer-built-with-tone-js-and-vue-js/js">https://vuejsexamples.com/a-drum-synthesizer-sequencer-built-with-tone-js-and-vue-js/js</a><br /> <a class="reference external" href="https://areknawo.com/10-libraries-for-web-audio-stuff/">https://areknawo.com/10-libraries-for-web-audio-stuff/</a><br /> ................................................................................ <a class="reference external" href="https://github.com/kevincennis/TinyMusic">https://github.com/kevincennis/TinyMusic</a><br /> <a class="reference external" href="https://github.com/pixicoder/PS">https://github.com/pixicoder/PS</a><br /> <a class="reference external" href="https://github.com/swallez/livecoding-webaudio-tonejs">https://github.com/swallez/livecoding-webaudio-tonejs</a><br /> <a class="reference external" href="https://padenot.github.io/litsynth/">https://padenot.github.io/litsynth/</a></p> </div> <div class="section" id="inspiration"> <h2>Inspiration<a class="headerlink" href="#inspiration" title="Permalink to this headline">¶</a></h2> <p><a class="reference external" href="https://www.bbc.co.uk/bitesize/guides/z4k9dxs/revision/2">https://www.bbc.co.uk/bitesize/guides/z4k9dxs/revision/2</a><br /> <a class="reference external" href="https://github.com/AuburnSounds/Dplug/wiki/Dplug-VST2-Guide">https://github.com/AuburnSounds/Dplug/wiki/Dplug-VST2-Guide</a><br /> <a class="reference external" href="https://github.com/tmhglnd/mercury">https://github.com/tmhglnd/mercury</a><br /> <a class="reference external" href="https://www.mazbox.com/synths/dubstep/">https://www.mazbox.com/synths/dubstep/</a><br /> <a class="reference external" href="https://cdm.link/2019/04/automated-techno-eternal-flow/">https://cdm.link/2019/04/automated-techno-eternal-flow/</a><br /> <a class="reference external" href="https://survios.com/electronauts/">https://survios.com/electronauts/</a><br /> <a class="reference external" href="https://liv3c0der.com/">https://liv3c0der.com/</a><br /> <a class="reference external" href="http://wavepot.com/">http://wavepot.com/</a><br /> <a class="reference external" href="https://glicol.web.app/">https://glicol.web.app/</a><br /> ................................................................................ <a class="reference external" href="https://tweakable.org/">https://tweakable.org/</a> <a class="reference external" href="https://foxdot.org/docs/pattern-functions/">https://foxdot.org/docs/pattern-functions/</a><br /> <a class="reference external" href="https://faustdoc.grame.fr/">https://faustdoc.grame.fr/</a><br /> <a class="reference external" href="https://www.fsynth.com/">https://www.fsynth.com/</a><br /> <a class="reference external" href="https://errozero.co.uk/acid-machine/">https://errozero.co.uk/acid-machine/</a><br /> <a class="reference external" href="https://the.wubmachine.com/">https://the.wubmachine.com/</a><br /> <a class="reference external" href="https://scribbletune.com/documentation/browser/browser-clip">https://scribbletune.com/documentation/browser/browser-clip</a><br /> <a class="reference external" href="https://djen.co/">https://djen.co/</a><br /> <<a class="reference external" href="https://burial.glitch.me/">https://burial.glitch.me/</a>></p> </div> <div class="section" id="music"> <h2>Music<a class="headerlink" href="#music" title="Permalink to this headline">¶</a></h2> <p><a class="reference external" href="http://www.p01.org/256b_woman_farmer/">http://www.p01.org/256b_woman_farmer/</a><br /> <a class="reference external" href="https://aem1k.com/">https://aem1k.com/</a><br /> <a class="reference external" href="https://ludotune.com/">https://ludotune.com/</a><br /> <a class="reference external" href="https://www.mazbox.com/synths/dubstep/">https://www.mazbox.com/synths/dubstep/</a></p> </div> <div class="section" id="algorithmic-music"> <h2>Algorithmic Music<a class="headerlink" href="#algorithmic-music" title="Permalink to this headline">¶</a></h2> <p><a class="reference external" href="https://teropa.info/">https://teropa.info/</a><br /> <a class="reference external" href="https://cmsw.mit.edu/algorithmic-music-experience-composing-wolframtones/">https://cmsw.mit.edu/algorithmic-music-experience-composing-wolframtones/</a><br /> <a class="reference external" href="https://ccrma.stanford.edu/~blackrse/algorithm.html">https://ccrma.stanford.edu/~blackrse/algorithm.html</a><br /> <a class="reference external" href="https://oeis.org/">https://oeis.org/</a><br /> <a class="reference external" href="https://www.cs.cmu.edu/~music/cmsip/readings/MIDI%20tutorial%20for%20programmers.html">https://www.cs.cmu.edu/~music/cmsip/readings/MIDI%20tutorial%20for%20programmers.html</a> <a class="reference external" href="https://en.wikipedia.org/wiki/Computational_creativity">https://en.wikipedia.org/wiki/Computational_creativity</a><br /> <a class="reference external" href="https://en.wikipedia.org/wiki/Algorithmic_composition">https://en.wikipedia.org/wiki/Algorithmic_composition</a><br /> <a class="reference external" href="https://en.wikipedia.org/wiki/Constraint_programming">https://en.wikipedia.org/wiki/Constraint_programming</a><br /> <a class="reference external" href="https://www.bipscript.org/">https://www.bipscript.org/</a><br /> <a class="reference external" href="http://commonmusic.sourceforge.net/cm/res/doc/cm.html">http://commonmusic.sourceforge.net/cm/res/doc/cm.html</a><br /> <a class="reference external" href="https://bolprocessor.sourceforge.io/docs/">https://bolprocessor.sourceforge.io/docs/</a><br /> <a class="reference external" href="https://en.wikipedia.org/wiki/Music_Macro_Language">https://en.wikipedia.org/wiki/Music_Macro_Language</a><br /> <a class="reference external" href="https://github.com/IjzerenHein/kiwi.js/">https://github.com/IjzerenHein/kiwi.js/</a><br /> <a class="reference external" href="https://github.com/miguelramos/node-media-manager">https://github.com/miguelramos/node-media-manager</a><br /> <a class="reference external" href="https://github.com/lnfiniteMonkeys/TimeLines">https://github.com/lnfiniteMonkeys/TimeLines</a></p> </div> <div class="section" id="sound-design"> <h2>Sound Design<a class="headerlink" href="#sound-design" title="Permalink to this headline">¶</a></h2> <p><a class="reference external" href="https://www.attackmagazine.com/technique/synth-secrets/dub-techno-synth-chords/">https://www.attackmagazine.com/technique/synth-secrets/dub-techno-synth-chords/</a></p> </div> <div class="section" id="clocks"> <h2>Clocks<a class="headerlink" href="#clocks" title="Permalink to this headline">¶</a></h2> <p><a class="reference external" href="https://github.com/eriser/clock">https://github.com/eriser/clock</a><br /> <a class="reference external" href="https://github.com/filebrowser/filebrowser">https://github.com/filebrowser/filebrowser</a><br /> <a class="reference external" href="https://github.com/lachlandk/chronos/blob/master/chronos.js">https://github.com/lachlandk/chronos/blob/master/chronos.js</a><br /> <a class="reference external" href="https://github.com/CharlotteGore/tick">https://github.com/CharlotteGore/tick</a><br /> <a class="reference external" href="https://github.com/pelevesque/web-audio-scheduler/blob/master/index.html">https://github.com/pelevesque/web-audio-scheduler/blob/master/index.html</a><br /> <a class="reference external" href="https://github.com/CharlotteGore/beat-master">https://github.com/CharlotteGore/beat-master</a><br /> <a class="reference external" href="https://www.npmjs.com/package/beat-scheduler">https://www.npmjs.com/package/beat-scheduler</a><br /> <a class="reference external" href="https://www.npmjs.com/package/beet.js">https://www.npmjs.com/package/beet.js</a><br /> <a class="reference external" href="https://www.npmjs.com/package/step-seq">https://www.npmjs.com/package/step-seq</a><br /> <a class="reference external" href="https://github.com/mmckegg/bopper/blob/master/index.js">https://github.com/mmckegg/bopper/blob/master/index.js</a><br /> <a class="reference external" href="https://github.com/jshanley/blip/blob/master/src/loop.js">https://github.com/jshanley/blip/blob/master/src/loop.js</a><br /> <a class="reference external" href="https://sebpiq.github.io/WAAClock/demos/beatSequence.html">https://sebpiq.github.io/WAAClock/demos/beatSequence.html</a> <a class="reference external" href="http://adamrenklint.com/using-expressions-in-dilla">http://adamrenklint.com/using-expressions-in-dilla</a></p> </div> </div> </div> |
Changes to build/html/changelog.html.
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
</li> <li class="toctree-l1"> <a class="reference internal" href="alternate-implementation.html"> Alternate Implementations </a> </li> <li class="toctree-l1"> <a class="reference internal" href="limitations.html"> Saving and other limitations </a> </li> <li class="toctree-l1"> <a class="reference internal" href="credits.html"> Credits </a> </li> |
| | |
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
</li> <li class="toctree-l1"> <a class="reference internal" href="alternate-implementation.html"> Alternate Implementations </a> </li> <li class="toctree-l1"> <a class="reference internal" href="saving.html"> Saving / Recording / Streaming </a> </li> <li class="toctree-l1"> <a class="reference internal" href="credits.html"> Credits </a> </li> |
Changes to build/html/credits.html.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 ... 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 ... 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 |
<script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script src="_static/sphinx-book-theme.12a9622fbb08dcb3a2a40b2c02b83a57.js"></script> <script src="_static/analytics.js"></script> <link rel="index" title="Index" href="genindex.html" /> <link rel="search" title="Search" href="search.html" /> <link rel="next" title="Bookmarks" href="bookmarks.html" /> <link rel="prev" title="Saving and other limitations" href="limitations.html" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="docsearch:language" content="en" /> </head> <body data-spy="scroll" data-target="#bd-toc-nav" data-offset="80"> <div class="container-fluid" id="banner"></div> ................................................................................ </li> <li class="toctree-l1"> <a class="reference internal" href="alternate-implementation.html"> Alternate Implementations </a> </li> <li class="toctree-l1"> <a class="reference internal" href="limitations.html"> Saving and other limitations </a> </li> <li class="toctree-l1 current active"> <a class="current reference internal" href="#"> Credits </a> </li> ................................................................................ </div> <div class='prev-next-bottom'> <a class='left-prev' id="prev-link" href="limitations.html" title="previous page">Saving and other limitations</a> <a class='right-next' id="next-link" href="bookmarks.html" title="next page">Bookmarks</a> </div> </div> </div> <footer class="footer mt-5 mt-md-0"> |
| | | | |
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 ... 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 ... 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 |
<script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script src="_static/sphinx-book-theme.12a9622fbb08dcb3a2a40b2c02b83a57.js"></script> <script src="_static/analytics.js"></script> <link rel="index" title="Index" href="genindex.html" /> <link rel="search" title="Search" href="search.html" /> <link rel="next" title="Bookmarks" href="bookmarks.html" /> <link rel="prev" title="Saving / Recording / Streaming" href="saving.html" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="docsearch:language" content="en" /> </head> <body data-spy="scroll" data-target="#bd-toc-nav" data-offset="80"> <div class="container-fluid" id="banner"></div> ................................................................................ </li> <li class="toctree-l1"> <a class="reference internal" href="alternate-implementation.html"> Alternate Implementations </a> </li> <li class="toctree-l1"> <a class="reference internal" href="saving.html"> Saving / Recording / Streaming </a> </li> <li class="toctree-l1 current active"> <a class="current reference internal" href="#"> Credits </a> </li> ................................................................................ </div> <div class='prev-next-bottom'> <a class='left-prev' id="prev-link" href="saving.html" title="previous page">Saving / Recording / Streaming</a> <a class='right-next' id="next-link" href="bookmarks.html" title="next page">Bookmarks</a> </div> </div> </div> <footer class="footer mt-5 mt-md-0"> |
Changes to build/html/demo.html.
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
</li> <li class="toctree-l1"> <a class="reference internal" href="alternate-implementation.html"> Alternate Implementations </a> </li> <li class="toctree-l1"> <a class="reference internal" href="limitations.html"> Saving and other limitations </a> </li> <li class="toctree-l1"> <a class="reference internal" href="credits.html"> Credits </a> </li> |
| | |
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
</li> <li class="toctree-l1"> <a class="reference internal" href="alternate-implementation.html"> Alternate Implementations </a> </li> <li class="toctree-l1"> <a class="reference internal" href="saving.html"> Saving / Recording / Streaming </a> </li> <li class="toctree-l1"> <a class="reference internal" href="credits.html"> Credits </a> </li> |
Changes to build/html/early-attempts.html.
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
</li> <li class="toctree-l1"> <a class="reference internal" href="alternate-implementation.html"> Alternate Implementations </a> </li> <li class="toctree-l1"> <a class="reference internal" href="limitations.html"> Saving and other limitations </a> </li> <li class="toctree-l1"> <a class="reference internal" href="credits.html"> Credits </a> </li> |
| | |
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
</li> <li class="toctree-l1"> <a class="reference internal" href="alternate-implementation.html"> Alternate Implementations </a> </li> <li class="toctree-l1"> <a class="reference internal" href="saving.html"> Saving / Recording / Streaming </a> </li> <li class="toctree-l1"> <a class="reference internal" href="credits.html"> Credits </a> </li> |
Changes to build/html/genindex.html.
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
</li> <li class="toctree-l1"> <a class="reference internal" href="alternate-implementation.html"> Alternate Implementations </a> </li> <li class="toctree-l1"> <a class="reference internal" href="limitations.html"> Saving and other limitations </a> </li> <li class="toctree-l1"> <a class="reference internal" href="credits.html"> Credits </a> </li> |
| | |
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
</li> <li class="toctree-l1"> <a class="reference internal" href="alternate-implementation.html"> Alternate Implementations </a> </li> <li class="toctree-l1"> <a class="reference internal" href="saving.html"> Saving / Recording / Streaming </a> </li> <li class="toctree-l1"> <a class="reference internal" href="credits.html"> Credits </a> </li> |
Changes to build/html/index.html.
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 ... 192 193 194 195 196 197 198 199 200 201 202 203 204 205 ... 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 |
</li> <li class="toctree-l1"> <a class="reference internal" href="alternate-implementation.html"> Alternate Implementations </a> </li> <li class="toctree-l1"> <a class="reference internal" href="limitations.html"> Saving and other limitations </a> </li> <li class="toctree-l1"> <a class="reference internal" href="credits.html"> Credits </a> </li> ................................................................................ <div class="section" id="welcome-to-bitrhythm-s-documentation"> <h1>Welcome to Bitrhythm’s documentation!<a class="headerlink" href="#welcome-to-bitrhythm-s-documentation" title="Permalink to this headline">¶</a></h1> <div class="toctree-wrapper compound"> <p class="caption"><span class="caption-text">Table of Contents</span></p> <ul> <li class="toctree-l1"><a class="reference internal" href="what.html">What is bitrhythm about ?</a><ul> <li class="toctree-l2"><a class="reference internal" href="what.html#adc-2021">ADC 2021</a></li> <li class="toctree-l2"><a class="reference internal" href="what.html#inspiration-for-the-project">Inspiration for the project</a></li> <li class="toctree-l2"><a class="reference internal" href="what.html#support-this-project">Support this project</a></li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="source-code.html">Source Code and License</a></li> <li class="toctree-l1"><a class="reference internal" href="demo.html">Getting Started</a><ul> ................................................................................ <li class="toctree-l2"><a class="reference internal" href="tweaking.html#tweaking-and-transitions">Tweaking and Transitions</a></li> <li class="toctree-l2"><a class="reference internal" href="tweaking.html#is-bitrhythm-maths-heavy">Is Bitrhythm Maths heavy ?</a></li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="early-attempts.html">Early Attempts</a></li> <li class="toctree-l1"><a class="reference internal" href="changelog.html">Changelog</a></li> <li class="toctree-l1"><a class="reference internal" href="main.html">Code Walkthrough</a><ul> <li class="toctree-l2"><a class="reference internal" href="main.html#core-tracker-loop">Core Tracker Loop</a><ul> <li class="toctree-l3"><a class="reference internal" href="main.html#observers">Observers</a></li> </ul> </li> <li class="toctree-l2"><a class="reference internal" href="main.html#dials">Dials</a></li> <li class="toctree-l2"><a class="reference internal" href="main.html#numbers">Numbers</a></li> <li class="toctree-l2"><a class="reference internal" href="main.html#autoknob">AutoKnob</a></li> <li class="toctree-l2"><a class="reference internal" href="main.html#main-ui">Main UI</a></li> <li class="toctree-l2"><a class="reference internal" href="main.html#sample">Sample</a></li> <li class="toctree-l2"><a class="reference internal" href="main.html#javascript">Javascript</a></li> <li class="toctree-l2"><a class="reference internal" href="main.html#id1">303</a></li> <li class="toctree-l2"><a class="reference internal" href="main.html#autocommit">Autocommit</a></li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="alternate-implementation.html">Alternate Implementations</a><ul> <li class="toctree-l2"><a class="reference internal" href="alternate-implementation.html#elementary">Elementary</a></li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="limitations.html">Saving and other limitations</a></li> <li class="toctree-l1"><a class="reference internal" href="credits.html">Credits</a></li> <li class="toctree-l1"><a class="reference internal" href="bookmarks.html">Bookmarks</a><ul> <li class="toctree-l2"><a class="reference internal" href="bookmarks.html#webaudio">WebAudio</a></li> <li class="toctree-l2"><a class="reference internal" href="bookmarks.html#obsevers">Obsevers</a></li> <li class="toctree-l2"><a class="reference internal" href="bookmarks.html#visuals">Visuals</a></li> <li class="toctree-l2"><a class="reference internal" href="bookmarks.html#misc">Misc</a></li> <li class="toctree-l2"><a class="reference internal" href="bookmarks.html#other-projects">Other Projects</a></li> <li class="toctree-l2"><a class="reference internal" href="bookmarks.html#inspiration">Inspiration</a></li> <li class="toctree-l2"><a class="reference internal" href="bookmarks.html#music">Music</a></li> <li class="toctree-l2"><a class="reference internal" href="bookmarks.html#algorithmic-music">Algorithmic Music</a></li> </ul> </li> </ul> </div> </div> |
| | > > > > > > | > > > |
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 ... 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 ... 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 |
</li> <li class="toctree-l1"> <a class="reference internal" href="alternate-implementation.html"> Alternate Implementations </a> </li> <li class="toctree-l1"> <a class="reference internal" href="saving.html"> Saving / Recording / Streaming </a> </li> <li class="toctree-l1"> <a class="reference internal" href="credits.html"> Credits </a> </li> ................................................................................ <div class="section" id="welcome-to-bitrhythm-s-documentation"> <h1>Welcome to Bitrhythm’s documentation!<a class="headerlink" href="#welcome-to-bitrhythm-s-documentation" title="Permalink to this headline">¶</a></h1> <div class="toctree-wrapper compound"> <p class="caption"><span class="caption-text">Table of Contents</span></p> <ul> <li class="toctree-l1"><a class="reference internal" href="what.html">What is bitrhythm about ?</a><ul> <li class="toctree-l2"><a class="reference internal" href="what.html#intro">Intro</a></li> <li class="toctree-l2"><a class="reference internal" href="what.html#adc-2021">ADC 2021</a></li> <li class="toctree-l2"><a class="reference internal" href="what.html#inspiration-for-the-project">Inspiration for the project</a></li> <li class="toctree-l2"><a class="reference internal" href="what.html#support-this-project">Support this project</a></li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="source-code.html">Source Code and License</a></li> <li class="toctree-l1"><a class="reference internal" href="demo.html">Getting Started</a><ul> ................................................................................ <li class="toctree-l2"><a class="reference internal" href="tweaking.html#tweaking-and-transitions">Tweaking and Transitions</a></li> <li class="toctree-l2"><a class="reference internal" href="tweaking.html#is-bitrhythm-maths-heavy">Is Bitrhythm Maths heavy ?</a></li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="early-attempts.html">Early Attempts</a></li> <li class="toctree-l1"><a class="reference internal" href="changelog.html">Changelog</a></li> <li class="toctree-l1"><a class="reference internal" href="main.html">Code Walkthrough</a><ul> <li class="toctree-l2"><a class="reference internal" href="main.html#running">Running</a></li> <li class="toctree-l2"><a class="reference internal" href="main.html#core-tracker-loop">Core Tracker Loop</a><ul> <li class="toctree-l3"><a class="reference internal" href="main.html#observers">Observers</a></li> </ul> </li> <li class="toctree-l2"><a class="reference internal" href="main.html#dials">Dials</a></li> <li class="toctree-l2"><a class="reference internal" href="main.html#numbers">Numbers</a></li> <li class="toctree-l2"><a class="reference internal" href="main.html#autoknob">AutoKnob</a></li> <li class="toctree-l2"><a class="reference internal" href="main.html#main-ui">Main UI</a></li> <li class="toctree-l2"><a class="reference internal" href="main.html#worklet">Worklet</a></li> <li class="toctree-l2"><a class="reference internal" href="main.html#sample">Sample</a></li> <li class="toctree-l2"><a class="reference internal" href="main.html#app">App</a></li> <li class="toctree-l2"><a class="reference internal" href="main.html#index">Index</a></li> <li class="toctree-l2"><a class="reference internal" href="main.html#page">Page</a></li> <li class="toctree-l2"><a class="reference internal" href="main.html#javascript">Javascript</a></li> <li class="toctree-l2"><a class="reference internal" href="main.html#id1">303</a></li> <li class="toctree-l2"><a class="reference internal" href="main.html#autocommit">Autocommit</a></li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="alternate-implementation.html">Alternate Implementations</a><ul> <li class="toctree-l2"><a class="reference internal" href="alternate-implementation.html#elementary">Elementary</a></li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="saving.html">Saving / Recording / Streaming</a></li> <li class="toctree-l1"><a class="reference internal" href="credits.html">Credits</a></li> <li class="toctree-l1"><a class="reference internal" href="bookmarks.html">Bookmarks</a><ul> <li class="toctree-l2"><a class="reference internal" href="bookmarks.html#webaudio">WebAudio</a></li> <li class="toctree-l2"><a class="reference internal" href="bookmarks.html#audio-worklets-and-wasm">Audio Worklets and Wasm</a></li> <li class="toctree-l2"><a class="reference internal" href="bookmarks.html#obsevers">Obsevers</a></li> <li class="toctree-l2"><a class="reference internal" href="bookmarks.html#visuals">Visuals</a></li> <li class="toctree-l2"><a class="reference internal" href="bookmarks.html#misc">Misc</a></li> <li class="toctree-l2"><a class="reference internal" href="bookmarks.html#other-projects">Other Projects</a></li> <li class="toctree-l2"><a class="reference internal" href="bookmarks.html#inspiration">Inspiration</a></li> <li class="toctree-l2"><a class="reference internal" href="bookmarks.html#music">Music</a></li> <li class="toctree-l2"><a class="reference internal" href="bookmarks.html#algorithmic-music">Algorithmic Music</a></li> <li class="toctree-l2"><a class="reference internal" href="bookmarks.html#sound-design">Sound Design</a></li> <li class="toctree-l2"><a class="reference internal" href="bookmarks.html#clocks">Clocks</a></li> </ul> </li> </ul> </div> </div> |
Deleted build/html/limitations.html.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 |
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Saving and other limitations — Bitrhythm's literate documentation</title> <link href="_static/css/theme.css" rel="stylesheet" /> <link href="_static/css/index.c5995385ac14fb8791e8eb36b4908be2.css" rel="stylesheet" /> <link rel="stylesheet" href="_static/vendor/fontawesome/5.13.0/css/all.min.css"> <link rel="preload" as="font" type="font/woff2" crossorigin href="_static/vendor/fontawesome/5.13.0/webfonts/fa-solid-900.woff2"> <link rel="preload" as="font" type="font/woff2" crossorigin href="_static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.woff2"> <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="_static/sphinx-book-theme.e8e5499552300ddf5d7adccae7cc3b70.css" type="text/css" /> <link rel="stylesheet" type="text/css" href="_static/custom.css" /> <link rel="preload" as="script" href="_static/js/index.1c5a1a01449ed65a7b51.js"> <script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script> <script src="_static/jquery.js"></script> <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script src="_static/sphinx-book-theme.12a9622fbb08dcb3a2a40b2c02b83a57.js"></script> <script src="_static/analytics.js"></script> <link rel="index" title="Index" href="genindex.html" /> <link rel="search" title="Search" href="search.html" /> <link rel="next" title="Credits" href="credits.html" /> <link rel="prev" title="Alternate Implementations" href="alternate-implementation.html" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="docsearch:language" content="en" /> </head> <body data-spy="scroll" data-target="#bd-toc-nav" data-offset="80"> <div class="container-fluid" id="banner"></div> <div class="container-xl"> <div class="row"> <div class="col-12 col-md-3 bd-sidebar site-navigation show" id="site-navigation"> <div class="navbar-brand-box"> <a class="navbar-brand text-wrap" href="index.html"> <h1 class="site-logo" id="site-title">Bitrhythm's literate documentation</h1> </a> </div><nav class="bd-links" id="bd-docs-nav" aria-label="Main navigation"> <div class="bd-toc-item active"> <p class="caption"> <span class="caption-text"> Table of Contents </span> </p> <ul class="current nav bd-sidenav"> <li class="toctree-l1"> <a class="reference internal" href="what.html"> What is bitrhythm about ? </a> </li> <li class="toctree-l1"> <a class="reference internal" href="source-code.html"> Source Code and License </a> </li> <li class="toctree-l1"> <a class="reference internal" href="demo.html"> Getting Started </a> </li> <li class="toctree-l1"> <a class="reference internal" href="samples.html"> Samples </a> </li> <li class="toctree-l1"> <a class="reference internal" href="tweaking.html"> Core Features </a> </li> <li class="toctree-l1"> <a class="reference internal" href="early-attempts.html"> Early Attempts </a> </li> <li class="toctree-l1"> <a class="reference internal" href="changelog.html"> Changelog </a> </li> <li class="toctree-l1"> <a class="reference internal" href="main.html"> Code Walkthrough </a> </li> <li class="toctree-l1"> <a class="reference internal" href="alternate-implementation.html"> Alternate Implementations </a> </li> <li class="toctree-l1 current active"> <a class="current reference internal" href="#"> Saving and other limitations </a> </li> <li class="toctree-l1"> <a class="reference internal" href="credits.html"> Credits </a> </li> <li class="toctree-l1"> <a class="reference internal" href="bookmarks.html"> Bookmarks </a> </li> </ul> </div> </nav> <!-- To handle the deprecated key --> <div class="navbar_extra_footer"> <a target="_blank" href="/">Bitrhythm App Home</a><br> <a target="_blank" href="https://xyzzyapps.link">Xyzzy Apps Home</a><br> <p class='custom-nav-footer'>(c) Xyzzy Apps, 2021</p> </div> </div> <main class="col py-md-3 pl-md-4 bd-content overflow-auto" role="main"> <div class="topbar container-xl fixed-top"> <div class="topbar-contents row"> <div class="col-12 col-md-3 bd-topbar-whitespace site-navigation show"></div> <div class="col pl-md-4 topbar-main"> <button id="navbar-toggler" class="navbar-toggler ml-0" type="button" data-toggle="collapse" data-toggle="tooltip" data-placement="bottom" data-target=".site-navigation" aria-controls="navbar-menu" aria-expanded="true" aria-label="Toggle navigation" aria-controls="site-navigation" title="Toggle navigation" data-toggle="tooltip" data-placement="left"> <i class="fas fa-bars"></i> <i class="fas fa-arrow-left"></i> <i class="fas fa-arrow-up"></i> </button> <!-- Source interaction buttons --> <!-- Full screen (wrap in <a> to have style consistency --> <a class="full-screen-button"><button type="button" class="btn btn-secondary topbarbtn" data-toggle="tooltip" data-placement="bottom" onclick="toggleFullScreen()" aria-label="Fullscreen mode" title="Fullscreen mode"><i class="fas fa-expand"></i></button></a> <!-- Launch buttons --> </div> <!-- Table of contents --> <div class="d-none d-md-block col-md-2 bd-toc show"> </div> </div> </div> <div id="main-content" class="row"> <div class="col-12 col-md-9 pl-md-3 pr-md-0"> <div> <div class="section" id="saving-and-other-limitations"> <h1>Saving and other limitations<a class="headerlink" href="#saving-and-other-limitations" title="Permalink to this headline">¶</a></h1> <p>There is a save button that converts the state of bitrhythm into a url paramter. This means there is an upper limit on how much code you can write, making it useful for demoscene like situations. You can share the url with tinyurl.</p> <p>You can also download the file. Please keep a backup.</p> <ul class="simple"> <li><p>Opening developer tools might slow down the execution a bit</p></li> <li><p>Using excessive delays and reverbs seems to cause some glitches</p></li> <li><p>Mobile browsers don’t work properly</p></li> <li><p>Firefox does not seem to work well with tone.js</p></li> </ul> <p>I use <a class="reference external" href="https://existential.audio/blackhole/">BlackHole</a> to record audio from the browser window to Reaper. You can use any screenrecording software to record the screen. Have a distinct sound to match both audio and video.</p> </div> </div> <div class='prev-next-bottom'> <a class='left-prev' id="prev-link" href="alternate-implementation.html" title="previous page">Alternate Implementations</a> <a class='right-next' id="next-link" href="credits.html" title="next page">Credits</a> </div> </div> </div> <footer class="footer mt-5 mt-md-0"> <div class="container"> <p> By Xyzzy Apps<br/> © Copyright (c) Xyzzy Apps, 2021.<br/> </p> </div> </footer> </main> </div> </div> <script src="_static/js/index.1c5a1a01449ed65a7b51.js"></script> </body> </html> |
< < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Changes to build/html/main.html.
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 ... 182 183 184 185 186 187 188 189 190 191 192 193 194 195 ... 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 ... 247 248 249 250 251 252 253 254 255 256 257 258 259 260 ... 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 ... 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 ... 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 ... 973 974 975 976 977 978 979 980 981 982 983 984 985 986 .... 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 .... 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 .... 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 .... 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 |
</li> <li class="toctree-l1"> <a class="reference internal" href="alternate-implementation.html"> Alternate Implementations </a> </li> <li class="toctree-l1"> <a class="reference internal" href="limitations.html"> Saving and other limitations </a> </li> <li class="toctree-l1"> <a class="reference internal" href="credits.html"> Credits </a> </li> ................................................................................ <div class="d-none d-md-block col-md-2 bd-toc show"> <div class="tocsection onthispage pt-5 pb-3"> <i class="fas fa-list"></i> Contents </div> <nav id="bd-toc-nav"> <ul class="visible nav section-nav flex-column"> <li class="toc-h2 nav-item toc-entry"> <a class="reference internal nav-link" href="#core-tracker-loop"> Core Tracker Loop </a> <ul class="nav section-nav flex-column"> <li class="toc-h3 nav-item toc-entry"> <a class="reference internal nav-link" href="#observers"> ................................................................................ AutoKnob </a> </li> <li class="toc-h2 nav-item toc-entry"> <a class="reference internal nav-link" href="#main-ui"> Main UI </a> </li> <li class="toc-h2 nav-item toc-entry"> <a class="reference internal nav-link" href="#sample"> Sample </a> </li> <li class="toc-h2 nav-item toc-entry"> <a class="reference internal nav-link" href="#javascript"> Javascript </a> </li> <li class="toc-h2 nav-item toc-entry"> ................................................................................ <div id="main-content" class="row"> <div class="col-12 col-md-9 pl-md-3 pr-md-0"> <div> <div class="section" id="code-walkthrough"> <h1>Code Walkthrough<a class="headerlink" href="#code-walkthrough" title="Permalink to this headline">¶</a></h1> <div class="section" id="core-tracker-loop"> <h2>Core Tracker Loop<a class="headerlink" href="#core-tracker-loop" title="Permalink to this headline">¶</a></h2> <p>In bitrhythm code is evaluated for every cycle.</p> <p>1 beat = 60 / tempo 1 cycle = 1 beat / ticks</p> <p>For every cycle visual and audio code is evaluated.</p> <p>The edit checkbox allows you to perform long edits, where only old code is evaluated. Once you disable it, all the new edit changes are applied in the next cycle.</p> ................................................................................ <span class="kd">var</span> <span class="nx">bars</span> <span class="o">=</span> <span class="mf">0</span><span class="p">;</span> <span class="kd">var</span> <span class="nx">tick</span> <span class="o">=</span> <span class="mf">0</span><span class="p">;</span> <span class="kd">var</span> <span class="nx">quarter_beat_length</span> <span class="o">=</span> <span class="mf">60000.0</span> <span class="o">/</span> <span class="k">this</span><span class="p">.</span><span class="nx">state</span><span class="p">.</span><span class="nx">tempo</span><span class="p">;</span> <span class="kd">var</span> <span class="nx">beat_length</span> <span class="o">=</span> <span class="nx">quarter_beat_length</span> <span class="o">*</span> <span class="mf">4</span><span class="p">;</span> <span class="kd">var</span> <span class="nx">delta</span> <span class="o">=</span> <span class="nx">beat_length</span> <span class="o">/</span> <span class="k">this</span><span class="p">.</span><span class="nx">state</span><span class="p">.</span><span class="nx">ticks</span><span class="p">;</span> <span class="nb">window</span><span class="p">.</span><span class="nx">samples</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">state</span><span class="p">.</span><span class="nx">samples</span><span class="p">;</span> <span class="kd">var</span> <span class="nx">eval_guard</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span> <span class="nx">self</span><span class="p">.</span><span class="nx">timer</span> <span class="o">=</span> <span class="nx">setInterval</span><span class="p">(</span><span class="kd">function</span> <span class="p">()</span> <span class="p">{</span> <span class="nx">count</span> <span class="o">=</span> <span class="nx">count</span> <span class="o">+</span> <span class="mf">1</span><span class="p">;</span> <span class="nx">tick</span> <span class="o">=</span> <span class="p">(</span><span class="nx">count</span> <span class="o">%</span> <span class="k">this</span><span class="p">.</span><span class="nx">state</span><span class="p">.</span><span class="nx">ticks</span><span class="p">);</span> <span class="k">if</span> <span class="p">(</span><span class="nx">tick</span> <span class="o">===</span> <span class="mf">0</span><span class="p">)</span> <span class="o">++</span><span class="nx">bars</span><span class="p">;</span> <span class="nx">$</span><span class="p">(</span><span class="s2">"#duration"</span><span class="p">).</span><span class="nx">html</span><span class="p">(</span><span class="s2">""</span> <span class="o">+</span> <span class="nx">bars</span> <span class="o">+</span> <span class="s2">"."</span> <span class="o">+</span> <span class="nx">tick</span> <span class="o">+</span> <span class="s2">" / "</span> <span class="o">+</span> <span class="nx">count</span> <span class="o">+</span> <span class="s2">" / "</span> <span class="o">+</span> <span class="nb">window</span><span class="p">.</span><span class="nx">roundTo</span><span class="p">(</span><span class="nx">Tone</span><span class="p">.</span><span class="nx">Transport</span><span class="p">.</span><span class="nx">seconds</span><span class="p">,</span> <span class="mf">2</span><span class="p">));</span> <span class="nx">always</span><span class="p">();</span> <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="mf">0</span><span class="p">;</span> <span class="nx">i</span> <span class="o"><</span> <span class="nx">patterns</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span> <span class="k">if</span> <span class="p">(</span><span class="nx">i</span> <span class="o">==</span> <span class="mf">0</span><span class="p">)</span> <span class="p">{</span> <span class="nx">eval_guard</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span> <span class="nx">eval_guard</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span> <span class="p">}</span> <span class="kd">var</span> <span class="nx">dials</span> <span class="o">=</span> <span class="nx">self</span><span class="p">.</span><span class="nx">state</span><span class="p">.</span><span class="nx">dials</span><span class="p">;</span> <span class="kd">var</span> <span class="nx">numbers</span> <span class="o">=</span> <span class="nx">self</span><span class="p">.</span><span class="nx">state</span><span class="p">.</span><span class="nx">numbers</span><span class="p">;</span> <span class="k">if</span> <span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'edit-mode'</span><span class="p">).</span><span class="nx">checked</span><span class="p">)</span> <span class="p">{</span> <span class="kd">var</span> <span class="nx">p_text</span> <span class="o">=</span> <span class="nx">oldPatterns</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span> <span class="kd">var</span> <span class="nx">p_text</span> <span class="o">=</span> <span class="nx">patterns</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span> <span class="nx">oldPatterns</span><span class="p">[</span><span class="nx">i</span><span class="p">]</span> <span class="o">=</span> <span class="nx">p_text</span><span class="p">;</span> <span class="p">}</span> <span class="k">if</span> <span class="p">(</span><span class="nx">p_text</span><span class="p">()</span> <span class="o">&&</span> <span class="nx">p_text</span><span class="p">().</span><span class="nx">length</span> <span class="o">!==</span> <span class="mf">0</span><span class="p">)</span> <span class="p">{</span> <span class="kd">var</span> <span class="nx">track_no</span> <span class="o">=</span> <span class="nx">i</span> <span class="o">+</span> <span class="mf">1</span><span class="p">;</span> <span class="kd">var</span> <span class="nx">pattern</span> <span class="o">=</span> <span class="nx">pattern_parse</span><span class="p">(</span><span class="nx">p_text</span><span class="p">());</span> <span class="kd">var</span> <span class="nx">meta</span> <span class="o">=</span> <span class="nx">pattern_meta</span><span class="p">(</span><span class="nx">p_text</span><span class="p">());</span> <span class="kd">var</span> <span class="nx">isHit</span> <span class="o">=</span> <span class="p">(</span><span class="nx">pattern</span><span class="p">.</span><span class="nx">split</span><span class="p">(</span><span class="s1">''</span><span class="p">)[</span><span class="nx">tick</span><span class="p">]</span> <span class="o">==</span> <span class="s2">"1"</span><span class="p">)</span> <span class="o">?</span> <span class="kc">true</span> <span class="o">:</span> <span class="kc">false</span><span class="p">;</span> <span class="k">try</span> <span class="p">{</span> <span class="k">if</span> <span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'edit-mode'</span><span class="p">).</span><span class="nx">checked</span><span class="p">)</span> <span class="p">{</span> <span class="nb">eval</span><span class="p">(</span><span class="nx">oldCode</span><span class="p">);</span> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span> <span class="nb">eval</span><span class="p">(</span><span class="nx">text</span><span class="p">);</span> <span class="k">if</span> <span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'redo'</span><span class="p">).</span><span class="nx">checked</span><span class="p">)</span> <span class="p">{</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'redo'</span><span class="p">).</span><span class="nx">checked</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span> <span class="nx">tick</span> <span class="o">=</span> <span class="p">(</span><span class="nx">count</span> <span class="o">%</span> <span class="k">this</span><span class="p">.</span><span class="nx">state</span><span class="p">.</span><span class="nx">ticks</span><span class="p">);</span> <span class="nx">count</span> <span class="o">-=</span> <span class="nx">tick</span> <span class="o">+</span> <span class="mf">1</span><span class="p">;</span> <span class="nx">i</span> <span class="o">=</span> <span class="mf">0</span><span class="p">;</span> <span class="k">continue</span><span class="p">;</span> <span class="p">}</span> <span class="k">if</span> <span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'load-mode'</span><span class="p">).</span><span class="nx">checked</span><span class="p">)</span> <span class="p">{</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'load-mode'</span><span class="p">).</span><span class="nx">checked</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span> <span class="nx">transition</span><span class="p">();</span> <span class="p">}</span> <span class="nx">oldCode</span> <span class="o">=</span> <span class="nx">text</span><span class="p">;</span> <span class="p">}</span> <span class="nx">$</span><span class="p">(</span><span class="s2">"#error"</span><span class="p">).</span><span class="nx">html</span><span class="p">(</span><span class="s2">""</span><span class="p">);</span> <span class="p">}</span> <span class="k">catch</span> <span class="p">(</span><span class="nx">ex</span><span class="p">)</span> <span class="p">{</span> <span class="nx">$</span><span class="p">(</span><span class="s2">"#error"</span><span class="p">).</span><span class="nx">html</span><span class="p">(</span><span class="nx">ex</span><span class="p">);</span> <span class="nb">eval</span><span class="p">(</span><span class="nx">oldCode</span><span class="p">);</span> <span class="p">}</span> <span class="p">}</span> <span class="p">}</span> <span class="p">}.</span><span class="nx">bind</span><span class="p">(</span><span class="k">this</span><span class="p">),</span> <span class="nx">delta</span><span class="p">)</span> <span class="nb">window</span><span class="p">.</span><span class="nx">requestAnimationFrame</span><span class="p">(</span><span class="nx">animation</span><span class="p">);</span> <span class="p">}</span> </pre></div> </div> ................................................................................ <span class="nx">context</span><span class="p">.</span><span class="nx">count_skip</span> <span class="o">=</span> <span class="nx">options</span><span class="p">.</span><span class="nx">speed</span> <span class="o">||</span> <span class="mf">4</span><span class="p">;</span> <span class="nx">context</span><span class="p">.</span><span class="nx">step</span> <span class="o">=</span> <span class="nx">options</span><span class="p">.</span><span class="nx">step</span> <span class="o">||</span> <span class="mf">0.01</span><span class="p">;</span> <span class="nx">context</span><span class="p">.</span><span class="nx">reverse</span> <span class="o">=</span> <span class="nx">options</span><span class="p">.</span><span class="nx">reverse</span> <span class="o">||</span> <span class="kc">true</span><span class="p">;</span> <span class="nx">context</span><span class="p">.</span><span class="nx">number</span> <span class="o">=</span> <span class="nx">options</span><span class="p">.</span><span class="nx">number</span> <span class="o">||</span> <span class="kc">null</span><span class="p">;</span> <span class="nx">context</span><span class="p">.</span><span class="nx">current_count</span> <span class="o">=</span> <span class="mf">0</span><span class="p">;</span> <span class="nx">context</span><span class="p">.</span><span class="nx">index</span> <span class="o">=</span> <span class="mf">0</span><span class="p">;</span> <span class="nx">context</span><span class="p">.</span><span class="nx">val</span> <span class="o">=</span> <span class="nb">window</span><span class="p">.</span><span class="nx">cellx</span><span class="p">.</span><span class="nx">cellx</span><span class="p">(</span><span class="nx">options</span><span class="p">.</span><span class="nx">initial</span> <span class="o">||</span> <span class="mf">0.5</span><span class="p">)</span> <span class="kd">function</span> <span class="nx">changeContext</span><span class="p">()</span> <span class="p">{</span> <span class="nx">context</span><span class="p">.</span><span class="nx">next_val</span> <span class="o">=</span> <span class="nx">context</span><span class="p">.</span><span class="nx">ramp</span><span class="p">[</span><span class="nx">context</span><span class="p">.</span><span class="nx">index</span> <span class="o">+</span> <span class="mf">1</span><span class="p">];</span> <span class="nx">context</span><span class="p">.</span><span class="nx">val</span><span class="p">(</span><span class="nx">context</span><span class="p">.</span><span class="nx">ramp</span><span class="p">[</span><span class="nx">context</span><span class="p">.</span><span class="nx">index</span><span class="p">]);</span> <span class="k">if</span> <span class="p">(</span><span class="nx">context</span><span class="p">.</span><span class="nx">val</span><span class="p">()</span> <span class="o">></span> <span class="nx">context</span><span class="p">.</span><span class="nx">next_val</span><span class="p">)</span> <span class="p">{</span> <span class="nx">context</span><span class="p">.</span><span class="nx">direction</span> <span class="o">=</span> <span class="o">-</span><span class="mf">1</span><span class="p">;</span> ................................................................................ <span class="kd">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span> <span class="nx">alertify</span><span class="p">.</span><span class="nx">prompt</span><span class="p">(</span> <span class="s1">'Enter Sample URL'</span><span class="p">,</span> <span class="s1">''</span><span class="p">,</span> <span class="s1">''</span> <span class="p">,</span> <span class="kd">function</span><span class="p">(</span><span class="nx">evt</span><span class="p">,</span> <span class="nx">value</span><span class="p">)</span> <span class="p">{</span> <span class="nx">self</span><span class="p">.</span><span class="nx">addURL</span><span class="p">(</span><span class="nx">value</span><span class="p">);</span> <span class="p">}</span> <span class="p">,</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="nx">alertify</span><span class="p">.</span><span class="nx">error</span><span class="p">(</span><span class="s1">'Cancel'</span><span class="p">)</span> <span class="p">});</span> <span class="p">}</span> <span class="nx">addSample</span><span class="p">()</span> <span class="p">{</span> <span class="k">this</span><span class="p">.</span><span class="nx">state</span><span class="p">.</span><span class="nx">samples</span><span class="p">.</span><span class="nx">push</span><span class="p">({});</span> <span class="k">this</span><span class="p">.</span><span class="nx">update</span><span class="p">();</span> <span class="p">}</span> ................................................................................ <span class="p">}</span> <span class="p"></</span><span class="nt">script</span><span class="p">></span> <span class="p"></</span><span class="nt">bitrhythm</span><span class="p">></span> </pre></div> </div> </div> <div class="section" id="sample"> <h2>Sample<a class="headerlink" href="#sample" title="Permalink to this headline">¶</a></h2> <p>You can add samples using the file upload. All samples are available as an array – samples. Initialise samples, global variables and synthesisers using the transition function and change the sample parameters using the same during live coding.</p> <div class="highlight-html notranslate"><div class="highlight"><pre><span></span><span class="p"><</span><span class="nt">sample</span><span class="p">></span> <span class="p"><</span><span class="nt">vbox</span> <span class="na">class</span><span class="o">=</span><span class="s">"ml-2"</span><span class="p">></span> <span class="p"><</span><span class="nt">vstack</span> <span class="na">class</span><span class="o">=</span><span class="s">"ml-2"</span><span class="p">></span> ................................................................................ <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">props</span><span class="p">)</span> <span class="k">return</span> <span class="s2">""</span><span class="p">;</span> <span class="p">}</span> <span class="p">}</span> <span class="k">this</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s2">"mount"</span><span class="p">,</span> <span class="kd">function</span> <span class="p">()</span> <span class="p">{</span> <span class="kd">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span> <span class="cm">/*</span> <span class="cm"> var sample_file = $("#sample-file" + this.props.ti).get(0);</span> <span class="cm"> var sam;</span> <span class="cm"> sample_file.addEventListener('change', (event) => {</span> <span class="cm"> var file = event.srcElement.files[0];</span> <span class="cm"> var a = new Audio();</span> <span class="cm"> a.onloadedmetadata = (e) => {</span> <span class="cm"> sam = new Tone.Sampler({</span> <span class="cm"> urls: {</span> <span class="cm"> "C3": URL.createObjectURL(file),</span> <span class="cm"> },</span> <span class="cm"> onload: () => {</span> <span class="cm"> this.update();</span> <span class="cm"> sam.triggerAttackRelease("C3", 0.5);</span> <span class="cm"> }</span> <span class="cm"> });</span> <span class="cm"> sam["__name"] = file.name;</span> <span class="cm"> sam["__url"] = "";</span> <span class="cm"> // riot doesn't allow camelcase ?</span> <span class="cm"> self.props.setsample(sam, self.props.ti - 1);</span> <span class="cm"> }</span> <span class="cm"> a.src = URL.createObjectURL(file);</span> <span class="cm"> });</span> <span class="cm"> */</span> <span class="p">});</span> <span class="p"></</span><span class="nt">script</span><span class="p">></span> <span class="p"></</span><span class="nt">sample</span><span class="p">></span> </pre></div> </div> </div> <div class="section" id="javascript"> <h2>Javascript<a class="headerlink" href="#javascript" title="Permalink to this headline">¶</a></h2> <div class="highlight-js notranslate"><div class="highlight"><pre><span></span><span class="kd">function</span> <span class="nx">getRandomInt</span><span class="p">(</span><span class="nx">max</span><span class="p">)</span> <span class="p">{</span> <span class="k">return</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">floor</span><span class="p">(</span><span class="nb">Math</span><span class="p">.</span><span class="nx">random</span><span class="p">()</span> <span class="o">*</span> <span class="nx">max</span><span class="p">);</span> <span class="p">}</span> <span class="kd">function</span> <span class="nx">initWinamp</span><span class="p">(</span><span class="nx">preset</span><span class="p">)</span> <span class="p">{</span> <span class="kd">var</span> <span class="nx">can</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s2">"visual"</span><span class="p">);</span> <span class="nx">can</span><span class="p">.</span><span class="nx">height</span> <span class="o">=</span> <span class="nb">window</span><span class="p">.</span><span class="nx">innerHeight</span> <span class="o">-</span> <span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s2">"header-playback"</span><span class="p">).</span><span class="nx">clientHeight</span> <span class="o">/</span> <span class="mf">2</span><span class="p">);</span> ................................................................................ <span class="nx">can_container</span><span class="p">.</span><span class="nx">width</span> <span class="o">=</span> <span class="nb">window</span><span class="p">.</span><span class="nx">innerWidth</span><span class="p">;</span> <span class="kd">var</span> <span class="nx">visualizer</span> <span class="o">=</span> <span class="nb">window</span><span class="p">.</span><span class="nx">butterchurn</span><span class="p">.</span><span class="k">default</span><span class="p">.</span><span class="nx">createVisualizer</span><span class="p">(</span><span class="nx">Tone</span><span class="p">.</span><span class="nx">getContext</span><span class="p">().</span><span class="nx">rawContext</span><span class="p">,</span> <span class="nx">can</span><span class="p">,</span> <span class="p">{</span> <span class="nx">height</span><span class="o">:</span> <span class="nb">window</span><span class="p">.</span><span class="nx">innerHeight</span> <span class="o">-</span> <span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s2">"header-playback"</span><span class="p">).</span><span class="nx">clientHeight</span> <span class="o">/</span> <span class="mf">2</span><span class="p">),</span> <span class="nx">width</span><span class="o">:</span> <span class="nb">window</span><span class="p">.</span><span class="nx">innerWidth</span><span class="p">,</span> <span class="nx">meshWidth</span><span class="o">:</span> <span class="mf">24</span><span class="p">,</span> <span class="nx">meshHeight</span><span class="o">:</span> <span class="mf">18</span><span class="p">,</span> <span class="p">});</span> <span class="nx">visualizer</span><span class="p">.</span><span class="nx">connectAudio</span><span class="p">(</span><span class="nx">Tone</span><span class="p">.</span><span class="nx">getContext</span><span class="p">().</span><span class="nx">destination</span><span class="p">);</span> <span class="kd">const</span> <span class="nx">presets</span> <span class="o">=</span> <span class="nb">window</span><span class="p">.</span><span class="nx">butterchurnPresets</span><span class="p">.</span><span class="nx">getPresets</span><span class="p">();</span> <span class="kd">const</span> <span class="nx">presetParam</span> <span class="o">=</span> <span class="nx">presets</span><span class="p">[</span><span class="nx">preset</span><span class="p">];</span> <span class="nx">visualizer</span><span class="p">.</span><span class="nx">loadPreset</span><span class="p">(</span><span class="nx">presetParam</span><span class="p">,</span> <span class="mf">0.0</span><span class="p">);</span> <span class="c1">// 2nd argument is the number of seconds to blend presets</span> <span class="k">return</span> <span class="nx">visualizer</span><span class="p">;</span> <span class="p">}</span> <span class="kd">function</span> <span class="nx">guard</span><span class="p">(</span><span class="nx">range</span><span class="p">)</span> <span class="p">{</span> ................................................................................ <span class="nx">letters</span> <span class="o">=</span> <span class="nx">letters</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="s1">'`3'</span><span class="p">,</span><span class="s1">'d'</span><span class="p">);</span> <span class="nx">letters</span> <span class="o">=</span> <span class="nx">letters</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="s1">'`4'</span><span class="p">,</span><span class="s1">'e'</span><span class="p">);</span> <span class="nx">letters</span> <span class="o">=</span> <span class="nx">letters</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="s1">'`5'</span><span class="p">,</span><span class="s1">'f'</span><span class="p">);</span> <span class="k">return</span> <span class="nx">letters</span><span class="p">;</span> <span class="p">}</span> <span class="kd">function</span> <span class="nx">lettertodec</span><span class="p">(</span><span class="nx">letter</span><span class="p">)</span> <span class="p">{</span> <span class="kd">var</span> <span class="nx">bin</span> <span class="o">=</span> <span class="s2">""</span><span class="p">;</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span><span class="p">.</span><span class="nx">match</span><span class="p">(</span><span class="sr">/\d/</span><span class="p">))</span> <span class="p">{</span> <span class="nx">no</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="p">(</span><span class="nx">letter</span><span class="p">);</span> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"a"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">no</span> <span class="o">=</span> <span class="mf">10</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"b"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">no</span> <span class="o">=</span> <span class="mf">11</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"c"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">no</span> <span class="o">=</span> <span class="mf">12</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"d"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">no</span> <span class="o">=</span> <span class="mf">13</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"e"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">no</span> <span class="o">=</span> <span class="mf">14</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"f"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">no</span> <span class="o">=</span> <span class="mf">15</span><span class="p">;</span> <span class="p">}</span> <span class="k">for</span> <span class="p">(</span><span class="nx">i</span> <span class="o">=</span> <span class="mf">1</span><span class="p">;</span> <span class="nx">i</span> <span class="o"><=</span> <span class="nx">no</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span> <span class="nx">bin</span> <span class="o">+=</span> <span class="s2">"0"</span><span class="p">;</span> <span class="p">}</span> <span class="k">return</span> <span class="nx">bin</span><span class="p">;</span> <span class="p">}</span> <span class="kd">function</span> <span class="nx">lettertobin</span><span class="p">(</span><span class="nx">letter</span><span class="p">)</span> <span class="p">{</span> <span class="kd">var</span> <span class="nx">bin</span> <span class="o">=</span> <span class="s2">""</span><span class="p">;</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"0"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">bin</span> <span class="o">+=</span> <span class="s2">"0000"</span><span class="p">;</span> <span class="p">}</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"1"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">bin</span> <span class="o">+=</span> <span class="s2">"0001"</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"2"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">bin</span> <span class="o">+=</span> <span class="s2">"0010"</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"3"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">bin</span> <span class="o">+=</span> <span class="s2">"0011"</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"4"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">bin</span> <span class="o">+=</span> <span class="s2">"0100"</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"5"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">bin</span> <span class="o">+=</span> <span class="s2">"0101"</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"6"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">bin</span> <span class="o">+=</span> <span class="s2">"0110"</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"7"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">bin</span> <span class="o">+=</span> <span class="s2">"0111"</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"8"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">bin</span> <span class="o">+=</span> <span class="s2">"1000"</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"9"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">bin</span> <span class="o">+=</span> <span class="s2">"1001"</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"a"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">bin</span> <span class="o">+=</span> <span class="s2">"1010"</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"b"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">bin</span> <span class="o">+=</span> <span class="s2">"1011"</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"c"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">bin</span> <span class="o">+=</span> <span class="s2">"1100"</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"d"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">bin</span> <span class="o">+=</span> <span class="s2">"1101"</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"e"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">bin</span> <span class="o">+=</span> <span class="s2">"1110"</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"f"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">bin</span> <span class="o">+=</span> <span class="s2">"1111"</span><span class="p">;</span> <span class="p">}</span> <span class="k">return</span> <span class="nx">bin</span><span class="p">;</span> <span class="p">}</span> <span class="kd">function</span> <span class="nx">hex2bin</span><span class="p">(</span><span class="nx">hex</span><span class="p">)</span> <span class="p">{</span> <span class="kd">var</span> <span class="nx">letters</span> <span class="o">=</span> <span class="nx">romantogypsy</span><span class="p">(</span><span class="nx">hex</span><span class="p">)</span> <span class="nx">letters</span> <span class="o">=</span> <span class="nx">letters</span><span class="p">.</span><span class="nx">split</span><span class="p">(</span><span class="s1">''</span><span class="p">);</span> <span class="kd">var</span> <span class="nx">bin</span> <span class="o">=</span> <span class="s2">""</span><span class="p">;</span> <span class="nx">letters</span><span class="p">.</span><span class="nx">map</span><span class="p">(</span><span class="kd">function</span><span class="p">(</span><span class="nx">letter</span><span class="p">)</span> <span class="p">{</span> ................................................................................ <span class="nx">setTimeout</span><span class="p">(</span><span class="kd">function</span> <span class="p">()</span> <span class="p">{</span> <span class="nx">$</span><span class="p">(</span><span class="s2">"#cued"</span><span class="p">).</span><span class="nx">html</span><span class="p">(</span><span class="s2">""</span><span class="p">);</span> <span class="p">},</span> <span class="nx">seconds</span> <span class="o">*</span> <span class="mf">1000</span><span class="p">)</span> <span class="p">}</span> <span class="nb">window</span><span class="p">.</span><span class="nx">cue</span> <span class="o">=</span> <span class="nx">cue</span><span class="p">;</span> <span class="kd">function</span> <span class="nx">Sample</span><span class="p">(</span><span class="nx">name</span><span class="p">,</span> <span class="nx">no</span><span class="p">,</span> <span class="nx">filter</span><span class="p">,</span> <span class="nx">volume</span><span class="p">)</span> <span class="p">{</span> <span class="nx">name</span> <span class="o">=</span> <span class="nx">name</span> <span class="nx">filter</span> <span class="o">=</span> <span class="nx">filter</span> <span class="o">||</span> <span class="mf">10000</span> <span class="nx">volume</span> <span class="o">=</span> <span class="nx">volume</span> <span class="o">||</span> <span class="mf">0</span> <span class="nx">mem</span><span class="p">[</span><span class="nx">name</span> <span class="o">+</span> <span class="s2">"_filter"</span><span class="p">]</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Tone</span><span class="p">.</span><span class="nx">Filter</span><span class="p">(</span><span class="nx">filter</span><span class="p">,</span> <span class="s1">'lowpass'</span><span class="p">,</span> <span class="o">-</span><span class="mf">96</span><span class="p">);</span> <span class="nx">mem</span><span class="p">[</span><span class="nx">name</span> <span class="o">+</span> <span class="s2">"_channel"</span><span class="p">]</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Tone</span><span class="p">.</span><span class="nx">Channel</span><span class="p">({</span><span class="nx">channelCount</span><span class="o">:</span> <span class="mf">2</span><span class="p">,</span> <span class="nx">volume</span><span class="o">:</span> <span class="nx">volume</span><span class="p">}).</span><span class="nx">chain</span><span class="p">(</span><span class="nx">mem</span><span class="p">[</span><span class="nx">name</span> <span class="o">+</span> <span class="s2">"_filter"</span><span class="p">],</span> <span class="nx">mem</span><span class="p">.</span><span class="nx">master</span><span class="p">)</span> <span class="nx">samples</span><span class="p">[</span><span class="nx">no</span><span class="p">].</span><span class="nx">connect</span><span class="p">(</span><span class="nx">mem</span><span class="p">[</span><span class="nx">name</span> <span class="o">+</span> <span class="s2">"_channel"</span><span class="p">]);</span> <span class="nx">hit_map</span><span class="p">[</span><span class="nx">name</span><span class="p">]</span> <span class="o">=</span> <span class="nx">no</span><span class="p">;</span> <span class="p">}</span> <span class="nb">window</span><span class="p">.</span><span class="nx">Sample</span> <span class="o">=</span> <span class="nx">Sample</span><span class="p">;</span> <span class="kd">function</span> <span class="nx">p</span><span class="p">(</span><span class="nx">s</span><span class="p">,</span> <span class="nx">vol</span><span class="p">,</span> <span class="nx">note</span><span class="p">,</span> <span class="nx">len</span><span class="p">,</span> <span class="nx">delay</span><span class="p">,</span> <span class="nx">pan</span><span class="o">=</span><span class="mf">0</span><span class="p">)</span> <span class="p">{</span> <span class="nx">note</span> <span class="o">=</span> <span class="nx">note</span> <span class="o">||</span> <span class="s2">"C3"</span> <span class="nx">len</span> <span class="o">=</span> <span class="nx">len</span> <span class="o">||</span> <span class="s2">"16n"</span> <span class="nx">vol</span> <span class="o">=</span> <span class="nx">vol</span> <span class="o">||</span> <span class="mf">1</span> <span class="nx">delay</span> <span class="o">=</span> <span class="nx">delay</span> <span class="o">||</span> <span class="s2">"+0"</span><span class="p">;</span> <span class="k">for</span> <span class="p">(</span><span class="kd">const</span> <span class="p">[</span><span class="nx">key</span><span class="p">,</span> <span class="nx">value</span><span class="p">]</span> <span class="k">of</span> <span class="nb">Object</span><span class="p">.</span><span class="nx">entries</span><span class="p">(</span><span class="nx">hit_map</span><span class="p">))</span> <span class="p">{</span> <span class="k">if</span> <span class="p">(</span><span class="nx">value</span> <span class="o">==</span> <span class="nx">s</span><span class="p">)</span> <span class="p">{</span> <span class="nx">mem</span><span class="p">[</span><span class="nx">key</span> <span class="o">+</span> <span class="s2">"_last"</span><span class="p">]</span> <span class="o">=</span> <span class="nx">count</span> <span class="nx">mem</span><span class="p">[</span><span class="nx">key</span> <span class="o">+</span> <span class="s2">"_channel"</span><span class="p">].</span><span class="nx">pan</span><span class="p">.</span><span class="nx">value</span> <span class="o">=</span> <span class="nx">pan</span> <span class="p">}</span> <span class="p">}</span> <span class="nx">samples</span><span class="p">[</span><span class="nx">s</span><span class="p">].</span><span class="nx">triggerAttackRelease</span><span class="p">(</span><span class="nx">note</span><span class="p">,</span> <span class="nx">len</span><span class="p">,</span> <span class="nx">delay</span><span class="p">,</span> <span class="nx">vol</span><span class="p">);</span> <span class="p">}</span> <span class="nb">window</span><span class="p">.</span><span class="nx">p</span> <span class="o">=</span> <span class="nx">p</span><span class="p">;</span> <span class="kd">function</span> <span class="nx">p1</span><span class="p">(</span><span class="nx">s</span><span class="p">,</span> <span class="nx">vol</span><span class="p">,</span> <span class="nx">note</span><span class="p">,</span> <span class="nx">len</span><span class="p">,</span> <span class="nx">delay</span><span class="p">,</span> <span class="nx">pan</span><span class="o">=</span><span class="mf">0</span><span class="p">)</span> <span class="p">{</span> <span class="nx">note</span> <span class="o">=</span> <span class="nx">note</span> <span class="o">||</span> <span class="s2">"C3"</span> <span class="nx">len</span> <span class="o">=</span> <span class="nx">len</span> <span class="o">||</span> <span class="s2">"16n"</span> |
| | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | | | | | | | | | | < | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > > > | > > > | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > < > > > > > > > > > | < | < < < < < < < > > > > > | < < < | > > > > > > | > < < < < > > > > > | < | > > > > > | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | > > > > > > > > > > > > > > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > < < |
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 ... 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 ... 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 ... 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 ... 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 ... 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 ... 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 .... 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 .... 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 .... 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 .... 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 .... 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 |
</li> <li class="toctree-l1"> <a class="reference internal" href="alternate-implementation.html"> Alternate Implementations </a> </li> <li class="toctree-l1"> <a class="reference internal" href="saving.html"> Saving / Recording / Streaming </a> </li> <li class="toctree-l1"> <a class="reference internal" href="credits.html"> Credits </a> </li> ................................................................................ <div class="d-none d-md-block col-md-2 bd-toc show"> <div class="tocsection onthispage pt-5 pb-3"> <i class="fas fa-list"></i> Contents </div> <nav id="bd-toc-nav"> <ul class="visible nav section-nav flex-column"> <li class="toc-h2 nav-item toc-entry"> <a class="reference internal nav-link" href="#running"> Running </a> </li> <li class="toc-h2 nav-item toc-entry"> <a class="reference internal nav-link" href="#core-tracker-loop"> Core Tracker Loop </a> <ul class="nav section-nav flex-column"> <li class="toc-h3 nav-item toc-entry"> <a class="reference internal nav-link" href="#observers"> ................................................................................ AutoKnob </a> </li> <li class="toc-h2 nav-item toc-entry"> <a class="reference internal nav-link" href="#main-ui"> Main UI </a> </li> <li class="toc-h2 nav-item toc-entry"> <a class="reference internal nav-link" href="#worklet"> Worklet </a> </li> <li class="toc-h2 nav-item toc-entry"> <a class="reference internal nav-link" href="#sample"> Sample </a> </li> <li class="toc-h2 nav-item toc-entry"> <a class="reference internal nav-link" href="#app"> App </a> </li> <li class="toc-h2 nav-item toc-entry"> <a class="reference internal nav-link" href="#index"> Index </a> </li> <li class="toc-h2 nav-item toc-entry"> <a class="reference internal nav-link" href="#page"> Page </a> </li> <li class="toc-h2 nav-item toc-entry"> <a class="reference internal nav-link" href="#javascript"> Javascript </a> </li> <li class="toc-h2 nav-item toc-entry"> ................................................................................ <div id="main-content" class="row"> <div class="col-12 col-md-9 pl-md-3 pr-md-0"> <div> <div class="section" id="code-walkthrough"> <h1>Code Walkthrough<a class="headerlink" href="#code-walkthrough" title="Permalink to this headline">¶</a></h1> <div class="section" id="running"> <h2>Running<a class="headerlink" href="#running" title="Permalink to this headline">¶</a></h2> <p>ls source/main.cog | entr -r runserver.sh -b</p> </div> <div class="section" id="core-tracker-loop"> <h2>Core Tracker Loop<a class="headerlink" href="#core-tracker-loop" title="Permalink to this headline">¶</a></h2> <p>In bitrhythm code is evaluated for every cycle.</p> <p>1 beat = 60 / tempo 1 cycle = 1 beat / ticks</p> <p>For every cycle visual and audio code is evaluated.</p> <p>The edit checkbox allows you to perform long edits, where only old code is evaluated. Once you disable it, all the new edit changes are applied in the next cycle.</p> ................................................................................ <span class="kd">var</span> <span class="nx">bars</span> <span class="o">=</span> <span class="mf">0</span><span class="p">;</span> <span class="kd">var</span> <span class="nx">tick</span> <span class="o">=</span> <span class="mf">0</span><span class="p">;</span> <span class="kd">var</span> <span class="nx">quarter_beat_length</span> <span class="o">=</span> <span class="mf">60000.0</span> <span class="o">/</span> <span class="k">this</span><span class="p">.</span><span class="nx">state</span><span class="p">.</span><span class="nx">tempo</span><span class="p">;</span> <span class="kd">var</span> <span class="nx">beat_length</span> <span class="o">=</span> <span class="nx">quarter_beat_length</span> <span class="o">*</span> <span class="mf">4</span><span class="p">;</span> <span class="kd">var</span> <span class="nx">delta</span> <span class="o">=</span> <span class="nx">beat_length</span> <span class="o">/</span> <span class="k">this</span><span class="p">.</span><span class="nx">state</span><span class="p">.</span><span class="nx">ticks</span><span class="p">;</span> <span class="nb">window</span><span class="p">.</span><span class="nx">samples</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">state</span><span class="p">.</span><span class="nx">samples</span><span class="p">;</span> <span class="kd">var</span> <span class="nx">eval_guard</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span> <span class="nx">self</span><span class="p">.</span><span class="nx">timer</span> <span class="o">=</span> <span class="nx">setInterval</span><span class="p">(</span><span class="kd">function</span> <span class="p">()</span> <span class="p">{</span> <span class="nx">count</span> <span class="o">=</span> <span class="nx">count</span> <span class="o">+</span> <span class="mf">1</span><span class="p">;</span> <span class="nx">tick</span> <span class="o">=</span> <span class="p">(</span><span class="nx">count</span> <span class="o">%</span> <span class="k">this</span><span class="p">.</span><span class="nx">state</span><span class="p">.</span><span class="nx">ticks</span><span class="p">);</span> <span class="k">if</span> <span class="p">(</span><span class="nx">tick</span> <span class="o">===</span> <span class="mf">0</span><span class="p">)</span> <span class="o">++</span><span class="nx">bars</span><span class="p">;</span> <span class="nx">$</span><span class="p">(</span><span class="s2">"#duration"</span><span class="p">).</span><span class="nx">html</span><span class="p">(</span><span class="s2">""</span> <span class="o">+</span> <span class="nx">bars</span> <span class="o">+</span> <span class="s2">"."</span> <span class="o">+</span> <span class="nx">tick</span> <span class="o">+</span> <span class="s2">" / "</span> <span class="o">+</span> <span class="nx">count</span> <span class="o">+</span> <span class="s2">" / "</span> <span class="o">+</span> <span class="nb">window</span><span class="p">.</span><span class="nx">roundTo</span><span class="p">(</span><span class="nx">Tone</span><span class="p">.</span><span class="nx">Transport</span><span class="p">.</span><span class="nx">seconds</span><span class="p">,</span> <span class="mf">2</span><span class="p">));</span> <span class="nx">always</span><span class="p">();</span> <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="mf">0</span><span class="p">;</span> <span class="nx">i</span> <span class="o"><</span> <span class="nx">patterns</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span> <span class="k">if</span> <span class="p">(</span><span class="nx">i</span> <span class="o">==</span> <span class="mf">0</span><span class="p">)</span> <span class="p">{</span> <span class="nx">eval_guard</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span> <span class="nx">eval_guard</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span> <span class="p">}</span> <span class="kd">var</span> <span class="nx">dials</span> <span class="o">=</span> <span class="nx">self</span><span class="p">.</span><span class="nx">state</span><span class="p">.</span><span class="nx">dials</span><span class="p">;</span> <span class="kd">var</span> <span class="nx">numbers</span> <span class="o">=</span> <span class="nx">self</span><span class="p">.</span><span class="nx">state</span><span class="p">.</span><span class="nx">numbers</span><span class="p">;</span> <span class="k">if</span> <span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'edit-mode'</span><span class="p">).</span><span class="nx">checked</span><span class="p">)</span> <span class="p">{</span> <span class="kd">var</span> <span class="nx">p_text</span> <span class="o">=</span> <span class="nx">oldPatterns</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span> <span class="kd">var</span> <span class="nx">p_text</span> <span class="o">=</span> <span class="nx">patterns</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span> <span class="nx">oldPatterns</span><span class="p">[</span><span class="nx">i</span><span class="p">]</span> <span class="o">=</span> <span class="nx">p_text</span><span class="p">;</span> <span class="p">}</span> <span class="k">if</span> <span class="p">(</span><span class="nx">p_text</span><span class="p">()</span> <span class="o">&&</span> <span class="nx">p_text</span><span class="p">().</span><span class="nx">length</span> <span class="o">!==</span> <span class="mf">0</span><span class="p">)</span> <span class="p">{</span> <span class="kd">var</span> <span class="nx">track_no</span> <span class="o">=</span> <span class="nx">i</span> <span class="o">+</span> <span class="mf">1</span><span class="p">;</span> <span class="kd">var</span> <span class="nx">pattern</span> <span class="o">=</span> <span class="nx">pattern_parse</span><span class="p">(</span><span class="nx">p_text</span><span class="p">());</span> <span class="kd">var</span> <span class="nx">meta</span> <span class="o">=</span> <span class="nx">pattern_meta</span><span class="p">(</span><span class="nx">p_text</span><span class="p">());</span> <span class="kd">var</span> <span class="nx">isHit</span> <span class="o">=</span> <span class="p">(</span><span class="nx">pattern</span><span class="p">.</span><span class="nx">split</span><span class="p">(</span><span class="s1">''</span><span class="p">)[</span><span class="nx">tick</span><span class="p">]</span> <span class="o">==</span> <span class="s2">"1"</span><span class="p">)</span> <span class="o">?</span> <span class="kc">true</span> <span class="o">:</span> <span class="kc">false</span><span class="p">;</span> <span class="k">try</span> <span class="p">{</span> <span class="k">if</span> <span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'edit-mode'</span><span class="p">).</span><span class="nx">checked</span><span class="p">)</span> <span class="p">{</span> <span class="nb">eval</span><span class="p">(</span><span class="nx">oldCode</span><span class="p">);</span> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span> <span class="nb">eval</span><span class="p">(</span><span class="nx">text</span><span class="p">);</span> <span class="k">if</span> <span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'redo'</span><span class="p">).</span><span class="nx">checked</span><span class="p">)</span> <span class="p">{</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'redo'</span><span class="p">).</span><span class="nx">checked</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span> <span class="nx">tick</span> <span class="o">=</span> <span class="p">(</span><span class="nx">count</span> <span class="o">%</span> <span class="k">this</span><span class="p">.</span><span class="nx">state</span><span class="p">.</span><span class="nx">ticks</span><span class="p">);</span> <span class="nx">count</span> <span class="o">-=</span> <span class="nx">tick</span> <span class="o">+</span> <span class="mf">1</span><span class="p">;</span> <span class="nx">i</span> <span class="o">=</span> <span class="mf">0</span><span class="p">;</span> <span class="k">continue</span><span class="p">;</span> <span class="p">}</span> <span class="k">if</span> <span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'load-mode'</span><span class="p">).</span><span class="nx">checked</span><span class="p">)</span> <span class="p">{</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'load-mode'</span><span class="p">).</span><span class="nx">checked</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span> <span class="nx">transition</span><span class="p">();</span> <span class="p">}</span> <span class="nx">oldCode</span> <span class="o">=</span> <span class="nx">text</span><span class="p">;</span> <span class="p">}</span> <span class="nx">$</span><span class="p">(</span><span class="s2">"#error"</span><span class="p">).</span><span class="nx">html</span><span class="p">(</span><span class="s2">""</span><span class="p">);</span> <span class="p">}</span> <span class="k">catch</span> <span class="p">(</span><span class="nx">ex</span><span class="p">)</span> <span class="p">{</span> <span class="nx">$</span><span class="p">(</span><span class="s2">"#error"</span><span class="p">).</span><span class="nx">html</span><span class="p">(</span><span class="nx">ex</span><span class="p">);</span> <span class="nb">eval</span><span class="p">(</span><span class="nx">oldCode</span><span class="p">);</span> <span class="p">}</span> <span class="p">}</span> <span class="p">}</span> <span class="p">}.</span><span class="nx">bind</span><span class="p">(</span><span class="k">this</span><span class="p">),</span> <span class="nx">delta</span><span class="p">)</span> <span class="nb">window</span><span class="p">.</span><span class="nx">requestAnimationFrame</span><span class="p">(</span><span class="nx">animation</span><span class="p">);</span> <span class="p">}</span> </pre></div> </div> ................................................................................ <span class="nx">context</span><span class="p">.</span><span class="nx">count_skip</span> <span class="o">=</span> <span class="nx">options</span><span class="p">.</span><span class="nx">speed</span> <span class="o">||</span> <span class="mf">4</span><span class="p">;</span> <span class="nx">context</span><span class="p">.</span><span class="nx">step</span> <span class="o">=</span> <span class="nx">options</span><span class="p">.</span><span class="nx">step</span> <span class="o">||</span> <span class="mf">0.01</span><span class="p">;</span> <span class="nx">context</span><span class="p">.</span><span class="nx">reverse</span> <span class="o">=</span> <span class="nx">options</span><span class="p">.</span><span class="nx">reverse</span> <span class="o">||</span> <span class="kc">true</span><span class="p">;</span> <span class="nx">context</span><span class="p">.</span><span class="nx">number</span> <span class="o">=</span> <span class="nx">options</span><span class="p">.</span><span class="nx">number</span> <span class="o">||</span> <span class="kc">null</span><span class="p">;</span> <span class="nx">context</span><span class="p">.</span><span class="nx">current_count</span> <span class="o">=</span> <span class="mf">0</span><span class="p">;</span> <span class="nx">context</span><span class="p">.</span><span class="nx">index</span> <span class="o">=</span> <span class="mf">0</span><span class="p">;</span> <span class="c1">// Smooth transition from previous knob values</span> <span class="k">if</span> <span class="p">(</span><span class="nx">context</span><span class="p">.</span><span class="nx">number</span><span class="p">)</span> <span class="p">{</span> <span class="nx">context</span><span class="p">.</span><span class="nx">val</span> <span class="o">=</span> <span class="nb">window</span><span class="p">.</span><span class="nx">cellx</span><span class="p">.</span><span class="nx">cellx</span><span class="p">(</span><span class="nx">context</span><span class="p">.</span><span class="nx">number</span><span class="p">())</span> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span> <span class="nx">context</span><span class="p">.</span><span class="nx">val</span> <span class="o">=</span> <span class="nb">window</span><span class="p">.</span><span class="nx">cellx</span><span class="p">.</span><span class="nx">cellx</span><span class="p">(</span><span class="nx">options</span><span class="p">.</span><span class="nx">initial</span> <span class="o">||</span> <span class="mf">0.5</span><span class="p">)</span> <span class="p">}</span> <span class="kd">function</span> <span class="nx">changeContext</span><span class="p">()</span> <span class="p">{</span> <span class="nx">context</span><span class="p">.</span><span class="nx">next_val</span> <span class="o">=</span> <span class="nx">context</span><span class="p">.</span><span class="nx">ramp</span><span class="p">[</span><span class="nx">context</span><span class="p">.</span><span class="nx">index</span> <span class="o">+</span> <span class="mf">1</span><span class="p">];</span> <span class="nx">context</span><span class="p">.</span><span class="nx">val</span><span class="p">(</span><span class="nx">context</span><span class="p">.</span><span class="nx">ramp</span><span class="p">[</span><span class="nx">context</span><span class="p">.</span><span class="nx">index</span><span class="p">]);</span> <span class="k">if</span> <span class="p">(</span><span class="nx">context</span><span class="p">.</span><span class="nx">val</span><span class="p">()</span> <span class="o">></span> <span class="nx">context</span><span class="p">.</span><span class="nx">next_val</span><span class="p">)</span> <span class="p">{</span> <span class="nx">context</span><span class="p">.</span><span class="nx">direction</span> <span class="o">=</span> <span class="o">-</span><span class="mf">1</span><span class="p">;</span> ................................................................................ <span class="kd">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span> <span class="nx">alertify</span><span class="p">.</span><span class="nx">prompt</span><span class="p">(</span> <span class="s1">'Enter Sample URL'</span><span class="p">,</span> <span class="s1">''</span><span class="p">,</span> <span class="s1">''</span> <span class="p">,</span> <span class="kd">function</span><span class="p">(</span><span class="nx">evt</span><span class="p">,</span> <span class="nx">value</span><span class="p">)</span> <span class="p">{</span> <span class="nx">self</span><span class="p">.</span><span class="nx">addURL</span><span class="p">(</span><span class="nx">value</span><span class="p">);</span> <span class="p">}</span> <span class="p">,</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="nx">alertify</span><span class="p">.</span><span class="nx">error</span><span class="p">(</span><span class="s1">'Cancel'</span><span class="p">)</span> <span class="p">}</span> <span class="p">);</span> <span class="p">}</span> <span class="nx">addSample</span><span class="p">()</span> <span class="p">{</span> <span class="k">this</span><span class="p">.</span><span class="nx">state</span><span class="p">.</span><span class="nx">samples</span><span class="p">.</span><span class="nx">push</span><span class="p">({});</span> <span class="k">this</span><span class="p">.</span><span class="nx">update</span><span class="p">();</span> <span class="p">}</span> ................................................................................ <span class="p">}</span> <span class="p"></</span><span class="nt">script</span><span class="p">></span> <span class="p"></</span><span class="nt">bitrhythm</span><span class="p">></span> </pre></div> </div> </div> <div class="section" id="worklet"> <h2>Worklet<a class="headerlink" href="#worklet" title="Permalink to this headline">¶</a></h2> <p>More worklet implementations</p> <ul class="simple"> <li><p><a class="reference external" href="https://mimicproject.com/guides/maximJS">https://mimicproject.com/guides/maximJS</a></p></li> <li><p>Gibberish</p></li> </ul> <p>Some implementation links</p> <p><a class="reference external" href="https://stackoverflow.com/questions/12089662/mixing-16-bit-linear-pcm-streams-and-avoiding-clipping-overflow">https://stackoverflow.com/questions/12089662/mixing-16-bit-linear-pcm-streams-and-avoiding-clipping-overflow</a><br /> <a class="reference external" href="https://www.eumus.edu.uy/eme/ensenanza/electivas/dsp/presentaciones/PhaseVocoderTutorial.pdf">https://www.eumus.edu.uy/eme/ensenanza/electivas/dsp/presentaciones/PhaseVocoderTutorial.pdf</a></p> <div class="highlight-js notranslate"><div class="highlight"><pre><span></span><span class="kd">class</span> <span class="nx">Sampler</span> <span class="k">extends</span> <span class="nx">AudioWorkletProcessor</span> <span class="p">{</span> <span class="nx">files</span> <span class="o">=</span> <span class="p">[]</span> <span class="nx">readIdx</span> <span class="o">=</span> <span class="p">{}</span> <span class="nx">loopStartIdx</span> <span class="o">=</span> <span class="p">[]</span> <span class="nx">constructor</span><span class="p">(</span><span class="nx">options</span><span class="p">)</span> <span class="p">{</span> <span class="k">super</span><span class="p">()</span> <span class="k">this</span><span class="p">.</span><span class="nx">port</span><span class="p">.</span><span class="nx">onmessage</span> <span class="o">=</span> <span class="p">({</span> <span class="nx">data</span> <span class="p">})</span> <span class="p">=></span> <span class="p">{</span> <span class="k">if</span> <span class="p">(</span><span class="nx">data</span><span class="p">.</span><span class="nx">init</span><span class="p">)</span> <span class="p">{</span> <span class="k">this</span><span class="p">.</span><span class="nx">files</span> <span class="o">=</span> <span class="nx">data</span><span class="p">.</span><span class="nx">init</span> <span class="k">this</span><span class="p">.</span><span class="nx">loopStartIdx</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">files</span><span class="p">.</span><span class="nx">map</span><span class="p">(</span><span class="kd">function</span> <span class="p">(</span><span class="nx">f</span><span class="p">)</span> <span class="p">{</span> <span class="k">return</span> <span class="mf">0</span> <span class="p">})</span> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">data</span><span class="p">.</span><span class="nx">noteOn</span><span class="p">)</span> <span class="p">{</span> <span class="k">this</span><span class="p">.</span><span class="nx">readIdx</span><span class="p">[</span><span class="nx">data</span><span class="p">.</span><span class="nx">sample</span><span class="p">]</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">loopStartIdx</span><span class="p">[</span><span class="nx">data</span><span class="p">.</span><span class="nx">sample</span><span class="p">]</span> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">data</span><span class="p">.</span><span class="nx">noteOff</span><span class="p">)</span> <span class="p">{</span> <span class="k">delete</span> <span class="k">this</span><span class="p">.</span><span class="nx">readIdx</span><span class="p">[</span><span class="nx">data</span><span class="p">.</span><span class="nx">sample</span><span class="p">];</span> <span class="p">}</span> <span class="p">};</span> <span class="p">}</span> <span class="nx">process</span><span class="p">(</span><span class="nx">inputs</span><span class="p">,</span> <span class="nx">outputs</span><span class="p">)</span> <span class="p">{</span> <span class="kd">var</span> <span class="nx">outLeft</span> <span class="o">=</span> <span class="nx">outputs</span><span class="p">[</span><span class="mf">0</span><span class="p">][</span><span class="mf">0</span><span class="p">]</span> <span class="kd">var</span> <span class="nx">outRight</span> <span class="o">=</span> <span class="nx">outputs</span><span class="p">[</span><span class="mf">0</span><span class="p">][</span><span class="mf">1</span><span class="p">]</span> <span class="nb">Object</span><span class="p">.</span><span class="nx">keys</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">readIdx</span><span class="p">).</span><span class="nx">map</span><span class="p">((</span><span class="nx">sample</span><span class="p">)</span> <span class="p">=></span> <span class="p">{</span> <span class="k">for</span> <span class="p">(</span><span class="kd">let</span> <span class="nx">i</span><span class="o">=</span><span class="mf">0</span><span class="p">;</span> <span class="nx">i</span> <span class="o"><</span> <span class="nx">outLeft</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">readIdx</span><span class="p">[</span><span class="nx">sample</span><span class="p">]</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span> <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">readIdx</span><span class="p">[</span><span class="nx">sample</span><span class="p">]</span> <span class="o"><</span> <span class="k">this</span><span class="p">.</span><span class="nx">files</span><span class="p">[</span><span class="nx">sample</span><span class="p">].</span><span class="nx">pcmLeft</span><span class="p">.</span><span class="nx">length</span><span class="p">)</span> <span class="p">{</span> <span class="nx">outLeft</span><span class="p">[</span><span class="nx">i</span><span class="p">]</span> <span class="o">+=</span> <span class="k">this</span><span class="p">.</span><span class="nx">files</span><span class="p">[</span><span class="nx">sample</span><span class="p">].</span><span class="nx">pcmLeft</span><span class="p">[</span><span class="k">this</span><span class="p">.</span><span class="nx">readIdx</span><span class="p">[</span><span class="nx">sample</span><span class="p">]]</span> <span class="nx">outRight</span><span class="p">[</span><span class="nx">i</span><span class="p">]</span> <span class="o">+=</span> <span class="k">this</span><span class="p">.</span><span class="nx">files</span><span class="p">[</span><span class="nx">sample</span><span class="p">].</span><span class="nx">pcmRight</span><span class="p">[</span><span class="k">this</span><span class="p">.</span><span class="nx">readIdx</span><span class="p">[</span><span class="nx">sample</span><span class="p">]]</span> <span class="p">}</span> <span class="p">}</span> <span class="p">})</span> <span class="k">return</span> <span class="kc">true</span> <span class="p">}</span> <span class="p">}</span> <span class="nx">registerProcessor</span><span class="p">(</span><span class="s1">'sampler'</span><span class="p">,</span> <span class="nx">Sampler</span><span class="p">)</span> </pre></div> </div> </div> <div class="section" id="sample"> <h2>Sample<a class="headerlink" href="#sample" title="Permalink to this headline">¶</a></h2> <p>You can add samples using the file upload. All samples are available as an array – samples. Initialise samples, global variables and synthesisers using the transition function and change the sample parameters using the same during live coding.</p> <div class="highlight-html notranslate"><div class="highlight"><pre><span></span><span class="p"><</span><span class="nt">sample</span><span class="p">></span> <span class="p"><</span><span class="nt">vbox</span> <span class="na">class</span><span class="o">=</span><span class="s">"ml-2"</span><span class="p">></span> <span class="p"><</span><span class="nt">vstack</span> <span class="na">class</span><span class="o">=</span><span class="s">"ml-2"</span><span class="p">></span> ................................................................................ <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">props</span><span class="p">)</span> <span class="k">return</span> <span class="s2">""</span><span class="p">;</span> <span class="p">}</span> <span class="p">}</span> <span class="k">this</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s2">"mount"</span><span class="p">,</span> <span class="kd">function</span> <span class="p">()</span> <span class="p">{</span> <span class="p">});</span> <span class="p"></</span><span class="nt">script</span><span class="p">></span> <span class="p"></</span><span class="nt">sample</span><span class="p">></span> </pre></div> </div> </div> <div class="section" id="app"> <h2>App<a class="headerlink" href="#app" title="Permalink to this headline">¶</a></h2> <div class="highlight-hylang notranslate"><div class="highlight"><pre><span></span><span class="p">(</span><span class="k">import </span><span class="p">[</span><span class="nv">sanic</span> <span class="p">[</span><span class="nv">Sanic</span> <span class="nv">response</span><span class="p">]])</span> <span class="p">(</span><span class="k">import </span><span class="p">[</span><span class="nv">sanic.response</span> <span class="p">[</span><span class="nv">json</span> <span class="nv">text</span><span class="p">]])</span> <span class="p">(</span><span class="k">import </span><span class="p">[</span><span class="nv">sanic.exceptions</span> <span class="p">[</span><span class="nv">NotFound</span> <span class="nv">abort</span><span class="p">]])</span> <span class="p">(</span><span class="k">import </span><span class="p">[</span><span class="nv">jinja2</span> <span class="p">[</span><span class="nv">Environment</span> <span class="nv">FileSystemLoader</span><span class="p">]])</span> <span class="p">(</span><span class="k">import </span><span class="nv">re</span><span class="p">)</span> <span class="p">(</span><span class="k">import </span><span class="nv">ipdb</span><span class="p">)</span> <span class="p">(</span><span class="k">import </span><span class="nv">sys</span><span class="p">)</span> <span class="p">(</span><span class="k">import </span><span class="nv">traceback</span><span class="p">)</span> <span class="p">(</span><span class="k">import </span><span class="nv">json</span><span class="p">)</span> <span class="p">(</span><span class="k">import </span><span class="nv">datetime</span><span class="p">)</span> <span class="p">(</span><span class="k">import </span><span class="p">[</span><span class="nv">email.utils</span> <span class="p">[</span><span class="nv">format_datetime</span><span class="p">]])</span> <span class="p">(</span><span class="k">import </span><span class="p">[</span><span class="nv">urllib.parse</span> <span class="p">[</span><span class="nv">urlparse</span><span class="p">]])</span> <span class="p">(</span><span class="k">import </span><span class="nv">base64</span><span class="p">)</span> <span class="p">(</span><span class="kd">setv </span><span class="nv">file-loader</span> <span class="p">(</span><span class="nf">FileSystemLoader</span> <span class="s">"templates"</span><span class="p">))</span> <span class="p">(</span><span class="kd">setv </span><span class="nv">env</span> <span class="p">(</span><span class="nf">Environment</span> <span class="ss">:loader</span> <span class="nv">file-loader</span><span class="p">))</span> <span class="p">(</span><span class="kd">setv </span><span class="nv">app</span> <span class="p">(</span><span class="nf">Sanic</span> <span class="s">"Bitrhythm"</span><span class="p">))</span> <span class="p">(</span><span class="k">with</span><span class="nv">-decorator</span> <span class="p">(</span><span class="nf">app.exception</span> <span class="nv">NotFound</span><span class="p">)</span> <span class="p">(</span><span class="nf">defn/a</span> <span class="nv">ignore_404s</span> <span class="p">[</span><span class="nv">request</span> <span class="nv">exception</span><span class="p">]</span> <span class="p">(</span><span class="k">return</span> <span class="p">(</span><span class="nf">text</span> <span class="p">(</span><span class="nf">+</span> <span class="s">"Yep, I totally found the page "</span> <span class="nv">request.url</span><span class="p">)))</span> <span class="p">)</span> <span class="p">)</span> <span class="p">(</span><span class="k">with</span><span class="nv">-decorator</span> <span class="p">(</span><span class="nf">app.route</span> <span class="s">"/song/<name>"</span><span class="p">)</span> <span class="p">(</span><span class="nf">defn/a</span> <span class="nv">get-index</span> <span class="p">[</span><span class="nv">request</span> <span class="nv">name</span><span class="p">]</span> <span class="p">(</span><span class="kd">setv </span><span class="nv">template</span> <span class="p">(</span><span class="nf">env.get_template</span> <span class="s">"index.html"</span><span class="p">))</span> <span class="p">(</span><span class="k">return</span> <span class="p">(</span><span class="nf">response.html</span> <span class="p">(</span><span class="nf">template.render</span> <span class="p">{</span><span class="s">"data"</span> <span class="nv">name</span><span class="p">})))</span> <span class="p">)</span> <span class="p">)</span> <span class="p">(</span><span class="k">with</span><span class="nv">-decorator</span> <span class="p">(</span><span class="nf">app.route</span> <span class="s">"/"</span><span class="p">)</span> <span class="p">(</span><span class="nf">defn/a</span> <span class="nv">get-index</span> <span class="p">[</span><span class="nv">request</span><span class="p">]</span> <span class="p">(</span><span class="kd">setv </span><span class="nv">template</span> <span class="p">(</span><span class="nf">env.get_template</span> <span class="s">"index.html"</span><span class="p">))</span> <span class="p">(</span><span class="k">return</span> <span class="p">(</span><span class="nf">response.html</span> <span class="p">(</span><span class="nf">template.render</span> <span class="p">{</span><span class="s">"data"</span> <span class="s">""</span><span class="p">})))</span> <span class="p">)</span> <span class="p">)</span> <span class="p">(</span><span class="k">with</span><span class="nv">-decorator</span> <span class="p">(</span><span class="nf">app.route</span> <span class="s">"/issue"</span><span class="p">)</span> <span class="p">(</span><span class="nf">defn/a</span> <span class="nv">get-index</span> <span class="p">[</span><span class="nv">request</span><span class="p">]</span> <span class="p">(</span><span class="kd">setv </span><span class="nv">template</span> <span class="p">(</span><span class="nf">env.get_template</span> <span class="s">"page.html"</span><span class="p">))</span> <span class="p">(</span><span class="k">return</span> <span class="p">(</span><span class="nf">response.html</span> <span class="p">(</span><span class="nf">template.render</span><span class="p">)))</span> <span class="p">)</span> <span class="p">)</span> <span class="p">(</span><span class="nf">app.static</span> <span class="s">"/"</span> <span class="s">"./public"</span><span class="p">)</span> <span class="p">(</span><span class="nf">defmain</span> <span class="p">[</span><span class="o">&</span><span class="k">rest </span><span class="nv">args</span><span class="p">]</span> <span class="p">(</span><span class="nf">app.run</span> <span class="ss">:host</span> <span class="s">"0.0.0.0"</span> <span class="ss">:port</span> <span class="mi">8015</span><span class="p">)</span> <span class="p">)</span> </pre></div> </div> </div> <div class="section" id="index"> <h2>Index<a class="headerlink" href="#index" title="Permalink to this headline">¶</a></h2> <div class="highlight-html notranslate"><div class="highlight"><pre><span></span><span class="cp"><!DOCTYPE html></span> <span class="p"><</span><span class="nt">html</span> <span class="na">lang</span><span class="o">=</span><span class="s">"en"</span><span class="p">></span> <span class="p"><</span><span class="nt">head</span><span class="p">></span> <span class="p"><</span><span class="nt">meta</span> <span class="na">charset</span><span class="o">=</span><span class="s">"utf-8"</span><span class="p">></span> <span class="p"><</span><span class="nt">title</span><span class="p">></span>Bitrhythm<span class="p"></</span><span class="nt">title</span><span class="p">></span> <span class="p"><</span><span class="nt">meta</span> <span class="na">http-equiv</span><span class="o">=</span><span class="s">"Cache-Control"</span> <span class="na">content</span><span class="o">=</span><span class="s">"no-cache, no-store, must-revalidate"</span> <span class="p">/></span> <span class="p"><</span><span class="nt">meta</span> <span class="na">http-equiv</span><span class="o">=</span><span class="s">"Pragma"</span> <span class="na">content</span><span class="o">=</span><span class="s">"no-cache"</span> <span class="p">/></span> <span class="p"><</span><span class="nt">meta</span> <span class="na">http-equiv</span><span class="o">=</span><span class="s">"Expires"</span> <span class="na">content</span><span class="o">=</span><span class="s">"0"</span> <span class="p">/></span> <span class="p"><</span><span class="nt">meta</span> <span class="na">content</span><span class="o">=</span><span class="s">"Bitrhythm"</span> <span class="na">name</span><span class="o">=</span><span class="s">"description"</span> <span class="na">xml:lang</span><span class="o">=</span><span class="s">"en"</span> <span class="na">lang</span><span class="o">=</span><span class="s">"en"</span><span class="p">></span> <span class="p"><</span><span class="nt">meta</span> <span class="na">content</span><span class="o">=</span><span class="s">"literate programming, p5, live coding, algorave, demoscene, creative programming, music, techno, programming, webaudio, webgl, p5, improvising"</span><span class="p">></span> ${common_scripts} <span class="p"><</span><span class="nt">link</span> <span class="na">rel</span><span class="o">=</span><span class="s">"preconnect"</span> <span class="na">href</span><span class="o">=</span><span class="s">"https://fonts.gstatic.com"</span><span class="p">></span> <span class="p"><</span><span class="nt">link</span> <span class="na">href</span><span class="o">=</span><span class="s">"https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,700;1,100;1,200;1,300;1,400;1,500;1,700&display=swap"</span> <span class="na">rel</span><span class="o">=</span><span class="s">"stylesheet"</span><span class="p">></span> <span class="p"><</span><span class="nt">link</span> <span class="na">href</span><span class="o">=</span><span class="s">"https://fonts.googleapis.com/css2?family=Major+Mono+Display&family=Roboto+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,700;1,100;1,200;1,300;1,400;1,500;1,700&display=swap"</span> <span class="na">rel</span><span class="o">=</span><span class="s">"stylesheet"</span><span class="p">></span> <span class="p"><</span><span class="nt">script</span> <span class="na">src</span><span class="o">=</span><span class="s">"https://code.jquery.com/ui/1.12.0/jquery-ui.min.js"</span><span class="p">></</span><span class="nt">script</span><span class="p">></span> <span class="p"><</span><span class="nt">link</span> <span class="na">rel</span><span class="o">=</span><span class="s">"stylesheet"</span> <span class="na">href</span><span class="o">=</span><span class="s">"https://code.jquery.com/ui/1.12.0/themes/smoothness/jquery-ui.css"</span><span class="p">></span> <span class="p"><</span><span class="nt">script</span> <span class="na">src</span><span class="o">=</span><span class="s">"https://cdnjs.cloudflare.com/ajax/libs/micromodal/0.4.6/micromodal.min.js"</span> <span class="na">integrity</span><span class="o">=</span><span class="s">"sha512-RMMh+IHzfZLsVFo1rX9PBoysxrJJqjyOS31HYWftobWtv2At6KBTqKpvVDIWAjL5aiV+LjFqkQ6e53Rdw3VOBg=="</span> <span class="na">crossorigin</span><span class="o">=</span><span class="s">"anonymous"</span><span class="p">></</span><span class="nt">script</span><span class="p">></span> <span class="p"><</span><span class="nt">script</span> <span class="na">src</span><span class="o">=</span><span class="s">"https://cdn.jsdelivr.net/npm/whenipress@1.8.0/dist/whenipress.js"</span><span class="p">></</span><span class="nt">script</span><span class="p">></span> <span class="p"><</span><span class="nt">script</span> <span class="na">src</span><span class="o">=</span><span class="s">"https://cdnjs.cloudflare.com/ajax/libs/AlertifyJS/1.13.1/alertify.min.js"</span> <span class="na">integrity</span><span class="o">=</span><span class="s">"sha512-JnjG+Wt53GspUQXQhc+c4j8SBERsgJAoHeehagKHlxQN+MtCCmFDghX9/AcbkkNRZptyZU4zC8utK59M5L45Iw=="</span> <span class="na">crossorigin</span><span class="o">=</span><span class="s">"anonymous"</span><span class="p">></</span><span class="nt">script</span><span class="p">></span> <span class="p"><</span><span class="nt">link</span> <span class="na">rel</span><span class="o">=</span><span class="s">"stylesheet"</span> <span class="na">href</span><span class="o">=</span><span class="s">"https://cdnjs.cloudflare.com/ajax/libs/AlertifyJS/1.13.1/css/alertify.min.css"</span> <span class="na">integrity</span><span class="o">=</span><span class="s">"sha512-IXuoq1aFd2wXs4NqGskwX2Vb+I8UJ+tGJEu/Dc0zwLNKeQ7CW3Sr6v0yU3z5OQWe3eScVIkER4J9L7byrgR/fA=="</span> <span class="na">crossorigin</span><span class="o">=</span><span class="s">"anonymous"</span> <span class="p">/></span> <span class="p"><</span><span class="nt">link</span> <span class="na">rel</span><span class="o">=</span><span class="s">"stylesheet"</span> <span class="na">href</span><span class="o">=</span><span class="s">"https://cdnjs.cloudflare.com/ajax/libs/AlertifyJS/1.13.1/css/themes/default.min.css"</span> <span class="na">integrity</span><span class="o">=</span><span class="s">"sha512-RgUjDpwjEDzAb7nkShizCCJ+QTSLIiJO1ldtuxzs0UIBRH4QpOjUU9w47AF9ZlviqV/dOFGWF6o7l3lttEFb6g=="</span> <span class="na">crossorigin</span><span class="o">=</span><span class="s">"anonymous"</span> <span class="p">/></span> <span class="p"><</span><span class="nt">script</span> <span class="na">src</span><span class="o">=</span><span class="s">"/json-url-master/dist/browser/json-url.js"</span><span class="p">></</span><span class="nt">script</span><span class="p">></span> <span class="p"><</span><span class="nt">script</span> <span class="na">src</span><span class="o">=</span><span class="s">"/riot-3.13.2/riot+compiler.js"</span><span class="p">></</span><span class="nt">script</span><span class="p">></span> <span class="p"><</span><span class="nt">link</span> <span class="na">rel</span><span class="o">=</span><span class="s">"stylesheet"</span> <span class="na">href</span><span class="o">=</span><span class="s">"https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.1.2/tailwind.min.css"</span> <span class="na">integrity</span><span class="o">=</span><span class="s">"sha512-RntatPOhEcQEA81gC/esYoCkGkL7AYV7TeTPoU+R9zE44/yWxVvLIBfBSaMu78rhoDd73ZeRHXRJN5+aPEK53Q=="</span> <span class="na">crossorigin</span><span class="o">=</span><span class="s">"anonymous"</span> <span class="p">/></span> <span class="p"><</span><span class="nt">script</span> <span class="na">src</span><span class="o">=</span><span class="s">"https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"</span> <span class="na">integrity</span><span class="o">=</span><span class="s">"sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM"</span> <span class="na">crossorigin</span><span class="o">=</span><span class="s">"anonymous"</span><span class="p">></</span><span class="nt">script</span><span class="p">></span> <span class="p"><</span><span class="nt">link</span> <span class="na">rel</span><span class="o">=</span><span class="s">"stylesheet"</span> <span class="na">href</span><span class="o">=</span><span class="s">"https://esironal.github.io/cmtouch/lib/codemirror.css"</span><span class="p">></span> <span class="p"><</span><span class="nt">link</span> <span class="na">rel</span><span class="o">=</span><span class="s">"stylesheet"</span> <span class="na">href</span><span class="o">=</span><span class="s">"https://esironal.github.io/cmtouch/addon/hint/show-hint.css"</span><span class="p">></span> <span class="p"><</span><span class="nt">script</span> <span class="na">src</span><span class="o">=</span><span class="s">"https://esironal.github.io/cmtouch/lib/codemirror.js"</span><span class="p">></</span><span class="nt">script</span><span class="p">></span> <span class="p"><</span><span class="nt">script</span> <span class="na">src</span><span class="o">=</span><span class="s">"https://esironal.github.io/cmtouch/addon/hint/show-hint.js"</span><span class="p">></</span><span class="nt">script</span><span class="p">></span> <span class="p"><</span><span class="nt">script</span> <span class="na">src</span><span class="o">=</span><span class="s">"http://esironal.github.io/cmtouch/addon/hint/xml-hint.js"</span><span class="p">></</span><span class="nt">script</span><span class="p">></span> <span class="p"><</span><span class="nt">script</span> <span class="na">src</span><span class="o">=</span><span class="s">"https://esironal.github.io/cmtouch/addon/hint/html-hint.js"</span><span class="p">></</span><span class="nt">script</span><span class="p">></span> <span class="p"><</span><span class="nt">script</span> <span class="na">src</span><span class="o">=</span><span class="s">"https://esironal.github.io/cmtouch/mode/xml/xml.js"</span><span class="p">></</span><span class="nt">script</span><span class="p">></span> <span class="p"><</span><span class="nt">script</span> <span class="na">src</span><span class="o">=</span><span class="s">"https://esironal.github.io/cmtouch/mode/javascript/javascript.js"</span><span class="p">></</span><span class="nt">script</span><span class="p">></span> <span class="p"><</span><span class="nt">script</span> <span class="na">src</span><span class="o">=</span><span class="s">"https://esironal.github.io/cmtouch/mode/css/css.js"</span><span class="p">></</span><span class="nt">script</span><span class="p">></span> <span class="p"><</span><span class="nt">script</span> <span class="na">src</span><span class="o">=</span><span class="s">"https://esironal.github.io/cmtouch/mode/htmlmixed/htmlmixed.js"</span><span class="p">></</span><span class="nt">script</span><span class="p">></span> <span class="p"><</span><span class="nt">script</span> <span class="na">src</span><span class="o">=</span><span class="s">"https://esironal.github.io/cmtouch/addon/selection/active-line.js"</span><span class="p">></</span><span class="nt">script</span><span class="p">></span> <span class="p"><</span><span class="nt">script</span> <span class="na">src</span><span class="o">=</span><span class="s">"https://esironal.github.io/cmtouch/addon/selection/mark-selection.js"</span><span class="p">></</span><span class="nt">script</span><span class="p">></span> <span class="p"><</span><span class="nt">script</span> <span class="na">src</span><span class="o">=</span><span class="s">"https://esironal.github.io/cmtouch/addon/edit/matchbrackets.js"</span><span class="p">></</span><span class="nt">script</span><span class="p">></span> <span class="p"><</span><span class="nt">link</span> <span class="na">rel</span><span class="o">=</span><span class="s">"stylesheet"</span> <span class="na">href</span><span class="o">=</span><span class="s">"https://esironal.github.io/cmtouch/theme/neonsyntax.css"</span><span class="p">></span> <span class="p"><</span><span class="nt">link</span> <span class="na">rel</span><span class="o">=</span><span class="s">"stylesheet"</span> <span class="na">href</span><span class="o">=</span><span class="s">"https://unpkg.com/pyloncss@latest/css/pylon.css"</span><span class="p">/></span> <span class="p"><</span><span class="nt">script</span> <span class="na">src</span><span class="o">=</span><span class="s">"/tune.js"</span><span class="p">></</span><span class="nt">script</span><span class="p">></span> <span class="p"><</span><span class="nt">script</span> <span class="na">src</span><span class="o">=</span><span class="s">"/misc.js"</span><span class="p">></</span><span class="nt">script</span><span class="p">></span> <span class="p"><</span><span class="nt">style</span> <span class="na">type</span><span class="o">=</span><span class="s">"text/css"</span><span class="p">></span> <span class="nt">body</span> <span class="p">{</span> <span class="k">background</span><span class="p">:</span> <span class="kc">black</span><span class="p">;</span> <span class="k">color</span><span class="p">:</span> <span class="kc">white</span><span class="p">;</span> <span class="k">font-family</span><span class="p">:</span> <span class="s1">'Roboto Mono'</span><span class="p">,</span> <span class="kc">monospace</span><span class="p">;</span> <span class="k">overflow-x</span><span class="p">:</span> <span class="kc">hidden</span><span class="p">;</span> <span class="p">}</span> <span class="nt">a</span> <span class="p">{</span> <span class="k">color</span><span class="p">:</span> <span class="kc">white</span><span class="p">;</span> <span class="p">}</span> <span class="nt">input</span> <span class="p">{</span> <span class="k">color</span><span class="p">:</span> <span class="kc">black</span><span class="p">;</span> <span class="p">}</span> <span class="p">.</span><span class="nc">btn</span> <span class="p">{</span> <span class="k">background</span><span class="p">:</span> <span class="kc">white</span><span class="p">;</span> <span class="k">color</span><span class="p">:</span> <span class="kc">black</span><span class="p">;</span> <span class="k">padding</span><span class="p">:</span> <span class="mi">4</span><span class="kt">px</span><span class="p">;</span> <span class="p">}</span> <span class="p">.</span><span class="nc">CodeMirror-selected</span> <span class="p">{</span> <span class="k">background-color</span><span class="p">:</span> <span class="kc">transparent</span> <span class="cp">!important</span><span class="p">;</span> <span class="k">z-index</span><span class="p">:</span> <span class="mi">20</span> <span class="cp">!important</span><span class="p">;</span> <span class="p">}</span> <span class="p">.</span><span class="nc">CodeMirror-selectedtext</span> <span class="p">{</span> <span class="k">color</span><span class="p">:</span> <span class="kc">red</span> <span class="cp">!important</span><span class="p">;</span> <span class="k">z-index</span><span class="p">:</span> <span class="mi">25</span> <span class="cp">!important</span><span class="p">;</span> <span class="p">}</span> <span class="p">.</span><span class="nc">CodeMirror</span> <span class="nt">pre</span> <span class="p">{</span> <span class="k">z-index</span><span class="p">:</span> <span class="mi">5</span><span class="p">;</span> <span class="k">background</span><span class="p">:</span> <span class="kc">black</span><span class="p">;</span> <span class="k">padding</span><span class="p">:</span> <span class="mi">2</span><span class="kt">px</span><span class="p">;</span> <span class="p">}</span> <span class="p">.</span><span class="nc">CodeMirror-cursor</span> <span class="p">{</span> <span class="k">border-left</span><span class="p">:</span> <span class="mi">2</span><span class="kt">px</span> <span class="kc">solid</span> <span class="kc">white</span> <span class="cp">!important</span><span class="p">;</span> <span class="k">z-index</span><span class="p">:</span> <span class="mi">10</span> <span class="cp">!important</span><span class="p">;</span> <span class="k">color</span><span class="p">:</span> <span class="kc">white</span> <span class="cp">!important</span><span class="p">;</span> <span class="k">background</span><span class="p">:</span> <span class="kc">white</span> <span class="cp">!important</span><span class="p">;</span> <span class="p">}</span> <span class="p">.</span><span class="nc">CodeMirror-line</span> <span class="nt">span</span> <span class="p">{</span> <span class="k">color</span><span class="p">:</span> <span class="kc">white</span> <span class="cp">!important</span><span class="p">;</span> <span class="p">}</span> <span class="p">.</span><span class="nc">CodeMirror-line</span> <span class="o">></span> <span class="nt">span</span> <span class="p">{</span> <span class="k">background</span><span class="p">:</span> <span class="kc">black</span><span class="p">;</span> <span class="k">padding</span><span class="p">:</span> <span class="mi">0</span> <span class="cp">!important</span><span class="p">;</span> <span class="p">}</span> <span class="p">.</span><span class="nc">CodeMirror-lines</span> <span class="p">{</span> <span class="k">padding</span><span class="p">:</span> <span class="mi">0</span> <span class="cp">!important</span><span class="p">;</span> <span class="p">}</span> <span class="p">.</span><span class="nc">CodeMirror</span> <span class="p">{</span> <span class="k">font-size</span><span class="p">:</span> <span class="mi">12</span><span class="kt">px</span><span class="p">;</span> <span class="k">width</span><span class="p">:</span> <span class="mi">100</span><span class="kt">%</span><span class="p">;</span> <span class="k">padding-left</span><span class="p">:</span> <span class="mi">4</span><span class="kt">px</span><span class="p">;</span> <span class="k">line-height</span><span class="p">:</span> <span class="mi">1</span><span class="p">;</span> <span class="k">background</span><span class="p">:</span> <span class="kc">transparent</span> <span class="cp">!important</span><span class="p">;</span> <span class="k">color</span><span class="p">:</span> <span class="kc">white</span> <span class="cp">!important</span><span class="p">;</span> <span class="k">font-family</span><span class="p">:</span> <span class="s1">'Roboto Mono'</span><span class="p">,</span> <span class="kc">monospace</span> <span class="cp">!important</span><span class="p">;</span> <span class="p">}</span> <span class="p">.</span><span class="nc">CodeMirror-vscrollbar</span><span class="o">,</span> <span class="p">.</span><span class="nc">CodeMirror-hscrollbar</span> <span class="p">{</span> <span class="k">overflow-x</span><span class="p">:</span> <span class="kc">hidden</span> <span class="cp">!important</span><span class="p">;</span> <span class="k">overflow-y</span><span class="p">:</span> <span class="kc">hidden</span> <span class="cp">!important</span><span class="p">;</span> <span class="p">}</span> <span class="p">.</span><span class="nc">CodeMirror-cursor</span> <span class="p">{</span> <span class="k">border-left</span><span class="p">:</span> <span class="mi">2</span><span class="kt">px</span> <span class="kc">solid</span> <span class="kc">white</span> <span class="cp">!important</span><span class="p">;</span> <span class="p">}</span> <span class="p"></</span><span class="nt">style</span><span class="p">></span> <span class="p"><</span><span class="nt">script</span> <span class="na">type</span><span class="o">=</span><span class="s">"riot/tag"</span> <span class="na">src</span><span class="o">=</span><span class="s">"/components/bitrhythm.tag"</span><span class="p">></</span><span class="nt">script</span><span class="p">></span> <span class="p"><</span><span class="nt">script</span> <span class="na">type</span><span class="o">=</span><span class="s">"riot/tag"</span> <span class="na">src</span><span class="o">=</span><span class="s">"/components/dial.tag"</span><span class="p">></</span><span class="nt">script</span><span class="p">></span> <span class="p"><</span><span class="nt">script</span> <span class="na">type</span><span class="o">=</span><span class="s">"riot/tag"</span> <span class="na">src</span><span class="o">=</span><span class="s">"/components/sample.tag"</span> <span class="p">></</span><span class="nt">script</span><span class="p">></span> <span class="p"><</span><span class="nt">script</span> <span class="na">type</span><span class="o">=</span><span class="s">"riot/tag"</span> <span class="na">src</span><span class="o">=</span><span class="s">"/components/number.tag"</span> <span class="p">></</span><span class="nt">script</span><span class="p">></span> <span class="p"><</span><span class="nt">script</span> <span class="na">type</span><span class="o">=</span><span class="s">"text/javascript"</span><span class="p">></span> <span class="kd">var</span> <span class="nx">_paq</span> <span class="o">=</span> <span class="nb">window</span><span class="p">.</span><span class="nx">_paq</span> <span class="o">=</span> <span class="nb">window</span><span class="p">.</span><span class="nx">_paq</span> <span class="o">||</span> <span class="p">[];</span> <span class="nx">_paq</span><span class="p">.</span><span class="nx">push</span><span class="p">([</span><span class="s1">'trackPageView'</span><span class="p">]);</span><span class="nx">_paq</span><span class="p">.</span><span class="nx">push</span><span class="p">([</span><span class="s1">'enableLinkTracking'</span><span class="p">]);</span><span class="nx">_paq</span><span class="p">.</span><span class="nx">push</span><span class="p">([</span><span class="s1">'alwaysUseSendBeacon'</span><span class="p">]);</span><span class="nx">_paq</span><span class="p">.</span><span class="nx">push</span><span class="p">([</span><span class="s1">'setTrackerUrl'</span><span class="p">,</span> <span class="s2">"\/\/blog.xyzzyapps.link\/owoamims\/matomo\/app\/matomo.php"</span><span class="p">]);</span><span class="nx">_paq</span><span class="p">.</span><span class="nx">push</span><span class="p">([</span><span class="s1">'setSiteId'</span><span class="p">,</span> <span class="s1">'1'</span><span class="p">]);</span><span class="kd">var</span> <span class="nx">d</span><span class="o">=</span><span class="nb">document</span><span class="p">,</span> <span class="nx">g</span><span class="o">=</span><span class="nx">d</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s1">'script'</span><span class="p">),</span> <span class="nx">s</span><span class="o">=</span><span class="nx">d</span><span class="p">.</span><span class="nx">getElementsByTagName</span><span class="p">(</span><span class="s1">'script'</span><span class="p">)[</span><span class="mf">0</span><span class="p">];</span> <span class="nx">g</span><span class="p">.</span><span class="nx">type</span><span class="o">=</span><span class="s1">'text/javascript'</span><span class="p">;</span> <span class="nx">g</span><span class="p">.</span><span class="k">async</span><span class="o">=</span><span class="kc">true</span><span class="p">;</span> <span class="nx">g</span><span class="p">.</span><span class="nx">src</span><span class="o">=</span><span class="s2">"\/\/blog.xyzzyapps.link\/oozotche\/matomo\/matomo.js"</span><span class="p">;</span> <span class="nx">s</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">insertBefore</span><span class="p">(</span><span class="nx">g</span><span class="p">,</span><span class="nx">s</span><span class="p">);</span> <span class="p"></</span><span class="nt">script</span><span class="p">></span> <span class="p"></</span><span class="nt">head</span><span class="p">></span> <span class="p"><</span><span class="nt">body</span><span class="p">></span> <span class="p"><</span><span class="nt">div</span> <span class="na">class</span><span class="o">=</span><span class="s">"containera-full"</span><span class="p">></span> <span class="p"><</span><span class="nt">hstack</span> <span class="na">class</span><span class="o">=</span><span class="s">"mb-2"</span><span class="p">></span> <span class="p"><</span><span class="nt">h5</span> <span class="na">class</span><span class="o">=</span><span class="s">"ml-4"</span><span class="p">><</span><span class="nt">a</span> <span class="na">href</span><span class="o">=</span><span class="s">"/docs/index.html"</span> <span class="na">target</span><span class="o">=</span><span class="s">"_blank"</span><span class="p">></span>docs<span class="p"></</span><span class="nt">a</span><span class="p">></</span><span class="nt">h5</span><span class="p">></span> <span class="p"><</span><span class="nt">h5</span> <span class="na">class</span><span class="o">=</span><span class="s">"ml-4"</span><span class="p">><</span><span class="nt">a</span> <span class="na">href</span><span class="o">=</span><span class="s">"/song/XQAAAAJwFAAAAAAAAABDKUqGU5vI8Eygv8VLc6H1NFIzdYQe5mT-79BTKosH6Xje2IYnNRgEOpeuhg9NTfIT-_uEg-npGX0y9CmzyyVpwgaOUrKNlF-pzVXf3YnQ2gSfpzY3zlYLujavQRq73hSEM-RaGxTxuud9nauG_VdXCmE_lvZ88XvUHOIGjOkCUKV-1ot3i9fx5NP-UsUmVpnjUDnq_9eUJfonx5B_oG4c3GvLit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F47RUq7oc-9ibiF9FUuoonMLE0PwyGOUJ6LU9SDb4FLPwk0gJBP4GiWLftvfErrXDNck9O6_JZvpJ_9O5qmNDUge5yDYbO__vJejx0bomU7eG2kuvPAmGtiWrYo8B_3JoEAOMgVa9SxE4kZ-ijdh-glIKredlMCUG5eYJc-6H_94pteyO-ocB8rrlfSGr6M2r9xlbeMecCvJTRjmwMbB12DWGbDq5Sxn8tgX98O9lT-51_oajqKVMmox3f7kXhsJPxyIMsUaVVFRmpPJvMt5nt9-i1Vgmux4a3t7a1oVPdN35POOjun63NkyODKhTUHmjdC7h9tv6ZI8WPf2Gh9__k6qf5xp3u3OjzkISj7ainHooji_3Cnjm3T30e6pm3MhliJg1ezFi8NetUwwYZz6UNCMOTUaWAqJ5BmF2hAh5Sdsog93orRvrOuPTNhRA1Wlyjrsy8zVW3WlO4chcKVYA0OsH1Zwjo7koXbfX7ERrPnAbZsWfkPePwI4to-KuPF1v0U4jwFelzwn3n4C1E2BkqPfNcvnVlFDmPHlyOCZHrfsrG9GUPsCrZdrX2EHiWH_bRkXVJwkHTLir8d_cjI0DIrVYji4XBIDX9Pmt-0ylr0FeHLXVHNb4Q7V--3d4-mJ2zXsZDR97M_ikaQVHZBWcKnyWmx_aPoWKnFYkk_6PbR246YU3fViA9PdZKTYrN2B3KmcrliH2T2YRcRdWQGxXlXZh3Bsd5PtOC1EuV7-DHlkI67D6V-AFScJfdj64Pv1wKwGQZ7lEZtrmv_VVRmkWYWFtbBj5HHnth1sKhBjVgGIVH74y9b0hHjpo5kw-1_3jNZ1ooxp-y8FTHblmSkSoQe8bey9XQ7BxGbUPsG0X5LfT8FpZH36A6Vz6nedFEvuoQCyV55qcnDD5IKsJeyKZz1ugrYGoZIfJMr1XTiulWUiaxeat7Q6Xq1YXOjvWV7ki_w4m__-wVP5g"</span><span class="p">></span>techno<span class="p"></</span><span class="nt">a</span><span class="p">></</span><span class="nt">h5</span><span class="p">></span> <span class="p"><</span><span class="nt">h5</span> <span class="na">class</span><span class="o">=</span><span class="s">"ml-4"</span><span class="p">><</span><span class="nt">a</span> <span class="na">href</span><span class="o">=</span><span class="s">"/song/XQAAAAIbCAAAAAAAAABDKUqGU5vI8Eygv8VLc6H1NFIzdYQe5mT-79BTKosH6Xje2IYnNRgEOpeuhg9OTB7Y34cZmeLb5MKZic7bXMO7vWrjHyfc2FvIP0v1Gp--NY5tUsY7sQ71Zzph5WmKUZ2oNtnxz8-HaVpK1SGQzEOq3-lWkeJ76a2J8Ng2OEZxOMNAk6VTnu8fRRTToMlowDe3wjs8DorsxdnW49ThFhGbOek4QAwzPneapDmjuDKRqiqN3btgnfZDzokeOTh6CzwAI2rBbL07YUBEFaMziOJ_2X59fYBPM3eCnL7GlOCk2u6_22WnYgZPbc3RuJLf8JLAhbDrXvZHyYekrPuGo_R6V2BCPE14rZFFwJQWEqy_KDtH_YPMhj1TPS62qcPr6qAWrI9nsndpRrczwBFChHSPKiZXjCZJZKH1Kh19A4-vpXwbr1BCiNdOTQ89KKv0OXpIFUMwx5Qd5jsrb2c-hywM688ClZ86A5o4KzrE2xjG4VbcexmPdOXS-K6PRU4c6dJOUClOLNZpbmZvL8Bo4ep67wL0bFEOMqhN30pLGmZlnfd5mgH8J9dPrGsEglKLGskQ_g2vEeR9CzOstzctjCKtL1O8oNkSuCnXSGE0uY5rxGmBu7AW99tRx0i8hNzB4l1S1mxnzkLefi9VM6YYZraX7T2kGnRgD5HOg0WH2LeUsVuWpnp189Ph_Os95_XUVBc67TwU8IWbzat1decCt0jKKP13L7a0OCO18Fq2DVr9veHq2mRepiObWGsYcqjXkUNjaxoItg_pWdK6gyveVXjfs3PaJ477UbpiZBWxoc-Ebn8FZu6bZZ4gOZE-MoJHUDiQZgo3-lirXTvpcpsgsaIUESDAcGUNE4aIK6wIFGnEaEFYo4veQqTLeic4NhPtUpTdfRqdNTKOaVSUE_KGXKXaZl0Eni1DBmEGykml4uxHsWBEE44Ku34YIb6KZUcCu2DuXDiXcbabsWkA-czXWBtRnzWJ6ib4scny1o6CsVnugUjE9wv84bz2"</span><span class="p">></span>chiptune<span class="p"></</span><span class="nt">a</span><span class="p">></</span><span class="nt">h5</span><span class="p">></span> <span class="p"><</span><span class="nt">h5</span> <span class="na">class</span><span class="o">=</span><span class="s">"ml-4"</span><span class="p">><</span><span class="nt">a</span> <span class="na">href</span><span class="o">=</span><span class="s">"/song/XQAAAAKJCAAAAAAAAABDKUqGU5vI8Eygv8VLc6H1NFIzdYQFgmT-79BTKosH6Xje2IYnNRgEOpeuhg8jahOEd3yMC_PXFq-i_ClvL8Ct3Wgf6uJb5dmDYwtUHkddL3DLEcA0AoD3rP_ZyA1lDuiOOQJSJIeDylz8ajg_yNsR8119StK7SE1-QOm5OZus7ISs3-UqjsX1W0VSZeoF1ebH8hgDFisSvjykmfW2_oDLr6axQL5meUVvESZBQhe4lE78iytxrPrbhjdx5v4qwKWbDGm2pSdeuz9FMGq63DfpnbAy-RHVY3dCDCZIYzOvwfOOR1QV0McEXIqbGpLzRcvIOe5TUnaGKm7qaQqHhDyjt5rL0jFxioR5yKnUAp0gL6zy5TLqRS80CIiz0dj0Na63UxYtPLpf4vWqOJFX6VZpTFRC7o1W8TmeheEr_UgpXblHVIdg8zUP69XACKo_X7MJ-g9-s5ejXxeCWt5YZ-T8-kFbDX-bFQsov0C5k2SMdsTF5IzBulC3aL6-2Mazf5wVU16v-r9t6-U0iaQCqL8UYXUlr9abJSXOYkzSax56PzZiPzRzDv1Sj8QhsZ3xdFXfXNe-3F5o4YjXZ9JwptVwQLaj3UcPvkB4_Eow3JC7mPStctj2RooSef63tbMlp_7YBzaIjRnjJp2n9m11_606XGaYn1JpXMq2Garz3FUYUCXkNziILJlMaKBPqh8GdHdR01bN3G2AcmJTKfppvrY4-TJqzwcQodEU7aiVmiMwbW0Gj9JRcA3tLOZ6EbzsaGxqB_z4gCMnZ7aYzaGXLI7R5ACSC8znneiNZH5_k3kmHB65_8-STam5BnbRBaO0EDSZLlMH4EeA5TUQbfxwBYXvbNX2QWqF5cwHg1S7i9RPr_VBAkC5WZNTYZlNmI1xWkYyli_pstNWBxrmj4ujztca0Fg8RScocAP3YADqMXt73EEMXyqP_y54UwA"</span><span class="p">></span>blank<span class="p"></</span><span class="nt">a</span><span class="p">></</span><span class="nt">h5</span><span class="p">></span> <span class="p"><</span><span class="nt">h5</span> <span class="na">class</span><span class="o">=</span><span class="s">"ml-4"</span><span class="p">><</span><span class="nt">a</span> <span class="na">href</span><span class="o">=</span><span class="s">"/song/XQAAAAL6DwAAAAAAAABDKUqGU5vI8Nuv2pxqeIybGqtJ0xIrSiobr98sdE7afj4Ar4jJq-8ql_W1_78a1_GXYU33QxiTtAV7SHRYdH6zp0CULZjCAn80UrL_cbk6C8SsOzgqMzV6zYkOLvG-fjZLi8LWC9mF2G1PfJaZ22MmMGC7XZiRMvuGgg9IXd6TYK8ymyJSEN8Xog0gS6esuZ-sV6WeWPyMk_80foxigbnhHOeWNjqTD3MHSKVhooDpOdlhHDE9Ym1lf1oXKJyd1nzIropiCpnzQhRx4VLOvptpUX9SPI8JfnOttZoK7-a-lbvVzgBRMrqzxMNO_Td-HNS-tmg3EhtJfpMHKvxFMaPkg0EusLRyP-FAPkl0N3Abu0-nyU14Ayniw1uEDi4tCwYvGQjE5FDxcOEAq0gm3NhikcGkInjkKD7Xhi9SKBshXapQ07ZcykBWOUNWiTQAWTyMwF4iQ2QQPlgV1pwOSSVp-sXJIwbsQFxnlV_wEdMZUF6a8JafjOXzkhYwDVoDVAoa7TAZdjxtIQf7ZIcr0einkkr79XkfkYr2Be38bAyG-KFPRL1L9Oc41gE36Wd6L3oEKuEI-oMYXp5IWlCC_sAyuOBNQsHYoZk8vxByQ8UNbLLOJ74GsYDEfGccM5THthnFOJmGz3h0eOAvxRkTXK1K7vr7ZASa1ijNatkfI2FGrAEJ8UN1aCbYz9YQbIQMfbLw5gzQCu7gUtzcaIx0YuTTJ3AjDw6hklmNmOP8Oefj-eJo4n4aOk6V3pB7n2Xc2S05-FxOA3iP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SjoXPmlg0m_9usiW95hbOMd7pxNKla8u8nOu8r9vkLqqKg_yBHdnTbHThqEgGRPmpcVB8x3P5DZ5sHAWg2k1mubUuuI9aycC-b1qMOPu5y8_bPvXK5uGpEpmoXqbRSlqMLxUrpRPIjOoTPjBc8BciARAkj1yXYWfJ5umO32LMrCaJSi3AO5v_K95FVKT3wnE4x3Ra1yU3CcuXKlFrWrUlWWXGHYS7tXc7YL7Ik5jvI8g3oJeS4LaFMc5WxyzzguEUaO-FxRzVU6kgN_9Yddrg"</span><span class="p">></span>stochastic<span class="p"></</span><span class="nt">a</span><span class="p">></</span><span class="nt">h5</span><span class="p">></span> <span class="p"><</span><span class="nt">h5</span> <span class="na">class</span><span class="o">=</span><span class="s">"ml-4"</span> <span class="p">><</span><span class="nt">a</span> <span class="na">href</span><span class="o">=</span><span class="s">"https://xyzzyapps.link/samples/"</span> <span class="na">target</span><span class="o">=</span><span class="s">"_blank"</span><span class="p">></span>sample browser<span class="p"></</span><span class="nt">a</span><span class="p">></</span><span class="nt">h5</span><span class="p">></span> <span class="p"></</span><span class="nt">hstack</span><span class="p">></span> <span class="p"><</span><span class="nt">bitrhythm</span> <span class="na">song</span><span class="o">=</span><span class="s">"{{data}}"</span><span class="p">></</span><span class="nt">bitrhythm</span><span class="p">></span> <span class="p"></</span><span class="nt">div</span><span class="p">></span> <span class="p"><</span><span class="nt">script</span><span class="p">></span> <span class="nx">riot</span><span class="p">.</span><span class="nx">compile</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="kd">var</span> <span class="nx">bitrhythm</span> <span class="o">=</span> <span class="nx">riot</span><span class="p">.</span><span class="nx">mount</span><span class="p">(</span><span class="s1">'bitrhythm'</span><span class="p">);</span> <span class="nb">window</span><span class="p">.</span><span class="nx">bitrhythm</span> <span class="o">=</span> <span class="nx">bitrhythm</span><span class="p">[</span><span class="mf">0</span><span class="p">];</span> <span class="kd">var</span> <span class="nx">dial</span> <span class="o">=</span> <span class="nx">riot</span><span class="p">.</span><span class="nx">mount</span><span class="p">(</span><span class="s1">'dial'</span><span class="p">);</span> <span class="kd">var</span> <span class="nx">number</span> <span class="o">=</span> <span class="nx">riot</span><span class="p">.</span><span class="nx">mount</span><span class="p">(</span><span class="s1">'number'</span><span class="p">);</span> <span class="kd">var</span> <span class="nx">sample</span> <span class="o">=</span> <span class="nx">riot</span><span class="p">.</span><span class="nx">mount</span><span class="p">(</span><span class="s1">'sample'</span><span class="p">);</span> <span class="p">})</span> <span class="p"></</span><span class="nt">script</span><span class="p">></span> <span class="p"></</span><span class="nt">body</span><span class="p">></span> <span class="p"></</span><span class="nt">html</span><span class="p">></span> </pre></div> </div> </div> <div class="section" id="page"> <h2>Page<a class="headerlink" href="#page" title="Permalink to this headline">¶</a></h2> <div class="highlight-html notranslate"><div class="highlight"><pre><span></span><span class="cp"><!DOCTYPE html></span> <span class="p"><</span><span class="nt">html</span> <span class="na">lang</span><span class="o">=</span><span class="s">"en"</span><span class="p">></span> <span class="p"><</span><span class="nt">head</span><span class="p">></span> <span class="p"><</span><span class="nt">meta</span> <span class="na">charset</span><span class="o">=</span><span class="s">"utf-8"</span><span class="p">></span> <span class="p"><</span><span class="nt">meta</span> <span class="na">name</span><span class="o">=</span><span class="s">"viewport"</span> <span class="na">content</span><span class="o">=</span><span class="s">"width=device-width, initial-scale=1"</span><span class="p">></span> <span class="p"><</span><span class="nt">meta</span> <span class="na">http-equiv</span><span class="o">=</span><span class="s">"Cache-Control"</span> <span class="na">content</span><span class="o">=</span><span class="s">"no-cache, no-store, must-revalidate"</span> <span class="p">/></span> <span class="p"><</span><span class="nt">meta</span> <span class="na">http-equiv</span><span class="o">=</span><span class="s">"Pragma"</span> <span class="na">content</span><span class="o">=</span><span class="s">"no-cache"</span> <span class="p">/></span> <span class="p"><</span><span class="nt">meta</span> <span class="na">http-equiv</span><span class="o">=</span><span class="s">"Expires"</span> <span class="na">content</span><span class="o">=</span><span class="s">"0"</span> <span class="p">/></span> <span class="p"><</span><span class="nt">title</span><span class="p">></span>About birthythm<span class="p"></</span><span class="nt">title</span><span class="p">></span> <span class="p"><</span><span class="nt">link</span> <span class="na">rel</span><span class="o">=</span><span class="s">"icon"</span> <span class="na">href</span><span class="o">=</span><span class="s">"favicon.ico"</span><span class="p">></span> <span class="p"><</span><span class="nt">style</span><span class="p">></span> <span class="nt">html</span><span class="o">,</span> <span class="nt">body</span> <span class="p">{</span> <span class="k">margin</span><span class="p">:</span> <span class="mi">0</span><span class="p">;</span> <span class="k">width</span><span class="p">:</span> <span class="mi">100</span><span class="kt">%</span><span class="p">;</span> <span class="k">height</span><span class="p">:</span> <span class="mi">100</span><span class="kt">%</span><span class="p">;</span> <span class="k">padding</span><span class="p">:</span> <span class="mi">0</span><span class="p">;</span> <span class="p">}</span> <span class="nt">iframe</span> <span class="p">{</span> <span class="k">position</span><span class="p">:</span><span class="kc">fixed</span><span class="p">;</span> <span class="k">top</span><span class="p">:</span><span class="mi">0</span><span class="p">;</span> <span class="k">left</span><span class="p">:</span><span class="mi">0</span><span class="p">;</span> <span class="k">bottom</span><span class="p">:</span><span class="mi">0</span><span class="p">;</span> <span class="k">right</span><span class="p">:</span><span class="mi">0</span><span class="p">;</span> <span class="k">width</span><span class="p">:</span><span class="mi">100</span><span class="kt">%</span><span class="p">;</span> <span class="k">height</span><span class="p">:</span><span class="mi">100</span><span class="kt">%</span><span class="p">;</span> <span class="k">border</span><span class="p">:</span><span class="kc">none</span><span class="p">;</span> <span class="k">margin</span><span class="p">:</span><span class="mi">0</span><span class="p">;</span> <span class="k">padding</span><span class="p">:</span><span class="mi">0</span><span class="p">;</span> <span class="k">overflow</span><span class="p">:</span><span class="kc">hidden</span><span class="p">;</span> <span class="k">z-index</span><span class="p">:</span><span class="mi">999999</span><span class="p">;</span> <span class="p">}</span> <span class="p"></</span><span class="nt">style</span><span class="p">></span> <span class="p"><</span><span class="nt">link</span> <span class="na">href</span><span class="o">=</span><span class="s">"https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css"</span> <span class="na">rel</span><span class="o">=</span><span class="s">"stylesheet"</span><span class="p">></span> <span class="p"><</span><span class="nt">script</span><span class="p">></span> <span class="nb">window</span><span class="p">.</span><span class="nx">goatcounter</span> <span class="o">=</span> <span class="p">{</span> <span class="nx">path</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">p</span><span class="p">)</span> <span class="p">{</span> <span class="k">return</span> <span class="nx">location</span><span class="p">.</span><span class="nx">host</span> <span class="o">+</span> <span class="nx">p</span> <span class="p">}</span> <span class="p">}</span> <span class="p"></</span><span class="nt">script</span><span class="p">></span> <span class="p"><</span><span class="nt">script</span> <span class="na">data-goatcounter</span><span class="o">=</span><span class="s">"https://analytics.xyzzyapps.link/count"</span> <span class="na">async</span> <span class="na">src</span><span class="o">=</span><span class="s">"//analytics.xyzzyapps.link/count.js"</span><span class="p">></</span><span class="nt">script</span><span class="p">></span> <span class="p"></</span><span class="nt">head</span><span class="p">></span> <span class="p"><</span><span class="nt">body</span><span class="p">></span> <span class="p"><</span><span class="nt">iframe</span> <span class="na">src</span><span class="o">=</span><span class="s">"https://blog.xyzzyapps.link/bitrhythm-submit-issue-feedback"</span> <span class="na">frameborder</span><span class="o">=</span><span class="s">"0"</span><span class="p">></</span><span class="nt">iframe</span><span class="p">></span> <span class="p"></</span><span class="nt">body</span><span class="p">></span> <span class="p"></</span><span class="nt">html</span><span class="p">></span> </pre></div> </div> </div> <div class="section" id="javascript"> <h2>Javascript<a class="headerlink" href="#javascript" title="Permalink to this headline">¶</a></h2> <p>This includes the functions used for parsing the pattern and initialising the samples. A prelimnary sampler implementation has been done with AudioWorklet support, although there doesn’t seem to much improvement in the performance.</p> <div class="highlight-js notranslate"><div class="highlight"><pre><span></span><span class="kd">function</span> <span class="nx">getRandomInt</span><span class="p">(</span><span class="nx">max</span><span class="p">)</span> <span class="p">{</span> <span class="k">return</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">floor</span><span class="p">(</span><span class="nb">Math</span><span class="p">.</span><span class="nx">random</span><span class="p">()</span> <span class="o">*</span> <span class="nx">max</span><span class="p">);</span> <span class="p">}</span> <span class="kd">function</span> <span class="nx">initWinamp</span><span class="p">(</span><span class="nx">preset</span><span class="p">)</span> <span class="p">{</span> <span class="kd">var</span> <span class="nx">can</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s2">"visual"</span><span class="p">);</span> <span class="nx">can</span><span class="p">.</span><span class="nx">height</span> <span class="o">=</span> <span class="nb">window</span><span class="p">.</span><span class="nx">innerHeight</span> <span class="o">-</span> <span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s2">"header-playback"</span><span class="p">).</span><span class="nx">clientHeight</span> <span class="o">/</span> <span class="mf">2</span><span class="p">);</span> ................................................................................ <span class="nx">can_container</span><span class="p">.</span><span class="nx">width</span> <span class="o">=</span> <span class="nb">window</span><span class="p">.</span><span class="nx">innerWidth</span><span class="p">;</span> <span class="kd">var</span> <span class="nx">visualizer</span> <span class="o">=</span> <span class="nb">window</span><span class="p">.</span><span class="nx">butterchurn</span><span class="p">.</span><span class="k">default</span><span class="p">.</span><span class="nx">createVisualizer</span><span class="p">(</span><span class="nx">Tone</span><span class="p">.</span><span class="nx">getContext</span><span class="p">().</span><span class="nx">rawContext</span><span class="p">,</span> <span class="nx">can</span><span class="p">,</span> <span class="p">{</span> <span class="nx">height</span><span class="o">:</span> <span class="nb">window</span><span class="p">.</span><span class="nx">innerHeight</span> <span class="o">-</span> <span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s2">"header-playback"</span><span class="p">).</span><span class="nx">clientHeight</span> <span class="o">/</span> <span class="mf">2</span><span class="p">),</span> <span class="nx">width</span><span class="o">:</span> <span class="nb">window</span><span class="p">.</span><span class="nx">innerWidth</span><span class="p">,</span> <span class="nx">meshWidth</span><span class="o">:</span> <span class="mf">24</span><span class="p">,</span> <span class="nx">meshHeight</span><span class="o">:</span> <span class="mf">18</span><span class="p">,</span> <span class="p">});</span> <span class="nx">visualizer</span><span class="p">.</span><span class="nx">connectAudio</span><span class="p">(</span><span class="nx">Tone</span><span class="p">.</span><span class="nx">getContext</span><span class="p">().</span><span class="nx">rawContext</span><span class="p">.</span><span class="nx">destination</span><span class="p">);</span> <span class="kd">const</span> <span class="nx">presets</span> <span class="o">=</span> <span class="nb">window</span><span class="p">.</span><span class="nx">butterchurnPresets</span><span class="p">.</span><span class="nx">getPresets</span><span class="p">();</span> <span class="kd">const</span> <span class="nx">presetParam</span> <span class="o">=</span> <span class="nx">presets</span><span class="p">[</span><span class="nx">preset</span><span class="p">];</span> <span class="nx">visualizer</span><span class="p">.</span><span class="nx">loadPreset</span><span class="p">(</span><span class="nx">presetParam</span><span class="p">,</span> <span class="mf">0.0</span><span class="p">);</span> <span class="c1">// 2nd argument is the number of seconds to blend presets</span> <span class="k">return</span> <span class="nx">visualizer</span><span class="p">;</span> <span class="p">}</span> <span class="kd">function</span> <span class="nx">guard</span><span class="p">(</span><span class="nx">range</span><span class="p">)</span> <span class="p">{</span> ................................................................................ <span class="nx">letters</span> <span class="o">=</span> <span class="nx">letters</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="s1">'`3'</span><span class="p">,</span><span class="s1">'d'</span><span class="p">);</span> <span class="nx">letters</span> <span class="o">=</span> <span class="nx">letters</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="s1">'`4'</span><span class="p">,</span><span class="s1">'e'</span><span class="p">);</span> <span class="nx">letters</span> <span class="o">=</span> <span class="nx">letters</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="s1">'`5'</span><span class="p">,</span><span class="s1">'f'</span><span class="p">);</span> <span class="k">return</span> <span class="nx">letters</span><span class="p">;</span> <span class="p">}</span> <span class="kd">function</span> <span class="nx">lettertodec</span><span class="p">(</span><span class="nx">letter</span><span class="p">)</span> <span class="p">{</span> <span class="kd">var</span> <span class="nx">bin</span> <span class="o">=</span> <span class="s2">""</span><span class="p">;</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span><span class="p">.</span><span class="nx">match</span><span class="p">(</span><span class="sr">/\d/</span><span class="p">))</span> <span class="p">{</span> <span class="nx">no</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="p">(</span><span class="nx">letter</span><span class="p">);</span> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"a"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">no</span> <span class="o">=</span> <span class="mf">10</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"b"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">no</span> <span class="o">=</span> <span class="mf">11</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"c"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">no</span> <span class="o">=</span> <span class="mf">12</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"d"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">no</span> <span class="o">=</span> <span class="mf">13</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"e"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">no</span> <span class="o">=</span> <span class="mf">14</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"f"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">no</span> <span class="o">=</span> <span class="mf">15</span><span class="p">;</span> <span class="p">}</span> <span class="k">for</span> <span class="p">(</span><span class="nx">i</span> <span class="o">=</span> <span class="mf">1</span><span class="p">;</span> <span class="nx">i</span> <span class="o"><=</span> <span class="nx">no</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span> <span class="nx">bin</span> <span class="o">+=</span> <span class="s2">"0"</span><span class="p">;</span> <span class="p">}</span> <span class="k">return</span> <span class="nx">bin</span><span class="p">;</span> <span class="p">}</span> <span class="kd">function</span> <span class="nx">lettertobin</span><span class="p">(</span><span class="nx">letter</span><span class="p">)</span> <span class="p">{</span> <span class="kd">var</span> <span class="nx">bin</span> <span class="o">=</span> <span class="s2">""</span><span class="p">;</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"0"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">bin</span> <span class="o">+=</span> <span class="s2">"0000"</span><span class="p">;</span> <span class="p">}</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"1"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">bin</span> <span class="o">+=</span> <span class="s2">"0001"</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"2"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">bin</span> <span class="o">+=</span> <span class="s2">"0010"</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"3"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">bin</span> <span class="o">+=</span> <span class="s2">"0011"</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"4"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">bin</span> <span class="o">+=</span> <span class="s2">"0100"</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"5"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">bin</span> <span class="o">+=</span> <span class="s2">"0101"</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"6"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">bin</span> <span class="o">+=</span> <span class="s2">"0110"</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"7"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">bin</span> <span class="o">+=</span> <span class="s2">"0111"</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"8"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">bin</span> <span class="o">+=</span> <span class="s2">"1000"</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"9"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">bin</span> <span class="o">+=</span> <span class="s2">"1001"</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"a"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">bin</span> <span class="o">+=</span> <span class="s2">"1010"</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"b"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">bin</span> <span class="o">+=</span> <span class="s2">"1011"</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"c"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">bin</span> <span class="o">+=</span> <span class="s2">"1100"</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"d"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">bin</span> <span class="o">+=</span> <span class="s2">"1101"</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"e"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">bin</span> <span class="o">+=</span> <span class="s2">"1110"</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">letter</span> <span class="o">==</span> <span class="s2">"f"</span><span class="p">)</span> <span class="p">{</span> <span class="nx">bin</span> <span class="o">+=</span> <span class="s2">"1111"</span><span class="p">;</span> <span class="p">}</span> <span class="k">return</span> <span class="nx">bin</span><span class="p">;</span> <span class="p">}</span> <span class="kd">function</span> <span class="nx">hex2bin</span><span class="p">(</span><span class="nx">hex</span><span class="p">)</span> <span class="p">{</span> <span class="kd">var</span> <span class="nx">letters</span> <span class="o">=</span> <span class="nx">romantogypsy</span><span class="p">(</span><span class="nx">hex</span><span class="p">)</span> <span class="nx">letters</span> <span class="o">=</span> <span class="nx">letters</span><span class="p">.</span><span class="nx">split</span><span class="p">(</span><span class="s1">''</span><span class="p">);</span> <span class="kd">var</span> <span class="nx">bin</span> <span class="o">=</span> <span class="s2">""</span><span class="p">;</span> <span class="nx">letters</span><span class="p">.</span><span class="nx">map</span><span class="p">(</span><span class="kd">function</span><span class="p">(</span><span class="nx">letter</span><span class="p">)</span> <span class="p">{</span> ................................................................................ <span class="nx">setTimeout</span><span class="p">(</span><span class="kd">function</span> <span class="p">()</span> <span class="p">{</span> <span class="nx">$</span><span class="p">(</span><span class="s2">"#cued"</span><span class="p">).</span><span class="nx">html</span><span class="p">(</span><span class="s2">""</span><span class="p">);</span> <span class="p">},</span> <span class="nx">seconds</span> <span class="o">*</span> <span class="mf">1000</span><span class="p">)</span> <span class="p">}</span> <span class="nb">window</span><span class="p">.</span><span class="nx">cue</span> <span class="o">=</span> <span class="nx">cue</span><span class="p">;</span> <span class="k">async</span> <span class="kd">function</span> <span class="nx">loadSamplesToWorklet</span><span class="p">(</span><span class="nx">urls</span><span class="p">)</span> <span class="p">{</span> <span class="kd">var</span> <span class="nx">context</span> <span class="o">=</span> <span class="nx">Tone</span><span class="p">.</span><span class="nx">getContext</span><span class="p">();</span> <span class="nb">window</span><span class="p">.</span><span class="nx">context</span> <span class="o">=</span> <span class="nx">context</span><span class="p">;</span> <span class="k">await</span> <span class="nx">context</span><span class="p">.</span><span class="nx">addAudioWorkletModule</span><span class="p">(</span><span class="s1">'/sampler.js'</span><span class="p">,</span> <span class="s1">'sampler'</span><span class="p">);</span> <span class="kd">var</span> <span class="nx">sampler</span> <span class="o">=</span> <span class="k">await</span> <span class="nx">context</span><span class="p">.</span><span class="nx">createAudioWorkletNode</span><span class="p">(</span><span class="s1">'sampler'</span><span class="p">,</span> <span class="p">{</span> <span class="nx">outputChannelCount</span><span class="o">:</span> <span class="p">[</span><span class="mf">2</span><span class="p">],</span> <span class="c1">// stereo</span> <span class="p">});</span> <span class="nb">window</span><span class="p">.</span><span class="nx">sampler</span> <span class="o">=</span> <span class="nx">sampler</span><span class="p">;</span> <span class="kd">var</span> <span class="nx">files</span> <span class="o">=</span> <span class="p">[]</span> <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="mf">0</span><span class="p">;</span> <span class="nx">i</span> <span class="o"><</span> <span class="nx">urls</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span> <span class="kd">var</span> <span class="nx">url</span> <span class="o">=</span> <span class="nx">urls</span><span class="p">[</span><span class="nx">i</span><span class="p">]</span> <span class="kd">const</span> <span class="nx">source</span> <span class="o">=</span> <span class="nx">context</span><span class="p">.</span><span class="nx">createBufferSource</span><span class="p">();</span> <span class="kd">const</span> <span class="nx">audioBuffer</span> <span class="o">=</span> <span class="k">await</span> <span class="nx">fetch</span><span class="p">(</span><span class="nx">url</span><span class="p">)</span> <span class="p">.</span><span class="nx">then</span><span class="p">(</span><span class="nx">res</span> <span class="p">=></span> <span class="nx">res</span><span class="p">.</span><span class="nx">arrayBuffer</span><span class="p">())</span> <span class="p">.</span><span class="nx">then</span><span class="p">(</span><span class="nx">ArrayBuffer</span> <span class="p">=></span> <span class="nx">context</span><span class="p">.</span><span class="nx">decodeAudioData</span><span class="p">(</span><span class="nx">ArrayBuffer</span><span class="p">));</span> <span class="kd">const</span> <span class="nx">pcmLeft</span> <span class="o">=</span> <span class="nx">audioBuffer</span><span class="p">.</span><span class="nx">getChannelData</span><span class="p">(</span><span class="mf">0</span><span class="p">)</span> <span class="kd">const</span> <span class="nx">pcmRight</span> <span class="o">=</span> <span class="nx">audioBuffer</span><span class="p">.</span><span class="nx">getChannelData</span><span class="p">(</span><span class="mf">1</span><span class="p">)</span> <span class="nx">files</span><span class="p">.</span><span class="nx">push</span><span class="p">({</span> <span class="nx">pcmLeft</span><span class="p">,</span> <span class="nx">pcmRight</span> <span class="p">})</span> <span class="p">}</span> <span class="nx">sampler</span><span class="p">.</span><span class="nx">port</span><span class="p">.</span><span class="nx">postMessage</span><span class="p">({</span> <span class="nx">init</span><span class="o">:</span> <span class="nx">files</span> <span class="p">})</span> <span class="nx">context</span><span class="p">.</span><span class="nx">rawContext</span><span class="p">.</span><span class="nx">resume</span><span class="p">();</span> <span class="nx">sampler</span><span class="p">.</span><span class="nx">connect</span><span class="p">(</span><span class="nx">Tone</span><span class="p">.</span><span class="nx">getContext</span><span class="p">().</span><span class="nx">rawContext</span><span class="p">.</span><span class="nx">destination</span><span class="p">);</span> <span class="p">}</span> <span class="kd">function</span> <span class="nx">Sample</span><span class="p">(</span><span class="nx">name</span><span class="p">,</span> <span class="nx">no</span><span class="p">,</span> <span class="nx">filter</span><span class="p">,</span> <span class="nx">volume</span><span class="p">)</span> <span class="p">{</span> <span class="nx">name</span> <span class="o">=</span> <span class="nx">name</span> <span class="nx">filter</span> <span class="o">=</span> <span class="nx">filter</span> <span class="o">||</span> <span class="mf">10000</span> <span class="nx">volume</span> <span class="o">=</span> <span class="nx">volume</span> <span class="o">||</span> <span class="mf">0</span> <span class="nx">mem</span><span class="p">[</span><span class="nx">name</span> <span class="o">+</span> <span class="s2">"_filter"</span><span class="p">]</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Tone</span><span class="p">.</span><span class="nx">Filter</span><span class="p">(</span><span class="nx">filter</span><span class="p">,</span> <span class="s1">'lowpass'</span><span class="p">,</span> <span class="o">-</span><span class="mf">96</span><span class="p">);</span> <span class="nx">mem</span><span class="p">[</span><span class="nx">name</span> <span class="o">+</span> <span class="s2">"_channel"</span><span class="p">]</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Tone</span><span class="p">.</span><span class="nx">Channel</span><span class="p">({</span><span class="nx">channelCount</span><span class="o">:</span> <span class="mf">2</span><span class="p">,</span> <span class="nx">volume</span><span class="o">:</span> <span class="nx">volume</span><span class="p">}).</span><span class="nx">chain</span><span class="p">(</span><span class="nx">mem</span><span class="p">[</span><span class="nx">name</span> <span class="o">+</span> <span class="s2">"_filter"</span><span class="p">],</span> <span class="nx">mem</span><span class="p">.</span><span class="nx">master</span><span class="p">)</span> <span class="nx">samples</span><span class="p">[</span><span class="nx">no</span><span class="p">].</span><span class="nx">connect</span><span class="p">(</span><span class="nx">mem</span><span class="p">[</span><span class="nx">name</span> <span class="o">+</span> <span class="s2">"_channel"</span><span class="p">]);</span> <span class="nx">hit_map</span><span class="p">[</span><span class="nx">name</span><span class="p">]</span> <span class="o">=</span> <span class="nx">no</span><span class="p">;</span> <span class="p">}</span> <span class="nb">window</span><span class="p">.</span><span class="nx">Sample</span> <span class="o">=</span> <span class="nx">Sample</span><span class="p">;</span> <span class="kd">function</span> <span class="nx">pw</span><span class="p">(</span><span class="nx">s</span><span class="p">,</span> <span class="nx">vol</span><span class="p">,</span> <span class="nx">note</span><span class="p">,</span> <span class="nx">len</span><span class="p">,</span> <span class="nx">delay</span><span class="p">,</span> <span class="nx">pan</span><span class="o">=</span><span class="mf">0</span><span class="p">)</span> <span class="p">{</span> <span class="nb">window</span><span class="p">.</span><span class="nx">sampler</span><span class="p">.</span><span class="nx">port</span><span class="p">.</span><span class="nx">postMessage</span><span class="p">({</span> <span class="nx">noteOn</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span> <span class="nx">sample</span><span class="o">:</span> <span class="nx">s</span><span class="p">,</span> <span class="nx">volume</span><span class="o">:</span> <span class="nx">vol</span><span class="p">});</span> <span class="p">}</span> <span class="nb">window</span><span class="p">.</span><span class="nx">pw</span> <span class="o">=</span> <span class="nx">pw</span><span class="p">;</span> <span class="kd">function</span> <span class="nx">p</span><span class="p">(</span><span class="nx">s</span><span class="p">,</span> <span class="nx">vol</span><span class="p">,</span> <span class="nx">note</span><span class="p">,</span> <span class="nx">len</span><span class="p">,</span> <span class="nx">delay</span><span class="p">,</span> <span class="nx">pan</span><span class="o">=</span><span class="mf">0</span><span class="p">)</span> <span class="p">{</span> <span class="nx">note</span> <span class="o">=</span> <span class="nx">note</span> <span class="o">||</span> <span class="s2">"C3"</span> <span class="nx">len</span> <span class="o">=</span> <span class="nx">len</span> <span class="o">||</span> <span class="s2">"16n"</span> <span class="nx">vol</span> <span class="o">=</span> <span class="nx">vol</span> <span class="o">||</span> <span class="mf">1</span> <span class="nx">delay</span> <span class="o">=</span> <span class="nx">delay</span> <span class="o">||</span> <span class="s2">"+0"</span><span class="p">;</span> <span class="k">for</span> <span class="p">(</span><span class="kd">const</span> <span class="p">[</span><span class="nx">key</span><span class="p">,</span> <span class="nx">value</span><span class="p">]</span> <span class="k">of</span> <span class="nb">Object</span><span class="p">.</span><span class="nx">entries</span><span class="p">(</span><span class="nx">hit_map</span><span class="p">))</span> <span class="p">{</span> <span class="k">if</span> <span class="p">(</span><span class="nx">value</span> <span class="o">==</span> <span class="nx">s</span><span class="p">)</span> <span class="p">{</span> <span class="nx">mem</span><span class="p">[</span><span class="nx">key</span> <span class="o">+</span> <span class="s2">"_last"</span><span class="p">]</span> <span class="o">=</span> <span class="nx">count</span> <span class="nx">mem</span><span class="p">[</span><span class="nx">key</span> <span class="o">+</span> <span class="s2">"_channel"</span><span class="p">].</span><span class="nx">pan</span><span class="p">.</span><span class="nx">value</span> <span class="o">=</span> <span class="nx">pan</span> <span class="p">}</span> <span class="p">}</span> <span class="nx">samples</span><span class="p">[</span><span class="nx">s</span><span class="p">].</span><span class="nx">triggerAttackRelease</span><span class="p">(</span><span class="nx">note</span><span class="p">,</span> <span class="nx">len</span><span class="p">,</span> <span class="nx">delay</span><span class="p">,</span> <span class="nx">vol</span><span class="p">);</span> <span class="p">}</span> <span class="nb">window</span><span class="p">.</span><span class="nx">p</span> <span class="o">=</span> <span class="nx">p</span><span class="p">;</span> <span class="kd">function</span> <span class="nx">p1</span><span class="p">(</span><span class="nx">s</span><span class="p">,</span> <span class="nx">vol</span><span class="p">,</span> <span class="nx">note</span><span class="p">,</span> <span class="nx">len</span><span class="p">,</span> <span class="nx">delay</span><span class="p">,</span> <span class="nx">pan</span><span class="o">=</span><span class="mf">0</span><span class="p">)</span> <span class="p">{</span> <span class="nx">note</span> <span class="o">=</span> <span class="nx">note</span> <span class="o">||</span> <span class="s2">"C3"</span> <span class="nx">len</span> <span class="o">=</span> <span class="nx">len</span> <span class="o">||</span> <span class="s2">"16n"</span> |
Changes to build/html/samples.html.
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
</li> <li class="toctree-l1"> <a class="reference internal" href="alternate-implementation.html"> Alternate Implementations </a> </li> <li class="toctree-l1"> <a class="reference internal" href="limitations.html"> Saving and other limitations </a> </li> <li class="toctree-l1"> <a class="reference internal" href="credits.html"> Credits </a> </li> |
| | |
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
</li> <li class="toctree-l1"> <a class="reference internal" href="alternate-implementation.html"> Alternate Implementations </a> </li> <li class="toctree-l1"> <a class="reference internal" href="saving.html"> Saving / Recording / Streaming </a> </li> <li class="toctree-l1"> <a class="reference internal" href="credits.html"> Credits </a> </li> |
Added build/html/saving.html.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 |
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Saving / Recording / Streaming — Bitrhythm's literate documentation</title> <link href="_static/css/theme.css" rel="stylesheet" /> <link href="_static/css/index.c5995385ac14fb8791e8eb36b4908be2.css" rel="stylesheet" /> <link rel="stylesheet" href="_static/vendor/fontawesome/5.13.0/css/all.min.css"> <link rel="preload" as="font" type="font/woff2" crossorigin href="_static/vendor/fontawesome/5.13.0/webfonts/fa-solid-900.woff2"> <link rel="preload" as="font" type="font/woff2" crossorigin href="_static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.woff2"> <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="_static/sphinx-book-theme.e8e5499552300ddf5d7adccae7cc3b70.css" type="text/css" /> <link rel="stylesheet" type="text/css" href="_static/custom.css" /> <link rel="preload" as="script" href="_static/js/index.1c5a1a01449ed65a7b51.js"> <script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script> <script src="_static/jquery.js"></script> <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script src="_static/sphinx-book-theme.12a9622fbb08dcb3a2a40b2c02b83a57.js"></script> <script src="_static/analytics.js"></script> <link rel="index" title="Index" href="genindex.html" /> <link rel="search" title="Search" href="search.html" /> <link rel="next" title="Credits" href="credits.html" /> <link rel="prev" title="Alternate Implementations" href="alternate-implementation.html" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="docsearch:language" content="en" /> </head> <body data-spy="scroll" data-target="#bd-toc-nav" data-offset="80"> <div class="container-fluid" id="banner"></div> <div class="container-xl"> <div class="row"> <div class="col-12 col-md-3 bd-sidebar site-navigation show" id="site-navigation"> <div class="navbar-brand-box"> <a class="navbar-brand text-wrap" href="index.html"> <h1 class="site-logo" id="site-title">Bitrhythm's literate documentation</h1> </a> </div><nav class="bd-links" id="bd-docs-nav" aria-label="Main navigation"> <div class="bd-toc-item active"> <p class="caption"> <span class="caption-text"> Table of Contents </span> </p> <ul class="current nav bd-sidenav"> <li class="toctree-l1"> <a class="reference internal" href="what.html"> What is bitrhythm about ? </a> </li> <li class="toctree-l1"> <a class="reference internal" href="source-code.html"> Source Code and License </a> </li> <li class="toctree-l1"> <a class="reference internal" href="demo.html"> Getting Started </a> </li> <li class="toctree-l1"> <a class="reference internal" href="samples.html"> Samples </a> </li> <li class="toctree-l1"> <a class="reference internal" href="tweaking.html"> Core Features </a> </li> <li class="toctree-l1"> <a class="reference internal" href="early-attempts.html"> Early Attempts </a> </li> <li class="toctree-l1"> <a class="reference internal" href="changelog.html"> Changelog </a> </li> <li class="toctree-l1"> <a class="reference internal" href="main.html"> Code Walkthrough </a> </li> <li class="toctree-l1"> <a class="reference internal" href="alternate-implementation.html"> Alternate Implementations </a> </li> <li class="toctree-l1 current active"> <a class="current reference internal" href="#"> Saving / Recording / Streaming </a> </li> <li class="toctree-l1"> <a class="reference internal" href="credits.html"> Credits </a> </li> <li class="toctree-l1"> <a class="reference internal" href="bookmarks.html"> Bookmarks </a> </li> </ul> </div> </nav> <!-- To handle the deprecated key --> <div class="navbar_extra_footer"> <a target="_blank" href="/">Bitrhythm App Home</a><br> <a target="_blank" href="https://xyzzyapps.link">Xyzzy Apps Home</a><br> <p class='custom-nav-footer'>(c) Xyzzy Apps, 2021</p> </div> </div> <main class="col py-md-3 pl-md-4 bd-content overflow-auto" role="main"> <div class="topbar container-xl fixed-top"> <div class="topbar-contents row"> <div class="col-12 col-md-3 bd-topbar-whitespace site-navigation show"></div> <div class="col pl-md-4 topbar-main"> <button id="navbar-toggler" class="navbar-toggler ml-0" type="button" data-toggle="collapse" data-toggle="tooltip" data-placement="bottom" data-target=".site-navigation" aria-controls="navbar-menu" aria-expanded="true" aria-label="Toggle navigation" aria-controls="site-navigation" title="Toggle navigation" data-toggle="tooltip" data-placement="left"> <i class="fas fa-bars"></i> <i class="fas fa-arrow-left"></i> <i class="fas fa-arrow-up"></i> </button> <!-- Source interaction buttons --> <!-- Full screen (wrap in <a> to have style consistency --> <a class="full-screen-button"><button type="button" class="btn btn-secondary topbarbtn" data-toggle="tooltip" data-placement="bottom" onclick="toggleFullScreen()" aria-label="Fullscreen mode" title="Fullscreen mode"><i class="fas fa-expand"></i></button></a> <!-- Launch buttons --> </div> <!-- Table of contents --> <div class="d-none d-md-block col-md-2 bd-toc show"> </div> </div> </div> <div id="main-content" class="row"> <div class="col-12 col-md-9 pl-md-3 pr-md-0"> <div> <div class="section" id="saving-recording-streaming"> <h1>Saving / Recording / Streaming<a class="headerlink" href="#saving-recording-streaming" title="Permalink to this headline">¶</a></h1> <p>There is a save button that converts the state of bitrhythm into a url paramter. This means there is an upper limit on how much code you can write, making it useful for demoscene like situations. You can share the url with tinyurl.</p> <p>You can also download the file. Please keep a backup!</p> <p>I use <a class="reference external" href="https://existential.audio/blackhole/">BlackHole</a> to record audio from the browser window to Reaper. There is however a huge performance hit while recording the video, especially if there is WebGL. I recommend an HDMI capture card with a loop out to record the video output into another computer and simultanously see it. This is the recommended setup by twitch streamers.</p> <p>Have a distinct sound at the start to match both audio and video for easy syncing between the two.</p> <ul class="simple"> <li><p>Opening developer tools might slow down the execution a bit</p></li> <li><p>Using excessive delays and reverbs seems to cause some glitches</p></li> <li><p>Mobile browsers don’t work properly</p></li> <li><p>Firefox does not seem to work well with tone.js</p></li> </ul> </div> </div> <div class='prev-next-bottom'> <a class='left-prev' id="prev-link" href="alternate-implementation.html" title="previous page">Alternate Implementations</a> <a class='right-next' id="next-link" href="credits.html" title="next page">Credits</a> </div> </div> </div> <footer class="footer mt-5 mt-md-0"> <div class="container"> <p> By Xyzzy Apps<br/> © Copyright (c) Xyzzy Apps, 2021.<br/> </p> </div> </footer> </main> </div> </div> <script src="_static/js/index.1c5a1a01449ed65a7b51.js"></script> </body> </html> |
Changes to build/html/search.html.
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
</li> <li class="toctree-l1"> <a class="reference internal" href="alternate-implementation.html"> Alternate Implementations </a> </li> <li class="toctree-l1"> <a class="reference internal" href="limitations.html"> Saving and other limitations </a> </li> <li class="toctree-l1"> <a class="reference internal" href="credits.html"> Credits </a> </li> |
| | |
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
</li> <li class="toctree-l1"> <a class="reference internal" href="alternate-implementation.html"> Alternate Implementations </a> </li> <li class="toctree-l1"> <a class="reference internal" href="saving.html"> Saving / Recording / Streaming </a> </li> <li class="toctree-l1"> <a class="reference internal" href="credits.html"> Credits </a> </li> |
Changes to build/html/source-code.html.
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
</li> <li class="toctree-l1"> <a class="reference internal" href="alternate-implementation.html"> Alternate Implementations </a> </li> <li class="toctree-l1"> <a class="reference internal" href="limitations.html"> Saving and other limitations </a> </li> <li class="toctree-l1"> <a class="reference internal" href="credits.html"> Credits </a> </li> |
| | |
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
</li> <li class="toctree-l1"> <a class="reference internal" href="alternate-implementation.html"> Alternate Implementations </a> </li> <li class="toctree-l1"> <a class="reference internal" href="saving.html"> Saving / Recording / Streaming </a> </li> <li class="toctree-l1"> <a class="reference internal" href="credits.html"> Credits </a> </li> |
Changes to build/html/tweaking.html.
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
</li> <li class="toctree-l1"> <a class="reference internal" href="alternate-implementation.html"> Alternate Implementations </a> </li> <li class="toctree-l1"> <a class="reference internal" href="limitations.html"> Saving and other limitations </a> </li> <li class="toctree-l1"> <a class="reference internal" href="credits.html"> Credits </a> </li> |
| | |
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
</li> <li class="toctree-l1"> <a class="reference internal" href="alternate-implementation.html"> Alternate Implementations </a> </li> <li class="toctree-l1"> <a class="reference internal" href="saving.html"> Saving / Recording / Streaming </a> </li> <li class="toctree-l1"> <a class="reference internal" href="credits.html"> Credits </a> </li> |
Changes to build/html/what.html.
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 ... 182 183 184 185 186 187 188 189 190 191 192 193 194 195 ... 210 211 212 213 214 215 216 217 218 219 220 221 222 223 ... 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 |
</li> <li class="toctree-l1"> <a class="reference internal" href="alternate-implementation.html"> Alternate Implementations </a> </li> <li class="toctree-l1"> <a class="reference internal" href="limitations.html"> Saving and other limitations </a> </li> <li class="toctree-l1"> <a class="reference internal" href="credits.html"> Credits </a> </li> ................................................................................ <div class="d-none d-md-block col-md-2 bd-toc show"> <div class="tocsection onthispage pt-5 pb-3"> <i class="fas fa-list"></i> Contents </div> <nav id="bd-toc-nav"> <ul class="visible nav section-nav flex-column"> <li class="toc-h2 nav-item toc-entry"> <a class="reference internal nav-link" href="#adc-2021"> ADC 2021 </a> </li> <li class="toc-h2 nav-item toc-entry"> <a class="reference internal nav-link" href="#inspiration-for-the-project"> ................................................................................ <div id="main-content" class="row"> <div class="col-12 col-md-9 pl-md-3 pr-md-0"> <div> <div class="section" id="what-is-bitrhythm-about"> <h1>What is bitrhythm about ?<a class="headerlink" href="#what-is-bitrhythm-about" title="Permalink to this headline">¶</a></h1> <p>In Bitrhythm you get a coding playground to make music with webaudio, canvas and webgl apis. You can share the final track as a URL which enables interactive music with your listener. The url size limit acts as a contraint on creativity.</p> <p>Apart from the core html apis, you can also use the following libraries</p> <ol class="simple"> <li><p>Tuna</p></li> <li><p>Timbral</p></li> <li><p>Tone.js</p></li> <li><p>Underscore / Rambda</p></li> ................................................................................ <ol class="simple"> <li><p>DSL for describing music sequences - similar to the tracker notation</p></li> <li><p>A core Music Loop that runs your javascript code, with an edit mode</p></li> <li><p>A knob and guard abstraction for programming automation</p></li> </ol> <p>You can use Bitrhythm for making music similar to the music possible with trackers like Buzz / Renoise / OpenMPT. I call this approach Hard Coding music. This is also known as executable music in the Demoscene.</p> <p>You can also use Bitrhythm for Live Coding and Algorithmic composition.</p> <div class="section" id="adc-2021"> <h2>ADC 2021<a class="headerlink" href="#adc-2021" title="Permalink to this headline">¶</a></h2> <p>I presented Bitrhythm in ADC ‘21.</p> <p><a class="reference external" href="https://xyzzyapps.link/adc21">Slides</a></p> <p>Video: TBD</p> </div> <div class="section" id="inspiration-for-the-project"> <h2>Inspiration for the project<a class="headerlink" href="#inspiration-for-the-project" title="Permalink to this headline">¶</a></h2> <p>I make <a class="reference external" href="https://xyzzyapps.link">web apps</a> for a living. I started messing with algorithmic composition using pure data around 2011. In many ways Pure Data was my first DAW. Although nothing much came out of it musically, it transformed the way I view programming. The unix pipes concept is identical to the data flow model in pure data; albeit with more connections.</p> <p>For my music I moved onto Electribe, Renoise, Reaper and live looping with my guitar. I started exploring sonic pi in 2019 but TBH none of the live coding tools were doing what I wanted - basically tweaking /knob-twisting in techno so I started my work on this project. <a class="reference external" href="https://www.youtube.com/watch?v=adz1Gv5Lm34">This library</a> in sonic pi comes close to what I am trying todo with this project. In bitrhythm time is divided into ticks like renoise tracker.</p> <p>After my initial work on the project in 2019, the project got sidetracked. After seeing <a class="reference external" href="https://www.vitling.xyz/toys/acid-banger/">endless acid banger</a> I had an epiphany to work on this project again with programmatic knobs. I was able to compose an endless and interactive dubtechno demo track. In March 2021, I also picked up on literate programming so this document will have both code and documentation intertwined.</p> <p>The documentation for the literate programming project - wheel is <a class="reference external" href="https://xyzzyapps.link/wheel/">available here</a>.</p> |
| | > > > > > > > > | | | > > |
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 ... 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 ... 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 ... 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 |
</li> <li class="toctree-l1"> <a class="reference internal" href="alternate-implementation.html"> Alternate Implementations </a> </li> <li class="toctree-l1"> <a class="reference internal" href="saving.html"> Saving / Recording / Streaming </a> </li> <li class="toctree-l1"> <a class="reference internal" href="credits.html"> Credits </a> </li> ................................................................................ <div class="d-none d-md-block col-md-2 bd-toc show"> <div class="tocsection onthispage pt-5 pb-3"> <i class="fas fa-list"></i> Contents </div> <nav id="bd-toc-nav"> <ul class="visible nav section-nav flex-column"> <li class="toc-h2 nav-item toc-entry"> <a class="reference internal nav-link" href="#intro"> Intro </a> </li> <li class="toc-h2 nav-item toc-entry"> <a class="reference internal nav-link" href="#adc-2021"> ADC 2021 </a> </li> <li class="toc-h2 nav-item toc-entry"> <a class="reference internal nav-link" href="#inspiration-for-the-project"> ................................................................................ <div id="main-content" class="row"> <div class="col-12 col-md-9 pl-md-3 pr-md-0"> <div> <div class="section" id="what-is-bitrhythm-about"> <h1>What is bitrhythm about ?<a class="headerlink" href="#what-is-bitrhythm-about" title="Permalink to this headline">¶</a></h1> <div class="section" id="intro"> <h2>Intro<a class="headerlink" href="#intro" title="Permalink to this headline">¶</a></h2> <p>In Bitrhythm you get a coding playground to make music with webaudio, canvas and webgl apis. You can share the final track as a URL which enables interactive music with your listener. The url size limit acts as a contraint on creativity.</p> <p>Apart from the core html apis, you can also use the following libraries</p> <ol class="simple"> <li><p>Tuna</p></li> <li><p>Timbral</p></li> <li><p>Tone.js</p></li> <li><p>Underscore / Rambda</p></li> ................................................................................ <ol class="simple"> <li><p>DSL for describing music sequences - similar to the tracker notation</p></li> <li><p>A core Music Loop that runs your javascript code, with an edit mode</p></li> <li><p>A knob and guard abstraction for programming automation</p></li> </ol> <p>You can use Bitrhythm for making music similar to the music possible with trackers like Buzz / Renoise / OpenMPT. I call this approach Hard Coding music. This is also known as executable music in the Demoscene.</p> <p>You can also use Bitrhythm for Live Coding and Algorithmic composition.</p> </div> <div class="section" id="adc-2021"> <h2>ADC 2021<a class="headerlink" href="#adc-2021" title="Permalink to this headline">¶</a></h2> <p>I presented Bitrhythm in ADC ‘21 and the ICLC ‘21 for other audio developers.</p> <p><a class="reference external" href="https://xyzzyapps.link/ADC21.pdf">Slides ADC ‘21</a> Video - TBD</p> <p><a class="reference external" href="https://xyzzyapps.link/ICLC21.pdf">Slides ICLC ‘21</a> <a class="reference external" href="https://www.youtube.com/watch?v=LDQ1PMqZowQ">Video</a> ~ 20 minute mark</p> </div> <div class="section" id="inspiration-for-the-project"> <h2>Inspiration for the project<a class="headerlink" href="#inspiration-for-the-project" title="Permalink to this headline">¶</a></h2> <p>I make <a class="reference external" href="https://xyzzyapps.link">web apps</a> for a living. I started messing with algorithmic composition using pure data around 2011. In many ways Pure Data was my first DAW. Although nothing much came out of it musically, it transformed the way I view programming. The unix pipes concept is identical to the data flow model in pure data; albeit with more connections.</p> <p>For my music I moved onto Electribe, Renoise, Reaper and live looping with my guitar. I started exploring sonic pi in 2019 but TBH none of the live coding tools were doing what I wanted - basically tweaking /knob-twisting in techno so I started my work on this project. <a class="reference external" href="https://www.youtube.com/watch?v=adz1Gv5Lm34">This library</a> in sonic pi comes close to what I am trying todo with this project. In bitrhythm time is divided into ticks like renoise tracker.</p> <p>After my initial work on the project in 2019, the project got sidetracked. After seeing <a class="reference external" href="https://www.vitling.xyz/toys/acid-banger/">endless acid banger</a> I had an epiphany to work on this project again with programmatic knobs. I was able to compose an endless and interactive dubtechno demo track. In March 2021, I also picked up on literate programming so this document will have both code and documentation intertwined.</p> <p>The documentation for the literate programming project - wheel is <a class="reference external" href="https://xyzzyapps.link/wheel/">available here</a>.</p> |
Added public/C3.wav.
cannot compute difference between binary files
Added public/ChipShop_GB_Ride_01.wav.
cannot compute difference between binary files
Added public/D5.wav.
cannot compute difference between binary files
Added public/Grand Piano.wav.
cannot compute difference between binary files
Added public/Piano2.wav.
cannot compute difference between binary files
Changes to public/components/bitrhythm.tag.
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
...
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
|
var bars = 0; var tick = 0; var quarter_beat_length = 60000.0 / this.state.tempo; var beat_length = quarter_beat_length * 4; var delta = beat_length / this.state.ticks; window.samples = this.state.samples; var eval_guard = false; self.timer = setInterval(function () { count = count + 1; tick = (count % this.state.ticks); if (tick === 0) ++bars; $("#duration").html("" + bars + "." + tick + " / " + count + " / " + window.roundTo(Tone.Transport.seconds, 2)); always(); for (var i = 0; i < patterns.length; i++) { if (i == 0) { eval_guard = true; } else { eval_guard = false; } var dials = self.state.dials; var numbers = self.state.numbers; if (document.getElementById('edit-mode').checked) { var p_text = oldPatterns[i]; } else { var p_text = patterns[i]; oldPatterns[i] = p_text; } if (p_text() && p_text().length !== 0) { var track_no = i + 1; var pattern = pattern_parse(p_text()); var meta = pattern_meta(p_text()); var isHit = (pattern.split('')[tick] == "1") ? true : false; try { if (document.getElementById('edit-mode').checked) { eval(oldCode); } else { eval(text); if (document.getElementById('redo').checked) { document.getElementById('redo').checked = false; tick = (count % this.state.ticks); count -= tick + 1; i = 0; continue; } if (document.getElementById('load-mode').checked) { document.getElementById('load-mode').checked = false; transition(); } oldCode = text; } $("#error").html(""); } catch (ex) { $("#error").html(ex); eval(oldCode); } } } }.bind(this), delta) window.requestAnimationFrame(animation); } ................................................................................ var self = this; alertify.prompt( 'Enter Sample URL', '', '' , function(evt, value) { self.addURL(value); } , function() { alertify.error('Cancel') }); } addSample() { this.state.samples.push({}); this.update(); } |
|
|
|
|
|
|
|
|
|
|
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>
|
|
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
...
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
|
var bars = 0; var tick = 0; var quarter_beat_length = 60000.0 / this.state.tempo; var beat_length = quarter_beat_length * 4; var delta = beat_length / this.state.ticks; window.samples = this.state.samples; var eval_guard = false; self.timer = setInterval(function () { count = count + 1; tick = (count % this.state.ticks); if (tick === 0) ++bars; $("#duration").html("" + bars + "." + tick + " / " + count + " / " + window.roundTo(Tone.Transport.seconds, 2)); always(); for (var i = 0; i < patterns.length; i++) { if (i == 0) { eval_guard = true; } else { eval_guard = false; } var dials = self.state.dials; var numbers = self.state.numbers; if (document.getElementById('edit-mode').checked) { var p_text = oldPatterns[i]; } else { var p_text = patterns[i]; oldPatterns[i] = p_text; } if (p_text() && p_text().length !== 0) { var track_no = i + 1; var pattern = pattern_parse(p_text()); var meta = pattern_meta(p_text()); var isHit = (pattern.split('')[tick] == "1") ? true : false; try { if (document.getElementById('edit-mode').checked) { eval(oldCode); } else { eval(text); if (document.getElementById('redo').checked) { document.getElementById('redo').checked = false; tick = (count % this.state.ticks); count -= tick + 1; i = 0; continue; } if (document.getElementById('load-mode').checked) { document.getElementById('load-mode').checked = false; transition(); } oldCode = text; } $("#error").html(""); } catch (ex) { $("#error").html(ex); eval(oldCode); } } } }.bind(this), delta) window.requestAnimationFrame(animation); } ................................................................................ var self = this; alertify.prompt( 'Enter Sample URL', '', '' , function(evt, value) { self.addURL(value); } , function() { alertify.error('Cancel') } ); } addSample() { this.state.samples.push({}); this.update(); } |
Changes to public/components/sample.tag.
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
console.log(this.props) return ""; } } this.on("mount", function () { var self = this; /* var sample_file = $("#sample-file" + this.props.ti).get(0); var sam; sample_file.addEventListener('change', (event) => { var file = event.srcElement.files[0]; var a = new Audio(); a.onloadedmetadata = (e) => { sam = new Tone.Sampler({ urls: { "C3": URL.createObjectURL(file), }, onload: () => { this.update(); sam.triggerAttackRelease("C3", 0.5); } }); sam["__name"] = file.name; sam["__url"] = ""; // riot doesn't allow camelcase ? self.props.setsample(sam, self.props.ti - 1); } a.src = URL.createObjectURL(file); }); */ }); </script> </sample> |
< < < < < < < < < < < < < < < < < < | < < < < < < < < < < < |
29 30 31 32 33 34 35 36 37 38 |
console.log(this.props) return ""; } } this.on("mount", function () { }); </script> </sample> |
Added public/demo.js.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 |
volume_guard1 = guard([-20,15]) Tone.Master.volume.value = volume_guard1(Math.round(dials[0]["cell"]() * 30) -20); intro = [ cellx("p x000 0000 0000 0000 "), ] main = [ cellx("p x[2;^C2;+0.01]000 0000 x[0.1]0x[1]0 00x[1]0 "), cellx("p 0000 x000 0000 x000 "), cellx("p x0x0 x0x0 x0x0 x0x0 "), cellx("p x000 0000 0000 0000 "), cellx("p 0000 0000 0000 0000"), cellx("p 0000 0000 0000 0000"), ] bass = [ cellx("p x[2;^C2;+0.01]000 0000 x[0.1]0x[1]0 00x[1]0 "), cellx("p 0000 x000 0000 x000 "), cellx("p x0x0 x0x0 x0x0 x0x0 "), cellx("p x000 0000 0000 0000 "), cellx("p x[^B2]x.00 x[^B2]x.x[^B2]x. x[^B2]x.x[^B2]x.x[^B2]x.0 "), cellx("p 00x[^D3]0 000x[^A2] 00x[^A2]x[^A2] 0x[^A2]0x[^A2] "), ] end = [ cellx("p x[2;^C2;+0.01]000 0000 x[0.1]0x[1]0 00x[1]0 "), cellx("p 0000 x000 0000 x000 "), cellx("p x0x0 x0x0 x0x0 x0x0 "), ] solo = [ cellx("p 0000 0000 0000 0000"), cellx("p 0000 0000 0000 0000"), cellx("p 0000 0000 0000 0000"), ] fin = solo; endgame = [ cellx("p x[2;^C2;+0.01]000 0000 x[0.1]0x[1]0 00x[1]0 "), cellx("p 0000 x000 0000 x000 "), cellx("p x0x0 x0x0 x0x0 x0x0 "), cellx("p x000 0000 0000 0000 "), cellx("p x[^B2]x.00 x[^B2]x.x[^B2]x. x[^B2]x.x[^B2]x.x[^B2]x.0 "), ] empty = cellx("p 0000 0000 0000 0000") function once () { const setup = ( instance ) => { var intro = [] var main = [] var bass = main var solo = bass var end = [] var count = 0; var old_scene = ""; let x = 100; let y = 100; instance.setup = function() { var x = instance.createCanvas(700, 410); x.canvas.style.position = "absolute"; instance.frameRate(2); intro.push(instance.loadImage('/closed/intro/1.png')); intro.push(instance.loadImage('/closed/intro/2.png')); main.push(instance.loadImage('/closed/main/1.png')); main.push(instance.loadImage('/closed/main/2.png')); main.push(instance.loadImage('/closed/main/3.png')); end.push(instance.loadImage('/closed/end/1.png')); end.push(instance.loadImage('/closed/end/2.png')); }; instance.draw = function() { if (old_scene != current_scene) { old_scene = current_scene; count = 0; } // instance.clear(); var c = eval(`${current_scene}`) // instance.image(c[count], 0, 0); count += 1 count = count % c.length; }; }; let myp5 = new p5(setup, document.getElementById('canvas-container')); Tone.Master.volume.value = -30 dials[2]["cell"](1) mem["master_filter"] = new Tone.Filter(10000, 'lowpass', -96); mem["master_stereo"] = new Tone.StereoWidener({width: 0.50}); dials[2]["cell"].onChange(function (e) { var val = parseFloat(e["data"].value); var cutoff_guard = guard([10, 20000]); mem["master_filter"].frequency.value = cutoff_guard(val * 10000); }) dials[3]["cell"](0) dials[3]["cell"].onChange(function (e) { var val = parseFloat(e["data"].value); var volume_guard1 = guard([0,1]) audio.master.in.gain.value = volume_guard1(val / 10); }) mem.master = new Tone.Channel({channelCount: 2, volume: -10}).chain( mem["master_filter"], mem["master_stereo"], Tone.Destination); Sample("k", 0, null, -5); Sample("sn1",1, null, 0); Sample("h",2, 5000, -35); Sample("m",3, null, -15); Sample("f",4, null, -15); name = "s" filter = 2000 volume = -15 mem[name + "_filter"] = new Tone.Filter(filter, 'lowpass', -96); mem[name + "_delay"] = new Tone.FeedbackDelay("4n", 0.4); mem[name + "_channel"] = new Tone.Channel({channelCount: 2, volume: volume, pan: -0.25}).chain(mem[name + "_filter"], mem[name + "_delay"], mem.master) samples[5].connect(mem[name + "_channel"]); hit_map[name] = 5; Sample("manager",6, null, -15); Sample("order",7, null, -15); Sample("cr",8, null, -15); Sample("piano",9, 400, -15); Sample("sitar",10, 5000, -15); const audio = Audio(); const three = ThreeOhUnit(audio, "sawtooth", { "cutoff": 78, "resonance": 15, "envMod": 4000, "decay": 0.5 } ) audio.master.in.gain.value = 0; mem["three"] = three // cutoff [30, 700], 400 // resonance: [1, 30], 15 // envMod: [0, 8000], 4000 // decay: [0.1, 0.9], 0.5 dials[1]["cell"](0.07825) dials[1]["cell"].onChange(function (e) { var val = parseFloat(e["data"].value); cutoff_guard = guard([30, 700]); three.params.cutoff.value = cutoff_guard(val * 1000); }) } function tweak() { var snare_count = cellx(16); snare_count.onChange(function (e) { var val = parseInt(e["data"].value); if (val == 22) { current_scene = "fin"; p1(8, null, null, 12.25); } else { p(1, null, null, "4n") } }) Mousetrap.bind(['f2'], function(e) { snare_count(snare_count() + 1) if (snare_count() <= 20) { setTimeout(function () { p(0, null, null, "24n", null ); setTimeout(function () { p(8, null, null, "2n" ); p(10, 0.5, "A2", 1); }, delta * 2) }, delta * 1.5) } return false; }) } transition = once; if (bars <= 2) { current_scene = "intro"; } else { // mem["three"].step("off"); if (bars == 3) { eval_guard ? cue("Start intro") : ""; current_scene = "intro"; } if (bars == 5) { eval_guard ? cue("Start drums") : ""; current_scene = "main"; } if (bars == 12) { eval_guard ? cue("Add bass"): ""; current_scene = "bass"; } if (bars == 32) { eval_guard ?cue("Reverse "): ""; current_scene = "bass"; } if (bars == 42) { eval_guard ? cue("End "): "" current_scene = "end"; } if (bars == 46) { eval_guard ? cue("Solo "): "" current_scene = "solo"; } transition = tweak; } patterns = eval(`${current_scene}`); always(); if (track_no == 1) { if (count == 0) { cue("Sample") // p1(8, null, null, 12.25); } } if (isHit) { if (current_scene == "intro") { if (track_no == 1) { p(3, null, null, "1n"); } } else if (current_scene == "fin") { } else if (current_scene == "solo") { } else if (current_scene == "end") { if (track_no == 1) { p(0, meta[tick]["volume"], meta[tick]["pitch"], "24n", meta[tick]["delay"] ); } if (track_no == 2) { p(1); } if (track_no == 3) { p(2) } } else if (current_scene == "main") { if (track_no == 1) { p(0, meta[tick]["volume"], meta[tick]["pitch"], "24n", meta[tick]["delay"] ); } if (track_no == 2) { p(1); } if (track_no == 3) { p(2) } if (track_no == 4) { p(3, null, null, "1n"); } if (track_no == 5) { if (meta[tick]["pitch"]) { mem["three"].step({"glide": true, "accent": false, "note": meta[tick]["pitch"]}); } else { mem["three"].step("off"); } } if (track_no == 6) { p(5, null, meta[tick]["pitch"], "1n"); } } else if (current_scene == "bass") { if (track_no == 1) { p(0, meta[tick]["volume"], meta[tick]["pitch"], "24n", meta[tick]["delay"] ); } if (track_no == 2) { p(1); } if (track_no == 3) { p(2) } if (track_no == 4) { p(3, null, null, "1n"); } if (track_no == 5) { if (meta[tick]["pitch"]) { mem["three"].step({"glide": true, "accent": false, "note": meta[tick]["pitch"]}); } else { mem["three"].step("off"); } } if (track_no == 6) { // p(5, 0.15, meta[tick]["pitch"], 1); // p(9, 1, meta[tick]["pitch"], 1); } } } |
Added public/diff.txt.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 |
commit 8e670e6da23eff7487d17e8f3857ee062131f847 Author: Xyzzy Apps <xyzzyapps@gmail.com> Date: Mon Nov 15 07:47:56 2021 +0000 Latest changes diff --git a/first.js b/first.js index cb231ff..73124f0 100644 --- a/first.js +++ b/first.js @@ -58,9 +58,11 @@ function once () { var intro = [] var main = [] var bass = main - var solo = bass var end = [] - var count = 0; + var solo = end + var fin = end + + var count = 0; var old_scene = ""; @@ -69,16 +71,18 @@ function once () { let y = 100; instance.setup = function() { - var x = instance.createCanvas(700, 410); + var x = instance.createCanvas(1280, 410); x.canvas.style.position = "absolute"; - instance.frameRate(2); + instance.frameRate(0.25); intro.push(instance.loadImage('/closed/intro/1.png')); - intro.push(instance.loadImage('/closed/intro/2.png')); main.push(instance.loadImage('/closed/main/1.png')); main.push(instance.loadImage('/closed/main/2.png')); main.push(instance.loadImage('/closed/main/3.png')); + main.push(instance.loadImage('/closed/main/4.png')); + main.push(instance.loadImage('/closed/main/5.png')); + main.push(instance.loadImage('/closed/main/6.png')); + main.push(instance.loadImage('/closed/main/7.png')); end.push(instance.loadImage('/closed/end/1.png')); - end.push(instance.loadImage('/closed/end/2.png')); }; instance.draw = function() { @@ -86,9 +90,9 @@ function once () { old_scene = current_scene; count = 0; } - // instance.clear(); + instance.clear(); var c = eval(`${current_scene}`) - // instance.image(c[count], 0, 0); + instance.image(c[count], 0, 0); count += 1 count = count % c.length; @@ -118,8 +122,6 @@ function once () { audio.master.in.gain.value = volume_guard1(val / 10); }) - - mem.master = new Tone.Channel({channelCount: 2, volume: -10}).chain( mem["master_filter"], mem["master_stereo"], Tone.Destination); Sample("k", 0, null, -5); Sample("sn1",1, null, 0); @@ -136,17 +138,14 @@ function once () { samples[5].connect(mem[name + "_channel"]); hit_map[name] = 5; - - + - - - Sample("manager",6, null, -15); + Sample("manager",6, null, -5); Sample("order",7, null, -15); Sample("cr",8, null, -15); - Sample("piano",9, 400, -15); + Sample("piano",9, 400, -5); Sample("sitar",10, 5000, -15); const audio = Audio(); @@ -172,22 +171,26 @@ function once () { cutoff_guard = guard([30, 700]); three.params.cutoff.value = cutoff_guard(val * 1000); }) + + + mem.k1 = knob({ramp : [0.525, 0.8, 0.4, 0.25, 0.75, 0.25], step: 0.005, "number": dials[1]["cell"] }); + always = function () { + let cutoff_guard = guard([30, 900]); + three.params.cutoff.value = cutoff_guard(mem.k1.move() * 1000); + } } function tweak() { - var snare_count = cellx(16); - - + var snare_count = cellx(0); + snare_count.onChange(function (e) { var val = parseInt(e["data"].value); if (val == 22) { current_scene = "fin"; - p1(8, null, null, 12.25); - } else { - p(1, null, null, "4n") - } + p1(8, null, null, 12.25); + } }) @@ -233,8 +236,6 @@ if (bars == 5) { } - - if (bars == 12) { eval_guard ? cue("Add bass"): ""; current_scene = "bass"; @@ -253,7 +254,7 @@ if (bars == 42) { } -if (bars == 46) { +if (bars == 48) { eval_guard ? cue("Solo "): "" current_scene = "solo"; } @@ -269,7 +270,7 @@ always(); if (track_no == 1) { if (count == 0) { cue("Sample") - // p1(8, null, null, 12.25); + p1(7, null, null, 12.25); } } @@ -311,9 +312,9 @@ if (isHit) { } if (track_no == 5) { if (meta[tick]["pitch"]) { - mem["three"].step({"glide": true, "accent": false, "note": meta[tick]["pitch"]}); + // mem["three"].step({"glide": true, "accent": false, "note": meta[tick]["pitch"]}); } else { - mem["three"].step("off"); + // mem["three"].step("off"); } } if (track_no == 6) { @@ -350,4 +351,4 @@ if (isHit) { } - + \ No newline at end of file commit 2ba2a38315b82fb03d1567d8e79eb58bd59f41c9 Author: Xyzzy Apps <xyzzyapps@gmail.com> Date: Sun Nov 14 12:31:39 2021 +0000 Tutorial diff --git a/tutorial.js b/tutorial.js new file mode 100644 index 0000000..c3c5f67 --- /dev/null +++ b/tutorial.js @@ -0,0 +1,183 @@ +volume_guard1 = guard([-20,15]) +Tone.Master.volume.value = volume_guard1(Math.round(dials[0]["cell"]() * 30) -20); +// mem["stab_channel"].volume.value = volume_guard2(-2); +// mem["stab_filter"].frequency.value = Math.round(dials[1]["cell"]() * 10000); + + +scene1 = [ + cellx("p 1000 1000 1000 1000"), + cellx("p 00x0 00x0 00x0 00x0"), + cellx("p 0x00 0000 0000 x000"), + cellx("p 0000 x000 0000 x000"), + cellx("p xx0x c0x0 x0x0 x0xx"), + cellx("p x000 x0x0 0000 x0x0"), +] + +patterns = scene1 + + +function NoiseSynth (name) { + name = name || "wf"; + mem[name + "_stereo"] = new Tone.StereoWidener({width: 1}); + mem[name] = new Tone.Noise("pink").start(); + mem[name + "_filter"] = new Tone.Filter(400, 'lowpass', -96); + mem[name + "_channel"] = new Tone.Channel({channelCount: 2, volume: -10, pan: -0.8}).chain(mem[name + "_filter"], mem[name + "_stereo"], mem.master); + mem[name].connect(mem[name + "_channel"]) +} + +function Stab(name) { + name = name || "stab"; + + mem[name + "_filter"] = new Tone.Filter(5250, 'lowpass', -96); + mem[name + "_hfilter"] = new Tone.Filter(80, 'highpass', -96); + mem[name + "_reverb"] = new Tone.Reverb(0.1); + mem[name + "_delay"] = new Tone.FeedbackDelay("4n", 0.4); + // mem[name + "_pdelay"] = new Tone.PingPongDelay("2n", 0.1); + mem[name + "_stereo"] = new Tone.StereoWidener({width: 0.25}); + mem[name + "_channel"] = new Tone.Channel({channelCount: 2, volume: -2}).chain(mem[name + "_filter"] , mem[name + "_delay"], mem[name + "_reverb"], mem[name + "_hfilter"] ,mem[name + "_stereo"], mem.master) + + + function voice(no, type) { + mem[name + "_synth" + no] = new Tone.MonoSynth({ + oscillator: { + type: type + } + }) + mem[name + "_synth" + no].connect(mem[name + "_channel"]); + } + + voice(1, "sawtooth") + voice(2, "sawtooth") + voice(3, "sawtooth") + voice(4, "pwm") + voice(5, "pwm") + voice(6, "pwm") +} + +function s(vel, notes, duration) { + vel = vel || 1.0; + duration = duration || "2n"; + notes = notes || ["E2", "B2", "G2"]; + mem["stab_synth1"].triggerAttackRelease(notes[0], duration, undefined, vel); + mem["stab_synth2"].triggerAttackRelease(notes[1], duration, undefined, vel); + mem["stab_synth3"].triggerAttackRelease(notes[2], duration, undefined, vel); + + mem["stab_synth4"].triggerAttackRelease(notes[0], duration, undefined, vel); + mem["stab_synth5"].triggerAttackRelease(notes[1], duration, undefined, vel); + mem["stab_synth6"].triggerAttackRelease(notes[2], duration, undefined, vel); +} + +function once() { + var pr; + const s = ( p ) => { + pr = p; + var img; + let x = 100; + let y = 100; + + p.setup = function() { + var x = p.createCanvas(700, 410); + x.canvas.style.position = "absolute"; + p.frameRate(30); + img = p.loadImage('/test.png'); + }; + + p.draw = function() { + var e = getRandomInt(2); + p.clear(); + if (e == 0) { + // p.fill(123); + // p.rect(x,y,50,50); + } else { + // p.image(img, 0, 0); + } + }; + }; + + let myp5 = new p5(s, document.getElementById('canvas-container')); + + + var visualizer = initWinamp("_Aderrasi - Wanderer in Curved Space - mash0000 - faclempt kibitzing meshuggana schmaltz (Geiss color mix)"); + + render_loop = function () { + visualizer.render(); + } + + Tone.Master.volume.value = -30; + mem.master = new Tone.Channel({channelCount: 2, volume: -10}).chain(Tone.Destination); + + // NoiseSynth(); + Stab(); + Sample("k", 0, 3000, 3); + Sample("h", 1, 7000, -15); + Sample("sn",2, 6000, -15); + Sample("c", 3, 620, 2); + Sample("l", 4, 420, -15); + + handlers["1"] = function (val) { + if (val > 0.5) { + mem["start_snare"] = true; + } else { + mem["start_snare"] = false; + } + mem["stab_filter"].Q.value = Math.round(val * 5); + } + + dials[1]["cell"].onChange(function (e) { + var val = parseFloat(e["data"].value); + handlers["1"](val); + }) + +} + +function tweak () { + mem.k1 = knob({ramp : [0.525, 0.8, 0.4, 1, 0.25, 0.75, 1, 0.25, 0.1], "number": dials[2]["cell"] }); + always = function () { + mem["stab_filter"].frequency.value = mem.k1.move() * 10000; + } +} + +if (bars <= 3 ) { + transition = once; +} else { + transition = tweak; +} + +if (isHit) { + if (track_no == 1) { + if (bars > 0 ) { + p(0); + } + } + if (track_no == 2) { + if (bars > 8 ) { + p(1); + } + } + if (track_no == 3) { + if (bars > 4 ) { + // s(); + } + if (bars == 6) { + transition(); + } + } + if (track_no == 4) { + if (mem["start_snare"]) { + p(2); + } + } + if (track_no == 5) { + if (bars > 12) { + p(3) + } + } + if (track_no == 6) { + // p(4, "C3") + } +} + +if (count == (mem["k_last"] + 3)) { + pn("h"); +} + commit 85e1f79228fa1ecdc5f57fcee70f31c8bee0a89f Author: Xyzzy Apps <xyzzyapps@gmail.com> Date: Tue Nov 2 22:09:26 2021 +0000 /Users/dev/proj/production/bitrhythm/song/4913 modified diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8943fb4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +tags +diff.txt diff --git a/first.js b/first.js index 3870156..cb231ff 100644 --- a/first.js +++ b/first.js @@ -10,113 +10,154 @@ main = [ cellx("p 0000 x000 0000 x000 "), cellx("p x0x0 x0x0 x0x0 x0x0 "), cellx("p x000 0000 0000 0000 "), - cellx("p x[^120]000 0000 00x[^124]0 00x[^116]0 "), // melody - + cellx("p 0000 0000 0000 0000"), + cellx("p 0000 0000 0000 0000"), ] bass = [ - cellx("p x[2;^C2;+0.01]000 0000 x[0.1]0x[1]0 00x[1]0 "), + cellx("p x[2;^C2;+0.01]000 0000 x[0.1]0x[1]0 00x[1]0 "), cellx("p 0000 x000 0000 x000 "), cellx("p x0x0 x0x0 x0x0 x0x0 "), cellx("p x000 0000 0000 0000 "), cellx("p x[^B2]x.00 x[^B2]x.x[^B2]x. x[^B2]x.x[^B2]x.x[^B2]x.0 "), - cellx("p x[^120]000 0000 00x[^124]0 00x[^116]0 "), // melody - cellx("p 0000 0000 0000 0000") + cellx("p 00x[^D3]0 000x[^A2] 00x[^A2]x[^A2] 0x[^A2]0x[^A2] "), ] -fill = cellx("p x000 x000 x0xx 00x0") -empty = cellx("p 0000 0000 0000 0000") +end = [ + cellx("p x[2;^C2;+0.01]000 0000 x[0.1]0x[1]0 00x[1]0 "), + cellx("p 0000 x000 0000 x000 "), + cellx("p x0x0 x0x0 x0x0 x0x0 "), +] +solo = [ + cellx("p 0000 0000 0000 0000"), + cellx("p 0000 0000 0000 0000"), + cellx("p 0000 0000 0000 0000"), +] +fin = solo; +endgame = [ + cellx("p x[2;^C2;+0.01]000 0000 x[0.1]0x[1]0 00x[1]0 "), + cellx("p 0000 x000 0000 x000 "), + cellx("p x0x0 x0x0 x0x0 x0x0 "), + cellx("p x000 0000 0000 0000 "), + cellx("p x[^B2]x.00 x[^B2]x.x[^B2]x. x[^B2]x.x[^B2]x.x[^B2]x.0 "), +] -function Sample(name, no, filter, volume) { - name = name - filter = filter || 20000 - volume = volume || 0 - //mem[name + "_filter"] = new Tone.Filter(filter, 'lowpass', -96); - mem[name + "_channel"] = new Tone.Channel({channelCount: 2, volume: volume}).chain(mem.master) - samples[no].connect(mem[name + "_channel"]); -} -function p(s, vol, note, len, delay) { - note = note || "C3" - len = len || "16n" - vol = vol || 1 - delay = delay || "+0"; - samples[s].triggerAttackRelease(note, len, delay, vol); -} -function once () { - var pr; - const s = ( p ) => { - pr = p; - var img; +empty = cellx("p 0000 0000 0000 0000") + + +function once () { + + + const setup = ( instance ) => { + var intro = [] + var main = [] + var bass = main + var solo = bass + var end = [] + var count = 0; + var old_scene = ""; + + - let x = 100; + let x = 100; let y = 100; - p.setup = function() { - var x = p.createCanvas(700, 410); + instance.setup = function() { + var x = instance.createCanvas(700, 410); x.canvas.style.position = "absolute"; - p.frameRate(2); - img = p.loadImage('/test3.png'); - console.log(img); + instance.frameRate(2); + intro.push(instance.loadImage('/closed/intro/1.png')); + intro.push(instance.loadImage('/closed/intro/2.png')); + main.push(instance.loadImage('/closed/main/1.png')); + main.push(instance.loadImage('/closed/main/2.png')); + main.push(instance.loadImage('/closed/main/3.png')); + end.push(instance.loadImage('/closed/end/1.png')); + end.push(instance.loadImage('/closed/end/2.png')); }; - p.draw = function() { - var e = getRandomInt(2); - p.clear(); - if (e == 0) { - // p.fill(123); - // p.rect(x,y,50,50); - } else { - p.image(img, 0, 0); + instance.draw = function() { + if (old_scene != current_scene) { + old_scene = current_scene; + count = 0; } + // instance.clear(); + var c = eval(`${current_scene}`) + // instance.image(c[count], 0, 0); + count += 1 + count = count % c.length; + }; }; - let myp5 = new p5(s, document.getElementById('canvas-container')); + let myp5 = new p5(setup, document.getElementById('canvas-container')); - render_loop = function () { -// pr.rect(x,y,50,50); - } Tone.Master.volume.value = -30 - mem.master = new Tone.Channel({channelCount: 2, volume: -10}).chain(Tone.Destination); + + dials[2]["cell"](1) + mem["master_filter"] = new Tone.Filter(10000, 'lowpass', -96); + mem["master_stereo"] = new Tone.StereoWidener({width: 0.50}); + + dials[2]["cell"].onChange(function (e) { + var val = parseFloat(e["data"].value); + var cutoff_guard = guard([10, 20000]); + mem["master_filter"].frequency.value = cutoff_guard(val * 10000); + }) + + dials[3]["cell"](0) + + dials[3]["cell"].onChange(function (e) { + var val = parseFloat(e["data"].value); + var volume_guard1 = guard([0,1]) + audio.master.in.gain.value = volume_guard1(val / 10); + }) + + + + mem.master = new Tone.Channel({channelCount: 2, volume: -10}).chain( mem["master_filter"], mem["master_stereo"], Tone.Destination); Sample("k", 0, null, -5); Sample("sn1",1, null, 0); - Sample("h",2, null, -15); + Sample("h",2, 5000, -35); Sample("m",3, null, -15); Sample("f",4, null, -15); - Sample("s",5, 900, -15); - - - mem["c"] = cellx(1); - mem["c"].onChange(function (e) { - var val = parseInt(e["data"].value); - - p(0,null, null, "24n"); - setTimeout(function () { - p(4, null, null, "4n") - }, delta * 2); - - }) - mem["c"].onError(function (e) { - console.log(e); - - }) + + name = "s" + filter = 2000 + volume = -15 + mem[name + "_filter"] = new Tone.Filter(filter, 'lowpass', -96); + mem[name + "_delay"] = new Tone.FeedbackDelay("4n", 0.4); + mem[name + "_channel"] = new Tone.Channel({channelCount: 2, volume: volume, pan: -0.25}).chain(mem[name + "_filter"], mem[name + "_delay"], mem.master) + samples[5].connect(mem[name + "_channel"]); + hit_map[name] = 5; + + + + + + + + Sample("manager",6, null, -15); + Sample("order",7, null, -15); + Sample("cr",8, null, -15); + Sample("piano",9, 400, -15); + Sample("sitar",10, 5000, -15); + const audio = Audio(); const three = ThreeOhUnit(audio, "sawtooth", { - "cutoff": 86, + "cutoff": 78, "resonance": 15, "envMod": 4000, "decay": 0.5 } ) - audio.master.in.gain.value = 0.1; + audio.master.in.gain.value = 0; mem["three"] = three // cutoff [30, 700], 400 @@ -124,7 +165,7 @@ function once () { // envMod: [0, 8000], 4000 // decay: [0.1, 0.9], 0.5 - dials[1]["cell"](0.0860) + dials[1]["cell"](0.07825) dials[1]["cell"].onChange(function (e) { var val = parseFloat(e["data"].value); @@ -133,25 +174,128 @@ function once () { }) } +function tweak() { + + var snare_count = cellx(16); + + + + snare_count.onChange(function (e) { + var val = parseInt(e["data"].value); + if (val == 22) { + current_scene = "fin"; + p1(8, null, null, 12.25); + } else { + p(1, null, null, "4n") + } + }) + + + + Mousetrap.bind(['f2'], function(e) { + + snare_count(snare_count() + 1) + if (snare_count() <= 20) { + setTimeout(function () { + p(0, null, null, "24n", null ); + setTimeout(function () { + p(8, null, null, "2n" ); + p(10, 0.5, "A2", 1); + }, delta * 2) + + }, delta * 1.5) + } + + return false; + }) + + + +} + transition = once; + if (bars <= 2) { current_scene = "intro"; } else { - current_scene = "main"; +// mem["three"].step("off"); +if (bars == 3) { + eval_guard ? cue("Start intro") : ""; + current_scene = "intro"; + +} + +if (bars == 5) { + eval_guard ? cue("Start drums") : ""; + current_scene = "main"; +} + + + + +if (bars == 12) { + eval_guard ? cue("Add bass"): ""; + current_scene = "bass"; + +} + +if (bars == 32) { + eval_guard ?cue("Reverse "): ""; + current_scene = "bass"; + +} + +if (bars == 42) { + eval_guard ? cue("End "): "" + current_scene = "end"; + +} + +if (bars == 46) { + eval_guard ? cue("Solo "): "" + current_scene = "solo"; +} + + + transition = tweak; } -current_scene = "bass"; patterns = eval(`${current_scene}`); always(); +if (track_no == 1) { +if (count == 0) { + cue("Sample") + // p1(8, null, null, 12.25); +} +} + + + if (isHit) { if (current_scene == "intro") { if (track_no == 1) { - p(3, null, null, "1n"); + p(3, null, null, "1n"); + } + } else if (current_scene == "fin") { + + } else if (current_scene == "solo") { + + + } else if (current_scene == "end") { + if (track_no == 1) { + p(0, meta[tick]["volume"], meta[tick]["pitch"], "24n", meta[tick]["delay"] ); } + if (track_no == 2) { + p(1); + } + if (track_no == 3) { + p(2) + } + } else if (current_scene == "main") { if (track_no == 1) { p(0, meta[tick]["volume"], meta[tick]["pitch"], "24n", meta[tick]["delay"] ); @@ -165,18 +309,26 @@ if (isHit) { if (track_no == 4) { p(3, null, null, "1n"); } - if (track_no == 5) { - p(5, 0.3, meta[tick]["pitch"], "1n"); + if (track_no == 5) { + if (meta[tick]["pitch"]) { + mem["three"].step({"glide": true, "accent": false, "note": meta[tick]["pitch"]}); + } else { + mem["three"].step("off"); + } + } + if (track_no == 6) { + p(5, null, meta[tick]["pitch"], "1n"); } - } else if (current_scene == "bass") { + + } else if (current_scene == "bass") { if (track_no == 1) { - p(0, meta[tick]["volume"], meta[tick]["pitch"], "24n", meta[tick]["delay"] ); + p(0, meta[tick]["volume"], meta[tick]["pitch"], "24n", meta[tick]["delay"] ); } if (track_no == 2) { p(1); } if (track_no == 3) { - p(2) + p(2) } if (track_no == 4) { p(3, null, null, "1n"); @@ -189,13 +341,13 @@ if (isHit) { } } if (track_no == 6) { - p(5, null, meta[tick]["pitch"], "1n"); - } - if (track_no == 7) { - mem["c"](mem["c"]() + 1); + // p(5, 0.15, meta[tick]["pitch"], 1); + // p(9, 1, meta[tick]["pitch"], 1); + } } + } diff --git a/tags b/tags deleted file mode 100644 index ee17c89..0000000 --- a/tags +++ /dev/null @@ -1,10 +0,0 @@ -!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/ -!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/ -!_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/ -!_TAG_PROGRAM_NAME Exuberant Ctags // -!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/ -!_TAG_PROGRAM_VERSION 5.8 // -p first.js /^function p(s, vol, note, len, delay) {$/;" f -p.draw first.js /^ p.draw = function() {$/;" f -p.setup first.js /^ p.setup = function() {$/;" f -render_loop first.js /^ render_loop = function () {$/;" f diff --git a/tags.lock b/tags.lock deleted file mode 100644 index 07cac4e..0000000 --- a/tags.lock +++ /dev/null @@ -1 +0,0 @@ -45658 diff --git a/tags.temp b/tags.temp deleted file mode 100644 index ee17c89..0000000 --- a/tags.temp +++ /dev/null @@ -1,10 +0,0 @@ -!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/ -!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/ -!_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/ -!_TAG_PROGRAM_NAME Exuberant Ctags // -!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/ -!_TAG_PROGRAM_VERSION 5.8 // -p first.js /^function p(s, vol, note, len, delay) {$/;" f -p.draw first.js /^ p.draw = function() {$/;" f -p.setup first.js /^ p.setup = function() {$/;" f -render_loop first.js /^ render_loop = function () {$/;" f commit f4a04eacf7ed677f6b60fb0ea944229a016f4b61 Author: Xyzzy Apps <xyzzyapps@gmail.com> Date: Tue Nov 2 22:09:26 2021 +0000 /Users/dev/proj/production/bitrhythm/song modified diff --git a/first.js b/first.js index 5b2422c..3870156 100644 --- a/first.js +++ b/first.js @@ -2,7 +2,7 @@ volume_guard1 = guard([-20,15]) Tone.Master.volume.value = volume_guard1(Math.round(dials[0]["cell"]() * 30) -20); intro = [ - cellx("p x000 0000 0000 0000 "), + cellx("p x000 0000 0000 0000 "), ] main = [ @@ -10,7 +10,7 @@ main = [ cellx("p 0000 x000 0000 x000 "), cellx("p x0x0 x0x0 x0x0 x0x0 "), cellx("p x000 0000 0000 0000 "), - cellx("p 0000 0000 x0x0 00x0 "), // melody + cellx("p x[^120]000 0000 00x[^124]0 00x[^116]0 "), // melody ] @@ -19,9 +19,9 @@ bass = [ cellx("p 0000 x000 0000 x000 "), cellx("p x0x0 x0x0 x0x0 x0x0 "), cellx("p x000 0000 0000 0000 "), - cellx("p x[^C2]000 000x. 00x[^B1]x. x[^B1]x.x[^B1]x. "), - cellx("p 0000 0000 x0x0 00x0 "), // melody - cellx("p 0000 0000 0000 0000") + cellx("p x[^B2]x.00 x[^B2]x.x[^B2]x. x[^B2]x.x[^B2]x.x[^B2]x.0 "), + cellx("p x[^120]000 0000 00x[^124]0 00x[^116]0 "), // melody + cellx("p 0000 0000 0000 0000") ] fill = cellx("p x000 x000 x0xx 00x0") @@ -62,6 +62,7 @@ function once () { x.canvas.style.position = "absolute"; p.frameRate(2); img = p.loadImage('/test3.png'); + console.log(img); }; p.draw = function() { @@ -79,7 +80,7 @@ function once () { let myp5 = new p5(s, document.getElementById('canvas-container')); render_loop = function () { - // pr.rect(x,y,50,50); +// pr.rect(x,y,50,50); } Tone.Master.volume.value = -30 @@ -89,40 +90,41 @@ function once () { Sample("h",2, null, -15); Sample("m",3, null, -15); Sample("f",4, null, -15); - Sample("s",5, null, -15); + Sample("s",5, 900, -15); mem["c"] = cellx(1); mem["c"].onChange(function (e) { var val = parseInt(e["data"].value); - + p(0,null, null, "24n"); setTimeout(function () { - p(4, null, null, "4n") + p(4, null, null, "4n") }, delta * 2); - + }) mem["c"].onError(function (e) { console.log(e); + }) const audio = Audio(); const three = ThreeOhUnit(audio, "sawtooth", { - "cutoff": 100, - "resonance": 15, - "envMod": 4000, - "decay": 0.5 - } - ) - audio.master.in.gain.value = 0.2; + "cutoff": 86, + "resonance": 15, + "envMod": 4000, + "decay": 0.5 + } + ) + audio.master.in.gain.value = 0.1; mem["three"] = three - + // cutoff [30, 700], 400 // resonance: [1, 30], 15 // envMod: [0, 8000], 4000 // decay: [0.1, 0.9], 0.5 - - dials[1]["cell"](0.0100) + + dials[1]["cell"](0.0860) dials[1]["cell"].onChange(function (e) { var val = parseFloat(e["data"].value); @@ -134,7 +136,14 @@ function once () { transition = once; +if (bars <= 2) { + current_scene = "intro"; +} else { + current_scene = "main"; +} + current_scene = "bass"; + patterns = eval(`${current_scene}`); always(); @@ -156,8 +165,8 @@ if (isHit) { if (track_no == 4) { p(3, null, null, "1n"); } - if (track_no == 5) { - p(5, null, null, "1n"); + if (track_no == 5) { + p(5, 0.3, meta[tick]["pitch"], "1n"); } } else if (current_scene == "bass") { if (track_no == 1) { @@ -180,12 +189,13 @@ if (isHit) { } } if (track_no == 6) { - p(5, null, null, "1n"); + p(5, null, meta[tick]["pitch"], "1n"); } if (track_no == 7) { mem["c"](mem["c"]() + 1); } } + } diff --git a/tags.lock b/tags.lock new file mode 100644 index 0000000..07cac4e --- /dev/null +++ b/tags.lock @@ -0,0 +1 @@ +45658 diff --git a/tags.temp b/tags.temp new file mode 100644 index 0000000..ee17c89 --- /dev/null +++ b/tags.temp @@ -0,0 +1,10 @@ +!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/ +!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/ +!_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/ +!_TAG_PROGRAM_NAME Exuberant Ctags // +!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/ +!_TAG_PROGRAM_VERSION 5.8 // +p first.js /^function p(s, vol, note, len, delay) {$/;" f +p.draw first.js /^ p.draw = function() {$/;" f +p.setup first.js /^ p.setup = function() {$/;" f +render_loop first.js /^ render_loop = function () {$/;" f commit deab9f4632ff94263e99b72cc7c817108cfb13d7 Author: Xyzzy Apps <xyzzyapps@gmail.com> Date: Mon Nov 1 20:08:11 2021 +0000 /Users/dev/proj/production/bitrhythm/song modified diff --git a/tags b/tags new file mode 100644 index 0000000..ee17c89 --- /dev/null +++ b/tags @@ -0,0 +1,10 @@ +!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/ +!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/ +!_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/ +!_TAG_PROGRAM_NAME Exuberant Ctags // +!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/ +!_TAG_PROGRAM_VERSION 5.8 // +p first.js /^function p(s, vol, note, len, delay) {$/;" f +p.draw first.js /^ p.draw = function() {$/;" f +p.setup first.js /^ p.setup = function() {$/;" f +render_loop first.js /^ render_loop = function () {$/;" f diff --git a/tags.lock b/tags.lock deleted file mode 100644 index e60e4c8..0000000 --- a/tags.lock +++ /dev/null @@ -1 +0,0 @@ -31247 commit 3f2b149bde471bf71edf8ca73350ca57d1f026aa Author: Xyzzy Apps <xyzzyapps@gmail.com> Date: Mon Nov 1 20:08:11 2021 +0000 /Users/dev/proj/production/bitrhythm/song/tags.lock created diff --git a/tags.lock b/tags.lock new file mode 100644 index 0000000..e60e4c8 --- /dev/null +++ b/tags.lock @@ -0,0 +1 @@ +31247 commit ecffe57b68d1b37f6689332bd7f4ea7739c3f9ad Author: Xyzzy Apps <xyzzyapps@gmail.com> Date: Mon Nov 1 07:39:32 2021 +0000 /Users/dev/proj/production/bitrhythm/song modified diff --git a/first.js b/first.js index 13b23b8..5b2422c 100644 --- a/first.js +++ b/first.js @@ -2,7 +2,7 @@ volume_guard1 = guard([-20,15]) Tone.Master.volume.value = volume_guard1(Math.round(dials[0]["cell"]() * 30) -20); intro = [ - cellx("p x000 0000 0000 0000 "), + cellx("p x000 0000 0000 0000 "), ] main = [ @@ -21,7 +21,7 @@ bass = [ cellx("p x000 0000 0000 0000 "), cellx("p x[^C2]000 000x. 00x[^B1]x. x[^B1]x.x[^B1]x. "), cellx("p 0000 0000 x0x0 00x0 "), // melody - cellx("p 0000 0000 0000 0000") + cellx("p 0000 0000 0000 0000") ] fill = cellx("p x000 x000 x0xx 00x0") @@ -62,7 +62,6 @@ function once () { x.canvas.style.position = "absolute"; p.frameRate(2); img = p.loadImage('/test3.png'); - console.log(img); }; p.draw = function() { @@ -80,7 +79,7 @@ function once () { let myp5 = new p5(s, document.getElementById('canvas-container')); render_loop = function () { -// pr.rect(x,y,50,50); + // pr.rect(x,y,50,50); } Tone.Master.volume.value = -30 @@ -96,34 +95,33 @@ function once () { mem["c"] = cellx(1); mem["c"].onChange(function (e) { var val = parseInt(e["data"].value); - + p(0,null, null, "24n"); setTimeout(function () { - p(4, null, null, "4n") + p(4, null, null, "4n") }, delta * 2); - + }) mem["c"].onError(function (e) { console.log(e); - }) const audio = Audio(); const three = ThreeOhUnit(audio, "sawtooth", { - "cutoff": 100, - "resonance": 15, - "envMod": 4000, - "decay": 0.5 - } - ) + "cutoff": 100, + "resonance": 15, + "envMod": 4000, + "decay": 0.5 + } + ) audio.master.in.gain.value = 0.2; mem["three"] = three - + // cutoff [30, 700], 400 // resonance: [1, 30], 15 // envMod: [0, 8000], 4000 // decay: [0.1, 0.9], 0.5 - + dials[1]["cell"](0.0100) dials[1]["cell"].onChange(function (e) { @@ -158,7 +156,7 @@ if (isHit) { if (track_no == 4) { p(3, null, null, "1n"); } - if (track_no == 5) { + if (track_no == 5) { p(5, null, null, "1n"); } } else if (current_scene == "bass") { @@ -182,13 +180,12 @@ if (isHit) { } } if (track_no == 6) { - p(5, null, null, "1n"); + p(5, null, null, "1n"); } if (track_no == 7) { mem["c"](mem["c"]() + 1); } } - } commit dc1695bed8f2b6bfc586b97b0103ab3accbf4ab5 Author: Xyzzy Apps <xyzzyapps@gmail.com> Date: Mon Nov 1 07:39:01 2021 +0000 /Users/dev/proj/production/bitrhythm/song modified diff --git a/first.js b/first.js index 3d8e9fb..13b23b8 100644 --- a/first.js +++ b/first.js @@ -10,6 +10,8 @@ main = [ cellx("p 0000 x000 0000 x000 "), cellx("p x0x0 x0x0 x0x0 x0x0 "), cellx("p x000 0000 0000 0000 "), + cellx("p 0000 0000 x0x0 00x0 "), // melody + ] bass = [ @@ -17,11 +19,17 @@ bass = [ cellx("p 0000 x000 0000 x000 "), cellx("p x0x0 x0x0 x0x0 x0x0 "), cellx("p x000 0000 0000 0000 "), - cellx("p x[^C3]000 x.000 0000 0000 "), + cellx("p x[^C2]000 000x. 00x[^B1]x. x[^B1]x.x[^B1]x. "), cellx("p 0000 0000 x0x0 00x0 "), // melody - cellx("p 0000 0000 0000 0000 "), // fill + cellx("p 0000 0000 0000 0000") ] +fill = cellx("p x000 x000 x0xx 00x0") +empty = cellx("p 0000 0000 0000 0000") + + + + function Sample(name, no, filter, volume) { name = name filter = filter || 20000 @@ -52,8 +60,8 @@ function once () { p.setup = function() { var x = p.createCanvas(700, 410); x.canvas.style.position = "absolute"; - p.frameRate(30); - img = p.loadImage('/test.png'); + p.frameRate(2); + img = p.loadImage('/test3.png'); console.log(img); }; @@ -88,9 +96,12 @@ function once () { mem["c"] = cellx(1); mem["c"].onChange(function (e) { var val = parseInt(e["data"].value); - console.log(val); - p(4, null, null, "8n"); - + + p(0,null, null, "24n"); + setTimeout(function () { + p(4, null, null, "4n") + }, delta * 2); + }) mem["c"].onError(function (e) { console.log(e); @@ -98,13 +109,34 @@ function once () { }) const audio = Audio(); - const three = ThreeOhUnit(audio, "sawtooth") - // audio.master.in.gain.value = 0.5; + const three = ThreeOhUnit(audio, "sawtooth", { + "cutoff": 100, + "resonance": 15, + "envMod": 4000, + "decay": 0.5 + } + ) + audio.master.in.gain.value = 0.2; mem["three"] = three + + // cutoff [30, 700], 400 + // resonance: [1, 30], 15 + // envMod: [0, 8000], 4000 + // decay: [0.1, 0.9], 0.5 + + dials[1]["cell"](0.0100) + + dials[1]["cell"].onChange(function (e) { + var val = parseFloat(e["data"].value); + cutoff_guard = guard([30, 700]); + three.params.cutoff.value = cutoff_guard(val * 1000); + }) } + + transition = once; -current_scene = "main"; +current_scene = "bass"; patterns = eval(`${current_scene}`); always(); @@ -126,6 +158,9 @@ if (isHit) { if (track_no == 4) { p(3, null, null, "1n"); } + if (track_no == 5) { + p(5, null, null, "1n"); + } } else if (current_scene == "bass") { if (track_no == 1) { p(0, meta[tick]["volume"], meta[tick]["pitch"], "24n", meta[tick]["delay"] ); @@ -147,11 +182,13 @@ if (isHit) { } } if (track_no == 6) { - p(5, null, null, "1n"); + p(5, null, null, "1n"); } if (track_no == 7) { mem["c"](mem["c"]() + 1); } - } + } + } + commit 31722d2b46cd3039d1b45296e1b8bae28f834d4c Author: Xyzzy Apps <xyzzyapps@gmail.com> Date: Mon Nov 1 05:35:10 2021 +0000 /Users/dev/proj/production/bitrhythm/song modified diff --git a/first.js b/first.js index ffaa242..3d8e9fb 100644 --- a/first.js +++ b/first.js @@ -1,21 +1,26 @@ volume_guard1 = guard([-20,15]) -volume_guard2 = guard([-20,15]) Tone.Master.volume.value = volume_guard1(Math.round(dials[0]["cell"]() * 30) -20); -scene1 = [ +intro = [ + cellx("p x000 0000 0000 0000 "), +] + +main = [ cellx("p x[2;^C2;+0.01]000 0000 x[0.1]0x[1]0 00x[1]0 "), cellx("p 0000 x000 0000 x000 "), cellx("p x0x0 x0x0 x0x0 x0x0 "), cellx("p x000 0000 0000 0000 "), - cellx("p x[^C3]000 x.000 0000 0000 "), - cellx("p 0000 0000 x0x0 00x0 "), - cellx("p 0000 0000 0000 0000 "), - ] -patterns = scene1 - -always(); +bass = [ + cellx("p x[2;^C2;+0.01]000 0000 x[0.1]0x[1]0 00x[1]0 "), + cellx("p 0000 x000 0000 x000 "), + cellx("p x0x0 x0x0 x0x0 x0x0 "), + cellx("p x000 0000 0000 0000 "), + cellx("p x[^C3]000 x.000 0000 0000 "), + cellx("p 0000 0000 x0x0 00x0 "), // melody + cellx("p 0000 0000 0000 0000 "), // fill +] function Sample(name, no, filter, volume) { name = name @@ -67,7 +72,7 @@ function once () { let myp5 = new p5(s, document.getElementById('canvas-container')); render_loop = function () { - pr.rect(x,y,50,50); +// pr.rect(x,y,50,50); } Tone.Master.volume.value = -30 @@ -99,33 +104,54 @@ function once () { } transition = once; +current_scene = "main"; +patterns = eval(`${current_scene}`); +always(); if (isHit) { - if (track_no == 1) { - p(0, meta[tick]["volume"], meta[tick]["pitch"], "24n", meta[tick]["delay"] ); - } - if (track_no == 2) { - p(1); - } - if (track_no == 3) { - p(2) - } - if (track_no == 4) { - p(3, null, null, "1n"); - } - if (track_no == 5) { - console.log(meta[tick]) - if (meta[tick]["pitch"]) { - mem["three"].step({"glide": true, "accent": false, "note": meta[tick]["pitch"]}); - } else { - mem["three"].step("off"); + if (current_scene == "intro") { + if (track_no == 1) { + p(3, null, null, "1n"); + } + } else if (current_scene == "main") { + if (track_no == 1) { + p(0, meta[tick]["volume"], meta[tick]["pitch"], "24n", meta[tick]["delay"] ); + } + if (track_no == 2) { + p(1); + } + if (track_no == 3) { + p(2) + } + if (track_no == 4) { + p(3, null, null, "1n"); + } + } else if (current_scene == "bass") { + if (track_no == 1) { + p(0, meta[tick]["volume"], meta[tick]["pitch"], "24n", meta[tick]["delay"] ); + } + if (track_no == 2) { + p(1); + } + if (track_no == 3) { + p(2) + } + if (track_no == 4) { + p(3, null, null, "1n"); + } + if (track_no == 5) { + if (meta[tick]["pitch"]) { + mem["three"].step({"glide": true, "accent": false, "note": meta[tick]["pitch"]}); + } else { + mem["three"].step("off"); + } + } + if (track_no == 6) { + p(5, null, null, "1n"); + } + if (track_no == 7) { + mem["c"](mem["c"]() + 1); } - } - if (track_no == 6) { - p(5, null, null, "1n"); - } - if (track_no == 7) { - mem["c"](mem["c"]() + 1); } } commit 43816649e494483a39e0e6386f89a5b90e092270 Author: Xyzzy Apps <xyzzyapps@gmail.com> Date: Mon Nov 1 04:47:55 2021 +0000 /Users/dev/proj/production/bitrhythm/song modified diff --git a/first.js b/first.js index 83f48f1..ffaa242 100644 --- a/first.js +++ b/first.js @@ -35,6 +35,41 @@ function p(s, vol, note, len, delay) { } function once () { + + var pr; + const s = ( p ) => { + pr = p; + var img; + + let x = 100; + let y = 100; + + p.setup = function() { + var x = p.createCanvas(700, 410); + x.canvas.style.position = "absolute"; + p.frameRate(30); + img = p.loadImage('/test.png'); + console.log(img); + }; + + p.draw = function() { + var e = getRandomInt(2); + p.clear(); + if (e == 0) { + // p.fill(123); + // p.rect(x,y,50,50); + } else { + p.image(img, 0, 0); + } + }; + }; + + let myp5 = new p5(s, document.getElementById('canvas-container')); + + render_loop = function () { + pr.rect(x,y,50,50); + } + Tone.Master.volume.value = -30 mem.master = new Tone.Channel({channelCount: 2, volume: -10}).chain(Tone.Destination); Sample("k", 0, null, -5); commit c249b60dba4e507a880cfb68c29a324cad273b39 Author: Xyzzy Apps <xyzzyapps@gmail.com> Date: Mon Nov 1 03:01:06 2021 +0000 /Users/dev/proj/production/bitrhythm/song modified diff --git a/first.js b/first.js index 1864ae7..83f48f1 100644 --- a/first.js +++ b/first.js @@ -26,7 +26,6 @@ function Sample(name, no, filter, volume) { samples[no].connect(mem[name + "_channel"]); } - function p(s, vol, note, len, delay) { note = note || "C3" len = len || "16n" @@ -35,8 +34,6 @@ function p(s, vol, note, len, delay) { samples[s].triggerAttackRelease(note, len, delay, vol); } - - function once () { Tone.Master.volume.value = -30 mem.master = new Tone.Channel({channelCount: 2, volume: -10}).chain(Tone.Destination); @@ -64,19 +61,13 @@ function once () { const three = ThreeOhUnit(audio, "sawtooth") // audio.master.in.gain.value = 0.5; mem["three"] = three - - } - - transition = once; - if (isHit) { if (track_no == 1) { p(0, meta[tick]["volume"], meta[tick]["pitch"], "24n", meta[tick]["delay"] ); - } if (track_no == 2) { p(1); @@ -86,8 +77,7 @@ if (isHit) { } if (track_no == 4) { p(3, null, null, "1n"); - - } + } if (track_no == 5) { console.log(meta[tick]) if (meta[tick]["pitch"]) { @@ -95,24 +85,12 @@ if (isHit) { } else { mem["three"].step("off"); } - } - if (track_no == 6) { p(5, null, null, "1n"); - } - - if (track_no == 7) { mem["c"](mem["c"]() + 1); } - - } - - - - - commit 24347e5e277f32ebd37e6914b5508eb4f992d4d4 Author: Xyzzy Apps <xyzzyapps@gmail.com> Date: Mon Nov 1 02:56:59 2021 +0000 /Users/dev/proj/production/bitrhythm/song modified diff --git a/first.js b/first.js index 325b081..1864ae7 100644 --- a/first.js +++ b/first.js @@ -6,7 +6,7 @@ scene1 = [ cellx("p x[2;^C2;+0.01]000 0000 x[0.1]0x[1]0 00x[1]0 "), cellx("p 0000 x000 0000 x000 "), cellx("p x0x0 x0x0 x0x0 x0x0 "), - cellx("p x000 0000 0000 0000 "), + cellx("p x000 0000 0000 0000 "), cellx("p x[^C3]000 x.000 0000 0000 "), cellx("p 0000 0000 x0x0 00x0 "), cellx("p 0000 0000 0000 0000 "), @@ -43,28 +43,28 @@ function once () { Sample("k", 0, null, -5); Sample("sn1",1, null, 0); Sample("h",2, null, -15); - Sample("m",3, null, -15); + Sample("m",3, null, -15); Sample("f",4, null, -15); Sample("s",5, null, -15); - + mem["c"] = cellx(1); mem["c"].onChange(function (e) { - var val = parseInt(e["data"].value); + var val = parseInt(e["data"].value); console.log(val); - p(4, null, null, "8n"); - + p(4, null, null, "8n"); + }) mem["c"].onError(function (e) { - console.log(e); - + console.log(e); + }) - const audio = Audio(); - const three = ThreeOhUnit(audio, "sawtooth") - // audio.master.in.gain.value = 0.5; - mem["three"] = three - + const audio = Audio(); + const three = ThreeOhUnit(audio, "sawtooth") + // audio.master.in.gain.value = 0.5; + mem["three"] = three + } @@ -75,39 +75,39 @@ transition = once; if (isHit) { if (track_no == 1) { - p(0, meta[tick]["volume"], meta[tick]["pitch"], "24n", meta[tick]["delay"] ); - + p(0, meta[tick]["volume"], meta[tick]["pitch"], "24n", meta[tick]["delay"] ); + } if (track_no == 2) { - p(1); + p(1); } if (track_no == 3) { - p(2) - } - if (track_no == 4) { - p(3, null, null, "1n"); + p(2) + } + if (track_no == 4) { + p(3, null, null, "1n"); - } + } if (track_no == 5) { - console.log(meta[tick]) + console.log(meta[tick]) if (meta[tick]["pitch"]) { - mem["three"].step({"glide": true, "accent": false, "note": meta[tick]["pitch"]}); + mem["three"].step({"glide": true, "accent": false, "note": meta[tick]["pitch"]}); } else { - mem["three"].step("off"); + mem["three"].step("off"); } - + } - - if (track_no == 6) { - p(5, null, null, "1n"); + + if (track_no == 6) { + p(5, null, null, "1n"); } - if (track_no == 7) { - mem["c"](mem["c"]() + 1); + if (track_no == 7) { + mem["c"](mem["c"]() + 1); } - + } commit 418364bfcef224f37398c8bd3b7c61cb73c386f4 Author: Xyzzy Apps <xyzzyapps@gmail.com> Date: Mon Nov 1 02:55:34 2021 +0000 /Users/dev/proj/production/bitrhythm/song modified diff --git a/first.js b/first.js new file mode 100644 index 0000000..325b081 --- /dev/null +++ b/first.js @@ -0,0 +1,118 @@ +volume_guard1 = guard([-20,15]) +volume_guard2 = guard([-20,15]) +Tone.Master.volume.value = volume_guard1(Math.round(dials[0]["cell"]() * 30) -20); + +scene1 = [ + cellx("p x[2;^C2;+0.01]000 0000 x[0.1]0x[1]0 00x[1]0 "), + cellx("p 0000 x000 0000 x000 "), + cellx("p x0x0 x0x0 x0x0 x0x0 "), + cellx("p x000 0000 0000 0000 "), + cellx("p x[^C3]000 x.000 0000 0000 "), + cellx("p 0000 0000 x0x0 00x0 "), + cellx("p 0000 0000 0000 0000 "), + +] + +patterns = scene1 + +always(); + +function Sample(name, no, filter, volume) { + name = name + filter = filter || 20000 + volume = volume || 0 + //mem[name + "_filter"] = new Tone.Filter(filter, 'lowpass', -96); + mem[name + "_channel"] = new Tone.Channel({channelCount: 2, volume: volume}).chain(mem.master) + samples[no].connect(mem[name + "_channel"]); +} + + +function p(s, vol, note, len, delay) { + note = note || "C3" + len = len || "16n" + vol = vol || 1 + delay = delay || "+0"; + samples[s].triggerAttackRelease(note, len, delay, vol); +} + + + +function once () { + Tone.Master.volume.value = -30 + mem.master = new Tone.Channel({channelCount: 2, volume: -10}).chain(Tone.Destination); + Sample("k", 0, null, -5); + Sample("sn1",1, null, 0); + Sample("h",2, null, -15); + Sample("m",3, null, -15); + Sample("f",4, null, -15); + Sample("s",5, null, -15); + + + mem["c"] = cellx(1); + mem["c"].onChange(function (e) { + var val = parseInt(e["data"].value); + console.log(val); + p(4, null, null, "8n"); + + }) + mem["c"].onError(function (e) { + console.log(e); + + }) + + const audio = Audio(); + const three = ThreeOhUnit(audio, "sawtooth") + // audio.master.in.gain.value = 0.5; + mem["three"] = three + + +} + + + +transition = once; + + +if (isHit) { + if (track_no == 1) { + p(0, meta[tick]["volume"], meta[tick]["pitch"], "24n", meta[tick]["delay"] ); + + } + if (track_no == 2) { + p(1); + } + if (track_no == 3) { + p(2) + } + if (track_no == 4) { + p(3, null, null, "1n"); + + } + if (track_no == 5) { + console.log(meta[tick]) + if (meta[tick]["pitch"]) { + mem["three"].step({"glide": true, "accent": false, "note": meta[tick]["pitch"]}); + } else { + mem["three"].step("off"); + } + + } + + if (track_no == 6) { + p(5, null, null, "1n"); + + } + + + if (track_no == 7) { + mem["c"](mem["c"]() + 1); + } + + +} + + + + + + |
Added public/first.js.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 |
volume_guard1 = guard([-20,15]) Tone.Master.volume.value = volume_guard1(Math.round(dials[0]["cell"]() * 30) -20); intro = [ cellx("p x000 0000 0000 0000 "), ] main = [ cellx("p x[2;^C2;+0.01]000 0000 x[0.1]0x[1]0 00x[1]0 "), cellx("p 0000 x000 0000 x000 "), cellx("p x0x0 x0x0 x0x0 x0x0 "), cellx("p x000 0000 0000 0000 "), cellx("p 0000 0000 0000 0000"), cellx("p 0000 0000 0000 0000"), ] bass = [ cellx("p x[2;^C2;+0.01]000 0000 x[0.1]0x[1]0 00x[1]0 "), cellx("p 0000 x000 0000 x000 "), cellx("p x0x0 x0x0 x0x0 x0x0 "), cellx("p x000 0000 0000 0000 "), cellx("p x[^B2]x.00 x[^B2]x.x[^B2]x. x[^B2]x.x[^B2]x.x[^B2]x.0 "), cellx("p 00x[^D3]0 000x[^A2] 00x[^A2]x[^A2] 0x[^A2]0x[^A2] "), ] end = [ cellx("p x[2;^C2;+0.01]000 0000 x[0.1]0x[1]0 00x[1]0 "), cellx("p 0000 x000 0000 x000 "), cellx("p x0x0 x0x0 x0x0 x0x0 "), ] solo = [ cellx("p 0000 0000 0000 0000"), cellx("p 0000 0000 0000 0000"), cellx("p 0000 0000 0000 0000"), ] fin = solo; endgame = [ cellx("p x[2;^C2;+0.01]000 0000 x[0.1]0x[1]0 00x[1]0 "), cellx("p 0000 x000 0000 x000 "), cellx("p x0x0 x0x0 x0x0 x0x0 "), cellx("p x000 0000 0000 0000 "), cellx("p x[^B2]x.00 x[^B2]x.x[^B2]x. x[^B2]x.x[^B2]x.x[^B2]x.0 "), ] empty = cellx("p 0000 0000 0000 0000") function once () { const setup = ( instance ) => { var intro = [] var main = [] var bass = main var solo = bass var end = [] var count = 0; var old_scene = ""; let x = 100; let y = 100; instance.setup = function() { var x = instance.createCanvas(700, 410); x.canvas.style.position = "absolute"; instance.frameRate(2); intro.push(instance.loadImage('/closed/intro/1.png')); intro.push(instance.loadImage('/closed/intro/2.png')); main.push(instance.loadImage('/closed/main/1.png')); main.push(instance.loadImage('/closed/main/2.png')); main.push(instance.loadImage('/closed/main/3.png')); end.push(instance.loadImage('/closed/end/1.png')); end.push(instance.loadImage('/closed/end/2.png')); }; instance.draw = function() { if (old_scene != current_scene) { old_scene = current_scene; count = 0; } // instance.clear(); var c = eval(`${current_scene}`) // instance.image(c[count], 0, 0); count += 1 count = count % c.length; }; }; let myp5 = new p5(setup, document.getElementById('canvas-container')); Tone.Master.volume.value = -30 dials[2]["cell"](1) mem["master_filter"] = new Tone.Filter(10000, 'lowpass', -96); mem["master_stereo"] = new Tone.StereoWidener({width: 0.50}); dials[2]["cell"].onChange(function (e) { var val = parseFloat(e["data"].value); var cutoff_guard = guard([10, 20000]); mem["master_filter"].frequency.value = cutoff_guard(val * 10000); }) dials[3]["cell"](0) dials[3]["cell"].onChange(function (e) { var val = parseFloat(e["data"].value); var volume_guard1 = guard([0,1]) audio.master.in.gain.value = volume_guard1(val / 10); }) mem.master = new Tone.Channel({channelCount: 2, volume: -10}).chain( mem["master_filter"], mem["master_stereo"], Tone.Destination); Sample("k", 0, null, -5); Sample("sn1",1, null, 0); Sample("h",2, 5000, -35); Sample("m",3, null, -15); Sample("f",4, null, -15); name = "s" filter = 2000 volume = -15 mem[name + "_filter"] = new Tone.Filter(filter, 'lowpass', -96); mem[name + "_delay"] = new Tone.FeedbackDelay("4n", 0.4); mem[name + "_channel"] = new Tone.Channel({channelCount: 2, volume: volume, pan: -0.25}).chain(mem[name + "_filter"], mem[name + "_delay"], mem.master) samples[5].connect(mem[name + "_channel"]); hit_map[name] = 5; Sample("manager",6, null, -15); Sample("order",7, null, -15); Sample("cr",8, null, -15); Sample("piano",9, 400, -15); Sample("sitar",10, 5000, -15); const audio = Audio(); const three = ThreeOhUnit(audio, "sawtooth", { "cutoff": 78, "resonance": 15, "envMod": 4000, "decay": 0.5 } ) audio.master.in.gain.value = 0; mem["three"] = three // cutoff [30, 700], 400 // resonance: [1, 30], 15 // envMod: [0, 8000], 4000 // decay: [0.1, 0.9], 0.5 dials[1]["cell"](0.07825) dials[1]["cell"].onChange(function (e) { var val = parseFloat(e["data"].value); cutoff_guard = guard([30, 700]); three.params.cutoff.value = cutoff_guard(val * 1000); }) } function tweak() { var snare_count = cellx(16); snare_count.onChange(function (e) { var val = parseInt(e["data"].value); if (val == 22) { current_scene = "fin"; p1(8, null, null, 12.25); } else { p(1, null, null, "4n") } }) Mousetrap.bind(['f2'], function(e) { snare_count(snare_count() + 1) if (snare_count() <= 20) { setTimeout(function () { p(0, null, null, "24n", null ); setTimeout(function () { p(8, null, null, "2n" ); p(10, 0.5, "A2", 1); }, delta * 2) }, delta * 1.5) } return false; }) } transition = once; if (bars <= 2) { current_scene = "intro"; } else { // mem["three"].step("off"); if (bars == 3) { eval_guard ? cue("Start intro") : ""; current_scene = "intro"; } if (bars == 5) { eval_guard ? cue("Start drums") : ""; current_scene = "main"; } if (bars == 12) { eval_guard ? cue("Add bass"): ""; current_scene = "bass"; } if (bars == 32) { eval_guard ?cue("Reverse "): ""; current_scene = "bass"; } if (bars == 42) { eval_guard ? cue("End "): "" current_scene = "end"; } if (bars == 46) { eval_guard ? cue("Solo "): "" current_scene = "solo"; } transition = tweak; } patterns = eval(`${current_scene}`); always(); if (track_no == 1) { if (count == 0) { cue("Sample") // p1(8, null, null, 12.25); } } if (isHit) { if (current_scene == "intro") { if (track_no == 1) { p(3, null, null, "1n"); } } else if (current_scene == "fin") { } else if (current_scene == "solo") { } else if (current_scene == "end") { if (track_no == 1) { p(0, meta[tick]["volume"], meta[tick]["pitch"], "24n", meta[tick]["delay"] ); } if (track_no == 2) { p(1); } if (track_no == 3) { p(2) } } else if (current_scene == "main") { if (track_no == 1) { p(0, meta[tick]["volume"], meta[tick]["pitch"], "24n", meta[tick]["delay"] ); } if (track_no == 2) { p(1); } if (track_no == 3) { p(2) } if (track_no == 4) { p(3, null, null, "1n"); } if (track_no == 5) { if (meta[tick]["pitch"]) { mem["three"].step({"glide": true, "accent": false, "note": meta[tick]["pitch"]}); } else { mem["three"].step("off"); } } if (track_no == 6) { p(5, null, meta[tick]["pitch"], "1n"); } } else if (current_scene == "bass") { if (track_no == 1) { p(0, meta[tick]["volume"], meta[tick]["pitch"], "24n", meta[tick]["delay"] ); } if (track_no == 2) { p(1); } if (track_no == 3) { p(2) } if (track_no == 4) { p(3, null, null, "1n"); } if (track_no == 5) { if (meta[tick]["pitch"]) { mem["three"].step({"glide": true, "accent": false, "note": meta[tick]["pitch"]}); } else { mem["three"].step("off"); } } if (track_no == 6) { // p(5, 0.15, meta[tick]["pitch"], 1); // p(9, 1, meta[tick]["pitch"], 1); } } } |
Changes to public/misc.js.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 .. 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 ... 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 ... 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 |
can_container.width = window.innerWidth; var visualizer = window.butterchurn.default.createVisualizer(Tone.getContext().rawContext, can, { height: window.innerHeight - (document.getElementById("header-playback").clientHeight / 2), width: window.innerWidth, meshWidth: 24, meshHeight: 18, }); visualizer.connectAudio(Tone.getContext().destination); const presets = window.butterchurnPresets.getPresets(); const presetParam = presets[preset]; visualizer.loadPreset(presetParam, 0.0); // 2nd argument is the number of seconds to blend presets return visualizer; } function guard(range) { ................................................................................ letters = letters.replace('`3','d'); letters = letters.replace('`4','e'); letters = letters.replace('`5','f'); return letters; } function lettertodec(letter) { var bin = ""; if (letter.match(/\d/)) { no = parseInt(letter); } else if (letter == "a") { no = 10; } else if (letter == "b") { no = 11; } else if (letter == "c") { no = 12; } else if (letter == "d") { no = 13; } else if (letter == "e") { no = 14; } else if (letter == "f") { no = 15; } for (i = 1; i <= no; i++) { bin += "0"; } return bin; } function lettertobin(letter) { var bin = ""; if (letter == "0") { bin += "0000"; } if (letter == "1") { bin += "0001"; } else if (letter == "2") { bin += "0010"; } else if (letter == "3") { bin += "0011"; } else if (letter == "4") { bin += "0100"; } else if (letter == "5") { bin += "0101"; } else if (letter == "6") { bin += "0110"; } else if (letter == "7") { bin += "0111"; } else if (letter == "8") { bin += "1000"; } else if (letter == "9") { bin += "1001"; } else if (letter == "a") { bin += "1010"; } else if (letter == "b") { bin += "1011"; } else if (letter == "c") { bin += "1100"; } else if (letter == "d") { bin += "1101"; } else if (letter == "e") { bin += "1110"; } else if (letter == "f") { bin += "1111"; } return bin; } function hex2bin(hex) { var letters = romantogypsy(hex) letters = letters.split(''); var bin = ""; letters.map(function(letter) { ................................................................................ setTimeout(function () { $("#cued").html(""); }, seconds * 1000) } window.cue = cue; function Sample(name, no, filter, volume) { name = name filter = filter || 10000 volume = volume || 0 mem[name + "_filter"] = new Tone.Filter(filter, 'lowpass', -96); mem[name + "_channel"] = new Tone.Channel({channelCount: 2, volume: volume}).chain(mem[name + "_filter"], mem.master) samples[no].connect(mem[name + "_channel"]); hit_map[name] = no; } window.Sample = Sample; function p(s, vol, note, len, delay, pan=0) { note = note || "C3" len = len || "16n" vol = vol || 1 delay = delay || "+0"; for (const [key, value] of Object.entries(hit_map)) { if (value == s) { mem[key + "_last"] = count mem[key + "_channel"].pan.value = pan } } samples[s].triggerAttackRelease(note, len, delay, vol); } window.p = p; function p1(s, vol, note, len, delay, pan=0) { note = note || "C3" len = len || "16n" ................................................................................ context.count_skip = options.speed || 4; context.step = options.step || 0.01; context.reverse = options.reverse || true; context.number = options.number || null; context.current_count = 0; context.index = 0; context.val = window.cellx.cellx(options.initial || 0.5) function changeContext() { context.next_val = context.ramp[context.index + 1]; context.val(context.ramp[context.index]); if (context.val() > context.next_val) { context.direction = -1; |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > < < > > > > > | > |
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 .. 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 ... 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 ... 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 |
can_container.width = window.innerWidth; var visualizer = window.butterchurn.default.createVisualizer(Tone.getContext().rawContext, can, { height: window.innerHeight - (document.getElementById("header-playback").clientHeight / 2), width: window.innerWidth, meshWidth: 24, meshHeight: 18, }); visualizer.connectAudio(Tone.getContext().rawContext.destination); const presets = window.butterchurnPresets.getPresets(); const presetParam = presets[preset]; visualizer.loadPreset(presetParam, 0.0); // 2nd argument is the number of seconds to blend presets return visualizer; } function guard(range) { ................................................................................ letters = letters.replace('`3','d'); letters = letters.replace('`4','e'); letters = letters.replace('`5','f'); return letters; } function lettertodec(letter) { var bin = ""; if (letter.match(/\d/)) { no = parseInt(letter); } else if (letter == "a") { no = 10; } else if (letter == "b") { no = 11; } else if (letter == "c") { no = 12; } else if (letter == "d") { no = 13; } else if (letter == "e") { no = 14; } else if (letter == "f") { no = 15; } for (i = 1; i <= no; i++) { bin += "0"; } return bin; } function lettertobin(letter) { var bin = ""; if (letter == "0") { bin += "0000"; } if (letter == "1") { bin += "0001"; } else if (letter == "2") { bin += "0010"; } else if (letter == "3") { bin += "0011"; } else if (letter == "4") { bin += "0100"; } else if (letter == "5") { bin += "0101"; } else if (letter == "6") { bin += "0110"; } else if (letter == "7") { bin += "0111"; } else if (letter == "8") { bin += "1000"; } else if (letter == "9") { bin += "1001"; } else if (letter == "a") { bin += "1010"; } else if (letter == "b") { bin += "1011"; } else if (letter == "c") { bin += "1100"; } else if (letter == "d") { bin += "1101"; } else if (letter == "e") { bin += "1110"; } else if (letter == "f") { bin += "1111"; } return bin; } function hex2bin(hex) { var letters = romantogypsy(hex) letters = letters.split(''); var bin = ""; letters.map(function(letter) { ................................................................................ setTimeout(function () { $("#cued").html(""); }, seconds * 1000) } window.cue = cue; async function loadSamplesToWorklet(urls) { var context = Tone.getContext(); window.context = context; await context.addAudioWorkletModule('/sampler.js', 'sampler'); var sampler = await context.createAudioWorkletNode('sampler', { outputChannelCount: [2], // stereo }); window.sampler = sampler; var files = [] for (var i = 0; i < urls.length; i++) { var url = urls[i] const source = context.createBufferSource(); const audioBuffer = await fetch(url) .then(res => res.arrayBuffer()) .then(ArrayBuffer => context.decodeAudioData(ArrayBuffer)); const pcmLeft = audioBuffer.getChannelData(0) const pcmRight = audioBuffer.getChannelData(1) files.push({ pcmLeft, pcmRight }) } sampler.port.postMessage({ init: files }) context.rawContext.resume(); sampler.connect(Tone.getContext().rawContext.destination); } function Sample(name, no, filter, volume) { name = name filter = filter || 10000 volume = volume || 0 mem[name + "_filter"] = new Tone.Filter(filter, 'lowpass', -96); mem[name + "_channel"] = new Tone.Channel({channelCount: 2, volume: volume}).chain(mem[name + "_filter"], mem.master) samples[no].connect(mem[name + "_channel"]); hit_map[name] = no; } window.Sample = Sample; function pw(s, vol, note, len, delay, pan=0) { window.sampler.port.postMessage({ noteOn: true, sample: s, volume: vol}); } window.pw = pw; function p(s, vol, note, len, delay, pan=0) { note = note || "C3" len = len || "16n" vol = vol || 1 delay = delay || "+0"; for (const [key, value] of Object.entries(hit_map)) { if (value == s) { mem[key + "_last"] = count mem[key + "_channel"].pan.value = pan } } samples[s].triggerAttackRelease(note, len, delay, vol); } window.p = p; function p1(s, vol, note, len, delay, pan=0) { note = note || "C3" len = len || "16n" ................................................................................ context.count_skip = options.speed || 4; context.step = options.step || 0.01; context.reverse = options.reverse || true; context.number = options.number || null; context.current_count = 0; context.index = 0; // Smooth transition from previous knob values if (context.number) { context.val = window.cellx.cellx(context.number()) } else { context.val = window.cellx.cellx(options.initial || 0.5) } function changeContext() { context.next_val = context.ramp[context.index + 1]; context.val(context.ramp[context.index]); if (context.val() > context.next_val) { context.direction = -1; |
Added public/sampler.js.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
class Sampler extends AudioWorkletProcessor { files = [] readIdx = {} loopStartIdx = [] constructor(options) { super() this.port.onmessage = ({ data }) => { if (data.init) { this.files = data.init this.loopStartIdx = this.files.map(function (f) { return 0 }) } else if (data.noteOn) { this.readIdx[data.sample] = this.loopStartIdx[data.sample] } else if (data.noteOff) { delete this.readIdx[data.sample]; } }; } process(inputs, outputs) { var outLeft = outputs[0][0] var outRight = outputs[0][1] Object.keys(this.readIdx).map((sample) => { for (let i=0; i < outLeft.length; i++, this.readIdx[sample]++) { if (this.readIdx[sample] < this.files[sample].pcmLeft.length) { outLeft[i] += this.files[sample].pcmLeft[this.readIdx[sample]] outRight[i] += this.files[sample].pcmRight[this.readIdx[sample]] } } }) return true } } registerProcessor('sampler', Sampler) |
Changes to source/bookmarks.md.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 .. 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 .. 80 81 82 83 84 85 86 87 88 89 90 91 92 93 .. 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
<https://github.com/ideoforms/isobar> <https://github.com/tmhglnd/mercury/blob/master/docs/reference.md> <https://github.com/thedjinn/js303> <https://www.sitepoint.com/creating-accurate-timers-in-javascript/> <https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Advanced_techniques> <https://webaudiodemos.appspot.com/> <https://www.html5rocks.com/en/tutorials/audio/scheduling/> ## Obsevers <https://github.com/rsimmons/plinth> <https://github.com/gullerya/object-observer> <https://awesomeopensource.com/project/nx-js/observer-util> <https://doc.esdoc.org/github.com/jstoolkit/dom-observer/> ................................................................................ <https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Visualizations_with_Web_Audio_API> <https://www.airtightinteractive.com/2013/10/making-audio-reactive-visuals/> <https://1mb.club/> ## Misc <https://gist.github.com/sroccaserra/5bacbdb3e000a54dbae0972c346021d4> <https://teropa.info/blog/2016/08/10/frequency-and-pitch.html> <http://www.pawfal.org/fluxus/documentation/> <https://music.tutsplus.com/tutorials/how-to-create-acid-synth-sequences--audio-3000> <https://acidvoice.com/tb_303_famous_patterns.php> <https://www.adsrsounds.com/ni-massive-tutorials/dub-techno-synth-stab-tutorial/> <https://medias.ircam.fr/x9d4352> <https://vuejsexamples.com/a-drum-synthesizer-sequencer-built-with-tone-js-and-vue-js/js> ................................................................................ <https://github.com/kevincennis/TinyMusic> <https://github.com/pixicoder/PS> <https://github.com/swallez/livecoding-webaudio-tonejs> <https://padenot.github.io/litsynth/> ## Inspiration <https://github.com/AuburnSounds/Dplug/wiki/Dplug-VST2-Guide> <https://github.com/tmhglnd/mercury> <https://www.mazbox.com/synths/dubstep/#> <https://cdm.link/2019/04/automated-techno-eternal-flow/> <https://survios.com/electronauts/> <https://liv3c0der.com/> <http://wavepot.com/> ................................................................................ <https://foxdot.org/docs/pattern-functions/> <https://faustdoc.grame.fr/> <https://www.fsynth.com/> <https://errozero.co.uk/acid-machine/> <https://the.wubmachine.com/> <https://scribbletune.com/documentation/browser/browser-clip> <https://djen.co/> ## Music <http://www.p01.org/256b_woman_farmer/> <https://aem1k.com/> <https://ludotune.com/> <https://www.mazbox.com/synths/dubstep/> ## Algorithmic Music <https://cmsw.mit.edu/algorithmic-music-experience-composing-wolframtones/> <https://ccrma.stanford.edu/~blackrse/algorithm.html> <https://oeis.org/> <https://www.cs.cmu.edu/~music/cmsip/readings/MIDI%20tutorial%20for%20programmers.html> <https://en.wikipedia.org/wiki/Computational_creativity> <https://en.wikipedia.org/wiki/Algorithmic_composition> <https://en.wikipedia.org/wiki/Constraint_programming> <https://www.bipscript.org/> <http://commonmusic.sourceforge.net/cm/res/doc/cm.html> <https://bolprocessor.sourceforge.io/docs/> <https://en.wikipedia.org/wiki/Music_Macro_Language> <https://github.com/IjzerenHein/kiwi.js/> |
> > > > > > > > > > > > > > > > > | > > > > > > > > > > > > > > > > > > > > > > > > > |
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 .. 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 .. 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 ... 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 |
<https://github.com/ideoforms/isobar> <https://github.com/tmhglnd/mercury/blob/master/docs/reference.md> <https://github.com/thedjinn/js303> <https://www.sitepoint.com/creating-accurate-timers-in-javascript/> <https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Advanced_techniques> <https://webaudiodemos.appspot.com/> <https://www.html5rocks.com/en/tutorials/audio/scheduling/> <https://github.com/jshanley/blip> <https://github.com/alemangui/pizzicato> ## Audio Worklets and Wasm <https://sol.gfxile.net/soloud/> <https://github.com/micknoise/Maximilian> <https://mod.haxor.fi/Uncle_Tom/mod.occ-san-geen> <https://github.com/divideconcept/FluidLite> <https://github.com/mmontag/chip-player-js> <https://github.com/cutterbl/SoundTouchJS> <https://github.com/AnthumChris/opus-bitrates> <https://github.com/warpdesign/modplayer-js/> <https://github.com/fspa/AudioWorkletPolySynth> <https://www.youtube.com/watch?v=x9RP-M6q2Mg> <https://www.youtube.com/watch?v=zgOGZgAPUjQ> <https://soundprogramming.net/programming/tutorial-using-sdl2-and-sdl_mixer-to-play-samples/> ## Obsevers <https://github.com/rsimmons/plinth> <https://github.com/gullerya/object-observer> <https://awesomeopensource.com/project/nx-js/observer-util> <https://doc.esdoc.org/github.com/jstoolkit/dom-observer/> ................................................................................ <https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Visualizations_with_Web_Audio_API> <https://www.airtightinteractive.com/2013/10/making-audio-reactive-visuals/> <https://1mb.club/> ## Misc <https://gist.github.com/sroccaserra/5bacbdb3e000a54dbae0972c346021d4> <https://awesomeopensource.com/project/syncopika/piano_roll_browser> <https://teropa.info/blog/2016/08/10/frequency-and-pitch.html> <http://www.pawfal.org/fluxus/documentation/> <https://music.tutsplus.com/tutorials/how-to-create-acid-synth-sequences--audio-3000> <https://acidvoice.com/tb_303_famous_patterns.php> <https://www.adsrsounds.com/ni-massive-tutorials/dub-techno-synth-stab-tutorial/> <https://medias.ircam.fr/x9d4352> <https://vuejsexamples.com/a-drum-synthesizer-sequencer-built-with-tone-js-and-vue-js/js> ................................................................................ <https://github.com/kevincennis/TinyMusic> <https://github.com/pixicoder/PS> <https://github.com/swallez/livecoding-webaudio-tonejs> <https://padenot.github.io/litsynth/> ## Inspiration <https://www.bbc.co.uk/bitesize/guides/z4k9dxs/revision/2> <https://github.com/AuburnSounds/Dplug/wiki/Dplug-VST2-Guide> <https://github.com/tmhglnd/mercury> <https://www.mazbox.com/synths/dubstep/#> <https://cdm.link/2019/04/automated-techno-eternal-flow/> <https://survios.com/electronauts/> <https://liv3c0der.com/> <http://wavepot.com/> ................................................................................ <https://foxdot.org/docs/pattern-functions/> <https://faustdoc.grame.fr/> <https://www.fsynth.com/> <https://errozero.co.uk/acid-machine/> <https://the.wubmachine.com/> <https://scribbletune.com/documentation/browser/browser-clip> <https://djen.co/> <<https://burial.glitch.me/>> ## Music <http://www.p01.org/256b_woman_farmer/> <https://aem1k.com/> <https://ludotune.com/> <https://www.mazbox.com/synths/dubstep/> ## Algorithmic Music <https://teropa.info/> <https://cmsw.mit.edu/algorithmic-music-experience-composing-wolframtones/> <https://ccrma.stanford.edu/~blackrse/algorithm.html> <https://oeis.org/> <https://www.cs.cmu.edu/~music/cmsip/readings/MIDI%20tutorial%20for%20programmers.html> <https://en.wikipedia.org/wiki/Computational_creativity> <https://en.wikipedia.org/wiki/Algorithmic_composition> <https://en.wikipedia.org/wiki/Constraint_programming> <https://www.bipscript.org/> <http://commonmusic.sourceforge.net/cm/res/doc/cm.html> <https://bolprocessor.sourceforge.io/docs/> <https://en.wikipedia.org/wiki/Music_Macro_Language> <https://github.com/IjzerenHein/kiwi.js/> <https://github.com/miguelramos/node-media-manager> <https://github.com/lnfiniteMonkeys/TimeLines> ## Sound Design <https://www.attackmagazine.com/technique/synth-secrets/dub-techno-synth-chords/> ## Clocks <https://github.com/eriser/clock> <https://github.com/filebrowser/filebrowser> <https://github.com/lachlandk/chronos/blob/master/chronos.js> <https://github.com/CharlotteGore/tick> <https://github.com/pelevesque/web-audio-scheduler/blob/master/index.html> <https://github.com/CharlotteGore/beat-master> <https://www.npmjs.com/package/beat-scheduler> <https://www.npmjs.com/package/beet.js> <https://www.npmjs.com/package/step-seq> <https://github.com/mmckegg/bopper/blob/master/index.js> <https://github.com/jshanley/blip/blob/master/src/loop.js> <https://sebpiq.github.io/WAAClock/demos/beatSequence.html> <http://adamrenklint.com/using-expressions-in-dilla> |
Changes to source/changelog.md.
41 42 43 44 45 46 47 48 49 50 |
Autocommit Keyboard Bindings Reverting to setInterval Added code for p5 Update the docs ``` |
> > > > > |
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
Autocommit Keyboard Bindings Reverting to setInterval Added code for p5 Update the docs ``` Jan - Feb 2022 ``` Experimenting with Audioworklet ``` |
Changes to source/index.rst.
18 19 20 21 22 23 24 25 26 27 28 |
samples
tweaking
early-attempts
changelog
main
alternate-implementation
saving
limitations
credits
bookmarks
|
< |
18 19 20 21 22 23 24 25 26 27 |
samples tweaking early-attempts changelog main alternate-implementation saving credits bookmarks |
Deleted source/limitations.md.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
# Saving and other limitations There is a save button that converts the state of bitrhythm into a url paramter. This means there is an upper limit on how much code you can write, making it useful for demoscene like situations. You can share the url with tinyurl. You can also download the file. Please keep a backup. - Opening developer tools might slow down the execution a bit - Using excessive delays and reverbs seems to cause some glitches - Mobile browsers don't work properly - Firefox does not seem to work well with tone.js I use [BlackHole](https://existential.audio/blackhole/) to record audio from the browser window to Reaper. You can use any screenrecording software to record the screen. Have a distinct sound to match both audio and video. |
< < < < < < < < < < < < < < |
Changes to source/main.cog.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 ... 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 ... 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 ... 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 ... 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 ... 856 857 858 859 860 861 862 863 864 865 866 867 868 869 ... 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 .... 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 .... 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 .... 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 .... 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 .... 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 .... 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 |
## Running ls source/main.cog | entr -r runserver.sh -b """ cog.out(stuff) @> @@ ## Core Tracker Loop In bitrhythm code is evaluated for every cycle. 1 beat = 60 / tempo 1 cycle = 1 beat / ticks ................................................................................ var bars = 0; var tick = 0; var quarter_beat_length = 60000.0 / this.state.tempo; var beat_length = quarter_beat_length * 4; var delta = beat_length / this.state.ticks; window.samples = this.state.samples; var eval_guard = false; self.timer = setInterval(function () { count = count + 1; tick = (count % this.state.ticks); if (tick === 0) ++bars; $("#duration").html("" + bars + "." + tick + " / " + count + " / " + window.roundTo(Tone.Transport.seconds, 2)); always(); for (var i = 0; i < patterns.length; i++) { if (i == 0) { eval_guard = true; } else { eval_guard = false; } var dials = self.state.dials; var numbers = self.state.numbers; if (document.getElementById('edit-mode').checked) { var p_text = oldPatterns[i]; } else { var p_text = patterns[i]; oldPatterns[i] = p_text; } if (p_text() && p_text().length !== 0) { var track_no = i + 1; var pattern = pattern_parse(p_text()); var meta = pattern_meta(p_text()); var isHit = (pattern.split('')[tick] == "1") ? true : false; try { if (document.getElementById('edit-mode').checked) { eval(oldCode); } else { eval(text); if (document.getElementById('redo').checked) { document.getElementById('redo').checked = false; tick = (count % this.state.ticks); count -= tick + 1; i = 0; continue; } if (document.getElementById('load-mode').checked) { document.getElementById('load-mode').checked = false; transition(); } oldCode = text; } $("#error").html(""); } catch (ex) { $("#error").html(ex); eval(oldCode); } } } }.bind(this), delta) window.requestAnimationFrame(animation); } """ cog.out(core_loop) ................................................................................ context.count_skip = options.speed || 4; context.step = options.step || 0.01; context.reverse = options.reverse || true; context.number = options.number || null; context.current_count = 0; context.index = 0; context.val = window.cellx.cellx(options.initial || 0.5) function changeContext() { context.next_val = context.ramp[context.index + 1]; context.val(context.ramp[context.index]); if (context.val() > context.next_val) { context.direction = -1; ................................................................................ """ cog.out(knob_code) @> @@ ``` ## Main UI @< import cog import os if DEV == "1": stuff = """ ``` // Not working ``` """ cog.out(stuff) @> @@ ```{code-block} html --- force: true --- @< ................................................................................ var self = this; alertify.prompt( 'Enter Sample URL', '', '' , function(evt, value) { self.addURL(value); } , function() { alertify.error('Cancel') }); } addSample() { this.state.samples.push({}); this.update(); } ................................................................................ code = Template(bitrhythm).render(core_loop=core_loop) cog.out(bitrhythm) os.system("rm public/components/bitrhythm.tag") f = open("public/components/bitrhythm.tag", "w") f.write(code) f.close() @> @@ ``` ## Sample You can add samples using the file upload. All samples are available as an array – samples. Initialise samples, global variables and synthesisers using the transition function and change the sample parameters using the same during live coding. ................................................................................ console.log(this.props) return ""; } } this.on("mount", function () { var self = this; /* var sample_file = $("#sample-file" + this.props.ti).get(0); var sam; sample_file.addEventListener('change', (event) => { var file = event.srcElement.files[0]; var a = new Audio(); a.onloadedmetadata = (e) => { sam = new Tone.Sampler({ urls: { "C3": URL.createObjectURL(file), }, onload: () => { this.update(); sam.triggerAttackRelease("C3", 0.5); } }); sam["__name"] = file.name; sam["__url"] = ""; // riot doesn't allow camelcase ? self.props.setsample(sam, self.props.ti - 1); } a.src = URL.createObjectURL(file); }); */ }); </script> </sample> """ cog.out(sample) os.system("rm public/components/sample.tag") ................................................................................ <script src="/misc.js"></script> <style type="text/css"> body { background: black; color: white; font-family: 'Roboto Mono', monospace; } a { color: white; } input { ................................................................................ <div class="containera-full"> <hstack class="mb-2"> <h5 class="ml-4"><a href="/docs/index.html" target="_blank">docs</a></h5> <h5 class="ml-4"><a href="/song/XQAAAAJwFAAAAAAAAABDKUqGU5vI8Eygv8VLc6H1NFIzdYQe5mT-79BTKosH6Xje2IYnNRgEOpeuhg9NTfIT-_uEg-npGX0y9CmzyyVpwgaOUrKNlF-pzVXf3YnQ2gSfpzY3zlYLujavQRq73hSEM-RaGxTxuud9nauG_VdXCmE_lvZ88XvUHOIGjOkCUKV-1ot3i9fx5NP-UsUmVpnjUDnq_9eUJfonx5B_oG4c3GvLitNREl_O9emU8CST0v5RVqHSudqZqsrortpDjdMlekhQ2y7ZlNcUDjGoTrH4vFMrLVI60wINoufS0iO6ourxizS1Ifv_iirkdP0U0Zp21rHHKXlwhWG0hmTCxYo8ZIf0Cmbiu22GiFFmRfIcuWbcq-_SWdyMJ0sWIslhKpGFEapN604eNblpy5im2PsItjWScu-cS0JI3zeHb8JMNzWflq0-XWHG5WLsmPqCbn3GgfR6BiAx1ApmTui84WXgX6SuJPkXRqHEOKpBZ4dKEPr5P_-DDpwz0L7i8X_FHE-LBMactDBoKgIbIoyVnRe6DJ9s5AZLJjUrWGGVCLcp5bEKOnH_3HfZuDq9UlOvZRVkz3BwpUeajLeUJcAYxDmU2JbNUaipMJN7LF9YAX2LaT44LACw2A7Is-pQ_EGznjhEo7SS7JusQPN6G43g4OUZSUY5WNlPUCWfXSeWNU0Xx_-b4r6t4HHQS2P2stIQOS96JqLzXrx-Q62Y8RSRIvieE76j_-dw4icTDiATfx8doLkSzXgOzNTcZYume2cHLEG-0TbgR1M6WCPiH4pvHIRfcTxEDZK5b7iqIhY0MNW8Kkyn7KFVqQf_5d_msiv57DWIHg6Qi6cmBdOF0Li_CY8kFBV4BWLsOlanN6_hehIREVU8WgWbM9rdrKcqzhHD8Fp5qTmbyiVnjD83BDhKY5zwF8xF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RepiObWGsYcqjXkUNjaxoItg_pWdK6gyveVXjfs3PaJ477UbpiZBWxoc-Ebn8FZu6bZZ4gOZE-MoJHUDiQZgo3-lirXTvpcpsgsaIUESDAcGUNE4aIK6wIFGnEaEFYo4veQqTLeic4NhPtUpTdfRqdNTKOaVSUE_KGXKXaZl0Eni1DBmEGykml4uxHsWBEE44Ku34YIb6KZUcCu2DuXDiXcbabsWkA-czXWBtRnzWJ6ib4scny1o6CsVnugUjE9wv84bz2">chiptune</a></h5> <h5 class="ml-4" ><a href="https://xyzzyapps.link/samples/" target="_blank">sample browser</a></h5> </hstack> <bitrhythm song="{{data}}"></bitrhythm> </div> <script> ................................................................................ f.write(page) f.close() @> @@ ## Javascript ```{code-block} js --- force: true --- @< import cog ................................................................................ can_container.width = window.innerWidth; var visualizer = window.butterchurn.default.createVisualizer(Tone.getContext().rawContext, can, { height: window.innerHeight - (document.getElementById("header-playback").clientHeight / 2), width: window.innerWidth, meshWidth: 24, meshHeight: 18, }); visualizer.connectAudio(Tone.getContext().destination); const presets = window.butterchurnPresets.getPresets(); const presetParam = presets[preset]; visualizer.loadPreset(presetParam, 0.0); // 2nd argument is the number of seconds to blend presets return visualizer; } function guard(range) { ................................................................................ letters = letters.replace('`3','d'); letters = letters.replace('`4','e'); letters = letters.replace('`5','f'); return letters; } function lettertodec(letter) { var bin = ""; if (letter.match(/\d/)) { no = parseInt(letter); } else if (letter == "a") { no = 10; } else if (letter == "b") { no = 11; } else if (letter == "c") { no = 12; } else if (letter == "d") { no = 13; } else if (letter == "e") { no = 14; } else if (letter == "f") { no = 15; } for (i = 1; i <= no; i++) { bin += "0"; } return bin; } function lettertobin(letter) { var bin = ""; if (letter == "0") { bin += "0000"; } if (letter == "1") { bin += "0001"; } else if (letter == "2") { bin += "0010"; } else if (letter == "3") { bin += "0011"; } else if (letter == "4") { bin += "0100"; } else if (letter == "5") { bin += "0101"; } else if (letter == "6") { bin += "0110"; } else if (letter == "7") { bin += "0111"; } else if (letter == "8") { bin += "1000"; } else if (letter == "9") { bin += "1001"; } else if (letter == "a") { bin += "1010"; } else if (letter == "b") { bin += "1011"; } else if (letter == "c") { bin += "1100"; } else if (letter == "d") { bin += "1101"; } else if (letter == "e") { bin += "1110"; } else if (letter == "f") { bin += "1111"; } return bin; } function hex2bin(hex) { var letters = romantogypsy(hex) letters = letters.split(''); var bin = ""; letters.map(function(letter) { ................................................................................ setTimeout(function () { $("#cued").html(""); }, seconds * 1000) } window.cue = cue; function Sample(name, no, filter, volume) { name = name filter = filter || 10000 volume = volume || 0 mem[name + "_filter"] = new Tone.Filter(filter, 'lowpass', -96); mem[name + "_channel"] = new Tone.Channel({channelCount: 2, volume: volume}).chain(mem[name + "_filter"], mem.master) samples[no].connect(mem[name + "_channel"]); hit_map[name] = no; } window.Sample = Sample; function p(s, vol, note, len, delay, pan=0) { note = note || "C3" len = len || "16n" vol = vol || 1 delay = delay || "+0"; for (const [key, value] of Object.entries(hit_map)) { if (value == s) { mem[key + "_last"] = count mem[key + "_channel"].pan.value = pan } } samples[s].triggerAttackRelease(note, len, delay, vol); } window.p = p; function p1(s, vol, note, len, delay, pan=0) { note = note || "C3" len = len || "16n" |
< | | | | | | | | | | < | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > > > > > | > < < < < < < < < < < < < < < < < < > | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > < < < < < < < < < < < < < < < < < < < < < < < < < < < < < > > > > > > > > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > < < |
16 17 18 19 20 21 22 23 24 25 26 27 28 29 ... 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 ... 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 ... 451 452 453 454 455 456 457 458 459 460 461 462 463 464 ... 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 ... 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 ... 969 970 971 972 973 974 975 976 977 978 979 980 981 982 .... 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 .... 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 .... 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 .... 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 .... 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 .... 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 |
## Running ls source/main.cog | entr -r runserver.sh -b """ cog.out(stuff) @> @@ ## Core Tracker Loop In bitrhythm code is evaluated for every cycle. 1 beat = 60 / tempo 1 cycle = 1 beat / ticks ................................................................................ var bars = 0; var tick = 0; var quarter_beat_length = 60000.0 / this.state.tempo; var beat_length = quarter_beat_length * 4; var delta = beat_length / this.state.ticks; window.samples = this.state.samples; var eval_guard = false; self.timer = setInterval(function () { count = count + 1; tick = (count % this.state.ticks); if (tick === 0) ++bars; $("#duration").html("" + bars + "." + tick + " / " + count + " / " + window.roundTo(Tone.Transport.seconds, 2)); always(); for (var i = 0; i < patterns.length; i++) { if (i == 0) { eval_guard = true; } else { eval_guard = false; } var dials = self.state.dials; var numbers = self.state.numbers; if (document.getElementById('edit-mode').checked) { var p_text = oldPatterns[i]; } else { var p_text = patterns[i]; oldPatterns[i] = p_text; } if (p_text() && p_text().length !== 0) { var track_no = i + 1; var pattern = pattern_parse(p_text()); var meta = pattern_meta(p_text()); var isHit = (pattern.split('')[tick] == "1") ? true : false; try { if (document.getElementById('edit-mode').checked) { eval(oldCode); } else { eval(text); if (document.getElementById('redo').checked) { document.getElementById('redo').checked = false; tick = (count % this.state.ticks); count -= tick + 1; i = 0; continue; } if (document.getElementById('load-mode').checked) { document.getElementById('load-mode').checked = false; transition(); } oldCode = text; } $("#error").html(""); } catch (ex) { $("#error").html(ex); eval(oldCode); } } } }.bind(this), delta) window.requestAnimationFrame(animation); } """ cog.out(core_loop) ................................................................................ context.count_skip = options.speed || 4; context.step = options.step || 0.01; context.reverse = options.reverse || true; context.number = options.number || null; context.current_count = 0; context.index = 0; // Smooth transition from previous knob values if (context.number) { context.val = window.cellx.cellx(context.number()) } else { context.val = window.cellx.cellx(options.initial || 0.5) } function changeContext() { context.next_val = context.ramp[context.index + 1]; context.val(context.ramp[context.index]); if (context.val() > context.next_val) { context.direction = -1; ................................................................................ """ cog.out(knob_code) @> @@ ``` ## Main UI ```{code-block} html --- force: true --- @< ................................................................................ var self = this; alertify.prompt( 'Enter Sample URL', '', '' , function(evt, value) { self.addURL(value); } , function() { alertify.error('Cancel') } ); } addSample() { this.state.samples.push({}); this.update(); } ................................................................................ code = Template(bitrhythm).render(core_loop=core_loop) cog.out(bitrhythm) os.system("rm public/components/bitrhythm.tag") f = open("public/components/bitrhythm.tag", "w") f.write(code) f.close() @> @@ ``` ## Worklet More worklet implementations - <https://mimicproject.com/guides/maximJS> - Gibberish Some implementation links <https://stackoverflow.com/questions/12089662/mixing-16-bit-linear-pcm-streams-and-avoiding-clipping-overflow> <https://www.eumus.edu.uy/eme/ensenanza/electivas/dsp/presentaciones/PhaseVocoderTutorial.pdf> ```{code-block} js --- force: true --- @< import cog import os sampler = """ class Sampler extends AudioWorkletProcessor { files = [] readIdx = {} loopStartIdx = [] constructor(options) { super() this.port.onmessage = ({ data }) => { if (data.init) { this.files = data.init this.loopStartIdx = this.files.map(function (f) { return 0 }) } else if (data.noteOn) { this.readIdx[data.sample] = this.loopStartIdx[data.sample] } else if (data.noteOff) { delete this.readIdx[data.sample]; } }; } process(inputs, outputs) { var outLeft = outputs[0][0] var outRight = outputs[0][1] Object.keys(this.readIdx).map((sample) => { for (let i=0; i < outLeft.length; i++, this.readIdx[sample]++) { if (this.readIdx[sample] < this.files[sample].pcmLeft.length) { outLeft[i] += this.files[sample].pcmLeft[this.readIdx[sample]] outRight[i] += this.files[sample].pcmRight[this.readIdx[sample]] } } }) return true } } registerProcessor('sampler', Sampler) """ cog.out(sampler) os.system("rm public/sampler.js") f = open("public/sampler.js", "w") f.write(sampler) f.close() @> @@ ``` ## Sample You can add samples using the file upload. All samples are available as an array – samples. Initialise samples, global variables and synthesisers using the transition function and change the sample parameters using the same during live coding. ................................................................................ console.log(this.props) return ""; } } this.on("mount", function () { }); </script> </sample> """ cog.out(sample) os.system("rm public/components/sample.tag") ................................................................................ <script src="/misc.js"></script> <style type="text/css"> body { background: black; color: white; font-family: 'Roboto Mono', monospace; overflow-x: hidden; } a { color: white; } input { ................................................................................ <div class="containera-full"> <hstack class="mb-2"> <h5 class="ml-4"><a href="/docs/index.html" target="_blank">docs</a></h5> <h5 class="ml-4"><a href="/song/XQAAAAJwFAAAAAAAAABDKUqGU5vI8Eygv8VLc6H1NFIzdYQe5mT-79BTKosH6Xje2IYnNRgEOpeuhg9NTfIT-_uEg-npGX0y9CmzyyVpwgaOUrKNlF-pzVXf3YnQ2gSfpzY3zlYLujavQRq73hSEM-RaGxTxuud9nauG_VdXCmE_lvZ88XvUHOIGjOkCUKV-1ot3i9fx5NP-UsUmVpnjUDnq_9eUJfonx5B_oG4c3GvLitNREl_O9emU8CST0v5RVqHSudqZqsrortpDjdMlekhQ2y7ZlNcUDjGoTrH4vFMrLVI60wINoufS0iO6ourxizS1Ifv_iirkdP0U0Zp21rHHKXlwhWG0hmTCxYo8ZIf0Cmbiu22GiFFmRfIcuWbcq-_SWdyMJ0sWIslhKpGFEapN604eNblpy5im2PsItjWScu-cS0JI3zeHb8JMNzWflq0-XWHG5WLsmPqCbn3GgfR6BiAx1ApmTui84WXgX6SuJPkXRqHEOKpBZ4dKEPr5P_-DDpwz0L7i8X_FHE-LBMactDBoKgIbIoyVnRe6DJ9s5AZLJjUrWGGVCLcp5bEKOnH_3HfZuDq9UlOvZRVkz3BwpUeajLeUJcAYxDmU2JbNUaipMJN7LF9YAX2LaT44LACw2A7Is-pQ_EGznjhEo7SS7JusQPN6G43g4OUZSUY5WNlPUCWfXSeWNU0Xx_-b4r6t4HHQS2P2stIQOS96JqLzXrx-Q62Y8RSRIvieE76j_-dw4icTDiATfx8doLkSzXgOzNTcZYume2cHLEG-0TbgR1M6WCPiH4pvHIRfcTxEDZK5b7iqIhY0MNW8Kkyn7KFVqQf_5d_msiv57DWIHg6Qi6cmBdOF0Li_CY8kFBV4BWLsOlanN6_hehIREVU8WgWbM9rdrKcqzhHD8Fp5qTmbyiVnjD83BDhKY5zwF8xFM1p7ZmEj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pcVB8x3P5DZ5sHAWg2k1mubUuuI9aycC-b1qMOPu5y8_bPvXK5uGpEpmoXqbRSlqMLxUrpRPIjOoTPjBc8BciARAkj1yXYWfJ5umO32LMrCaJSi3AO5v_K95FVKT3wnE4x3Ra1yU3CcuXKlFrWrUlWWXGHYS7tXc7YL7Ik5jvI8g3oJeS4LaFMc5WxyzzguEUaO-FxRzVU6kgN_9Yddrg">stochastic</a></h5> <h5 class="ml-4" ><a href="https://xyzzyapps.link/samples/" target="_blank">sample browser</a></h5> </hstack> <bitrhythm song="{{data}}"></bitrhythm> </div> <script> ................................................................................ f.write(page) f.close() @> @@ ## Javascript This includes the functions used for parsing the pattern and initialising the samples. A prelimnary sampler implementation has been done with AudioWorklet support, although there doesn't seem to much improvement in the performance. ```{code-block} js --- force: true --- @< import cog ................................................................................ can_container.width = window.innerWidth; var visualizer = window.butterchurn.default.createVisualizer(Tone.getContext().rawContext, can, { height: window.innerHeight - (document.getElementById("header-playback").clientHeight / 2), width: window.innerWidth, meshWidth: 24, meshHeight: 18, }); visualizer.connectAudio(Tone.getContext().rawContext.destination); const presets = window.butterchurnPresets.getPresets(); const presetParam = presets[preset]; visualizer.loadPreset(presetParam, 0.0); // 2nd argument is the number of seconds to blend presets return visualizer; } function guard(range) { ................................................................................ letters = letters.replace('`3','d'); letters = letters.replace('`4','e'); letters = letters.replace('`5','f'); return letters; } function lettertodec(letter) { var bin = ""; if (letter.match(/\d/)) { no = parseInt(letter); } else if (letter == "a") { no = 10; } else if (letter == "b") { no = 11; } else if (letter == "c") { no = 12; } else if (letter == "d") { no = 13; } else if (letter == "e") { no = 14; } else if (letter == "f") { no = 15; } for (i = 1; i <= no; i++) { bin += "0"; } return bin; } function lettertobin(letter) { var bin = ""; if (letter == "0") { bin += "0000"; } if (letter == "1") { bin += "0001"; } else if (letter == "2") { bin += "0010"; } else if (letter == "3") { bin += "0011"; } else if (letter == "4") { bin += "0100"; } else if (letter == "5") { bin += "0101"; } else if (letter == "6") { bin += "0110"; } else if (letter == "7") { bin += "0111"; } else if (letter == "8") { bin += "1000"; } else if (letter == "9") { bin += "1001"; } else if (letter == "a") { bin += "1010"; } else if (letter == "b") { bin += "1011"; } else if (letter == "c") { bin += "1100"; } else if (letter == "d") { bin += "1101"; } else if (letter == "e") { bin += "1110"; } else if (letter == "f") { bin += "1111"; } return bin; } function hex2bin(hex) { var letters = romantogypsy(hex) letters = letters.split(''); var bin = ""; letters.map(function(letter) { ................................................................................ setTimeout(function () { $("#cued").html(""); }, seconds * 1000) } window.cue = cue; async function loadSamplesToWorklet(urls) { var context = Tone.getContext(); window.context = context; await context.addAudioWorkletModule('/sampler.js', 'sampler'); var sampler = await context.createAudioWorkletNode('sampler', { outputChannelCount: [2], // stereo }); window.sampler = sampler; var files = [] for (var i = 0; i < urls.length; i++) { var url = urls[i] const source = context.createBufferSource(); const audioBuffer = await fetch(url) .then(res => res.arrayBuffer()) .then(ArrayBuffer => context.decodeAudioData(ArrayBuffer)); const pcmLeft = audioBuffer.getChannelData(0) const pcmRight = audioBuffer.getChannelData(1) files.push({ pcmLeft, pcmRight }) } sampler.port.postMessage({ init: files }) context.rawContext.resume(); sampler.connect(Tone.getContext().rawContext.destination); } function Sample(name, no, filter, volume) { name = name filter = filter || 10000 volume = volume || 0 mem[name + "_filter"] = new Tone.Filter(filter, 'lowpass', -96); mem[name + "_channel"] = new Tone.Channel({channelCount: 2, volume: volume}).chain(mem[name + "_filter"], mem.master) samples[no].connect(mem[name + "_channel"]); hit_map[name] = no; } window.Sample = Sample; function pw(s, vol, note, len, delay, pan=0) { window.sampler.port.postMessage({ noteOn: true, sample: s, volume: vol}); } window.pw = pw; function p(s, vol, note, len, delay, pan=0) { note = note || "C3" len = len || "16n" vol = vol || 1 delay = delay || "+0"; for (const [key, value] of Object.entries(hit_map)) { if (value == s) { mem[key + "_last"] = count mem[key + "_channel"].pan.value = pan } } samples[s].triggerAttackRelease(note, len, delay, vol); } window.p = p; function p1(s, vol, note, len, delay, pan=0) { note = note || "C3" len = len || "16n" |
Changes to source/main.md.
1 2 3 4 5 6 7 8 9 10 11 .. 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 ... 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 ... 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 ... 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 ... 771 772 773 774 775 776 777 778 779 780 781 782 783 784 ... 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 ... 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 ... 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 .... 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 |
# Code Walkthrough ## Core Tracker Loop In bitrhythm code is evaluated for every cycle. 1 beat = 60 / tempo 1 cycle = 1 beat / ticks ................................................................................ var bars = 0; var tick = 0; var quarter_beat_length = 60000.0 / this.state.tempo; var beat_length = quarter_beat_length * 4; var delta = beat_length / this.state.ticks; window.samples = this.state.samples; var eval_guard = false; self.timer = setInterval(function () { count = count + 1; tick = (count % this.state.ticks); if (tick === 0) ++bars; $("#duration").html("" + bars + "." + tick + " / " + count + " / " + window.roundTo(Tone.Transport.seconds, 2)); always(); for (var i = 0; i < patterns.length; i++) { if (i == 0) { eval_guard = true; } else { eval_guard = false; } var dials = self.state.dials; var numbers = self.state.numbers; if (document.getElementById('edit-mode').checked) { var p_text = oldPatterns[i]; } else { var p_text = patterns[i]; oldPatterns[i] = p_text; } if (p_text() && p_text().length !== 0) { var track_no = i + 1; var pattern = pattern_parse(p_text()); var meta = pattern_meta(p_text()); var isHit = (pattern.split('')[tick] == "1") ? true : false; try { if (document.getElementById('edit-mode').checked) { eval(oldCode); } else { eval(text); if (document.getElementById('redo').checked) { document.getElementById('redo').checked = false; tick = (count % this.state.ticks); count -= tick + 1; i = 0; continue; } if (document.getElementById('load-mode').checked) { document.getElementById('load-mode').checked = false; transition(); } oldCode = text; } $("#error").html(""); } catch (ex) { $("#error").html(ex); eval(oldCode); } } } }.bind(this), delta) window.requestAnimationFrame(animation); } ``` ................................................................................ context.count_skip = options.speed || 4; context.step = options.step || 0.01; context.reverse = options.reverse || true; context.number = options.number || null; context.current_count = 0; context.index = 0; context.val = window.cellx.cellx(options.initial || 0.5) function changeContext() { context.next_val = context.ramp[context.index + 1]; context.val(context.ramp[context.index]); if (context.val() > context.next_val) { context.direction = -1; ................................................................................ } return context.knob; } ``` ## Main UI ```{code-block} html --- force: true --- ................................................................................ var self = this; alertify.prompt( 'Enter Sample URL', '', '' , function(evt, value) { self.addURL(value); } , function() { alertify.error('Cancel') }); } addSample() { this.state.samples.push({}); this.update(); } ................................................................................ } </script> </bitrhythm> ``` ## Sample You can add samples using the file upload. All samples are available as an array – samples. Initialise samples, global variables and synthesisers using the transition function and change the sample parameters using the same during live coding. ```{code-block} html --- ................................................................................ console.log(this.props) return ""; } } this.on("mount", function () { var self = this; /* var sample_file = $("#sample-file" + this.props.ti).get(0); var sam; sample_file.addEventListener('change', (event) => { var file = event.srcElement.files[0]; var a = new Audio(); a.onloadedmetadata = (e) => { sam = new Tone.Sampler({ urls: { "C3": URL.createObjectURL(file), }, onload: () => { this.update(); sam.triggerAttackRelease("C3", 0.5); } }); sam["__name"] = file.name; sam["__url"] = ""; // riot doesn't allow camelcase ? self.props.setsample(sam, self.props.ti - 1); } a.src = URL.createObjectURL(file); }); */ }); </script> </sample> ``` ## Javascript ```{code-block} js --- force: true --- function getRandomInt(max) { ................................................................................ can_container.width = window.innerWidth; var visualizer = window.butterchurn.default.createVisualizer(Tone.getContext().rawContext, can, { height: window.innerHeight - (document.getElementById("header-playback").clientHeight / 2), width: window.innerWidth, meshWidth: 24, meshHeight: 18, }); visualizer.connectAudio(Tone.getContext().destination); const presets = window.butterchurnPresets.getPresets(); const presetParam = presets[preset]; visualizer.loadPreset(presetParam, 0.0); // 2nd argument is the number of seconds to blend presets return visualizer; } function guard(range) { ................................................................................ letters = letters.replace('`3','d'); letters = letters.replace('`4','e'); letters = letters.replace('`5','f'); return letters; } function lettertodec(letter) { var bin = ""; if (letter.match(/\d/)) { no = parseInt(letter); } else if (letter == "a") { no = 10; } else if (letter == "b") { no = 11; } else if (letter == "c") { no = 12; } else if (letter == "d") { no = 13; } else if (letter == "e") { no = 14; } else if (letter == "f") { no = 15; } for (i = 1; i <= no; i++) { bin += "0"; } return bin; } function lettertobin(letter) { var bin = ""; if (letter == "0") { bin += "0000"; } if (letter == "1") { bin += "0001"; } else if (letter == "2") { bin += "0010"; } else if (letter == "3") { bin += "0011"; } else if (letter == "4") { bin += "0100"; } else if (letter == "5") { bin += "0101"; } else if (letter == "6") { bin += "0110"; } else if (letter == "7") { bin += "0111"; } else if (letter == "8") { bin += "1000"; } else if (letter == "9") { bin += "1001"; } else if (letter == "a") { bin += "1010"; } else if (letter == "b") { bin += "1011"; } else if (letter == "c") { bin += "1100"; } else if (letter == "d") { bin += "1101"; } else if (letter == "e") { bin += "1110"; } else if (letter == "f") { bin += "1111"; } return bin; } function hex2bin(hex) { var letters = romantogypsy(hex) letters = letters.split(''); var bin = ""; letters.map(function(letter) { ................................................................................ setTimeout(function () { $("#cued").html(""); }, seconds * 1000) } window.cue = cue; function Sample(name, no, filter, volume) { name = name filter = filter || 10000 volume = volume || 0 mem[name + "_filter"] = new Tone.Filter(filter, 'lowpass', -96); mem[name + "_channel"] = new Tone.Channel({channelCount: 2, volume: volume}).chain(mem[name + "_filter"], mem.master) samples[no].connect(mem[name + "_channel"]); hit_map[name] = no; } window.Sample = Sample; function p(s, vol, note, len, delay, pan=0) { note = note || "C3" len = len || "16n" vol = vol || 1 delay = delay || "+0"; for (const [key, value] of Object.entries(hit_map)) { if (value == s) { mem[key + "_last"] = count mem[key + "_channel"].pan.value = pan } } samples[s].triggerAttackRelease(note, len, delay, vol); } window.p = p; function p1(s, vol, note, len, delay, pan=0) { note = note || "C3" len = len || "16n" |
> > > | | | | | | | | | | < | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > > > > > | > < < > | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > < < < < | < < < < < < < < < < | < > > > > > > > > > > > | | | | > > | < < < > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | | < > > > > > > > | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > < < |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 .. 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 ... 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 ... 398 399 400 401 402 403 404 405 406 407 408 409 410 411 ... 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 ... 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 ... 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 .... 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 .... 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 .... 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 |
# Code Walkthrough ## Running ls source/main.cog | entr -r runserver.sh -b ## Core Tracker Loop In bitrhythm code is evaluated for every cycle. 1 beat = 60 / tempo 1 cycle = 1 beat / ticks ................................................................................ var bars = 0; var tick = 0; var quarter_beat_length = 60000.0 / this.state.tempo; var beat_length = quarter_beat_length * 4; var delta = beat_length / this.state.ticks; window.samples = this.state.samples; var eval_guard = false; self.timer = setInterval(function () { count = count + 1; tick = (count % this.state.ticks); if (tick === 0) ++bars; $("#duration").html("" + bars + "." + tick + " / " + count + " / " + window.roundTo(Tone.Transport.seconds, 2)); always(); for (var i = 0; i < patterns.length; i++) { if (i == 0) { eval_guard = true; } else { eval_guard = false; } var dials = self.state.dials; var numbers = self.state.numbers; if (document.getElementById('edit-mode').checked) { var p_text = oldPatterns[i]; } else { var p_text = patterns[i]; oldPatterns[i] = p_text; } if (p_text() && p_text().length !== 0) { var track_no = i + 1; var pattern = pattern_parse(p_text()); var meta = pattern_meta(p_text()); var isHit = (pattern.split('')[tick] == "1") ? true : false; try { if (document.getElementById('edit-mode').checked) { eval(oldCode); } else { eval(text); if (document.getElementById('redo').checked) { document.getElementById('redo').checked = false; tick = (count % this.state.ticks); count -= tick + 1; i = 0; continue; } if (document.getElementById('load-mode').checked) { document.getElementById('load-mode').checked = false; transition(); } oldCode = text; } $("#error").html(""); } catch (ex) { $("#error").html(ex); eval(oldCode); } } } }.bind(this), delta) window.requestAnimationFrame(animation); } ``` ................................................................................ context.count_skip = options.speed || 4; context.step = options.step || 0.01; context.reverse = options.reverse || true; context.number = options.number || null; context.current_count = 0; context.index = 0; // Smooth transition from previous knob values if (context.number) { context.val = window.cellx.cellx(context.number()) } else { context.val = window.cellx.cellx(options.initial || 0.5) } function changeContext() { context.next_val = context.ramp[context.index + 1]; context.val(context.ramp[context.index]); if (context.val() > context.next_val) { context.direction = -1; ................................................................................ } return context.knob; } ``` ## Main UI ```{code-block} html --- force: true --- ................................................................................ var self = this; alertify.prompt( 'Enter Sample URL', '', '' , function(evt, value) { self.addURL(value); } , function() { alertify.error('Cancel') } ); } addSample() { this.state.samples.push({}); this.update(); } ................................................................................ } </script> </bitrhythm> ``` ## Worklet More worklet implementations - <https://mimicproject.com/guides/maximJS> - Gibberish Some implementation links <https://stackoverflow.com/questions/12089662/mixing-16-bit-linear-pcm-streams-and-avoiding-clipping-overflow> <https://www.eumus.edu.uy/eme/ensenanza/electivas/dsp/presentaciones/PhaseVocoderTutorial.pdf> ```{code-block} js --- force: true --- class Sampler extends AudioWorkletProcessor { files = [] readIdx = {} loopStartIdx = [] constructor(options) { super() this.port.onmessage = ({ data }) => { if (data.init) { this.files = data.init this.loopStartIdx = this.files.map(function (f) { return 0 }) } else if (data.noteOn) { this.readIdx[data.sample] = this.loopStartIdx[data.sample] } else if (data.noteOff) { delete this.readIdx[data.sample]; } }; } process(inputs, outputs) { var outLeft = outputs[0][0] var outRight = outputs[0][1] Object.keys(this.readIdx).map((sample) => { for (let i=0; i < outLeft.length; i++, this.readIdx[sample]++) { if (this.readIdx[sample] < this.files[sample].pcmLeft.length) { outLeft[i] += this.files[sample].pcmLeft[this.readIdx[sample]] outRight[i] += this.files[sample].pcmRight[this.readIdx[sample]] } } }) return true } } registerProcessor('sampler', Sampler) ``` ## Sample You can add samples using the file upload. All samples are available as an array – samples. Initialise samples, global variables and synthesisers using the transition function and change the sample parameters using the same during live coding. ```{code-block} html --- ................................................................................ console.log(this.props) return ""; } } this.on("mount", function () { }); </script> </sample> ``` ## App ```{code-block} hylang --- force: true --- (import [sanic [Sanic response]]) (import [sanic.response [json text]]) (import [sanic.exceptions [NotFound abort]]) (import [jinja2 [Environment FileSystemLoader]]) (import re) (import ipdb) (import sys) (import traceback) (import json) (import datetime) (import [email.utils [format_datetime]]) (import [urllib.parse [urlparse]]) (import base64) (setv file-loader (FileSystemLoader "templates")) (setv env (Environment :loader file-loader)) (setv app (Sanic "Bitrhythm")) (with-decorator (app.exception NotFound) (defn/a ignore_404s [request exception] (return (text (+ "Yep, I totally found the page " request.url))) ) ) (with-decorator (app.route "/song/<name>") (defn/a get-index [request name] (setv template (env.get_template "index.html")) (return (response.html (template.render {"data" name}))) ) ) (with-decorator (app.route "/") (defn/a get-index [request] (setv template (env.get_template "index.html")) (return (response.html (template.render {"data" ""}))) ) ) (with-decorator (app.route "/issue") (defn/a get-index [request] (setv template (env.get_template "page.html")) (return (response.html (template.render))) ) ) (app.static "/" "./public") (defmain [&rest args] (app.run :host "0.0.0.0" :port 8015) ) ``` ## Index ```{code-block} html --- force: true --- <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Bitrhythm</title> <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" /> <meta http-equiv="Pragma" content="no-cache" /> <meta http-equiv="Expires" content="0" /> <meta content="Bitrhythm" name="description" xml:lang="en" lang="en"> <meta content="literate programming, p5, live coding, algorave, demoscene, creative programming, music, techno, programming, webaudio, webgl, p5, improvising"> ${common_scripts} <link rel="preconnect" href="https://fonts.gstatic.com"> <link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,700;1,100;1,200;1,300;1,400;1,500;1,700&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Major+Mono+Display&family=Roboto+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,700;1,100;1,200;1,300;1,400;1,500;1,700&display=swap" rel="stylesheet"> <script src="https://code.jquery.com/ui/1.12.0/jquery-ui.min.js"></script> <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.0/themes/smoothness/jquery-ui.css"> <script src="https://cdnjs.cloudflare.com/ajax/libs/micromodal/0.4.6/micromodal.min.js" integrity="sha512-RMMh+IHzfZLsVFo1rX9PBoysxrJJqjyOS31HYWftobWtv2At6KBTqKpvVDIWAjL5aiV+LjFqkQ6e53Rdw3VOBg==" crossorigin="anonymous"></script> <script src="https://cdn.jsdelivr.net/npm/whenipress@1.8.0/dist/whenipress.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/AlertifyJS/1.13.1/alertify.min.js" integrity="sha512-JnjG+Wt53GspUQXQhc+c4j8SBERsgJAoHeehagKHlxQN+MtCCmFDghX9/AcbkkNRZptyZU4zC8utK59M5L45Iw==" crossorigin="anonymous"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/AlertifyJS/1.13.1/css/alertify.min.css" integrity="sha512-IXuoq1aFd2wXs4NqGskwX2Vb+I8UJ+tGJEu/Dc0zwLNKeQ7CW3Sr6v0yU3z5OQWe3eScVIkER4J9L7byrgR/fA==" crossorigin="anonymous" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/AlertifyJS/1.13.1/css/themes/default.min.css" integrity="sha512-RgUjDpwjEDzAb7nkShizCCJ+QTSLIiJO1ldtuxzs0UIBRH4QpOjUU9w47AF9ZlviqV/dOFGWF6o7l3lttEFb6g==" crossorigin="anonymous" /> <script src="/json-url-master/dist/browser/json-url.js"></script> <script src="/riot-3.13.2/riot+compiler.js"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.1.2/tailwind.min.css" integrity="sha512-RntatPOhEcQEA81gC/esYoCkGkL7AYV7TeTPoU+R9zE44/yWxVvLIBfBSaMu78rhoDd73ZeRHXRJN5+aPEK53Q==" crossorigin="anonymous" /> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script> <link rel="stylesheet" href="https://esironal.github.io/cmtouch/lib/codemirror.css"> <link rel="stylesheet" href="https://esironal.github.io/cmtouch/addon/hint/show-hint.css"> <script src="https://esironal.github.io/cmtouch/lib/codemirror.js"></script> <script src="https://esironal.github.io/cmtouch/addon/hint/show-hint.js"></script> <script src="http://esironal.github.io/cmtouch/addon/hint/xml-hint.js"></script> <script src="https://esironal.github.io/cmtouch/addon/hint/html-hint.js"></script> <script src="https://esironal.github.io/cmtouch/mode/xml/xml.js"></script> <script src="https://esironal.github.io/cmtouch/mode/javascript/javascript.js"></script> <script src="https://esironal.github.io/cmtouch/mode/css/css.js"></script> <script src="https://esironal.github.io/cmtouch/mode/htmlmixed/htmlmixed.js"></script> <script src="https://esironal.github.io/cmtouch/addon/selection/active-line.js"></script> <script src="https://esironal.github.io/cmtouch/addon/selection/mark-selection.js"></script> <script src="https://esironal.github.io/cmtouch/addon/edit/matchbrackets.js"></script> <link rel="stylesheet" href="https://esironal.github.io/cmtouch/theme/neonsyntax.css"> <link rel="stylesheet" href="https://unpkg.com/pyloncss@latest/css/pylon.css"/> <script src="/tune.js"></script> <script src="/misc.js"></script> <style type="text/css"> body { background: black; color: white; font-family: 'Roboto Mono', monospace; overflow-x: hidden; } a { color: white; } input { color: black; } .btn { background: white; color: black; padding: 4px; } .CodeMirror-selected { background-color: transparent !important; z-index: 20 !important; } .CodeMirror-selectedtext { color: red !important; z-index: 25 !important; } .CodeMirror pre { z-index: 5; background: black; padding: 2px; } .CodeMirror-cursor { border-left: 2px solid white !important; z-index: 10 !important; color: white !important; background: white !important; } .CodeMirror-line span { color: white !important; } .CodeMirror-line > span { background: black; padding: 0 !important; } .CodeMirror-lines { padding: 0 !important; } .CodeMirror { font-size: 12px; width: 100%; padding-left: 4px; line-height: 1; background: transparent !important; color: white !important; font-family: 'Roboto Mono', monospace !important; } .CodeMirror-vscrollbar, .CodeMirror-hscrollbar { overflow-x: hidden !important; overflow-y: hidden !important; } .CodeMirror-cursor { border-left: 2px solid white !important; } </style> <script type="riot/tag" src="/components/bitrhythm.tag"></script> <script type="riot/tag" src="/components/dial.tag"></script> <script type="riot/tag" src="/components/sample.tag" ></script> <script type="riot/tag" src="/components/number.tag" ></script> <script type="text/javascript"> var _paq = window._paq = window._paq || []; _paq.push(['trackPageView']);_paq.push(['enableLinkTracking']);_paq.push(['alwaysUseSendBeacon']);_paq.push(['setTrackerUrl', "\/\/blog.xyzzyapps.link\/owoamims\/matomo\/app\/matomo.php"]);_paq.push(['setSiteId', '1']);var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.async=true; g.src="\/\/blog.xyzzyapps.link\/oozotche\/matomo\/matomo.js"; s.parentNode.insertBefore(g,s); </script> </head> <body> <div class="containera-full"> <hstack class="mb-2"> <h5 class="ml-4"><a href="/docs/index.html" target="_blank">docs</a></h5> <h5 class="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O5v_K95FVKT3wnE4x3Ra1yU3CcuXKlFrWrUlWWXGHYS7tXc7YL7Ik5jvI8g3oJeS4LaFMc5WxyzzguEUaO-FxRzVU6kgN_9Yddrg">stochastic</a></h5> <h5 class="ml-4" ><a href="https://xyzzyapps.link/samples/" target="_blank">sample browser</a></h5> </hstack> <bitrhythm song="{{data}}"></bitrhythm> </div> <script> riot.compile(function() { var bitrhythm = riot.mount('bitrhythm'); window.bitrhythm = bitrhythm[0]; var dial = riot.mount('dial'); var number = riot.mount('number'); var sample = riot.mount('sample'); }) </script> </body> </html> ``` ## Page ```{code-block} html --- force: true --- <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" /> <meta http-equiv="Pragma" content="no-cache" /> <meta http-equiv="Expires" content="0" /> <title>About birthythm</title> <link rel="icon" href="favicon.ico"> <style> html, body { margin: 0; width: 100%; height: 100%; padding: 0; } iframe { position:fixed; top:0; left:0; bottom:0; right:0; width:100%; height:100%; border:none; margin:0; padding:0; overflow:hidden; z-index:999999; } </style> <link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet"> <script> window.goatcounter = { path: function(p) { return location.host + p } } </script> <script data-goatcounter="https://analytics.xyzzyapps.link/count" async src="//analytics.xyzzyapps.link/count.js"></script> </head> <body> <iframe src="https://blog.xyzzyapps.link/bitrhythm-submit-issue-feedback" frameborder="0"></iframe> </body> </html> ``` ## Javascript This includes the functions used for parsing the pattern and initialising the samples. A prelimnary sampler implementation has been done with AudioWorklet support, although there doesn't seem to much improvement in the performance. ```{code-block} js --- force: true --- function getRandomInt(max) { ................................................................................ can_container.width = window.innerWidth; var visualizer = window.butterchurn.default.createVisualizer(Tone.getContext().rawContext, can, { height: window.innerHeight - (document.getElementById("header-playback").clientHeight / 2), width: window.innerWidth, meshWidth: 24, meshHeight: 18, }); visualizer.connectAudio(Tone.getContext().rawContext.destination); const presets = window.butterchurnPresets.getPresets(); const presetParam = presets[preset]; visualizer.loadPreset(presetParam, 0.0); // 2nd argument is the number of seconds to blend presets return visualizer; } function guard(range) { ................................................................................ letters = letters.replace('`3','d'); letters = letters.replace('`4','e'); letters = letters.replace('`5','f'); return letters; } function lettertodec(letter) { var bin = ""; if (letter.match(/\d/)) { no = parseInt(letter); } else if (letter == "a") { no = 10; } else if (letter == "b") { no = 11; } else if (letter == "c") { no = 12; } else if (letter == "d") { no = 13; } else if (letter == "e") { no = 14; } else if (letter == "f") { no = 15; } for (i = 1; i <= no; i++) { bin += "0"; } return bin; } function lettertobin(letter) { var bin = ""; if (letter == "0") { bin += "0000"; } if (letter == "1") { bin += "0001"; } else if (letter == "2") { bin += "0010"; } else if (letter == "3") { bin += "0011"; } else if (letter == "4") { bin += "0100"; } else if (letter == "5") { bin += "0101"; } else if (letter == "6") { bin += "0110"; } else if (letter == "7") { bin += "0111"; } else if (letter == "8") { bin += "1000"; } else if (letter == "9") { bin += "1001"; } else if (letter == "a") { bin += "1010"; } else if (letter == "b") { bin += "1011"; } else if (letter == "c") { bin += "1100"; } else if (letter == "d") { bin += "1101"; } else if (letter == "e") { bin += "1110"; } else if (letter == "f") { bin += "1111"; } return bin; } function hex2bin(hex) { var letters = romantogypsy(hex) letters = letters.split(''); var bin = ""; letters.map(function(letter) { ................................................................................ setTimeout(function () { $("#cued").html(""); }, seconds * 1000) } window.cue = cue; async function loadSamplesToWorklet(urls) { var context = Tone.getContext(); window.context = context; await context.addAudioWorkletModule('/sampler.js', 'sampler'); var sampler = await context.createAudioWorkletNode('sampler', { outputChannelCount: [2], // stereo }); window.sampler = sampler; var files = [] for (var i = 0; i < urls.length; i++) { var url = urls[i] const source = context.createBufferSource(); const audioBuffer = await fetch(url) .then(res => res.arrayBuffer()) .then(ArrayBuffer => context.decodeAudioData(ArrayBuffer)); const pcmLeft = audioBuffer.getChannelData(0) const pcmRight = audioBuffer.getChannelData(1) files.push({ pcmLeft, pcmRight }) } sampler.port.postMessage({ init: files }) context.rawContext.resume(); sampler.connect(Tone.getContext().rawContext.destination); } function Sample(name, no, filter, volume) { name = name filter = filter || 10000 volume = volume || 0 mem[name + "_filter"] = new Tone.Filter(filter, 'lowpass', -96); mem[name + "_channel"] = new Tone.Channel({channelCount: 2, volume: volume}).chain(mem[name + "_filter"], mem.master) samples[no].connect(mem[name + "_channel"]); hit_map[name] = no; } window.Sample = Sample; function pw(s, vol, note, len, delay, pan=0) { window.sampler.port.postMessage({ noteOn: true, sample: s, volume: vol}); } window.pw = pw; function p(s, vol, note, len, delay, pan=0) { note = note || "C3" len = len || "16n" vol = vol || 1 delay = delay || "+0"; for (const [key, value] of Object.entries(hit_map)) { if (value == s) { mem[key + "_last"] = count mem[key + "_channel"].pan.value = pan } } samples[s].triggerAttackRelease(note, len, delay, vol); } window.p = p; function p1(s, vol, note, len, delay, pan=0) { note = note || "C3" len = len || "16n" |
Changes to source/samples.md.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
# Samples You can use Sample URL to add samples from anywhere. Currently there are three samples available from the main site for use in the demos. - /Kick01.wav - /Snare19.wav - /Closedhat01.wav - /MiscSynthStab04.wav - /Perc11.wav - /PianoStab03.wav - /Snare06.wav - /Snare12.wav - /Snare09.wav |
| > > | | | |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
# Samples You can use Sample URL to add samples from anywhere. Use can use the sample browser to add some music radar samples. Currently these samples are available for testing purposes, but in the future they might be removed. - /Kick01.wav - /Snare19.wav - /Closedhat01.wav - /MiscSynthStab04.wav - /Perc11.wav - /PianoStab03.wav - /Snare06.wav - /Snare12.wav - /Snare09.wav |
Added source/saving.md.
> > > > > > > > > > > > > > > |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
# Saving / Recording / Streaming There is a save button that converts the state of bitrhythm into a url paramter. This means there is an upper limit on how much code you can write, making it useful for demoscene like situations. You can share the url with tinyurl. You can also download the file. Please keep a backup! I use [BlackHole](https://existential.audio/blackhole/) to record audio from the browser window to Reaper. There is however a huge performance hit while recording the video, especially if there is WebGL. I recommend an HDMI capture card with a loop out to record the video output into another computer and simultanously see it. This is the recommended setup by twitch streamers. Have a distinct sound at the start to match both audio and video for easy syncing between the two. - Opening developer tools might slow down the execution a bit - Using excessive delays and reverbs seems to cause some glitches - Mobile browsers don't work properly - Firefox does not seem to work well with tone.js |
Changes to source/what.cog.
1
2
3
4
5
6
7
8
..
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
# What is bitrhythm about ? In Bitrhythm you get a coding playground to make music with webaudio, canvas and webgl apis. You can share the final track as a URL which enables interactive music with your listener. The url size limit acts as a contraint on creativity. Apart from the core html apis, you can also use the following libraries 1. Tuna 2. Timbral ................................................................................ You can use Bitrhythm for making music similar to the music possible with trackers like Buzz / Renoise / OpenMPT. I call this approach Hard Coding music. This is also known as executable music in the Demoscene. You can also use Bitrhythm for Live Coding and Algorithmic composition. ## ADC 2021 I presented Bitrhythm in ADC '21. [Slides](https://xyzzyapps.link/adc21) Video: TBD ## Inspiration for the project I make [web apps](https://xyzzyapps.link) for a living. I started messing with algorithmic composition using pure data around 2011. In many ways Pure Data was my first DAW. Although nothing much came out of it musically, it transformed the way I view programming. The unix pipes concept is identical to the data flow model in pure data; albeit with more connections. For my music I moved onto Electribe, Renoise, Reaper and live looping with my guitar. I started exploring sonic pi in 2019 but TBH none of the live coding tools were doing what I wanted - basically tweaking /knob-twisting in techno so I started my work on this project. [This library](https://www.youtube.com/watch?v=adz1Gv5Lm34) in sonic pi comes close to what I am trying todo with this project. In bitrhythm time is divided into ticks like renoise tracker. |
>
>
|
|
>
<
>
>
|
1
2
3
4
5
6
7
8
9
10
..
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
# What is bitrhythm about ? ## Intro In Bitrhythm you get a coding playground to make music with webaudio, canvas and webgl apis. You can share the final track as a URL which enables interactive music with your listener. The url size limit acts as a contraint on creativity. Apart from the core html apis, you can also use the following libraries 1. Tuna 2. Timbral ................................................................................ You can use Bitrhythm for making music similar to the music possible with trackers like Buzz / Renoise / OpenMPT. I call this approach Hard Coding music. This is also known as executable music in the Demoscene. You can also use Bitrhythm for Live Coding and Algorithmic composition. ## ADC 2021 I presented Bitrhythm in ADC '21 and the ICLC '21 for other audio developers. [Slides ADC '21](https://xyzzyapps.link/ADC21.pdf) Video - TBD [Slides ICLC '21](https://xyzzyapps.link/ICLC21.pdf) [Video](https://www.youtube.com/watch?v=LDQ1PMqZowQ) ~ 20 minute mark ## Inspiration for the project I make [web apps](https://xyzzyapps.link) for a living. I started messing with algorithmic composition using pure data around 2011. In many ways Pure Data was my first DAW. Although nothing much came out of it musically, it transformed the way I view programming. The unix pipes concept is identical to the data flow model in pure data; albeit with more connections. For my music I moved onto Electribe, Renoise, Reaper and live looping with my guitar. I started exploring sonic pi in 2019 but TBH none of the live coding tools were doing what I wanted - basically tweaking /knob-twisting in techno so I started my work on this project. [This library](https://www.youtube.com/watch?v=adz1Gv5Lm34) in sonic pi comes close to what I am trying todo with this project. In bitrhythm time is divided into ticks like renoise tracker. |
Changes to source/what.md.
1
2
3
4
5
6
7
8
..
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
# What is bitrhythm about ? In Bitrhythm you get a coding playground to make music with webaudio, canvas and webgl apis. You can share the final track as a URL which enables interactive music with your listener. The url size limit acts as a contraint on creativity. Apart from the core html apis, you can also use the following libraries 1. Tuna 2. Timbral ................................................................................ You can use Bitrhythm for making music similar to the music possible with trackers like Buzz / Renoise / OpenMPT. I call this approach Hard Coding music. This is also known as executable music in the Demoscene. You can also use Bitrhythm for Live Coding and Algorithmic composition. ## ADC 2021 I presented Bitrhythm in ADC '21. [Slides](https://xyzzyapps.link/adc21) Video: TBD ## Inspiration for the project I make [web apps](https://xyzzyapps.link) for a living. I started messing with algorithmic composition using pure data around 2011. In many ways Pure Data was my first DAW. Although nothing much came out of it musically, it transformed the way I view programming. The unix pipes concept is identical to the data flow model in pure data; albeit with more connections. For my music I moved onto Electribe, Renoise, Reaper and live looping with my guitar. I started exploring sonic pi in 2019 but TBH none of the live coding tools were doing what I wanted - basically tweaking /knob-twisting in techno so I started my work on this project. [This library](https://www.youtube.com/watch?v=adz1Gv5Lm34) in sonic pi comes close to what I am trying todo with this project. In bitrhythm time is divided into ticks like renoise tracker. |
>
>
|
|
>
<
>
>
|
1
2
3
4
5
6
7
8
9
10
..
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
# What is bitrhythm about ? ## Intro In Bitrhythm you get a coding playground to make music with webaudio, canvas and webgl apis. You can share the final track as a URL which enables interactive music with your listener. The url size limit acts as a contraint on creativity. Apart from the core html apis, you can also use the following libraries 1. Tuna 2. Timbral ................................................................................ You can use Bitrhythm for making music similar to the music possible with trackers like Buzz / Renoise / OpenMPT. I call this approach Hard Coding music. This is also known as executable music in the Demoscene. You can also use Bitrhythm for Live Coding and Algorithmic composition. ## ADC 2021 I presented Bitrhythm in ADC '21 and the ICLC '21 for other audio developers. [Slides ADC '21](https://xyzzyapps.link/ADC21.pdf) Video - TBD [Slides ICLC '21](https://xyzzyapps.link/ICLC21.pdf) [Video](https://www.youtube.com/watch?v=LDQ1PMqZowQ) ~ 20 minute mark ## Inspiration for the project I make [web apps](https://xyzzyapps.link) for a living. I started messing with algorithmic composition using pure data around 2011. In many ways Pure Data was my first DAW. Although nothing much came out of it musically, it transformed the way I view programming. The unix pipes concept is identical to the data flow model in pure data; albeit with more connections. For my music I moved onto Electribe, Renoise, Reaper and live looping with my guitar. I started exploring sonic pi in 2019 but TBH none of the live coding tools were doing what I wanted - basically tweaking /knob-twisting in techno so I started my work on this project. [This library](https://www.youtube.com/watch?v=adz1Gv5Lm34) in sonic pi comes close to what I am trying todo with this project. In bitrhythm time is divided into ticks like renoise tracker. |
Changes to templates/index.html.
82
83
84
85
86
87
88
89
90
91
92
93
94
95
...
176
177
178
179
180
181
182
183
184
185
186
187
188
189
|
<script src="/misc.js"></script>
<style type="text/css">
body {
background: black;
color: white;
font-family: 'Roboto Mono', monospace;
}
a {
color: white;
}
input {
................................................................................
<div class="containera-full">
<hstack class="mb-2">
<h5 class="ml-4"><a href="/docs/index.html" target="_blank">docs</a></h5>
<h5 class="ml-4"><a href="/song/XQAAAAJwFAAAAAAAAABDKUqGU5vI8Eygv8VLc6H1NFIzdYQe5mT-79BTKosH6Xje2IYnNRgEOpeuhg9NTfIT-_uEg-npGX0y9CmzyyVpwgaOUrKNlF-pzVXf3YnQ2gSfpzY3zlYLujavQRq73hSEM-RaGxTxuud9nauG_VdXCmE_lvZ88XvUHOIGjOkCUKV-1ot3i9fx5NP-UsUmVpnjUDnq_9eUJfonx5B_oG4c3GvLitNREl_O9emU8CST0v5RVqHSudqZqsrortpDjdMlekhQ2y7ZlNcUDjGoTrH4vFMrLVI60wINoufS0iO6ourxizS1Ifv_iirkdP0U0Zp21rHHKXlwhWG0hmTCxYo8ZIf0Cmbiu22GiFFmRfIcuWbcq-_SWdyMJ0sWIslhKpGFEapN604eNblpy5im2PsItjWScu-cS0JI3zeHb8JMNzWflq0-XWHG5WLsmPqCbn3GgfR6BiAx1ApmTui84WXgX6SuJPkXRqHEOKpBZ4dKEPr5P_-DDpwz0L7i8X_FHE-LBMactDBoKgIbIoyVnRe6DJ9s5AZLJjUrWGGVCLcp5bEKOnH_3HfZuDq9UlOvZRVkz3BwpUeajLeUJcAYxDmU2JbNUaipMJN7LF9YAX2LaT44LACw2A7Is-pQ_EGznjhEo7SS7JusQPN6G43g4OUZSUY5WNlPUCWfXSeWNU0Xx_-b4r6t4HHQS2P2stIQOS96JqLzXrx-Q62Y8RSRIvieE76j_-dw4icTDiATfx8doLkSzXgOzNTcZYume2cHLEG-0TbgR1M6WCPiH4pvHIRfcTxEDZK5b7iqIhY0MNW8Kkyn7KFVqQf_5d_msiv57DWIHg6Qi6cmBdOF0Li_CY8kFBV4BWLsOlanN6_hehIREVU8WgWbM9rdrKcqzhHD8Fp5qTmbyiVnj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O18Fq2DVr9veHq2mRepiObWGsYcqjXkUNjaxoItg_pWdK6gyveVXjfs3PaJ477UbpiZBWxoc-Ebn8FZu6bZZ4gOZE-MoJHUDiQZgo3-lirXTvpcpsgsaIUESDAcGUNE4aIK6wIFGnEaEFYo4veQqTLeic4NhPtUpTdfRqdNTKOaVSUE_KGXKXaZl0Eni1DBmEGykml4uxHsWBEE44Ku34YIb6KZUcCu2DuXDiXcbabsWkA-czXWBtRnzWJ6ib4scny1o6CsVnugUjE9wv84bz2">chiptune</a></h5>
<h5 class="ml-4" ><a href="https://xyzzyapps.link/samples/" target="_blank">sample browser</a></h5>
</hstack>
<bitrhythm song="{{data}}"></bitrhythm>
</div>
<script>
|
>
>
>
>
>
|
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
...
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
|
<script src="/misc.js"></script> <style type="text/css"> body { background: black; color: white; font-family: 'Roboto Mono', monospace; overflow-x: hidden; } a { color: white; } input { ................................................................................ <div class="containera-full"> <hstack class="mb-2"> <h5 class="ml-4"><a href="/docs/index.html" target="_blank">docs</a></h5> <h5 class="ml-4"><a href="/song/XQAAAAJwFAAAAAAAAABDKUqGU5vI8Eygv8VLc6H1NFIzdYQe5mT-79BTKosH6Xje2IYnNRgEOpeuhg9NTfIT-_uEg-npGX0y9CmzyyVpwgaOUrKNlF-pzVXf3YnQ2gSfpzY3zlYLujavQRq73hSEM-RaGxTxuud9nauG_VdXCmE_lvZ88XvUHOIGjOkCUKV-1ot3i9fx5NP-UsUmVpnjUDnq_9eUJfonx5B_oG4c3GvLitNREl_O9emU8CST0v5RVqHSudqZqsrortpDjdMlekhQ2y7ZlNcUDjGoTrH4vFMrLVI60wINoufS0iO6ourxizS1Ifv_iirkdP0U0Zp21rHHKXlwhWG0hmTCxYo8ZIf0Cmbiu22GiFFmRfIcuWbcq-_SWdyMJ0sWIslhKpGFEapN604eNblpy5im2PsItjWScu-cS0JI3zeHb8JMNzWflq0-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AviYg3GSuSG7t2gXd_XkTTJ6EugOt2p0Y1_CG8vG94s7k3DVJFWeMHQMW_naSbFJs4zyFDr7X8rfU5nJ1KABNH_wkrR2cLRxCCq95kzE4gahZyfOTKtfp-un1TMFTmJ0PWdbS67hxFTOhRrCYKoKsg62R14OJ6R_NbmhFin8mjwhFBLQK-n8_BuFwYTrUSYBh3k_gF1ZP68_0Kyf2d7o190dK1N6m5Qk-KcNujqiIgfzy0NeRcALL1oW97T7P29fOpEELXwVxuBY89yGi5TO_R7DUXEiCmEBFAmOB4EJMigVW6UJwSMR05gOBaaov1HBEmADf4MVM54b8H1EVXAMzzwszVKBPplb6ZbEkad1JYuzF9Wc2l07vsMLAzymm3Y2gkjv9GZo9biCDSLbFpacBJfqJF3xvr_-98Bs5-fnveqXf3IbAEVXZ3X_2SjoXPmlg0m_9usiW95hbOMd7pxNKla8u8nOu8r9vkLqqKg_yBHdnTbHThqEgGRPmpcVB8x3P5DZ5sHAWg2k1mubUuuI9aycC-b1qMOPu5y8_bPvXK5uGpEpmoXqbRSlqMLxUrpRPIjOoTPjBc8BciARAkj1yXYWfJ5umO32LMrCaJSi3AO5v_K95FVKT3wnE4x3Ra1yU3CcuXKlFrWrUlWWXGHYS7tXc7YL7Ik5jvI8g3oJeS4LaFMc5WxyzzguEUaO-FxRzVU6kgN_9Yddrg">stochastic</a></h5> <h5 class="ml-4" ><a href="https://xyzzyapps.link/samples/" target="_blank">sample browser</a></h5> </hstack> <bitrhythm song="{{data}}"></bitrhythm> </div> <script> |