├── .gitignore ├── LICENSE ├── M4L.RhythmVAE └── M4L.RhythmVAE.maxproj ├── README.md ├── images ├── bg1.png ├── bg2.png ├── bg3.png ├── ui-background1.png ├── ui_memo.png ├── ui_screenshot_ise.png ├── vae_tex_210315_data.png └── youtube_video.png ├── package-lock.json ├── package.json ├── release ├── M4L.RhythmVAE.amxd └── models │ ├── house_techno_breakbeat_jungle_96.model │ ├── model.json │ └── weights.bin │ ├── model_2020128_15444.model │ ├── model.json │ └── weights.bin │ ├── model_2020128_155954.model │ ├── model.json │ └── weights.bin │ └── old_models │ ├── README.md │ └── model_electronic_dance_music.model │ ├── model.json │ └── weights.bin ├── rhythmvae.js ├── rhythmvae.maxpat ├── src ├── constants.js ├── data.js ├── utils.js └── vae.js └── subpatches ├── count_for_me.maxpat ├── list_dup.maxpat ├── makenote_for_me.maxpat ├── setup_1_16.maxpat └── shuffle_metro.maxpat /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # Runtime data 9 | pids 10 | *.pid 11 | *.seed 12 | *.pid.lock 13 | 14 | # Directory for instrumented libs generated by jscoverage/JSCover 15 | lib-cov 16 | 17 | # Coverage directory used by tools like istanbul 18 | coverage 19 | 20 | # nyc test coverage 21 | .nyc_output 22 | 23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 24 | .grunt 25 | 26 | # Bower dependency directory (https://bower.io/) 27 | bower_components 28 | 29 | # node-waf configuration 30 | .lock-wscript 31 | 32 | # Compiled binary addons (https://nodejs.org/api/addons.html) 33 | build/Release 34 | 35 | # Dependency directories 36 | node_modules/ 37 | jspm_packages/ 38 | 39 | # TypeScript v1 declaration files 40 | typings/ 41 | 42 | # Optional npm cache directory 43 | .npm 44 | 45 | # Optional eslint cache 46 | .eslintcache 47 | 48 | # Optional REPL history 49 | .node_repl_history 50 | 51 | # Output of 'npm pack' 52 | *.tgz 53 | 54 | # Yarn Integrity file 55 | .yarn-integrity 56 | 57 | # dotenv environment variables file 58 | .env 59 | 60 | # next.js build output 61 | .next 62 | .DS_Store 63 | test_data/** -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /M4L.RhythmVAE/M4L.RhythmVAE.maxproj: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "M4L.RhythmVAE", 3 | "version" : 1, 4 | "creationdate" : 3672837233, 5 | "modificationdate" : 3752437369, 6 | "viewrect" : [ 25.0, 104.0, 300.0, 500.0 ], 7 | "autoorganize" : 1, 8 | "hideprojectwindow" : 0, 9 | "showdependencies" : 1, 10 | "autolocalize" : 0, 11 | "contents" : { 12 | "patchers" : { 13 | "rhythmvae.maxpat" : { 14 | "kind" : "patcher", 15 | "local" : 1, 16 | "toplevel" : 1, 17 | "singleton" : { 18 | "bootpath" : "~/Documents/GitHub/RhythmVAE_M4L", 19 | "projectrelativepath" : ".." 20 | } 21 | 22 | } 23 | 24 | } 25 | , 26 | "media" : { 27 | "vae_tex_210315_data.png" : { 28 | "kind" : "imagefile", 29 | "local" : 1 30 | } 31 | 32 | } 33 | , 34 | "code" : { 35 | 36 | } 37 | 38 | } 39 | , 40 | "layout" : { 41 | 42 | } 43 | , 44 | "searchpath" : { 45 | "0" : { 46 | "bootpath" : "~/Documents/GitHub/RhythmVAE_M4L/node_modules", 47 | "projectrelativepath" : "../node_modules", 48 | "label" : "node_modules", 49 | "recursive" : 1, 50 | "enabled" : 1, 51 | "includeincollective" : 1 52 | } 53 | , 54 | "1" : { 55 | "bootpath" : "~/Documents/GitHub/RhythmVAE_M4L/src", 56 | "projectrelativepath" : "../src", 57 | "label" : "src", 58 | "recursive" : 1, 59 | "enabled" : 1, 60 | "includeincollective" : 1 61 | } 62 | , 63 | "2" : { 64 | "bootpath" : "~/Documents/GitHub/RhythmVAE_M4L/subpatches", 65 | "projectrelativepath" : "../subpatches", 66 | "label" : "subpatch", 67 | "recursive" : 1, 68 | "enabled" : 1, 69 | "includeincollective" : 1 70 | } 71 | , 72 | "3" : { 73 | "bootpath" : "~/Documents/GitHub/RhythmVAE_M4L/images", 74 | "projectrelativepath" : "../images", 75 | "label" : "", 76 | "recursive" : 1, 77 | "enabled" : 1, 78 | "includeincollective" : 1 79 | } 80 | 81 | } 82 | , 83 | "detailsvisible" : 1, 84 | "amxdtype" : 1835887981, 85 | "readonly" : 0, 86 | "devpathtype" : 0, 87 | "devpath" : ".", 88 | "sortmode" : 0, 89 | "viewmode" : 1, 90 | "includepackages" : 0 91 | } 92 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # M4L.RhythmVAE 2 | Max for Live(M4L) Rhythm generator using Variational Autoencoder(VAE) 3 | 4 | 5 | 6 | 7 | ## Help me!! 8 | 9 | I need your feedback! It takes a few minutes and it's anonymous. 10 | https://forms.gle/1HBhDV9k5pCKnPNE8 11 | 12 | 13 | ## How it works 14 | 15 | [![M4L.RhythmVAE - VAE Rhythm Generator for Max for Live/Ableton Live](./images/youtube_video.png)](https://www.youtube.com/watch?v=rH7mEumq9wQ "M4L.RhythmVAE - VAE Rhythm Generator for Max for Live/Ableton Live") 16 | 17 | If you want to quickly test the device, please use the one in `/release` directory. 18 | 19 | ![VAE Rhythm Generator in M4L(Max for Live) Device](./images/ui_memo.png) 20 | 21 | If you want to know the detail of the plugin, please refer to my [arxiv paper](https://arxiv.org/abs/2004.01525): 22 | 23 | ``` 24 | Towards democratizing music production with AI-Design of Variational Autoencoder-based Rhythm Generator as a DAW plugin 25 | Nao Tokui 26 | ``` 27 | 28 | 29 | ## Requirement 30 | - On Mac: **Ableton Live Suite for Mac 10.1.2** or later 31 | - On Windows: Ableton Live Suite for Windows 10.1.2 **and Standalone Max 8.1.2 or later** 32 | On Windows, you need to set the path of external standalone Max installation on the preference panel of Ableton Live. The device is not compatible with the internal Max runtime. 33 | 34 | ## Installation 35 | 36 | If you want to edit Max patches and export the device by yourself: 37 | 38 | - Open `M4L.RhythmVAE/M4L.RhythmVAE.maxproj`, then open `rhythmvae.maxpat` from the project. 39 | - When you open `rhythmvae.maxpat` for the first time, you need to press `script npm install` to install Node.js packages. 40 | - Every time you export the device, you have to set `Max for Live Device Type` to `MIDI` on Project Inspector (Apparently this is a bug of Max/MSP.) 41 | 42 | ## Pretrained model 43 | - You don't have enough training MIDI data? Don't worry! You can find a pretrained model trained with thausands of electronic dance music rhythm patterns in `/release/models`. 44 | 45 | ## Known problems 46 | - Incompatible with folders with names containing special characters such as `[]?*!|@` 47 | - Changes you make on the sequence grid view are not reflected the rhythm sequence. It is just a display! 48 | 49 | 50 | ## TO DO 51 | - better documentation 52 | - better UI design!! 53 | - add a feature to add random noise to `z` 54 | 55 | 56 | ## Updates 57 | - 2020.3 added | new plugin design by Naoki Ise 58 | - 2019.12.27 fxied| onset/velocity/offset training data used be shuffled independently. it makes no sense! 59 | - 2019.11.10 added| Time shift parameter / MIDI Mapping 60 | - 2019.10.19 fixed| beat sync issue 61 | - 2019.10.18 added| note on the requirement 62 | - 2019.9.14 added| functionality to save/load trained model 63 | - 2019.5.21 added| a pretrained model 64 | - 2019.3.11 added| Windows version! 65 | 66 | ## Music Examples 🎵 67 | Here is a track I made with rhythm patterns generated by this plugin: 68 | [https://soundcloud.com/naotokui/missions-demo](https://soundcloud.com/naotokui/missions-demo) 69 | 70 | 71 | ## MIDI Mapping 72 | 73 | This devices considers the following 9 drum types: 74 | 75 | | Drum Types | 76 | |:-----:| 77 | | Kick | 78 | | Snare | 79 | |Hi-hat closed | 80 | |Hi-hat open | 81 | |Tom low| 82 | |Tom mid| 83 | |Tom high| 84 | |Clap| 85 | |Rim| 86 | 87 | MIDI notes in a MIDI file will be classified into the 9 Drum Types based on [General MIDI (GM) Mapping](https://www.midi.org/specifications-old/item/gm-level-1-sound-set). We have two MIDI Mapping modes and you can select one of these mappings on the device: 88 | 89 | *Strict* 90 | 91 | | MIDI Note Number | Drum Type | GM Type | 92 | |:-----:|:-----:|:-----:| 93 | | 36 | Kick | Acoustic Bass Drum 94 | | 35 | Kick | Bass Drum 95 | | 38 | Snare | Acoustic Snare 96 | | 40 | Snare | Electric Snare 97 | | 42 | Hi-hat closed | Closed Hihat 98 | | 44 | Hi-hat open | Pedal Hihat 99 | | 46 | Hi-hat open | Open Hihat 100 | | 41 | Tom low | Low floor Tom 101 | | 45 | Tom low | Low Tom 102 | | 47 | Tom mid | Low-mid Tom 103 | | 48 | Tom mid | High-mid Tom 104 | | 43 | Tom high | High Floor Tom 105 | | 50 | Tom high | High Tom 106 | | 39 | Clap | hand clap 107 | | 51 | Rim | Ride Symbal 1 108 | | 52 | Rim | Chinese Symbal 109 | | 53 | Rim | Ride Bell 110 | | 59 | Rim | Ride Symbal 2 111 | 112 | 113 | *Greedy* 114 | 115 | | MIDI Note Number | Drum Type | 116 | |:-----:|:-----:| 117 | | 36| Kick | 118 | | 35| Kick | 119 | | 38| Snare | 120 | | 27| Snare | 121 | | 28| Snare | 122 | | 31| Snare | 123 | | 32| Snare | 124 | | 33| Snare | 125 | | 34 | Snare | 126 | | 37| Snare | 127 | | 39| Snare | 128 | | 40| Snare | 129 | | 56| Snare | 130 | | 65| Snare | 131 | | 66| Snare | 132 | | 75| Snare | 133 | | 85| Snare | 134 | | 42| Hi-hat closed | 135 | | 44| Hi-hat closed | 136 | | 54| Hi-hat closed | 137 | | 68| Hi-hat closed | 138 | | 69| Hi-hat closed | 139 | | 70| Hi-hat closed | 140 | | 71| Hi-hat closed | 141 | | 73| Hi-hat closed | 142 | | 78| Hi-hat closed | 143 | | 80| Hi-hat closed | 144 | | 46| Hi-hat open | 145 | | 67| Hi-hat open | 146 | | 72| Hi-hat open | 147 | | 74| Hi-hat open | 148 | | 79| Hi-hat open | 149 | | 81| Hi-hat open | 150 | | 45| Tom low | 151 | | 29| Tom low | 152 | | 41| Tom low | 153 | | 61| Tom low | 154 | | 64| Tom low | 155 | | 84| Tom low | 156 | | 48| Tom mid | 157 | | 47| Tom mid | 158 | | 60| Tom mid | 159 | | 63| Tom mid | 160 | | 77| Tom mid | 161 | | 86| Tom mid | 162 | | 87| Tom mid | 163 | | 50| Tom high | 164 | | 30| Tom high | 165 | | 43| Tom high | 166 | | 62| Tom high | 167 | | 76| Tom high | 168 | | 83| Tom high | 169 | | 49|Clap | 170 | | 55|Clap | 171 | | 57|Clap | 172 | | 58|Clap | 173 | | 51| Rim | 174 | | 52| Rim | 175 | | 53| Rim | 176 | | 59| Rim | 177 | | 82| Rim | 178 | 179 | (If you find these mappings are unnatual, please let me know. I'm not a drummer!) 180 | 181 | ## Design 182 | Title logo, Background Texture: [Naoki Ise](http://naokiise.com/) -------------------------------------------------------------------------------- /images/bg1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naotokui/RhythmVAE_M4L/571551efd4bd1e7ebdc9bcb8e238da6f83495aed/images/bg1.png -------------------------------------------------------------------------------- /images/bg2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naotokui/RhythmVAE_M4L/571551efd4bd1e7ebdc9bcb8e238da6f83495aed/images/bg2.png -------------------------------------------------------------------------------- /images/bg3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naotokui/RhythmVAE_M4L/571551efd4bd1e7ebdc9bcb8e238da6f83495aed/images/bg3.png -------------------------------------------------------------------------------- /images/ui-background1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naotokui/RhythmVAE_M4L/571551efd4bd1e7ebdc9bcb8e238da6f83495aed/images/ui-background1.png -------------------------------------------------------------------------------- /images/ui_memo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naotokui/RhythmVAE_M4L/571551efd4bd1e7ebdc9bcb8e238da6f83495aed/images/ui_memo.png -------------------------------------------------------------------------------- /images/ui_screenshot_ise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naotokui/RhythmVAE_M4L/571551efd4bd1e7ebdc9bcb8e238da6f83495aed/images/ui_screenshot_ise.png -------------------------------------------------------------------------------- /images/vae_tex_210315_data.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naotokui/RhythmVAE_M4L/571551efd4bd1e7ebdc9bcb8e238da6f83495aed/images/vae_tex_210315_data.png -------------------------------------------------------------------------------- /images/youtube_video.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naotokui/RhythmVAE_M4L/571551efd4bd1e7ebdc9bcb8e238da6f83495aed/images/youtube_video.png -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "RhythmVAE", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@tensorflow/tfjs": { 8 | "version": "1.7.4", 9 | "resolved": "https://registry.npmjs.org/@tensorflow/tfjs/-/tfjs-1.7.4.tgz", 10 | "integrity": "sha512-XWGwRQ/ECEoQacd74JY/dmbLdnMpwtq3H8tls45dQ+GJ553Advir1FDo/aQt0Yr6fTimQDeiOIG4Mcb5KduP/w==", 11 | "requires": { 12 | "@tensorflow/tfjs-converter": "1.7.4", 13 | "@tensorflow/tfjs-core": "1.7.4", 14 | "@tensorflow/tfjs-data": "1.7.4", 15 | "@tensorflow/tfjs-layers": "1.7.4" 16 | } 17 | }, 18 | "@tensorflow/tfjs-converter": { 19 | "version": "1.7.4", 20 | "resolved": "https://registry.npmjs.org/@tensorflow/tfjs-converter/-/tfjs-converter-1.7.4.tgz", 21 | "integrity": "sha512-B/Ux9I3osI0CXoESGR0Xe5C6BsEfC04+g2xn5zVaW9KEuVEnGEgnuBQxgijRFzkqTwoyLv4ptAmjyIghVARX0Q==" 22 | }, 23 | "@tensorflow/tfjs-core": { 24 | "version": "1.7.4", 25 | "resolved": "https://registry.npmjs.org/@tensorflow/tfjs-core/-/tfjs-core-1.7.4.tgz", 26 | "integrity": "sha512-3G4VKJ6nPs7iCt6gs3bjRj8chihKrYWenf63R0pm7D9MhlrVoX/tpN4LYVMGgBL7jHPxMLKdOkoAZJrn/J88HQ==", 27 | "requires": { 28 | "@types/offscreencanvas": "~2019.3.0", 29 | "@types/seedrandom": "2.4.27", 30 | "@types/webgl-ext": "0.0.30", 31 | "@types/webgl2": "0.0.4", 32 | "node-fetch": "~2.1.2", 33 | "seedrandom": "2.4.3" 34 | } 35 | }, 36 | "@tensorflow/tfjs-data": { 37 | "version": "1.7.4", 38 | "resolved": "https://registry.npmjs.org/@tensorflow/tfjs-data/-/tfjs-data-1.7.4.tgz", 39 | "integrity": "sha512-WFYG9wWjNDi62x6o3O20Q0XJxToCw2J4/fBEXiK/Gr0hIqVhl2oLQ1OjTWq7O08NUxM6BRzuG+ra3gWYdQUzOw==", 40 | "requires": { 41 | "@types/node-fetch": "^2.1.2", 42 | "node-fetch": "~2.1.2" 43 | } 44 | }, 45 | "@tensorflow/tfjs-layers": { 46 | "version": "1.7.4", 47 | "resolved": "https://registry.npmjs.org/@tensorflow/tfjs-layers/-/tfjs-layers-1.7.4.tgz", 48 | "integrity": "sha512-5/K8Z8RBfXsucL6EaSeb3/8jB/I8oPaaXkxwKVsBPQ+u6lB6LEtSKzeiFc57nDr5OMtVaUZV+pKDNEzP0RUQlg==" 49 | }, 50 | "@tensorflow/tfjs-node": { 51 | "version": "1.7.4", 52 | "resolved": "https://registry.npmjs.org/@tensorflow/tfjs-node/-/tfjs-node-1.7.4.tgz", 53 | "integrity": "sha512-xcK2NMJI2eOrvDBMrT5RjJSXZPK7B/SFvoSTS+ycpoiPAooeFsDuOcj4YzsgYlSBRyVl9qKHaNn3rWhrTWwG+Q==", 54 | "requires": { 55 | "@tensorflow/tfjs": "1.7.4", 56 | "@tensorflow/tfjs-core": "1.7.4", 57 | "adm-zip": "^0.4.11", 58 | "google-protobuf": "^3.9.2", 59 | "https-proxy-agent": "^2.2.1", 60 | "node-pre-gyp": "0.14.0", 61 | "progress": "^2.0.0", 62 | "rimraf": "^2.6.2", 63 | "tar": "^4.4.6" 64 | } 65 | }, 66 | "@tonejs/midi": { 67 | "version": "2.0.25", 68 | "resolved": "https://registry.npmjs.org/@tonejs/midi/-/midi-2.0.25.tgz", 69 | "integrity": "sha512-zT8pZy/upJCGqXHSCO1+U39wgWIaizDg+sv7nVReJehMcT86Peh+zo5kQ42Guwgc/gnv47n7fJhoTRGsJVaqJQ==", 70 | "requires": { 71 | "array-flatten": "^2.1.2", 72 | "midi-file": "^1.1.2" 73 | } 74 | }, 75 | "@types/node": { 76 | "version": "14.10.1", 77 | "resolved": "https://registry.npmjs.org/@types/node/-/node-14.10.1.tgz", 78 | "integrity": "sha512-aYNbO+FZ/3KGeQCEkNhHFRIzBOUgc7QvcVNKXbfnhDkSfwUv91JsQQa10rDgKSTSLkXZ1UIyPe4FJJNVgw1xWQ==" 79 | }, 80 | "@types/node-fetch": { 81 | "version": "2.5.7", 82 | "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.7.tgz", 83 | "integrity": "sha512-o2WVNf5UhWRkxlf6eq+jMZDu7kjgpgJfl4xVNlvryc95O/6F2ld8ztKX+qu+Rjyet93WAWm5LjeX9H5FGkODvw==", 84 | "requires": { 85 | "@types/node": "*", 86 | "form-data": "^3.0.0" 87 | } 88 | }, 89 | "@types/offscreencanvas": { 90 | "version": "2019.3.0", 91 | "resolved": "https://registry.npmjs.org/@types/offscreencanvas/-/offscreencanvas-2019.3.0.tgz", 92 | "integrity": "sha512-esIJx9bQg+QYF0ra8GnvfianIY8qWB0GBx54PK5Eps6m+xTj86KLavHv6qDhzKcu5UUOgNfJ2pWaIIV7TRUd9Q==" 93 | }, 94 | "@types/seedrandom": { 95 | "version": "2.4.27", 96 | "resolved": "https://registry.npmjs.org/@types/seedrandom/-/seedrandom-2.4.27.tgz", 97 | "integrity": "sha1-nbVjk33YaRX2kJK8QyWdL0hXjkE=" 98 | }, 99 | "@types/webgl-ext": { 100 | "version": "0.0.30", 101 | "resolved": "https://registry.npmjs.org/@types/webgl-ext/-/webgl-ext-0.0.30.tgz", 102 | "integrity": "sha512-LKVgNmBxN0BbljJrVUwkxwRYqzsAEPcZOe6S2T6ZaBDIrFp0qu4FNlpc5sM1tGbXUYFgdVQIoeLk1Y1UoblyEg==" 103 | }, 104 | "@types/webgl2": { 105 | "version": "0.0.4", 106 | "resolved": "https://registry.npmjs.org/@types/webgl2/-/webgl2-0.0.4.tgz", 107 | "integrity": "sha512-PACt1xdErJbMUOUweSrbVM7gSIYm1vTncW2hF6Os/EeWi6TXYAYMPp+8v6rzHmypE5gHrxaxZNXgMkJVIdZpHw==" 108 | }, 109 | "abbrev": { 110 | "version": "1.1.1", 111 | "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", 112 | "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" 113 | }, 114 | "adm-zip": { 115 | "version": "0.4.16", 116 | "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.16.tgz", 117 | "integrity": "sha512-TFi4HBKSGfIKsK5YCkKaaFG2m4PEDyViZmEwof3MTIgzimHLto6muaHVpbrljdIvIrFZzEq/p4nafOeLcYegrg==" 118 | }, 119 | "agent-base": { 120 | "version": "4.3.0", 121 | "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", 122 | "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", 123 | "requires": { 124 | "es6-promisify": "^5.0.0" 125 | } 126 | }, 127 | "ansi-regex": { 128 | "version": "2.1.1", 129 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", 130 | "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" 131 | }, 132 | "aproba": { 133 | "version": "1.2.0", 134 | "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", 135 | "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==" 136 | }, 137 | "are-we-there-yet": { 138 | "version": "1.1.5", 139 | "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", 140 | "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", 141 | "requires": { 142 | "delegates": "^1.0.0", 143 | "readable-stream": "^2.0.6" 144 | } 145 | }, 146 | "array-flatten": { 147 | "version": "2.1.2", 148 | "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-2.1.2.tgz", 149 | "integrity": "sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ==" 150 | }, 151 | "asynckit": { 152 | "version": "0.4.0", 153 | "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", 154 | "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" 155 | }, 156 | "balanced-match": { 157 | "version": "1.0.0", 158 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", 159 | "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" 160 | }, 161 | "brace-expansion": { 162 | "version": "1.1.11", 163 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 164 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 165 | "requires": { 166 | "balanced-match": "^1.0.0", 167 | "concat-map": "0.0.1" 168 | } 169 | }, 170 | "chownr": { 171 | "version": "1.1.4", 172 | "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", 173 | "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" 174 | }, 175 | "code-point-at": { 176 | "version": "1.1.0", 177 | "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", 178 | "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" 179 | }, 180 | "combined-stream": { 181 | "version": "1.0.8", 182 | "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", 183 | "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", 184 | "requires": { 185 | "delayed-stream": "~1.0.0" 186 | } 187 | }, 188 | "concat-map": { 189 | "version": "0.0.1", 190 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 191 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" 192 | }, 193 | "console-control-strings": { 194 | "version": "1.1.0", 195 | "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", 196 | "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" 197 | }, 198 | "core-util-is": { 199 | "version": "1.0.2", 200 | "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", 201 | "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" 202 | }, 203 | "cross-fetch": { 204 | "version": "3.1.5", 205 | "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.5.tgz", 206 | "integrity": "sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==", 207 | "requires": { 208 | "node-fetch": "2.6.7" 209 | }, 210 | "dependencies": { 211 | "node-fetch": { 212 | "version": "2.6.7", 213 | "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", 214 | "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", 215 | "requires": { 216 | "whatwg-url": "^5.0.0" 217 | } 218 | } 219 | } 220 | }, 221 | "debug": { 222 | "version": "3.2.6", 223 | "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", 224 | "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", 225 | "requires": { 226 | "ms": "^2.1.1" 227 | } 228 | }, 229 | "deep-extend": { 230 | "version": "0.6.0", 231 | "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", 232 | "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" 233 | }, 234 | "delayed-stream": { 235 | "version": "1.0.0", 236 | "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", 237 | "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" 238 | }, 239 | "delegates": { 240 | "version": "1.0.0", 241 | "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", 242 | "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=" 243 | }, 244 | "detect-libc": { 245 | "version": "1.0.3", 246 | "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", 247 | "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=" 248 | }, 249 | "es6-promise": { 250 | "version": "4.2.8", 251 | "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", 252 | "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==" 253 | }, 254 | "es6-promisify": { 255 | "version": "5.0.0", 256 | "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", 257 | "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", 258 | "requires": { 259 | "es6-promise": "^4.0.3" 260 | } 261 | }, 262 | "form-data": { 263 | "version": "3.0.0", 264 | "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.0.tgz", 265 | "integrity": "sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg==", 266 | "requires": { 267 | "asynckit": "^0.4.0", 268 | "combined-stream": "^1.0.8", 269 | "mime-types": "^2.1.12" 270 | } 271 | }, 272 | "fs-minipass": { 273 | "version": "1.2.7", 274 | "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz", 275 | "integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==", 276 | "requires": { 277 | "minipass": "^2.6.0" 278 | } 279 | }, 280 | "fs.realpath": { 281 | "version": "1.0.0", 282 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 283 | "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" 284 | }, 285 | "gauge": { 286 | "version": "2.7.4", 287 | "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", 288 | "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", 289 | "requires": { 290 | "aproba": "^1.0.3", 291 | "console-control-strings": "^1.0.0", 292 | "has-unicode": "^2.0.0", 293 | "object-assign": "^4.1.0", 294 | "signal-exit": "^3.0.0", 295 | "string-width": "^1.0.1", 296 | "strip-ansi": "^3.0.1", 297 | "wide-align": "^1.1.0" 298 | } 299 | }, 300 | "glob": { 301 | "version": "7.1.6", 302 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", 303 | "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", 304 | "requires": { 305 | "fs.realpath": "^1.0.0", 306 | "inflight": "^1.0.4", 307 | "inherits": "2", 308 | "minimatch": "^3.0.4", 309 | "once": "^1.3.0", 310 | "path-is-absolute": "^1.0.0" 311 | } 312 | }, 313 | "globalyzer": { 314 | "version": "0.1.4", 315 | "resolved": "https://registry.npmjs.org/globalyzer/-/globalyzer-0.1.4.tgz", 316 | "integrity": "sha512-LeguVWaxgHN0MNbWC6YljNMzHkrCny9fzjmEUdnF1kQ7wATFD1RHFRqA1qxaX2tgxGENlcxjOflopBwj3YZiXA==" 317 | }, 318 | "globrex": { 319 | "version": "0.1.2", 320 | "resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz", 321 | "integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==" 322 | }, 323 | "google-protobuf": { 324 | "version": "3.13.0", 325 | "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.13.0.tgz", 326 | "integrity": "sha512-ZIf3qfLFayVrPvAjeKKxO5FRF1/NwRxt6Dko+fWEMuHwHbZx8/fcaAao9b0wCM6kr8qeg2te8XTpyuvKuD9aKw==" 327 | }, 328 | "has-unicode": { 329 | "version": "2.0.1", 330 | "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", 331 | "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=" 332 | }, 333 | "https-proxy-agent": { 334 | "version": "2.2.4", 335 | "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz", 336 | "integrity": "sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==", 337 | "requires": { 338 | "agent-base": "^4.3.0", 339 | "debug": "^3.1.0" 340 | } 341 | }, 342 | "iconv-lite": { 343 | "version": "0.4.24", 344 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", 345 | "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", 346 | "requires": { 347 | "safer-buffer": ">= 2.1.2 < 3" 348 | } 349 | }, 350 | "ignore-walk": { 351 | "version": "3.0.3", 352 | "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.3.tgz", 353 | "integrity": "sha512-m7o6xuOaT1aqheYHKf8W6J5pYH85ZI9w077erOzLje3JsB1gkafkAhHHY19dqjulgIZHFm32Cp5uNZgcQqdJKw==", 354 | "requires": { 355 | "minimatch": "^3.0.4" 356 | } 357 | }, 358 | "inflight": { 359 | "version": "1.0.6", 360 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 361 | "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", 362 | "requires": { 363 | "once": "^1.3.0", 364 | "wrappy": "1" 365 | } 366 | }, 367 | "inherits": { 368 | "version": "2.0.4", 369 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 370 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" 371 | }, 372 | "ini": { 373 | "version": "1.3.7", 374 | "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.7.tgz", 375 | "integrity": "sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ==" 376 | }, 377 | "is-fullwidth-code-point": { 378 | "version": "1.0.0", 379 | "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", 380 | "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", 381 | "requires": { 382 | "number-is-nan": "^1.0.0" 383 | } 384 | }, 385 | "isarray": { 386 | "version": "1.0.0", 387 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", 388 | "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" 389 | }, 390 | "midi-file": { 391 | "version": "1.1.2", 392 | "resolved": "https://registry.npmjs.org/midi-file/-/midi-file-1.1.2.tgz", 393 | "integrity": "sha512-VQNzirfADDFXTymgPJv2VfLylCq14spRNFhpA6u7dLqPMbw1BqGf5u9B0k7z++8X1RMs57pyn+G4kzhyIatlyw==" 394 | }, 395 | "mime-db": { 396 | "version": "1.44.0", 397 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", 398 | "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==" 399 | }, 400 | "mime-types": { 401 | "version": "2.1.27", 402 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", 403 | "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", 404 | "requires": { 405 | "mime-db": "1.44.0" 406 | } 407 | }, 408 | "minimatch": { 409 | "version": "3.0.4", 410 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", 411 | "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", 412 | "requires": { 413 | "brace-expansion": "^1.1.7" 414 | } 415 | }, 416 | "minimist": { 417 | "version": "1.2.6", 418 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", 419 | "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" 420 | }, 421 | "minipass": { 422 | "version": "2.9.0", 423 | "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", 424 | "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", 425 | "requires": { 426 | "safe-buffer": "^5.1.2", 427 | "yallist": "^3.0.0" 428 | } 429 | }, 430 | "minizlib": { 431 | "version": "1.3.3", 432 | "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz", 433 | "integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==", 434 | "requires": { 435 | "minipass": "^2.9.0" 436 | } 437 | }, 438 | "mkdirp": { 439 | "version": "0.5.5", 440 | "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", 441 | "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", 442 | "requires": { 443 | "minimist": "^1.2.5" 444 | } 445 | }, 446 | "ms": { 447 | "version": "2.1.2", 448 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", 449 | "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" 450 | }, 451 | "needle": { 452 | "version": "2.5.2", 453 | "resolved": "https://registry.npmjs.org/needle/-/needle-2.5.2.tgz", 454 | "integrity": "sha512-LbRIwS9BfkPvNwNHlsA41Q29kL2L/6VaOJ0qisM5lLWsTV3nP15abO5ITL6L81zqFhzjRKDAYjpcBcwM0AVvLQ==", 455 | "requires": { 456 | "debug": "^3.2.6", 457 | "iconv-lite": "^0.4.4", 458 | "sax": "^1.2.4" 459 | } 460 | }, 461 | "node-fetch": { 462 | "version": "2.1.2", 463 | "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.1.2.tgz", 464 | "integrity": "sha1-q4hOjn5X44qUR1POxwb3iNF2i7U=" 465 | }, 466 | "node-pre-gyp": { 467 | "version": "0.14.0", 468 | "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.14.0.tgz", 469 | "integrity": "sha512-+CvDC7ZttU/sSt9rFjix/P05iS43qHCOOGzcr3Ry99bXG7VX953+vFyEuph/tfqoYu8dttBkE86JSKBO2OzcxA==", 470 | "requires": { 471 | "detect-libc": "^1.0.2", 472 | "mkdirp": "^0.5.1", 473 | "needle": "^2.2.1", 474 | "nopt": "^4.0.1", 475 | "npm-packlist": "^1.1.6", 476 | "npmlog": "^4.0.2", 477 | "rc": "^1.2.7", 478 | "rimraf": "^2.6.1", 479 | "semver": "^5.3.0", 480 | "tar": "^4.4.2" 481 | } 482 | }, 483 | "nopt": { 484 | "version": "4.0.3", 485 | "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", 486 | "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==", 487 | "requires": { 488 | "abbrev": "1", 489 | "osenv": "^0.1.4" 490 | } 491 | }, 492 | "npm-bundled": { 493 | "version": "1.1.1", 494 | "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.1.tgz", 495 | "integrity": "sha512-gqkfgGePhTpAEgUsGEgcq1rqPXA+tv/aVBlgEzfXwA1yiUJF7xtEt3CtVwOjNYQOVknDk0F20w58Fnm3EtG0fA==", 496 | "requires": { 497 | "npm-normalize-package-bin": "^1.0.1" 498 | } 499 | }, 500 | "npm-normalize-package-bin": { 501 | "version": "1.0.1", 502 | "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz", 503 | "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==" 504 | }, 505 | "npm-packlist": { 506 | "version": "1.4.8", 507 | "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.8.tgz", 508 | "integrity": "sha512-5+AZgwru5IevF5ZdnFglB5wNlHG1AOOuw28WhUq8/8emhBmLv6jX5by4WJCh7lW0uSYZYS6DXqIsyZVIXRZU9A==", 509 | "requires": { 510 | "ignore-walk": "^3.0.1", 511 | "npm-bundled": "^1.0.1", 512 | "npm-normalize-package-bin": "^1.0.1" 513 | } 514 | }, 515 | "npmlog": { 516 | "version": "4.1.2", 517 | "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", 518 | "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", 519 | "requires": { 520 | "are-we-there-yet": "~1.1.2", 521 | "console-control-strings": "~1.1.0", 522 | "gauge": "~2.7.3", 523 | "set-blocking": "~2.0.0" 524 | } 525 | }, 526 | "number-is-nan": { 527 | "version": "1.0.1", 528 | "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", 529 | "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" 530 | }, 531 | "object-assign": { 532 | "version": "4.1.1", 533 | "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", 534 | "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" 535 | }, 536 | "once": { 537 | "version": "1.4.0", 538 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 539 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", 540 | "requires": { 541 | "wrappy": "1" 542 | } 543 | }, 544 | "os-homedir": { 545 | "version": "1.0.2", 546 | "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", 547 | "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" 548 | }, 549 | "os-tmpdir": { 550 | "version": "1.0.2", 551 | "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", 552 | "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" 553 | }, 554 | "osenv": { 555 | "version": "0.1.5", 556 | "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", 557 | "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", 558 | "requires": { 559 | "os-homedir": "^1.0.0", 560 | "os-tmpdir": "^1.0.0" 561 | } 562 | }, 563 | "path-is-absolute": { 564 | "version": "1.0.1", 565 | "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", 566 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" 567 | }, 568 | "process-nextick-args": { 569 | "version": "2.0.1", 570 | "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", 571 | "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" 572 | }, 573 | "progress": { 574 | "version": "2.0.3", 575 | "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", 576 | "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==" 577 | }, 578 | "rc": { 579 | "version": "1.2.8", 580 | "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", 581 | "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", 582 | "requires": { 583 | "deep-extend": "^0.6.0", 584 | "ini": "~1.3.0", 585 | "minimist": "^1.2.0", 586 | "strip-json-comments": "~2.0.1" 587 | } 588 | }, 589 | "readable-stream": { 590 | "version": "2.3.7", 591 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", 592 | "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", 593 | "requires": { 594 | "core-util-is": "~1.0.0", 595 | "inherits": "~2.0.3", 596 | "isarray": "~1.0.0", 597 | "process-nextick-args": "~2.0.0", 598 | "safe-buffer": "~5.1.1", 599 | "string_decoder": "~1.1.1", 600 | "util-deprecate": "~1.0.1" 601 | } 602 | }, 603 | "rimraf": { 604 | "version": "2.7.1", 605 | "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", 606 | "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", 607 | "requires": { 608 | "glob": "^7.1.3" 609 | } 610 | }, 611 | "safe-buffer": { 612 | "version": "5.1.2", 613 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 614 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 615 | }, 616 | "safer-buffer": { 617 | "version": "2.1.2", 618 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 619 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" 620 | }, 621 | "sax": { 622 | "version": "1.2.4", 623 | "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", 624 | "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" 625 | }, 626 | "seedrandom": { 627 | "version": "2.4.3", 628 | "resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-2.4.3.tgz", 629 | "integrity": "sha1-JDhQTa0zkXMUv/GKxNeU8W1qrsw=" 630 | }, 631 | "semver": { 632 | "version": "5.7.1", 633 | "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", 634 | "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" 635 | }, 636 | "set-blocking": { 637 | "version": "2.0.0", 638 | "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", 639 | "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" 640 | }, 641 | "signal-exit": { 642 | "version": "3.0.3", 643 | "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", 644 | "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==" 645 | }, 646 | "string-width": { 647 | "version": "1.0.2", 648 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", 649 | "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", 650 | "requires": { 651 | "code-point-at": "^1.0.0", 652 | "is-fullwidth-code-point": "^1.0.0", 653 | "strip-ansi": "^3.0.0" 654 | } 655 | }, 656 | "string_decoder": { 657 | "version": "1.1.1", 658 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", 659 | "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", 660 | "requires": { 661 | "safe-buffer": "~5.1.0" 662 | } 663 | }, 664 | "strip-ansi": { 665 | "version": "3.0.1", 666 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", 667 | "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", 668 | "requires": { 669 | "ansi-regex": "^2.0.0" 670 | } 671 | }, 672 | "strip-json-comments": { 673 | "version": "2.0.1", 674 | "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", 675 | "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" 676 | }, 677 | "tar": { 678 | "version": "4.4.19", 679 | "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.19.tgz", 680 | "integrity": "sha512-a20gEsvHnWe0ygBY8JbxoM4w3SJdhc7ZAuxkLqh+nvNQN2IOt0B5lLgM490X5Hl8FF0dl0tOf2ewFYAlIFgzVA==", 681 | "requires": { 682 | "chownr": "^1.1.4", 683 | "fs-minipass": "^1.2.7", 684 | "minipass": "^2.9.0", 685 | "minizlib": "^1.3.3", 686 | "mkdirp": "^0.5.5", 687 | "safe-buffer": "^5.2.1", 688 | "yallist": "^3.1.1" 689 | }, 690 | "dependencies": { 691 | "safe-buffer": { 692 | "version": "5.2.1", 693 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", 694 | "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" 695 | } 696 | } 697 | }, 698 | "tiny-glob": { 699 | "version": "0.2.6", 700 | "resolved": "https://registry.npmjs.org/tiny-glob/-/tiny-glob-0.2.6.tgz", 701 | "integrity": "sha512-A7ewMqPu1B5PWwC3m7KVgAu96Ch5LA0w4SnEN/LbDREj/gAD0nPWboRbn8YoP9ISZXqeNAlMvKSKoEuhcfK3Pw==", 702 | "requires": { 703 | "globalyzer": "^0.1.0", 704 | "globrex": "^0.1.1" 705 | } 706 | }, 707 | "tr46": { 708 | "version": "0.0.3", 709 | "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", 710 | "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" 711 | }, 712 | "util-deprecate": { 713 | "version": "1.0.2", 714 | "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", 715 | "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" 716 | }, 717 | "webidl-conversions": { 718 | "version": "3.0.1", 719 | "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", 720 | "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" 721 | }, 722 | "whatwg-url": { 723 | "version": "5.0.0", 724 | "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", 725 | "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", 726 | "requires": { 727 | "tr46": "~0.0.3", 728 | "webidl-conversions": "^3.0.0" 729 | } 730 | }, 731 | "wide-align": { 732 | "version": "1.1.3", 733 | "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", 734 | "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", 735 | "requires": { 736 | "string-width": "^1.0.2 || 2" 737 | } 738 | }, 739 | "wrappy": { 740 | "version": "1.0.2", 741 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 742 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" 743 | }, 744 | "yallist": { 745 | "version": "3.1.1", 746 | "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", 747 | "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" 748 | } 749 | } 750 | } 751 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "RhythmVAE", 3 | "version": "1.0.0", 4 | "main": "rhythmvae.js", 5 | "scripts": { 6 | "test": "echo \"Error: no test specified\" && exit 1" 7 | }, 8 | "keywords": [], 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "@tensorflow/tfjs-node": "^1.7.4", 13 | "@tonejs/midi": "^2.0.25", 14 | "cross-fetch": "^3.1.5", 15 | "glob": "^7.1.6", 16 | "tiny-glob": "^0.2.6" 17 | }, 18 | "description": "Max for Live(M4L) Rhythm generator using Variational Autoencoder(VAE)", 19 | "devDependencies": {}, 20 | "repository": { 21 | "type": "git", 22 | "url": "git+https://github.com/naotokui/RhythmVAE_M4L.git" 23 | }, 24 | "bugs": { 25 | "url": "https://github.com/naotokui/RhythmVAE_M4L/issues" 26 | }, 27 | "homepage": "https://github.com/naotokui/RhythmVAE_M4L#readme" 28 | } 29 | -------------------------------------------------------------------------------- /release/M4L.RhythmVAE.amxd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naotokui/RhythmVAE_M4L/571551efd4bd1e7ebdc9bcb8e238da6f83495aed/release/M4L.RhythmVAE.amxd -------------------------------------------------------------------------------- /release/models/house_techno_breakbeat_jungle_96.model/model.json: -------------------------------------------------------------------------------- 1 | {"modelTopology":{"class_name":"Model","config":{"name":"decoder","layers":[{"name":"input4","class_name":"InputLayer","config":{"batch_input_shape":[null,2],"dtype":"float32","sparse":false,"name":"input4"},"inbound_nodes":[]},{"name":"dense_Dense7","class_name":"Dense","config":{"units":1024,"activation":"linear","use_bias":true,"kernel_initializer":{"class_name":"VarianceScaling","config":{"scale":1,"mode":"fan_avg","distribution":"normal","seed":null}},"bias_initializer":{"class_name":"Zeros","config":{}},"kernel_regularizer":null,"bias_regularizer":null,"activity_regularizer":null,"kernel_constraint":null,"bias_constraint":null,"name":"dense_Dense7","trainable":true},"inbound_nodes":[[["input4",0,0,{}]]]},{"name":"batch_normalization_BatchNormalization5","class_name":"BatchNormalization","config":{"axis":1,"momentum":0.99,"epsilon":0.001,"center":true,"scale":true,"beta_initializer":{"class_name":"Zeros","config":{}},"gamma_initializer":{"class_name":"Ones","config":{}},"moving_mean_initializer":{"class_name":"Zeros","config":{}},"moving_variance_initializer":{"class_name":"Ones","config":{}},"beta_regularizer":null,"gamma_regularizer":null,"beta_constraint":null,"gamma_constraint":null,"name":"batch_normalization_BatchNormalization5","trainable":true},"inbound_nodes":[[["dense_Dense7",0,0,{}]]]},{"name":"leaky_re_lu_LeakyReLU5","class_name":"LeakyReLU","config":{"alpha":0.3,"name":"leaky_re_lu_LeakyReLU5","trainable":true},"inbound_nodes":[[["batch_normalization_BatchNormalization5",0,0,{}]]]},{"name":"dense_Dense8","class_name":"Dense","config":{"units":512,"activation":"linear","use_bias":true,"kernel_initializer":{"class_name":"VarianceScaling","config":{"scale":1,"mode":"fan_avg","distribution":"normal","seed":null}},"bias_initializer":{"class_name":"Zeros","config":{}},"kernel_regularizer":null,"bias_regularizer":null,"activity_regularizer":null,"kernel_constraint":null,"bias_constraint":null,"name":"dense_Dense8","trainable":true},"inbound_nodes":[[["leaky_re_lu_LeakyReLU5",0,0,{}]]]},{"name":"dense_Dense10","class_name":"Dense","config":{"units":512,"activation":"linear","use_bias":true,"kernel_initializer":{"class_name":"VarianceScaling","config":{"scale":1,"mode":"fan_avg","distribution":"normal","seed":null}},"bias_initializer":{"class_name":"Zeros","config":{}},"kernel_regularizer":null,"bias_regularizer":null,"activity_regularizer":null,"kernel_constraint":null,"bias_constraint":null,"name":"dense_Dense10","trainable":true},"inbound_nodes":[[["leaky_re_lu_LeakyReLU5",0,0,{}]]]},{"name":"dense_Dense12","class_name":"Dense","config":{"units":512,"activation":"linear","use_bias":true,"kernel_initializer":{"class_name":"VarianceScaling","config":{"scale":1,"mode":"fan_avg","distribution":"normal","seed":null}},"bias_initializer":{"class_name":"Zeros","config":{}},"kernel_regularizer":null,"bias_regularizer":null,"activity_regularizer":null,"kernel_constraint":null,"bias_constraint":null,"name":"dense_Dense12","trainable":true},"inbound_nodes":[[["leaky_re_lu_LeakyReLU5",0,0,{}]]]},{"name":"batch_normalization_BatchNormalization6","class_name":"BatchNormalization","config":{"axis":1,"momentum":0.99,"epsilon":0.001,"center":true,"scale":true,"beta_initializer":{"class_name":"Zeros","config":{}},"gamma_initializer":{"class_name":"Ones","config":{}},"moving_mean_initializer":{"class_name":"Zeros","config":{}},"moving_variance_initializer":{"class_name":"Ones","config":{}},"beta_regularizer":null,"gamma_regularizer":null,"beta_constraint":null,"gamma_constraint":null,"name":"batch_normalization_BatchNormalization6","trainable":true},"inbound_nodes":[[["dense_Dense8",0,0,{}]]]},{"name":"batch_normalization_BatchNormalization7","class_name":"BatchNormalization","config":{"axis":1,"momentum":0.99,"epsilon":0.001,"center":true,"scale":true,"beta_initializer":{"class_name":"Zeros","config":{}},"gamma_initializer":{"class_name":"Ones","config":{}},"moving_mean_initializer":{"class_name":"Zeros","config":{}},"moving_variance_initializer":{"class_name":"Ones","config":{}},"beta_regularizer":null,"gamma_regularizer":null,"beta_constraint":null,"gamma_constraint":null,"name":"batch_normalization_BatchNormalization7","trainable":true},"inbound_nodes":[[["dense_Dense10",0,0,{}]]]},{"name":"batch_normalization_BatchNormalization8","class_name":"BatchNormalization","config":{"axis":1,"momentum":0.99,"epsilon":0.001,"center":true,"scale":true,"beta_initializer":{"class_name":"Zeros","config":{}},"gamma_initializer":{"class_name":"Ones","config":{}},"moving_mean_initializer":{"class_name":"Zeros","config":{}},"moving_variance_initializer":{"class_name":"Ones","config":{}},"beta_regularizer":null,"gamma_regularizer":null,"beta_constraint":null,"gamma_constraint":null,"name":"batch_normalization_BatchNormalization8","trainable":true},"inbound_nodes":[[["dense_Dense12",0,0,{}]]]},{"name":"leaky_re_lu_LeakyReLU6","class_name":"LeakyReLU","config":{"alpha":0.3,"name":"leaky_re_lu_LeakyReLU6","trainable":true},"inbound_nodes":[[["batch_normalization_BatchNormalization6",0,0,{}]]]},{"name":"leaky_re_lu_LeakyReLU7","class_name":"LeakyReLU","config":{"alpha":0.3,"name":"leaky_re_lu_LeakyReLU7","trainable":true},"inbound_nodes":[[["batch_normalization_BatchNormalization7",0,0,{}]]]},{"name":"leaky_re_lu_LeakyReLU8","class_name":"LeakyReLU","config":{"alpha":0.3,"name":"leaky_re_lu_LeakyReLU8","trainable":true},"inbound_nodes":[[["batch_normalization_BatchNormalization8",0,0,{}]]]},{"name":"dense_Dense9","class_name":"Dense","config":{"units":864,"activation":"sigmoid","use_bias":true,"kernel_initializer":{"class_name":"VarianceScaling","config":{"scale":1,"mode":"fan_avg","distribution":"normal","seed":null}},"bias_initializer":{"class_name":"Zeros","config":{}},"kernel_regularizer":null,"bias_regularizer":null,"activity_regularizer":null,"kernel_constraint":null,"bias_constraint":null,"name":"dense_Dense9","trainable":true},"inbound_nodes":[[["leaky_re_lu_LeakyReLU6",0,0,{}]]]},{"name":"dense_Dense11","class_name":"Dense","config":{"units":864,"activation":"sigmoid","use_bias":true,"kernel_initializer":{"class_name":"VarianceScaling","config":{"scale":1,"mode":"fan_avg","distribution":"normal","seed":null}},"bias_initializer":{"class_name":"Zeros","config":{}},"kernel_regularizer":null,"bias_regularizer":null,"activity_regularizer":null,"kernel_constraint":null,"bias_constraint":null,"name":"dense_Dense11","trainable":true},"inbound_nodes":[[["leaky_re_lu_LeakyReLU7",0,0,{}]]]},{"name":"dense_Dense13","class_name":"Dense","config":{"units":864,"activation":"tanh","use_bias":true,"kernel_initializer":{"class_name":"VarianceScaling","config":{"scale":1,"mode":"fan_avg","distribution":"normal","seed":null}},"bias_initializer":{"class_name":"Zeros","config":{}},"kernel_regularizer":null,"bias_regularizer":null,"activity_regularizer":null,"kernel_constraint":null,"bias_constraint":null,"name":"dense_Dense13","trainable":true},"inbound_nodes":[[["leaky_re_lu_LeakyReLU8",0,0,{}]]]}],"input_layers":[["input4",0,0]],"output_layers":[["dense_Dense9",0,0],["dense_Dense11",0,0],["dense_Dense13",0,0]]},"keras_version":"tfjs-layers 1.7.4","backend":"tensor_flow.js"},"weightsManifest":[{"paths":["weights.bin"],"weights":[{"name":"dense_Dense7/kernel","shape":[2,1024],"dtype":"float32"},{"name":"dense_Dense7/bias","shape":[1024],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization5/gamma","shape":[1024],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization5/beta","shape":[1024],"dtype":"float32"},{"name":"dense_Dense8/kernel","shape":[1024,512],"dtype":"float32"},{"name":"dense_Dense8/bias","shape":[512],"dtype":"float32"},{"name":"dense_Dense10/kernel","shape":[1024,512],"dtype":"float32"},{"name":"dense_Dense10/bias","shape":[512],"dtype":"float32"},{"name":"dense_Dense12/kernel","shape":[1024,512],"dtype":"float32"},{"name":"dense_Dense12/bias","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization6/gamma","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization6/beta","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization7/gamma","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization7/beta","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization8/gamma","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization8/beta","shape":[512],"dtype":"float32"},{"name":"dense_Dense9/kernel","shape":[512,864],"dtype":"float32"},{"name":"dense_Dense9/bias","shape":[864],"dtype":"float32"},{"name":"dense_Dense11/kernel","shape":[512,864],"dtype":"float32"},{"name":"dense_Dense11/bias","shape":[864],"dtype":"float32"},{"name":"dense_Dense13/kernel","shape":[512,864],"dtype":"float32"},{"name":"dense_Dense13/bias","shape":[864],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization5/moving_mean","shape":[1024],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization5/moving_variance","shape":[1024],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization6/moving_mean","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization6/moving_variance","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization7/moving_mean","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization7/moving_variance","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization8/moving_mean","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization8/moving_variance","shape":[512],"dtype":"float32"}]}],"format":"layers-model","generatedBy":"TensorFlow.js tfjs-layers v1.7.4","convertedBy":null} -------------------------------------------------------------------------------- /release/models/house_techno_breakbeat_jungle_96.model/weights.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naotokui/RhythmVAE_M4L/571551efd4bd1e7ebdc9bcb8e238da6f83495aed/release/models/house_techno_breakbeat_jungle_96.model/weights.bin -------------------------------------------------------------------------------- /release/models/model_2020128_15444.model/model.json: -------------------------------------------------------------------------------- 1 | {"modelTopology":{"class_name":"Model","config":{"name":"decoder","layers":[{"name":"input4","class_name":"InputLayer","config":{"batch_input_shape":[null,2],"dtype":"float32","sparse":false,"name":"input4"},"inbound_nodes":[]},{"name":"dense_Dense7","class_name":"Dense","config":{"units":512,"activation":"linear","use_bias":true,"kernel_initializer":{"class_name":"VarianceScaling","config":{"scale":1,"mode":"fan_avg","distribution":"normal","seed":null}},"bias_initializer":{"class_name":"Zeros","config":{}},"kernel_regularizer":null,"bias_regularizer":null,"activity_regularizer":null,"kernel_constraint":null,"bias_constraint":null,"name":"dense_Dense7","trainable":true},"inbound_nodes":[[["input4",0,0,{}]]]},{"name":"batch_normalization_BatchNormalization5","class_name":"BatchNormalization","config":{"axis":1,"momentum":0.99,"epsilon":0.001,"center":true,"scale":true,"beta_initializer":{"class_name":"Zeros","config":{}},"gamma_initializer":{"class_name":"Ones","config":{}},"moving_mean_initializer":{"class_name":"Zeros","config":{}},"moving_variance_initializer":{"class_name":"Ones","config":{}},"beta_regularizer":null,"gamma_regularizer":null,"beta_constraint":null,"gamma_constraint":null,"name":"batch_normalization_BatchNormalization5","trainable":true},"inbound_nodes":[[["dense_Dense7",0,0,{}]]]},{"name":"leaky_re_lu_LeakyReLU5","class_name":"LeakyReLU","config":{"alpha":0.3,"name":"leaky_re_lu_LeakyReLU5","trainable":true},"inbound_nodes":[[["batch_normalization_BatchNormalization5",0,0,{}]]]},{"name":"dense_Dense8","class_name":"Dense","config":{"units":512,"activation":"linear","use_bias":true,"kernel_initializer":{"class_name":"VarianceScaling","config":{"scale":1,"mode":"fan_avg","distribution":"normal","seed":null}},"bias_initializer":{"class_name":"Zeros","config":{}},"kernel_regularizer":null,"bias_regularizer":null,"activity_regularizer":null,"kernel_constraint":null,"bias_constraint":null,"name":"dense_Dense8","trainable":true},"inbound_nodes":[[["leaky_re_lu_LeakyReLU5",0,0,{}]]]},{"name":"dense_Dense10","class_name":"Dense","config":{"units":512,"activation":"linear","use_bias":true,"kernel_initializer":{"class_name":"VarianceScaling","config":{"scale":1,"mode":"fan_avg","distribution":"normal","seed":null}},"bias_initializer":{"class_name":"Zeros","config":{}},"kernel_regularizer":null,"bias_regularizer":null,"activity_regularizer":null,"kernel_constraint":null,"bias_constraint":null,"name":"dense_Dense10","trainable":true},"inbound_nodes":[[["leaky_re_lu_LeakyReLU5",0,0,{}]]]},{"name":"dense_Dense12","class_name":"Dense","config":{"units":512,"activation":"linear","use_bias":true,"kernel_initializer":{"class_name":"VarianceScaling","config":{"scale":1,"mode":"fan_avg","distribution":"normal","seed":null}},"bias_initializer":{"class_name":"Zeros","config":{}},"kernel_regularizer":null,"bias_regularizer":null,"activity_regularizer":null,"kernel_constraint":null,"bias_constraint":null,"name":"dense_Dense12","trainable":true},"inbound_nodes":[[["leaky_re_lu_LeakyReLU5",0,0,{}]]]},{"name":"batch_normalization_BatchNormalization6","class_name":"BatchNormalization","config":{"axis":1,"momentum":0.99,"epsilon":0.001,"center":true,"scale":true,"beta_initializer":{"class_name":"Zeros","config":{}},"gamma_initializer":{"class_name":"Ones","config":{}},"moving_mean_initializer":{"class_name":"Zeros","config":{}},"moving_variance_initializer":{"class_name":"Ones","config":{}},"beta_regularizer":null,"gamma_regularizer":null,"beta_constraint":null,"gamma_constraint":null,"name":"batch_normalization_BatchNormalization6","trainable":true},"inbound_nodes":[[["dense_Dense8",0,0,{}]]]},{"name":"batch_normalization_BatchNormalization7","class_name":"BatchNormalization","config":{"axis":1,"momentum":0.99,"epsilon":0.001,"center":true,"scale":true,"beta_initializer":{"class_name":"Zeros","config":{}},"gamma_initializer":{"class_name":"Ones","config":{}},"moving_mean_initializer":{"class_name":"Zeros","config":{}},"moving_variance_initializer":{"class_name":"Ones","config":{}},"beta_regularizer":null,"gamma_regularizer":null,"beta_constraint":null,"gamma_constraint":null,"name":"batch_normalization_BatchNormalization7","trainable":true},"inbound_nodes":[[["dense_Dense10",0,0,{}]]]},{"name":"batch_normalization_BatchNormalization8","class_name":"BatchNormalization","config":{"axis":1,"momentum":0.99,"epsilon":0.001,"center":true,"scale":true,"beta_initializer":{"class_name":"Zeros","config":{}},"gamma_initializer":{"class_name":"Ones","config":{}},"moving_mean_initializer":{"class_name":"Zeros","config":{}},"moving_variance_initializer":{"class_name":"Ones","config":{}},"beta_regularizer":null,"gamma_regularizer":null,"beta_constraint":null,"gamma_constraint":null,"name":"batch_normalization_BatchNormalization8","trainable":true},"inbound_nodes":[[["dense_Dense12",0,0,{}]]]},{"name":"leaky_re_lu_LeakyReLU6","class_name":"LeakyReLU","config":{"alpha":0.3,"name":"leaky_re_lu_LeakyReLU6","trainable":true},"inbound_nodes":[[["batch_normalization_BatchNormalization6",0,0,{}]]]},{"name":"leaky_re_lu_LeakyReLU7","class_name":"LeakyReLU","config":{"alpha":0.3,"name":"leaky_re_lu_LeakyReLU7","trainable":true},"inbound_nodes":[[["batch_normalization_BatchNormalization7",0,0,{}]]]},{"name":"leaky_re_lu_LeakyReLU8","class_name":"LeakyReLU","config":{"alpha":0.3,"name":"leaky_re_lu_LeakyReLU8","trainable":true},"inbound_nodes":[[["batch_normalization_BatchNormalization8",0,0,{}]]]},{"name":"dense_Dense9","class_name":"Dense","config":{"units":864,"activation":"sigmoid","use_bias":true,"kernel_initializer":{"class_name":"VarianceScaling","config":{"scale":1,"mode":"fan_avg","distribution":"normal","seed":null}},"bias_initializer":{"class_name":"Zeros","config":{}},"kernel_regularizer":null,"bias_regularizer":null,"activity_regularizer":null,"kernel_constraint":null,"bias_constraint":null,"name":"dense_Dense9","trainable":true},"inbound_nodes":[[["leaky_re_lu_LeakyReLU6",0,0,{}]]]},{"name":"dense_Dense11","class_name":"Dense","config":{"units":864,"activation":"sigmoid","use_bias":true,"kernel_initializer":{"class_name":"VarianceScaling","config":{"scale":1,"mode":"fan_avg","distribution":"normal","seed":null}},"bias_initializer":{"class_name":"Zeros","config":{}},"kernel_regularizer":null,"bias_regularizer":null,"activity_regularizer":null,"kernel_constraint":null,"bias_constraint":null,"name":"dense_Dense11","trainable":true},"inbound_nodes":[[["leaky_re_lu_LeakyReLU7",0,0,{}]]]},{"name":"dense_Dense13","class_name":"Dense","config":{"units":864,"activation":"tanh","use_bias":true,"kernel_initializer":{"class_name":"VarianceScaling","config":{"scale":1,"mode":"fan_avg","distribution":"normal","seed":null}},"bias_initializer":{"class_name":"Zeros","config":{}},"kernel_regularizer":null,"bias_regularizer":null,"activity_regularizer":null,"kernel_constraint":null,"bias_constraint":null,"name":"dense_Dense13","trainable":true},"inbound_nodes":[[["leaky_re_lu_LeakyReLU8",0,0,{}]]]}],"input_layers":[["input4",0,0]],"output_layers":[["dense_Dense9",0,0],["dense_Dense11",0,0],["dense_Dense13",0,0]]},"keras_version":"tfjs-layers 1.7.4","backend":"tensor_flow.js"},"weightsManifest":[{"paths":["weights.bin"],"weights":[{"name":"dense_Dense7/kernel","shape":[2,512],"dtype":"float32"},{"name":"dense_Dense7/bias","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization5/gamma","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization5/beta","shape":[512],"dtype":"float32"},{"name":"dense_Dense8/kernel","shape":[512,512],"dtype":"float32"},{"name":"dense_Dense8/bias","shape":[512],"dtype":"float32"},{"name":"dense_Dense10/kernel","shape":[512,512],"dtype":"float32"},{"name":"dense_Dense10/bias","shape":[512],"dtype":"float32"},{"name":"dense_Dense12/kernel","shape":[512,512],"dtype":"float32"},{"name":"dense_Dense12/bias","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization6/gamma","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization6/beta","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization7/gamma","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization7/beta","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization8/gamma","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization8/beta","shape":[512],"dtype":"float32"},{"name":"dense_Dense9/kernel","shape":[512,864],"dtype":"float32"},{"name":"dense_Dense9/bias","shape":[864],"dtype":"float32"},{"name":"dense_Dense11/kernel","shape":[512,864],"dtype":"float32"},{"name":"dense_Dense11/bias","shape":[864],"dtype":"float32"},{"name":"dense_Dense13/kernel","shape":[512,864],"dtype":"float32"},{"name":"dense_Dense13/bias","shape":[864],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization5/moving_mean","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization5/moving_variance","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization6/moving_mean","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization6/moving_variance","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization7/moving_mean","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization7/moving_variance","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization8/moving_mean","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization8/moving_variance","shape":[512],"dtype":"float32"}]}],"format":"layers-model","generatedBy":"TensorFlow.js tfjs-layers v1.7.4","convertedBy":null} -------------------------------------------------------------------------------- /release/models/model_2020128_15444.model/weights.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naotokui/RhythmVAE_M4L/571551efd4bd1e7ebdc9bcb8e238da6f83495aed/release/models/model_2020128_15444.model/weights.bin -------------------------------------------------------------------------------- /release/models/model_2020128_155954.model/model.json: -------------------------------------------------------------------------------- 1 | {"modelTopology":{"class_name":"Model","config":{"name":"decoder","layers":[{"name":"input8","class_name":"InputLayer","config":{"batch_input_shape":[null,2],"dtype":"float32","sparse":false,"name":"input8"},"inbound_nodes":[]},{"name":"dense_Dense20","class_name":"Dense","config":{"units":512,"activation":"linear","use_bias":true,"kernel_initializer":{"class_name":"VarianceScaling","config":{"scale":1,"mode":"fan_avg","distribution":"normal","seed":null}},"bias_initializer":{"class_name":"Zeros","config":{}},"kernel_regularizer":null,"bias_regularizer":null,"activity_regularizer":null,"kernel_constraint":null,"bias_constraint":null,"name":"dense_Dense20","trainable":true},"inbound_nodes":[[["input8",0,0,{}]]]},{"name":"batch_normalization_BatchNormalization13","class_name":"BatchNormalization","config":{"axis":1,"momentum":0.99,"epsilon":0.001,"center":true,"scale":true,"beta_initializer":{"class_name":"Zeros","config":{}},"gamma_initializer":{"class_name":"Ones","config":{}},"moving_mean_initializer":{"class_name":"Zeros","config":{}},"moving_variance_initializer":{"class_name":"Ones","config":{}},"beta_regularizer":null,"gamma_regularizer":null,"beta_constraint":null,"gamma_constraint":null,"name":"batch_normalization_BatchNormalization13","trainable":true},"inbound_nodes":[[["dense_Dense20",0,0,{}]]]},{"name":"leaky_re_lu_LeakyReLU13","class_name":"LeakyReLU","config":{"alpha":0.3,"name":"leaky_re_lu_LeakyReLU13","trainable":true},"inbound_nodes":[[["batch_normalization_BatchNormalization13",0,0,{}]]]},{"name":"dense_Dense21","class_name":"Dense","config":{"units":512,"activation":"linear","use_bias":true,"kernel_initializer":{"class_name":"VarianceScaling","config":{"scale":1,"mode":"fan_avg","distribution":"normal","seed":null}},"bias_initializer":{"class_name":"Zeros","config":{}},"kernel_regularizer":null,"bias_regularizer":null,"activity_regularizer":null,"kernel_constraint":null,"bias_constraint":null,"name":"dense_Dense21","trainable":true},"inbound_nodes":[[["leaky_re_lu_LeakyReLU13",0,0,{}]]]},{"name":"dense_Dense23","class_name":"Dense","config":{"units":512,"activation":"linear","use_bias":true,"kernel_initializer":{"class_name":"VarianceScaling","config":{"scale":1,"mode":"fan_avg","distribution":"normal","seed":null}},"bias_initializer":{"class_name":"Zeros","config":{}},"kernel_regularizer":null,"bias_regularizer":null,"activity_regularizer":null,"kernel_constraint":null,"bias_constraint":null,"name":"dense_Dense23","trainable":true},"inbound_nodes":[[["leaky_re_lu_LeakyReLU13",0,0,{}]]]},{"name":"dense_Dense25","class_name":"Dense","config":{"units":512,"activation":"linear","use_bias":true,"kernel_initializer":{"class_name":"VarianceScaling","config":{"scale":1,"mode":"fan_avg","distribution":"normal","seed":null}},"bias_initializer":{"class_name":"Zeros","config":{}},"kernel_regularizer":null,"bias_regularizer":null,"activity_regularizer":null,"kernel_constraint":null,"bias_constraint":null,"name":"dense_Dense25","trainable":true},"inbound_nodes":[[["leaky_re_lu_LeakyReLU13",0,0,{}]]]},{"name":"batch_normalization_BatchNormalization14","class_name":"BatchNormalization","config":{"axis":1,"momentum":0.99,"epsilon":0.001,"center":true,"scale":true,"beta_initializer":{"class_name":"Zeros","config":{}},"gamma_initializer":{"class_name":"Ones","config":{}},"moving_mean_initializer":{"class_name":"Zeros","config":{}},"moving_variance_initializer":{"class_name":"Ones","config":{}},"beta_regularizer":null,"gamma_regularizer":null,"beta_constraint":null,"gamma_constraint":null,"name":"batch_normalization_BatchNormalization14","trainable":true},"inbound_nodes":[[["dense_Dense21",0,0,{}]]]},{"name":"batch_normalization_BatchNormalization15","class_name":"BatchNormalization","config":{"axis":1,"momentum":0.99,"epsilon":0.001,"center":true,"scale":true,"beta_initializer":{"class_name":"Zeros","config":{}},"gamma_initializer":{"class_name":"Ones","config":{}},"moving_mean_initializer":{"class_name":"Zeros","config":{}},"moving_variance_initializer":{"class_name":"Ones","config":{}},"beta_regularizer":null,"gamma_regularizer":null,"beta_constraint":null,"gamma_constraint":null,"name":"batch_normalization_BatchNormalization15","trainable":true},"inbound_nodes":[[["dense_Dense23",0,0,{}]]]},{"name":"batch_normalization_BatchNormalization16","class_name":"BatchNormalization","config":{"axis":1,"momentum":0.99,"epsilon":0.001,"center":true,"scale":true,"beta_initializer":{"class_name":"Zeros","config":{}},"gamma_initializer":{"class_name":"Ones","config":{}},"moving_mean_initializer":{"class_name":"Zeros","config":{}},"moving_variance_initializer":{"class_name":"Ones","config":{}},"beta_regularizer":null,"gamma_regularizer":null,"beta_constraint":null,"gamma_constraint":null,"name":"batch_normalization_BatchNormalization16","trainable":true},"inbound_nodes":[[["dense_Dense25",0,0,{}]]]},{"name":"leaky_re_lu_LeakyReLU14","class_name":"LeakyReLU","config":{"alpha":0.3,"name":"leaky_re_lu_LeakyReLU14","trainable":true},"inbound_nodes":[[["batch_normalization_BatchNormalization14",0,0,{}]]]},{"name":"leaky_re_lu_LeakyReLU15","class_name":"LeakyReLU","config":{"alpha":0.3,"name":"leaky_re_lu_LeakyReLU15","trainable":true},"inbound_nodes":[[["batch_normalization_BatchNormalization15",0,0,{}]]]},{"name":"leaky_re_lu_LeakyReLU16","class_name":"LeakyReLU","config":{"alpha":0.3,"name":"leaky_re_lu_LeakyReLU16","trainable":true},"inbound_nodes":[[["batch_normalization_BatchNormalization16",0,0,{}]]]},{"name":"dense_Dense22","class_name":"Dense","config":{"units":864,"activation":"sigmoid","use_bias":true,"kernel_initializer":{"class_name":"VarianceScaling","config":{"scale":1,"mode":"fan_avg","distribution":"normal","seed":null}},"bias_initializer":{"class_name":"Zeros","config":{}},"kernel_regularizer":null,"bias_regularizer":null,"activity_regularizer":null,"kernel_constraint":null,"bias_constraint":null,"name":"dense_Dense22","trainable":true},"inbound_nodes":[[["leaky_re_lu_LeakyReLU14",0,0,{}]]]},{"name":"dense_Dense24","class_name":"Dense","config":{"units":864,"activation":"sigmoid","use_bias":true,"kernel_initializer":{"class_name":"VarianceScaling","config":{"scale":1,"mode":"fan_avg","distribution":"normal","seed":null}},"bias_initializer":{"class_name":"Zeros","config":{}},"kernel_regularizer":null,"bias_regularizer":null,"activity_regularizer":null,"kernel_constraint":null,"bias_constraint":null,"name":"dense_Dense24","trainable":true},"inbound_nodes":[[["leaky_re_lu_LeakyReLU15",0,0,{}]]]},{"name":"dense_Dense26","class_name":"Dense","config":{"units":864,"activation":"tanh","use_bias":true,"kernel_initializer":{"class_name":"VarianceScaling","config":{"scale":1,"mode":"fan_avg","distribution":"normal","seed":null}},"bias_initializer":{"class_name":"Zeros","config":{}},"kernel_regularizer":null,"bias_regularizer":null,"activity_regularizer":null,"kernel_constraint":null,"bias_constraint":null,"name":"dense_Dense26","trainable":true},"inbound_nodes":[[["leaky_re_lu_LeakyReLU16",0,0,{}]]]}],"input_layers":[["input8",0,0]],"output_layers":[["dense_Dense22",0,0],["dense_Dense24",0,0],["dense_Dense26",0,0]]},"keras_version":"tfjs-layers 1.7.4","backend":"tensor_flow.js"},"weightsManifest":[{"paths":["weights.bin"],"weights":[{"name":"dense_Dense20/kernel","shape":[2,512],"dtype":"float32"},{"name":"dense_Dense20/bias","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization13/gamma","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization13/beta","shape":[512],"dtype":"float32"},{"name":"dense_Dense21/kernel","shape":[512,512],"dtype":"float32"},{"name":"dense_Dense21/bias","shape":[512],"dtype":"float32"},{"name":"dense_Dense23/kernel","shape":[512,512],"dtype":"float32"},{"name":"dense_Dense23/bias","shape":[512],"dtype":"float32"},{"name":"dense_Dense25/kernel","shape":[512,512],"dtype":"float32"},{"name":"dense_Dense25/bias","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization14/gamma","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization14/beta","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization15/gamma","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization15/beta","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization16/gamma","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization16/beta","shape":[512],"dtype":"float32"},{"name":"dense_Dense22/kernel","shape":[512,864],"dtype":"float32"},{"name":"dense_Dense22/bias","shape":[864],"dtype":"float32"},{"name":"dense_Dense24/kernel","shape":[512,864],"dtype":"float32"},{"name":"dense_Dense24/bias","shape":[864],"dtype":"float32"},{"name":"dense_Dense26/kernel","shape":[512,864],"dtype":"float32"},{"name":"dense_Dense26/bias","shape":[864],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization13/moving_mean","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization13/moving_variance","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization14/moving_mean","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization14/moving_variance","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization15/moving_mean","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization15/moving_variance","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization16/moving_mean","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization16/moving_variance","shape":[512],"dtype":"float32"}]}],"format":"layers-model","generatedBy":"TensorFlow.js tfjs-layers v1.7.4","convertedBy":null} -------------------------------------------------------------------------------- /release/models/model_2020128_155954.model/weights.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naotokui/RhythmVAE_M4L/571551efd4bd1e7ebdc9bcb8e238da6f83495aed/release/models/model_2020128_155954.model/weights.bin -------------------------------------------------------------------------------- /release/models/old_models/README.md: -------------------------------------------------------------------------------- 1 | This folder contains models for old device with the 48x9 grid 2 | -------------------------------------------------------------------------------- /release/models/old_models/model_electronic_dance_music.model/model.json: -------------------------------------------------------------------------------- 1 | {"modelTopology":{"class_name":"Model","config":{"name":"decoder","layers":[{"name":"input24","class_name":"InputLayer","config":{"batch_input_shape":[null,2],"dtype":"float32","sparse":false,"name":"input24"},"inbound_nodes":[]},{"name":"dense_Dense72","class_name":"Dense","config":{"units":512,"activation":"linear","use_bias":true,"kernel_initializer":{"class_name":"VarianceScaling","config":{"scale":1,"mode":"fan_avg","distribution":"normal","seed":null}},"bias_initializer":{"class_name":"Zeros","config":{}},"kernel_regularizer":null,"bias_regularizer":null,"activity_regularizer":null,"kernel_constraint":null,"bias_constraint":null,"name":"dense_Dense72","trainable":true},"inbound_nodes":[[["input24",0,0,{}]]]},{"name":"batch_normalization_BatchNormalization45","class_name":"BatchNormalization","config":{"axis":1,"momentum":0.99,"epsilon":0.001,"center":true,"scale":true,"beta_initializer":{"class_name":"Zeros","config":{}},"gamma_initializer":{"class_name":"Ones","config":{}},"moving_mean_initializer":{"class_name":"Zeros","config":{}},"moving_variance_initializer":{"class_name":"Ones","config":{}},"beta_regularizer":null,"gamma_regularizer":null,"beta_constraint":null,"gamma_constraint":null,"name":"batch_normalization_BatchNormalization45","trainable":true},"inbound_nodes":[[["dense_Dense72",0,0,{}]]]},{"name":"leaky_re_lu_LeakyReLU45","class_name":"LeakyReLU","config":{"alpha":0.3,"name":"leaky_re_lu_LeakyReLU45","trainable":true},"inbound_nodes":[[["batch_normalization_BatchNormalization45",0,0,{}]]]},{"name":"dense_Dense73","class_name":"Dense","config":{"units":512,"activation":"linear","use_bias":true,"kernel_initializer":{"class_name":"VarianceScaling","config":{"scale":1,"mode":"fan_avg","distribution":"normal","seed":null}},"bias_initializer":{"class_name":"Zeros","config":{}},"kernel_regularizer":null,"bias_regularizer":null,"activity_regularizer":null,"kernel_constraint":null,"bias_constraint":null,"name":"dense_Dense73","trainable":true},"inbound_nodes":[[["leaky_re_lu_LeakyReLU45",0,0,{}]]]},{"name":"dense_Dense75","class_name":"Dense","config":{"units":512,"activation":"linear","use_bias":true,"kernel_initializer":{"class_name":"VarianceScaling","config":{"scale":1,"mode":"fan_avg","distribution":"normal","seed":null}},"bias_initializer":{"class_name":"Zeros","config":{}},"kernel_regularizer":null,"bias_regularizer":null,"activity_regularizer":null,"kernel_constraint":null,"bias_constraint":null,"name":"dense_Dense75","trainable":true},"inbound_nodes":[[["leaky_re_lu_LeakyReLU45",0,0,{}]]]},{"name":"dense_Dense77","class_name":"Dense","config":{"units":512,"activation":"linear","use_bias":true,"kernel_initializer":{"class_name":"VarianceScaling","config":{"scale":1,"mode":"fan_avg","distribution":"normal","seed":null}},"bias_initializer":{"class_name":"Zeros","config":{}},"kernel_regularizer":null,"bias_regularizer":null,"activity_regularizer":null,"kernel_constraint":null,"bias_constraint":null,"name":"dense_Dense77","trainable":true},"inbound_nodes":[[["leaky_re_lu_LeakyReLU45",0,0,{}]]]},{"name":"batch_normalization_BatchNormalization46","class_name":"BatchNormalization","config":{"axis":1,"momentum":0.99,"epsilon":0.001,"center":true,"scale":true,"beta_initializer":{"class_name":"Zeros","config":{}},"gamma_initializer":{"class_name":"Ones","config":{}},"moving_mean_initializer":{"class_name":"Zeros","config":{}},"moving_variance_initializer":{"class_name":"Ones","config":{}},"beta_regularizer":null,"gamma_regularizer":null,"beta_constraint":null,"gamma_constraint":null,"name":"batch_normalization_BatchNormalization46","trainable":true},"inbound_nodes":[[["dense_Dense73",0,0,{}]]]},{"name":"batch_normalization_BatchNormalization47","class_name":"BatchNormalization","config":{"axis":1,"momentum":0.99,"epsilon":0.001,"center":true,"scale":true,"beta_initializer":{"class_name":"Zeros","config":{}},"gamma_initializer":{"class_name":"Ones","config":{}},"moving_mean_initializer":{"class_name":"Zeros","config":{}},"moving_variance_initializer":{"class_name":"Ones","config":{}},"beta_regularizer":null,"gamma_regularizer":null,"beta_constraint":null,"gamma_constraint":null,"name":"batch_normalization_BatchNormalization47","trainable":true},"inbound_nodes":[[["dense_Dense75",0,0,{}]]]},{"name":"batch_normalization_BatchNormalization48","class_name":"BatchNormalization","config":{"axis":1,"momentum":0.99,"epsilon":0.001,"center":true,"scale":true,"beta_initializer":{"class_name":"Zeros","config":{}},"gamma_initializer":{"class_name":"Ones","config":{}},"moving_mean_initializer":{"class_name":"Zeros","config":{}},"moving_variance_initializer":{"class_name":"Ones","config":{}},"beta_regularizer":null,"gamma_regularizer":null,"beta_constraint":null,"gamma_constraint":null,"name":"batch_normalization_BatchNormalization48","trainable":true},"inbound_nodes":[[["dense_Dense77",0,0,{}]]]},{"name":"leaky_re_lu_LeakyReLU46","class_name":"LeakyReLU","config":{"alpha":0.3,"name":"leaky_re_lu_LeakyReLU46","trainable":true},"inbound_nodes":[[["batch_normalization_BatchNormalization46",0,0,{}]]]},{"name":"leaky_re_lu_LeakyReLU47","class_name":"LeakyReLU","config":{"alpha":0.3,"name":"leaky_re_lu_LeakyReLU47","trainable":true},"inbound_nodes":[[["batch_normalization_BatchNormalization47",0,0,{}]]]},{"name":"leaky_re_lu_LeakyReLU48","class_name":"LeakyReLU","config":{"alpha":0.3,"name":"leaky_re_lu_LeakyReLU48","trainable":true},"inbound_nodes":[[["batch_normalization_BatchNormalization48",0,0,{}]]]},{"name":"dense_Dense74","class_name":"Dense","config":{"units":288,"activation":"sigmoid","use_bias":true,"kernel_initializer":{"class_name":"VarianceScaling","config":{"scale":1,"mode":"fan_avg","distribution":"normal","seed":null}},"bias_initializer":{"class_name":"Zeros","config":{}},"kernel_regularizer":null,"bias_regularizer":null,"activity_regularizer":null,"kernel_constraint":null,"bias_constraint":null,"name":"dense_Dense74","trainable":true},"inbound_nodes":[[["leaky_re_lu_LeakyReLU46",0,0,{}]]]},{"name":"dense_Dense76","class_name":"Dense","config":{"units":288,"activation":"sigmoid","use_bias":true,"kernel_initializer":{"class_name":"VarianceScaling","config":{"scale":1,"mode":"fan_avg","distribution":"normal","seed":null}},"bias_initializer":{"class_name":"Zeros","config":{}},"kernel_regularizer":null,"bias_regularizer":null,"activity_regularizer":null,"kernel_constraint":null,"bias_constraint":null,"name":"dense_Dense76","trainable":true},"inbound_nodes":[[["leaky_re_lu_LeakyReLU47",0,0,{}]]]},{"name":"dense_Dense78","class_name":"Dense","config":{"units":288,"activation":"tanh","use_bias":true,"kernel_initializer":{"class_name":"VarianceScaling","config":{"scale":1,"mode":"fan_avg","distribution":"normal","seed":null}},"bias_initializer":{"class_name":"Zeros","config":{}},"kernel_regularizer":null,"bias_regularizer":null,"activity_regularizer":null,"kernel_constraint":null,"bias_constraint":null,"name":"dense_Dense78","trainable":true},"inbound_nodes":[[["leaky_re_lu_LeakyReLU48",0,0,{}]]]}],"input_layers":[["input24",0,0]],"output_layers":[["dense_Dense74",0,0],["dense_Dense76",0,0],["dense_Dense78",0,0]]},"keras_version":"tfjs-layers 1.5.2","backend":"tensor_flow.js"},"weightsManifest":[{"paths":["weights.bin"],"weights":[{"name":"dense_Dense72/kernel","shape":[2,512],"dtype":"float32"},{"name":"dense_Dense72/bias","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization45/gamma","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization45/beta","shape":[512],"dtype":"float32"},{"name":"dense_Dense73/kernel","shape":[512,512],"dtype":"float32"},{"name":"dense_Dense73/bias","shape":[512],"dtype":"float32"},{"name":"dense_Dense75/kernel","shape":[512,512],"dtype":"float32"},{"name":"dense_Dense75/bias","shape":[512],"dtype":"float32"},{"name":"dense_Dense77/kernel","shape":[512,512],"dtype":"float32"},{"name":"dense_Dense77/bias","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization46/gamma","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization46/beta","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization47/gamma","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization47/beta","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization48/gamma","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization48/beta","shape":[512],"dtype":"float32"},{"name":"dense_Dense74/kernel","shape":[512,288],"dtype":"float32"},{"name":"dense_Dense74/bias","shape":[288],"dtype":"float32"},{"name":"dense_Dense76/kernel","shape":[512,288],"dtype":"float32"},{"name":"dense_Dense76/bias","shape":[288],"dtype":"float32"},{"name":"dense_Dense78/kernel","shape":[512,288],"dtype":"float32"},{"name":"dense_Dense78/bias","shape":[288],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization45/moving_mean","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization45/moving_variance","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization46/moving_mean","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization46/moving_variance","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization47/moving_mean","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization47/moving_variance","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization48/moving_mean","shape":[512],"dtype":"float32"},{"name":"batch_normalization_BatchNormalization48/moving_variance","shape":[512],"dtype":"float32"}]}],"format":"layers-model","generatedBy":"TensorFlow.js tfjs-layers v1.5.2","convertedBy":null} -------------------------------------------------------------------------------- /release/models/old_models/model_electronic_dance_music.model/weights.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naotokui/RhythmVAE_M4L/571551efd4bd1e7ebdc9bcb8e238da6f83495aed/release/models/old_models/model_electronic_dance_music.model/weights.bin -------------------------------------------------------------------------------- /rhythmvae.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const Max = require('max-api'); 3 | const fs = require('fs') 4 | const glob = require('glob'); 5 | const tf = require('@tensorflow/tfjs-node'); 6 | const { Midi } = require('@tonejs/midi'); // https://github.com/Tonejs/Midi 7 | 8 | // Constants 9 | const MIDI_DRUM_MAP = require('./src/constants.js').MIDI_DRUM_MAP; 10 | const MIDI_DRUM_MAP_STRICT = require('./src/constants.js').MIDI_DRUM_MAP_STRICT; 11 | const DRUM_CLASSES = require('./src/constants.js').DRUM_CLASSES; 12 | const NUM_DRUM_CLASSES = require('.//src/constants.js').NUM_DRUM_CLASSES; 13 | const LOOP_DURATION = require('.//src/constants.js').LOOP_DURATION; 14 | const MIN_ONSETS_THRESHOLD = require('./src/constants.js').MIN_ONSETS_THRESHOLD; 15 | const BEAT_RESOLUTION = require('./src/constants.js').BEAT_RESOLUTION; 16 | 17 | // VAE model and Utilities 18 | const utils = require('./src/utils.js'); 19 | const vae = require('./src/vae.js'); 20 | 21 | // This will be printed directly to the Max console 22 | Max.post(`Loaded the ${path.basename(__filename)} script`); 23 | 24 | // Global varibles 25 | var train_data_onsets = []; 26 | var train_data_velocities = []; 27 | var train_data_timeshifts = []; 28 | var isGenerating = false; 29 | 30 | function isValidMIDIFile(midiFile){ 31 | if (midiFile.header.tempos.length > 1){ 32 | utils.error("not compatible with midi files containing multiple tempo changes") 33 | return false; 34 | } 35 | return true; 36 | } 37 | 38 | function getTempo(midiFile){ 39 | if (midiFile.header.tempos.length == 0) return 120.0 // no tempo info, then use 120.0 40 | return midiFile.header.tempos[0].bpm; // use the first tempo info and ignore tempo changes in MIDI file 41 | } 42 | 43 | // Get location of a note in pianoroll 44 | function getNoteIndexAndTimeshift(note, tempo){ 45 | const unit = (60.0 / tempo) / BEAT_RESOLUTION; // the duration of 16th note 46 | const half_unit = unit * 0.5; 47 | 48 | const index = Math.max(0, Math.floor((note.time + half_unit) / unit)) // centering 49 | const timeshift = (note.time - unit * index)/half_unit; // normalized 50 | 51 | return [index, timeshift]; 52 | } 53 | 54 | function getNumOfDrumOnsets(onsets){ 55 | var count = 0; 56 | for (var i = 0; i < NUM_DRUM_CLASSES; i++){ 57 | for (var j=0; j < LOOP_DURATION; j++){ 58 | if (onsets[i][j] > 0) count += 1; 59 | } 60 | } 61 | return count; 62 | } 63 | 64 | 65 | 66 | // Convert midi into pianoroll matrix 67 | function processPianoroll(midiFile, midi_map){ 68 | const tempo = getTempo(midiFile); 69 | 70 | // data array 71 | var onsets = []; 72 | var velocities = []; 73 | var timeshifts = []; 74 | 75 | midiFile.tracks.forEach(track => { 76 | 77 | //notes are an array 78 | const notes = track.notes 79 | notes.forEach(note => { 80 | if ((note.midi in midi_map)){ 81 | let timing = getNoteIndexAndTimeshift(note, tempo); 82 | let index = timing[0]; 83 | let timeshift = timing[1]; 84 | 85 | // add new array 86 | while (Math.floor(index / LOOP_DURATION) >= onsets.length){ 87 | onsets.push(utils.create2DArray(NUM_DRUM_CLASSES, LOOP_DURATION)); 88 | velocities.push(utils.create2DArray(NUM_DRUM_CLASSES, LOOP_DURATION)); 89 | timeshifts.push(utils.create2DArray(NUM_DRUM_CLASSES, LOOP_DURATION)); 90 | } 91 | 92 | // store velocity 93 | let drum_id = midi_map[note.midi]; 94 | 95 | let matrix = onsets[Math.floor(index / LOOP_DURATION)]; 96 | matrix[drum_id][index % LOOP_DURATION] = 1; // 1 for onsets 97 | 98 | matrix = velocities[Math.floor(index / LOOP_DURATION)]; 99 | matrix[drum_id][index % LOOP_DURATION] = note.velocity; // normalized 0 - 1 100 | 101 | // store timeshift 102 | matrix = timeshifts[Math.floor(index / LOOP_DURATION)]; 103 | matrix[drum_id][index % LOOP_DURATION] = timeshift; // normalized -1 - 1 104 | } 105 | }) 106 | }) 107 | 108 | /* for debug - output pianoroll */ 109 | // if (velocities.length > 0){ 110 | // var index = utils.getRandomInt(velocities.length); 111 | // let x = velocities[index]; 112 | // for (var i=0; i< NUM_DRUM_CLASSES; i++){ 113 | // for (var j=0; j < LOOP_DURATION; j++){ 114 | // Max.outlet("matrix_output", j, i, Math.ceil(x[i][j])); 115 | // } 116 | // } 117 | // } 118 | 119 | // 2D array to tf.tensor2d 120 | for (var i=0; i < onsets.length; i++){ 121 | if (getNumOfDrumOnsets(onsets[i]) > MIN_ONSETS_THRESHOLD){ 122 | train_data_onsets.push(tf.tensor2d(onsets[i], [NUM_DRUM_CLASSES, LOOP_DURATION])); 123 | train_data_velocities.push(tf.tensor2d(velocities[i], [NUM_DRUM_CLASSES, LOOP_DURATION])); 124 | train_data_timeshifts.push(tf.tensor2d(timeshifts[i], [NUM_DRUM_CLASSES, LOOP_DURATION])); 125 | } 126 | } 127 | } 128 | 129 | function processMidiFile(filename, mapping = 0){ 130 | // // Read MIDI file into a buffer 131 | var input = fs.readFileSync(filename) 132 | 133 | var midiFile = new Midi(input); 134 | if (isValidMIDIFile(midiFile) == false){ 135 | utils.error("Invalid MIDI file: " + filename); 136 | return false; 137 | } 138 | 139 | var tempo = getTempo(midiFile); 140 | // console.log("tempo:", tempo); 141 | // console.log("signature:", midiFile.header.timeSignatures); 142 | 143 | // select mapping 144 | if (mapping == 0) midi_map = MIDI_DRUM_MAP_STRICT; 145 | else midi_map = MIDI_DRUM_MAP; 146 | 147 | processPianoroll(midiFile, midi_map); 148 | // console.log("processed:", filename); 149 | return true; 150 | } 151 | 152 | // Add training data 153 | Max.addHandler("midi", (filename, mapping) => { 154 | var count = 0; 155 | // is directory? 156 | if (fs.existsSync(filename) && fs.lstatSync(filename).isDirectory()){ 157 | // iterate over *.mid or *.midi files 158 | glob(filename + '**/*.@(mid|midi)', {}, (err, files)=>{ 159 | utils.post("# of files in dir: " + files.length); 160 | if (err) utils.error(err); 161 | else { 162 | for (var idx in files){ 163 | try { 164 | if (processMidiFile(files[idx], mapping)) count += 1; 165 | } catch(error) { 166 | console.error("failed to process " + files[idx] + " - " + error); 167 | } 168 | } 169 | utils.post("# of midi files added: " + count); 170 | reportNumberOfBars(); 171 | } 172 | }) 173 | } else { 174 | if (processMidiFile(filename, mapping)) count += 1; 175 | Max.post("# of midi files added: " + count); 176 | reportNumberOfBars(); 177 | } 178 | }); 179 | 180 | // Start training! 181 | Max.addHandler("train", ()=>{ 182 | if (vae.isTraining()){ 183 | utils.error_status("Failed to start training. There is already an ongoing training process."); 184 | return; 185 | } 186 | 187 | if (train_data_onsets.length == 0){ 188 | utils.error_status("No training data provided."); 189 | return; 190 | } 191 | 192 | // Start training 193 | utils.log_status("Start training..."); 194 | console.log("# of bars in training data:", train_data_onsets.length * 2); 195 | reportNumberOfBars(); 196 | vae.loadAndTrain(train_data_onsets, train_data_velocities, train_data_timeshifts); 197 | }); 198 | 199 | // Generate a rhythm pattern 200 | Max.addHandler("generate", (z1, z2, threshold, noise_range = 0.0)=>{ 201 | try { 202 | generatePattern(z1, z2, threshold, noise_range); 203 | } catch(error) { 204 | utils.error_status(error); 205 | } 206 | }); 207 | 208 | async function generatePattern(z1, z2, threshold, noise_range){ 209 | if (vae.isReadyToGenerate()){ 210 | if (isGenerating) return; 211 | 212 | isGenerating = true; 213 | let [onsets, velocities, timeshifts] = vae.generatePattern(z1, z2, noise_range); 214 | Max.outlet("matrix_clear", 1); // clear all 215 | for (var i=0; i< NUM_DRUM_CLASSES; i++){ 216 | var sequence = []; // for velocity 217 | var sequenceTS = []; // for timeshift 218 | // output for matrix view 219 | for (var j=0; j < LOOP_DURATION; j++){ 220 | // if (pattern[i * LOOP_DURATION + j] > 0.2) x = 1; 221 | if (onsets[i][j] > threshold){ 222 | Max.outlet("matrix_output", j + 1, i + 1, 1); // index for live.grid starts from 1 223 | 224 | // for live.step 225 | sequence.push(Math.floor(velocities[i][j]*127. + 1)); // 0-1 -> 1-127 226 | sequenceTS.push(Math.floor(utils.scale(timeshifts[i][j], -1., 1, 0, 127))); // -1 - 1 -> 0 - 127 227 | } else { 228 | sequence.push(0); 229 | sequenceTS.push(64); 230 | } 231 | } 232 | 233 | // output for live.step object 234 | Max.outlet("seq_output", i+1, sequence.join(" ")); 235 | Max.outlet("timeshift_output", i+1, sequenceTS.join(" ")); 236 | } 237 | Max.outlet("generated", 1); 238 | utils.log_status(""); 239 | isGenerating = false; 240 | } else { 241 | if (vae.isTraining()){ 242 | utils.error_status("Still training..."); 243 | } else { 244 | utils.error_status("Model is not trained yet"); 245 | } 246 | } 247 | } 248 | 249 | 250 | 251 | // Start encoding... reset input matrix 252 | var input_onset; 253 | var input_velocity; 254 | var input_timeshift; 255 | Max.addHandler("encode_start", (is_test) => { 256 | Max.post("encode_start"); 257 | input_onset = utils.create2DArray(NUM_DRUM_CLASSES, LOOP_DURATION); 258 | input_velocity = utils.create2DArray(NUM_DRUM_CLASSES, LOOP_DURATION); 259 | input_timeshift = utils.create2DArray(NUM_DRUM_CLASSES, LOOP_DURATION); 260 | 261 | if (is_test){ 262 | for (var i=0; i < LOOP_DURATION; i=i+4){ 263 | input_onset[0][i] = 1; 264 | input_velocity[0][i] = 0.8; 265 | } 266 | 267 | } 268 | }); 269 | 270 | Max.addHandler("encode_add", (pitch, time, duration, velocity, muted, mapping) => { 271 | 272 | // select mapping 273 | if (mapping == 0) midi_map = MIDI_DRUM_MAP_STRICT; 274 | else midi_map = MIDI_DRUM_MAP; 275 | 276 | // add note 277 | if (!muted){ 278 | var unit = 0.25; // 1.0 = quarter note grid size = 16th note 279 | const half_unit = unit * 0.5; 280 | const index = Math.max(0, Math.floor((time + half_unit) / unit)) // centering 281 | const timeshift = (time - unit * index)/half_unit; // normalized 282 | Max.post("index", index, timeshift, pitch); 283 | // Ignore notes after the first 2 bars 284 | if (index < LOOP_DURATION && pitch in midi_map){ 285 | let drum_id = midi_map[pitch]; 286 | Max.post("pitch", pitch, drum_id); 287 | input_onset[drum_id][index] = 1; 288 | input_velocity[drum_id][index] = velocity/127.; 289 | input_timeshift[drum_id][index] = timeshift; 290 | } 291 | } 292 | }); 293 | 294 | Max.addHandler("encode_done", () => { 295 | utils.post(input_onset); 296 | utils.post(input_velocity); 297 | utils.post(input_timeshift); 298 | 299 | // Encoding! 300 | var inputOn = tf.tensor2d(input_onset, [NUM_DRUM_CLASSES, LOOP_DURATION]) 301 | var inputVel = tf.tensor2d(input_velocity, [NUM_DRUM_CLASSES, LOOP_DURATION]) 302 | var inputTS = tf.tensor2d(input_timeshift, [NUM_DRUM_CLASSES, LOOP_DURATION]) 303 | let zs = vae.encodePattern(inputOn, inputVel, inputTS); 304 | 305 | // output encoded z vector 306 | utils.post(zs) 307 | Max.outlet("zs", zs[0], zs[1]); 308 | }); 309 | 310 | // Clear training data 311 | Max.addHandler("clear_train", ()=>{ 312 | train_data_onsets = []; // clear 313 | train_data_velocities = []; 314 | train_data_timeshift = []; 315 | 316 | reportNumberOfBars(); 317 | }); 318 | 319 | Max.addHandler("stop", ()=>{ 320 | vae.stopTraining(); 321 | }); 322 | 323 | Max.addHandler("savemodel", (path)=>{ 324 | // check if already trained or not 325 | if (vae.isReadyToGenerate()){ 326 | filepath = "file://" + path; 327 | vae.saveModel(filepath); 328 | utils.log_status("Model saved."); 329 | } else { 330 | utils.error_status("Train a model first!"); 331 | } 332 | }); 333 | 334 | Max.addHandler("loadmodel", (path)=>{ 335 | filepath = "file://" + path; 336 | vae.loadModel(filepath); 337 | utils.log_status("Model loaded!"); 338 | }); 339 | 340 | Max.addHandler("clearmodel", ()=>{ 341 | vae.clearModel(); 342 | utils.log_status("Model reset"); 343 | }); 344 | 345 | Max.addHandler("epochs", (e)=>{ 346 | vae.setEpochs(e); 347 | utils.post("number of epochs: " + e); 348 | }); 349 | 350 | function reportNumberOfBars(){ 351 | Max.outlet("train_bars", train_data_onsets.length * 2); // number of bars for training 352 | } 353 | 354 | // Generate a rhythm pattern 355 | Max.addHandler("bend", (noise_range = 0.0)=>{ 356 | try { 357 | vae.bendModel(noise_range); 358 | } catch(error) { 359 | console.log(error); 360 | utils.error_status("model bending failed"); 361 | } 362 | }); 363 | 364 | Max.outlet("loaded"); -------------------------------------------------------------------------------- /src/constants.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | const DRUM_CLASSES = [ 4 | 'Kick', 5 | 'Snare', 6 | 'Hi-hat closed', 7 | 'Hi-hat open', 8 | 'Tom low', 9 | 'Tom mid', 10 | 'Tom high', 11 | 'Clap', 12 | 'Rim' 13 | ] 14 | 15 | const MIDI_DRUM_MAP = { 16 | 36: 0, 17 | 35: 0, 18 | 38: 1, 19 | 27: 1, 20 | 28: 1, 21 | 31: 1, 22 | 32: 1, 23 | 33: 1, 24 | 34: 1, 25 | 37: 1, 26 | 39: 1, 27 | 40: 1, 28 | 56: 1, 29 | 65: 1, 30 | 66: 1, 31 | 75: 1, 32 | 85: 1, 33 | 42: 2, 34 | 44: 2, 35 | 54: 2, 36 | 68: 2, 37 | 69: 2, 38 | 70: 2, 39 | 71: 2, 40 | 73: 2, 41 | 78: 2, 42 | 80: 2, 43 | 46: 3, 44 | 67: 3, 45 | 72: 3, 46 | 74: 3, 47 | 79: 3, 48 | 81: 3, 49 | 45: 4, 50 | 29: 4, 51 | 41: 4, 52 | 61: 4, 53 | 64: 4, 54 | 84: 4, 55 | 48: 5, 56 | 47: 5, 57 | 60: 5, 58 | 63: 5, 59 | 77: 5, 60 | 86: 5, 61 | 87: 5, 62 | 50: 6, 63 | 30: 6, 64 | 43: 6, 65 | 62: 6, 66 | 76: 6, 67 | 83: 6, 68 | 49: 7, 69 | 55: 7, 70 | 57: 7, 71 | 58: 7, 72 | 51: 8, 73 | 52: 8, 74 | 53: 8, 75 | 59: 8, 76 | 82: 8 77 | } 78 | 79 | const MIDI_DRUM_MAP_STRICT = { 80 | 36: 0, // Acoustic Bass Drum 81 | 35: 0, // Bass drum 82 | 38: 1, // Acoustic Snare 83 | 40: 1, // Electric Snare 84 | 42: 2, // closed hihat 85 | 44: 3, // pedal hihat 86 | 46: 3, // open hihat 87 | 41: 4, // low floor tom 88 | 45: 4, // low tom 89 | 47: 5, // low-mid tom 90 | 48: 5, // high-mid tom 91 | 43: 6, // high floor tom 92 | 50: 6, // high tom 93 | 39: 7, // hand clap 94 | 51: 8, // Ride Symbal 1 95 | 52: 8, // Chinese Symbal 96 | 53: 8, // Ride Bell 97 | 59: 8, // Ride Symbal 2 98 | } 99 | 100 | 101 | const NUM_DRUM_CLASSES = DRUM_CLASSES.length; 102 | const BEAT_RESOLUTION = 12; 103 | const LOOP_DURATION = BEAT_RESOLUTION * 4 * 2; // 2bars x 16th note 104 | 105 | const MIN_ONSETS_THRESHOLD = 5; // ignore loops with onsets less than this num 106 | 107 | const ORIGINAL_DIM = NUM_DRUM_CLASSES * LOOP_DURATION; 108 | 109 | exports.MIDI_DRUM_MAP = MIDI_DRUM_MAP; 110 | exports.MIDI_DRUM_MAP_STRICT = MIDI_DRUM_MAP_STRICT; 111 | exports.DRUM_CLASSES = DRUM_CLASSES; 112 | 113 | exports.NUM_DRUM_CLASSES = NUM_DRUM_CLASSES; 114 | exports.BEAT_RESOLUTION = BEAT_RESOLUTION; 115 | exports.LOOP_DURATION = LOOP_DURATION; 116 | exports.ORIGINAL_DIM = ORIGINAL_DIM; 117 | exports.MIN_ONSETS_THRESHOLD = MIN_ONSETS_THRESHOLD; 118 | -------------------------------------------------------------------------------- /src/data.js: -------------------------------------------------------------------------------- 1 | 2 | const tf = require('@tensorflow/tfjs-node'); 3 | const utils = require('./utils.js') 4 | 5 | const IMAGE_SIZE = 784; 6 | const NUM_CLASSES = 10; 7 | 8 | const TRAIN_TEST_RATIO = 5 / 6; 9 | 10 | const ORIGINAL_DIM = require('./constants.js').ORIGINAL_DIM; 11 | 12 | class DataHandler { 13 | constructor(shuffled_data, trainIndices, testIndices) { 14 | this.dataset = shuffled_data; 15 | 16 | this.shuffledTrainIndex = 0; 17 | this.shuffledTestIndex = 0; 18 | 19 | this.NUM_DATASET_ELEMENTS = this.dataset.length; 20 | this.NUM_TRAIN_ELEMENTS = Math.floor(TRAIN_TEST_RATIO * this.NUM_DATASET_ELEMENTS); 21 | this.NUM_TEST_ELEMENTS = this.NUM_DATASET_ELEMENTS - this.NUM_TRAIN_ELEMENTS; 22 | 23 | // Slice the the training data into train and test sets. 24 | this.trainData = this.dataset.slice(0, this.NUM_TRAIN_ELEMENTS); 25 | this.testData = this.dataset.slice(this.NUM_TRAIN_ELEMENTS); 26 | 27 | // Shuffled indices for both training and test data 28 | this.trainIndices = trainIndices; 29 | this.testIndices = testIndices; 30 | } 31 | 32 | getDataSize(){ 33 | return this.dataset.length; 34 | } 35 | 36 | nextTrainBatch(batchSize) { 37 | return this.nextBatch(batchSize, this.trainData, () => { 38 | this.shuffledTrainIndex = (this.shuffledTrainIndex + 1) % this.trainIndices.length; 39 | return this.trainIndices[this.shuffledTrainIndex]; 40 | }); 41 | } 42 | 43 | nextTestBatch(batchSize) { 44 | return this.nextBatch(batchSize, this.testData, () => { 45 | this.shuffledTestIndex = (this.shuffledTestIndex + 1) % this.testIndices.length; 46 | return this.testIndices[this.shuffledTestIndex]; 47 | }); 48 | } 49 | 50 | // Create batch from an array of tf.tensor2d 51 | nextBatch(batchSize, data, index) { 52 | const batchArray = []; 53 | for (let i = 0; i < batchSize; i++) { 54 | const idx = index(); 55 | batchArray.push(data[idx].reshape([1, ORIGINAL_DIM])); 56 | } 57 | const axis = 0; 58 | const xs = tf.concat(batchArray, axis); 59 | return {xs}; 60 | } 61 | } 62 | 63 | exports.DataHandler = DataHandler; 64 | exports.TRAIN_TEST_RATIO = TRAIN_TEST_RATIO; -------------------------------------------------------------------------------- /src/utils.js: -------------------------------------------------------------------------------- 1 | 2 | const Max = require('max-api'); 3 | 4 | // prefixes for max messages 5 | const PREFIX_STATUS = "status"; 6 | const PREFIX_LOG = "log"; 7 | 8 | const ERROR_FLAG = 1; 9 | const MESSAGE_FLAG = 0; 10 | 11 | 12 | function create2DArray(row, col){ 13 | var x = new Array(row); 14 | for (var i = 0; i < x.length; i++) { 15 | x[i] = new Array(col); 16 | for (var j =0; j < x[i].length; j++){ 17 | x[i][j] = 0.0; 18 | } 19 | } 20 | return x; 21 | } 22 | 23 | function getRandomInt(max) { 24 | return Math.floor(Math.random() * Math.floor(max)); 25 | } 26 | 27 | function scale(value, minIn, maxIn, minOut, maxOut){ 28 | value = Math.min(Math.max(value, minIn), maxIn); 29 | value = (value - minIn)/(maxIn - minIn) * (maxOut - minOut) + minOut; 30 | return value; 31 | } 32 | 33 | function shuffle(a) { 34 | var j, x, i; 35 | for (i = a.length - 1; i > 0; i--) { 36 | j = Math.floor(Math.random() * (i + 1)); 37 | x = a[i]; 38 | a[i] = a[j]; 39 | a[j] = x; 40 | } 41 | return a; 42 | } 43 | 44 | function shuffle_with_indices(a, indices){ 45 | console.assert(a.length == indices.length); 46 | let b = []; 47 | for (var i = 0; i < indices.length; i++){ 48 | b.push(a[indices[i]]); 49 | } 50 | return b; 51 | } 52 | 53 | 54 | function does_post(message, is_error){ 55 | if (is_error) Max.post(message, Max.POST_LEVELS.ERROR); 56 | else Max.post(message); 57 | } 58 | 59 | function post(message){ 60 | does_post(message, false); 61 | } 62 | 63 | function error(message){ 64 | does_post(message, true); 65 | } 66 | 67 | function does_log_status(message, is_error){ 68 | Max.outlet(PREFIX_STATUS, message, is_error) 69 | post(message, is_error); 70 | } 71 | 72 | function log_status(message){ 73 | does_log_status(message, 0) 74 | } 75 | 76 | function error_status(message){ 77 | does_log_status(message, 1); 78 | } 79 | 80 | 81 | exports.create2DArray = create2DArray; 82 | exports.getRandomInt = getRandomInt; 83 | exports.scale = scale; 84 | exports.shuffle = shuffle; 85 | exports.shuffle_with_indices = shuffle_with_indices; 86 | exports.post = post; 87 | exports.error = error; 88 | exports.log_status = log_status; 89 | exports.error_status = error_status; -------------------------------------------------------------------------------- /src/vae.js: -------------------------------------------------------------------------------- 1 | // VAE in tensorflow.js 2 | // based on https://github.com/songer1993/tfjs-vae 3 | 4 | const Max = require('max-api'); 5 | const tf = require('@tensorflow/tfjs-node'); 6 | 7 | const utils = require('./utils.js') 8 | const data = require('./data.js') 9 | 10 | // Constants 11 | const NUM_DRUM_CLASSES = require('./constants.js').NUM_DRUM_CLASSES; 12 | const LOOP_DURATION = require('./constants.js').LOOP_DURATION; 13 | 14 | const ORIGINAL_DIM = require('./constants.js').ORIGINAL_DIM; 15 | const INTERMEDIATE_DIM = 512; 16 | const LATENT_DIM = 2; 17 | 18 | const BATCH_SIZE = 64; 19 | const TEST_BATCH_SIZE = 128; 20 | const TS_LOSS_COEF = 5.0; // coef for timeshift loss 21 | const VEL_LOSS_COEF = 2.5; // coef for velocity loss 22 | 23 | 24 | let dataHandlerOnset; 25 | let dataHandlerVelocity; 26 | let dataHandlerTimeshift; 27 | let model = null; 28 | let numEpochs = 150; // default # of epochs 29 | 30 | async function loadAndTrain(train_data_onset, train_data_velocity, train_data_timeshift) { 31 | console.assert(train_data_onset.length == train_data_velocity.length && train_data_velocity.length == train_data_timeshift.length); 32 | 33 | // shuffle in sync 34 | const total_num = train_data_onset.length; 35 | shuffled_indices = tf.util.createShuffledIndices(total_num); 36 | train_data_onset = utils.shuffle_with_indices(train_data_onset,shuffled_indices); 37 | train_data_velocity = utils.shuffle_with_indices(train_data_velocity,shuffled_indices); 38 | train_data_timeshift = utils.shuffle_with_indices(train_data_timeshift,shuffled_indices); 39 | 40 | // synced indices 41 | const num_trains = Math.floor(data.TRAIN_TEST_RATIO * total_num); 42 | const num_tests = total_num - num_trains; 43 | const train_indices = tf.util.createShuffledIndices(num_trains); 44 | const test_indices = tf.util.createShuffledIndices(num_tests); 45 | 46 | // create data handlers 47 | dataHandlerOnset = new data.DataHandler(train_data_onset, train_indices, test_indices); // data utility fo onset 48 | dataHandlerVelocity = new data.DataHandler(train_data_velocity, train_indices, test_indices); // data utility for velocity 49 | dataHandlerTimeshift = new data.DataHandler(train_data_timeshift, train_indices, test_indices); // data utility for duration 50 | 51 | // start training! 52 | if (!model) initModel(); // initializing model class 53 | startTraining(); // start the actual training process with the given training data 54 | } 55 | 56 | function initModel(){ 57 | model = new ConditionalVAE({ 58 | modelConfig:{ 59 | originalDim: ORIGINAL_DIM, 60 | intermediateDim: INTERMEDIATE_DIM, 61 | latentDim: LATENT_DIM 62 | }, 63 | trainConfig:{ 64 | batchSize: BATCH_SIZE, 65 | testBatchSize: TEST_BATCH_SIZE, 66 | optimizer: tf.train.adam() 67 | } 68 | }); 69 | } 70 | 71 | async function startTraining(){ 72 | await model.train(); 73 | } 74 | 75 | function stopTraining(){ 76 | model.shouldStopTraining = true; 77 | utils.log_status("Stopping training..."); 78 | } 79 | 80 | function isTraining(){ 81 | if (model && model.isTraining) return true; 82 | } 83 | 84 | function isReadyToGenerate(){ 85 | return (model && model.isTrained); 86 | } 87 | 88 | function setEpochs(e){ 89 | numEpochs = e; 90 | Max.outlet("epoch", 0, numEpochs); 91 | } 92 | 93 | function generatePattern(z1, z2, noise_range=0.0){ 94 | var zs; 95 | if (z1 === 'undefined' || z2 === 'undefined'){ 96 | zs = tf.randomNormal([1, 2]); 97 | } else { 98 | zs = tf.tensor2d([[z1, z2]]); 99 | } 100 | 101 | // noise 102 | if (noise_range > 0.0){ 103 | var noise = tf.randomNormal([1, 2]); 104 | zs = zs.add(noise.mul(tf.scalar(noise_range))); 105 | } 106 | return model.generate(zs); 107 | } 108 | 109 | function encodePattern(inputOn, inputVel, inputTS){ 110 | return model.encode(inputOn, inputVel, inputTS); 111 | } 112 | 113 | async function saveModel(filepath){ 114 | model.saveModel(filepath); 115 | } 116 | 117 | async function loadModel(filepath){ 118 | if (!model) initModel(); 119 | model.loadModel(filepath); 120 | } 121 | 122 | function clearModel(){ 123 | model = null; 124 | } 125 | 126 | function bendModel(noise_range){ 127 | model.bendModel(noise_range) 128 | } 129 | 130 | // Sampling Z 131 | class sampleLayer extends tf.layers.Layer { 132 | constructor(args) { 133 | super({}); 134 | } 135 | 136 | computeOutputShape(inputShape) { 137 | return inputShape[0]; 138 | } 139 | 140 | call(inputs, kwargs) { 141 | return tf.tidy(() => { 142 | const [zMean, zLogVar] = inputs; 143 | const batch = zMean.shape[0]; 144 | const dim = zMean.shape[1]; 145 | const epsilon = tf.randomNormal([batch, dim]); 146 | const half = tf.scalar(0.5); 147 | const temp = zLogVar.mul(half).exp().mul(epsilon); 148 | const sample = zMean.add(temp); 149 | return sample; 150 | }); 151 | } 152 | 153 | getClassName() { 154 | return 'sampleLayer'; 155 | } 156 | } 157 | 158 | 159 | class ConditionalVAE { 160 | constructor(config) { 161 | this.modelConfig = config.modelConfig; 162 | this.trainConfig = config.trainConfig; 163 | [this.encoder, this.decoder, this.apply] = this.build(); 164 | this.isTrained = false; 165 | } 166 | 167 | build(modelConfig) { 168 | if (modelConfig != undefined){ 169 | this.modelConfig = modelConfig; 170 | } 171 | const config = this.modelConfig; 172 | 173 | const originalDim = config.originalDim; 174 | const intermediateDim = config.intermediateDim; 175 | const latentDim = config.latentDim; 176 | 177 | // VAE model = encoder + decoder 178 | // build encoder model 179 | 180 | // Onset input 181 | const encoderInputsOn = tf.input({shape: [originalDim]}); 182 | const x1LinearOn = tf.layers.dense({units: intermediateDim, useBias: true, kernelInitializer: 'glorotNormal'}).apply(encoderInputsOn); 183 | const x1NormalisedOn = tf.layers.batchNormalization({axis: 1}).apply(x1LinearOn); 184 | const x1On = tf.layers.leakyReLU().apply(x1NormalisedOn); 185 | 186 | // Velocity input 187 | const encoderInputsVel = tf.input({shape: [originalDim]}); 188 | const x1LinearVel = tf.layers.dense({units: intermediateDim, useBias: true, kernelInitializer: 'glorotNormal'}).apply(encoderInputsVel); 189 | const x1NormalisedVel = tf.layers.batchNormalization({axis: 1}).apply(x1LinearVel); 190 | const x1Vel = tf.layers.leakyReLU().apply(x1NormalisedVel); 191 | 192 | // Timeshift input 193 | const encoderInputsTS= tf.input({shape: [originalDim]}); 194 | const x1LinearTS = tf.layers.dense({units: intermediateDim, useBias: true, kernelInitializer: 'glorotNormal'}).apply(encoderInputsTS); 195 | const x1NormalisedTS = tf.layers.batchNormalization({axis: 1}).apply(x1LinearTS); 196 | const x1TS = tf.layers.leakyReLU().apply(x1NormalisedTS); 197 | 198 | // Merged 199 | const concatLayer = tf.layers.concatenate(); 200 | const x1Merged = concatLayer.apply([x1On, x1Vel, x1TS]); 201 | const x2Linear = tf.layers.dense({units: intermediateDim, useBias: true, kernelInitializer: 'glorotNormal'}).apply(x1Merged); 202 | const x2Normalised = tf.layers.batchNormalization({axis: 1}).apply(x2Linear); 203 | const x2 = tf.layers.leakyReLU().apply(x2Normalised); 204 | 205 | const zMean = tf.layers.dense({units: latentDim, useBias: true, kernelInitializer: 'glorotNormal'}).apply(x2); 206 | const zLogVar = tf.layers.dense({units: latentDim, useBias: true, kernelInitializer: 'glorotNormal'}).apply(x2); 207 | const z = new sampleLayer().apply([zMean, zLogVar]); 208 | 209 | const encoderInputs = [encoderInputsOn, encoderInputsVel, encoderInputsTS]; 210 | const encoderOutputs = [zMean, zLogVar, z]; 211 | 212 | const encoder = tf.model({inputs: encoderInputs, outputs: encoderOutputs, name: "encoder"}) 213 | 214 | // build decoder model 215 | const decoderInputs = tf.input({shape: [latentDim]}); 216 | const x3Linear = tf.layers.dense({units: intermediateDim * 2.0, useBias: true, kernelInitializer: 'glorotNormal'}).apply(decoderInputs); 217 | const x3Normalised = tf.layers.batchNormalization({axis: 1}).apply(x3Linear); 218 | const x3 = tf.layers.leakyReLU().apply(x3Normalised); 219 | 220 | // Decoder for onsets 221 | const x4LinearOn = tf.layers.dense({units: intermediateDim, useBias: true, kernelInitializer: 'glorotNormal'}).apply(x3); 222 | const x4NormalisedOn = tf.layers.batchNormalization({axis: 1}).apply(x4LinearOn); 223 | const x4On = tf.layers.leakyReLU().apply(x4NormalisedOn); 224 | const decoderOutputsOn = tf.layers.dense({units: originalDim, activation: 'sigmoid'}).apply(x4On); 225 | 226 | // Decoder for velocity 227 | const x4LinearVel = tf.layers.dense({units: intermediateDim, useBias: true, kernelInitializer: 'glorotNormal'}).apply(x3); 228 | const x4NormalisedVel = tf.layers.batchNormalization({axis: 1}).apply(x4LinearVel); 229 | const x4Vel = tf.layers.leakyReLU().apply(x4NormalisedVel); 230 | const decoderOutputsVel = tf.layers.dense({units: originalDim, activation: 'sigmoid'}).apply(x4Vel); 231 | 232 | // Decoder for timeshift 233 | const x4LinearTS = tf.layers.dense({units: intermediateDim, useBias: true, kernelInitializer: 'glorotNormal'}).apply(x3); 234 | const x4NormalisedTS = tf.layers.batchNormalization({axis: 1}).apply(x4LinearTS); 235 | const x4TS = tf.layers.leakyReLU().apply(x4NormalisedTS); 236 | const decoderOutputsTS = tf.layers.dense({units: originalDim, activation: 'tanh'}).apply(x4TS); 237 | const decoderOutputs = [decoderOutputsOn, decoderOutputsVel, decoderOutputsTS]; 238 | 239 | // Decoder model 240 | const decoder = tf.model({inputs: decoderInputs, outputs: decoderOutputs, name: "decoder"}) 241 | 242 | // build VAE model 243 | const vae = (inputs) => { 244 | return tf.tidy(() => { 245 | const [zMean, zLogVar, z] = this.encoder.apply(inputs); 246 | const outputs = this.decoder.apply(z); 247 | return [zMean, zLogVar, outputs]; 248 | }); 249 | } 250 | 251 | return [encoder, decoder, vae]; 252 | } 253 | 254 | reconstructionLoss(yTrue, yPred) { 255 | return tf.tidy(() => { 256 | let reconstruction_loss; 257 | reconstruction_loss = tf.metrics.binaryCrossentropy(yTrue, yPred); 258 | reconstruction_loss = reconstruction_loss.mul(tf.scalar(yPred.shape[1])); 259 | return reconstruction_loss; 260 | }); 261 | } 262 | 263 | mseLoss(yTrue, yPred) { 264 | return tf.tidy(() => { 265 | let mse_loss = tf.metrics.meanSquaredError(yTrue, yPred); 266 | mse_loss = mse_loss.mul(tf.scalar(yPred.shape[1])); 267 | return mse_loss; 268 | }); 269 | } 270 | 271 | klLoss(z_mean, z_log_var) { 272 | return tf.tidy(() => { 273 | let kl_loss; 274 | kl_loss = tf.scalar(1).add(z_log_var).sub(z_mean.square()).sub(z_log_var.exp()); 275 | kl_loss = tf.sum(kl_loss, -1); 276 | kl_loss = kl_loss.mul(tf.scalar(-0.5)); 277 | return kl_loss; 278 | }); 279 | } 280 | 281 | vaeLoss(yTrue, yPred) { 282 | return tf.tidy(() => { 283 | const [yTrueOn, yTrueVel, yTrueTS] = yTrue; 284 | const [z_mean, z_log_var, y] = yPred; 285 | const [yOn, yVel, yTS] = y; 286 | 287 | const onset_loss = this.reconstructionLoss(yTrueOn, yOn); 288 | let velocity_loss = this.mseLoss(yTrueVel, yVel); 289 | velocity_loss = velocity_loss.mul(VEL_LOSS_COEF); 290 | let timeshift_loss = this.mseLoss(yTrueTS, yTS); 291 | timeshift_loss = timeshift_loss.mul(TS_LOSS_COEF); 292 | 293 | const kl_loss = this.klLoss(z_mean, z_log_var); 294 | // console.log("onset_loss", tf.mean(onset_loss).dataSync()); 295 | // console.log("velocity_loss", tf.mean(velocity_loss).dataSync()); 296 | // console.log("timeshift_loss", tf.mean(timeshift_loss).dataSync()); 297 | // console.log("kl_loss", tf.mean(kl_loss).dataSync()); 298 | const total_loss = tf.mean(onset_loss.add(velocity_loss).add(timeshift_loss).add(kl_loss)); // averaged in the batch 299 | return total_loss; 300 | }); 301 | } 302 | 303 | async train(data, trainConfig) { 304 | this.isTrained = false; 305 | this.isTraining = true; 306 | this.shouldStopTraining = false; 307 | if (trainConfig != undefined){ 308 | this.trainConfig = trainConfig; 309 | } 310 | const config = this.trainConfig; 311 | 312 | const batchSize = config.batchSize; 313 | const numBatch = Math.floor(dataHandlerOnset.getDataSize() / batchSize); 314 | const epochs = numEpochs; 315 | const testBatchSize = config.testBatchSize; 316 | const optimizer = config.optimizer; 317 | const logMessage = console.log; 318 | 319 | const originalDim = this.modelConfig.originalDim; 320 | 321 | Max.outlet("training", 1); 322 | for (let i = 0; i < epochs; i++) { 323 | if (this.shouldStopTraining) break; 324 | 325 | let batchInputOn,batchInputVel,batchInputTS; 326 | let testBatchInputOn,testBatchInputVel,testBatchInputTS; 327 | let trainLoss; // for a training batch 328 | let epochLoss, valLoss; 329 | 330 | logMessage(`[Epoch ${i + 1}]\n`); 331 | Max.outlet("epoch", i + 1, epochs); 332 | epochLoss = 0; 333 | 334 | // Training 335 | for (let j = 0; j < numBatch; j++) { 336 | batchInputOn = dataHandlerOnset.nextTrainBatch(batchSize).xs.reshape([batchSize, originalDim]); 337 | batchInputVel = dataHandlerVelocity.nextTrainBatch(batchSize).xs.reshape([batchSize, originalDim]); 338 | batchInputTS = dataHandlerTimeshift.nextTrainBatch(batchSize).xs.reshape([batchSize, originalDim]); 339 | trainLoss = await optimizer.minimize(() => this.vaeLoss([batchInputOn, batchInputVel, batchInputTS], 340 | this.apply([batchInputOn, batchInputVel, batchInputTS])), true); 341 | trainLoss = Number(trainLoss.dataSync()); 342 | epochLoss = epochLoss + trainLoss; 343 | 344 | await tf.nextFrame(); 345 | } 346 | epochLoss = epochLoss / numBatch; // average 347 | logMessage(`\t[Average] Training Loss: ${epochLoss.toFixed(3)}. Epoch ${i} / ${epochs} \n`); 348 | Max.outlet("loss", epochLoss); 349 | 350 | // Validation 351 | testBatchInputOn = dataHandlerOnset.nextTestBatch(testBatchSize).xs.reshape([testBatchSize, originalDim]); 352 | testBatchInputVel = dataHandlerVelocity.nextTestBatch(testBatchSize).xs.reshape([testBatchSize, originalDim]); 353 | testBatchInputTS = dataHandlerTimeshift.nextTestBatch(testBatchSize).xs.reshape([testBatchSize, originalDim]); 354 | valLoss = this.vaeLoss([testBatchInputOn, testBatchInputVel, testBatchInputTS], 355 | this.apply([testBatchInputOn, testBatchInputVel, testBatchInputTS])); 356 | valLoss = Number(valLoss.dataSync()); 357 | 358 | logMessage(`\tVal Loss: ${valLoss.toFixed(3)}. Epoch ${i} / ${epochs}\n`); 359 | Max.outlet("val_loss", valLoss); 360 | 361 | await tf.nextFrame(); 362 | } 363 | this.isTrained = true; 364 | this.isTraining = false; 365 | Max.outlet("training", 0); 366 | utils.log_status("Training finished!"); 367 | } 368 | 369 | generate(zs){ 370 | let [outputsOn, outputsVel, outputsTS] = this.decoder.apply(zs); 371 | 372 | outputsOn = outputsOn.reshape([NUM_DRUM_CLASSES, LOOP_DURATION]); 373 | outputsVel = outputsVel.reshape([NUM_DRUM_CLASSES, LOOP_DURATION]); 374 | outputsTS = outputsTS.reshape([NUM_DRUM_CLASSES, LOOP_DURATION]); // timshift output 375 | 376 | return [outputsOn.arraySync(), outputsVel.arraySync(), outputsTS.arraySync()]; 377 | } 378 | 379 | bendModel(noise_range){ 380 | let weights = []; 381 | for (let i = 0; i < this.decoder.getWeights().length; i++) { 382 | let w = this.decoder.getWeights()[i]; 383 | let shape = w.shape; 384 | console.log(shape); 385 | let noise = tf.randomNormal(w.shape, 0.0, noise_range); 386 | let neww = tf.add(w, noise); 387 | weights.push(neww); 388 | } 389 | this.decoder.setWeights(weights); 390 | } 391 | 392 | async saveModel(path){ 393 | const saved = await this.decoder.save(path); 394 | utils.post(saved); 395 | } 396 | 397 | async loadModel(path){ 398 | this.decoder = await tf.loadLayersModel(path); 399 | this.isTrained = true; 400 | } 401 | 402 | encode(inputOn, inputVel, inputTS){ 403 | if (!this.encoder) { 404 | utils.error_status("Model is not trained yet"); 405 | return; 406 | } 407 | 408 | // reshaping... 409 | inputOn = inputOn.reshape([1, ORIGINAL_DIM]); 410 | inputVel = inputVel.reshape([1, ORIGINAL_DIM]); 411 | inputTS = inputTS.reshape([1, ORIGINAL_DIM]); 412 | 413 | let [zMean, zLogVar, zs] = this.encoder.apply([inputOn, inputVel, inputTS]); 414 | this.generate(zs); // generate rhythm pattern with the encoded z 415 | zs = zs.arraySync(); 416 | return zs[0]; 417 | } 418 | 419 | } 420 | 421 | function range(start, edge, step) { 422 | // If only one number was passed in make it the edge and 0 the start. 423 | if (arguments.length == 1) { 424 | edge = start; 425 | start = 0; 426 | } 427 | 428 | // Validate the edge and step numbers. 429 | edge = edge || 0; 430 | step = step || 1; 431 | 432 | // Create the array of numbers, stopping befor the edge. 433 | for (var ret = []; (edge - start) * step > 0; start += step) { 434 | ret.push(start); 435 | } 436 | return ret; 437 | } 438 | 439 | exports.loadAndTrain = loadAndTrain; 440 | exports.saveModel = saveModel; 441 | exports.loadModel = loadModel; 442 | exports.clearModel = clearModel; 443 | exports.generatePattern = generatePattern; 444 | exports.encodePattern = encodePattern; 445 | exports.stopTraining = stopTraining; 446 | exports.isReadyToGenerate = isReadyToGenerate; 447 | exports.isTraining = isTraining; 448 | exports.setEpochs = setEpochs; 449 | exports.bendModel = bendModel; 450 | 451 | -------------------------------------------------------------------------------- /subpatches/count_for_me.maxpat: -------------------------------------------------------------------------------- 1 | { 2 | "patcher" : { 3 | "fileversion" : 1, 4 | "appversion" : { 5 | "major" : 8, 6 | "minor" : 1, 7 | "revision" : 8, 8 | "architecture" : "x64", 9 | "modernui" : 1 10 | } 11 | , 12 | "classnamespace" : "box", 13 | "rect" : [ 386.0, 566.0, 504.0, 367.0 ], 14 | "bglocked" : 0, 15 | "openinpresentation" : 0, 16 | "default_fontsize" : 12.0, 17 | "default_fontface" : 0, 18 | "default_fontname" : "Arial", 19 | "gridonopen" : 1, 20 | "gridsize" : [ 15.0, 15.0 ], 21 | "gridsnaponopen" : 1, 22 | "objectsnaponopen" : 1, 23 | "statusbarvisible" : 2, 24 | "toolbarvisible" : 1, 25 | "lefttoolbarpinned" : 0, 26 | "toptoolbarpinned" : 0, 27 | "righttoolbarpinned" : 0, 28 | "bottomtoolbarpinned" : 0, 29 | "toolbars_unpinned_last_save" : 0, 30 | "tallnewobj" : 0, 31 | "boxanimatetime" : 200, 32 | "enablehscroll" : 1, 33 | "enablevscroll" : 1, 34 | "devicewidth" : 0.0, 35 | "description" : "", 36 | "digest" : "", 37 | "tags" : "", 38 | "style" : "", 39 | "subpatcher_template" : "no_top", 40 | "assistshowspatchername" : 0, 41 | "boxes" : [ { 42 | "box" : { 43 | "id" : "obj-18", 44 | "maxclass" : "message", 45 | "numinlets" : 2, 46 | "numoutlets" : 1, 47 | "outlettype" : [ "" ], 48 | "patching_rect" : [ 113.0, 195.0, 29.5, 22.0 ], 49 | "text" : "0" 50 | } 51 | 52 | } 53 | , { 54 | "box" : { 55 | "id" : "obj-12", 56 | "maxclass" : "button", 57 | "numinlets" : 1, 58 | "numoutlets" : 1, 59 | "outlettype" : [ "bang" ], 60 | "parameter_enable" : 0, 61 | "patching_rect" : [ 113.0, 166.0, 24.0, 24.0 ] 62 | } 63 | 64 | } 65 | , { 66 | "box" : { 67 | "id" : "obj-6", 68 | "maxclass" : "number", 69 | "numinlets" : 1, 70 | "numoutlets" : 2, 71 | "outlettype" : [ "", "bang" ], 72 | "parameter_enable" : 0, 73 | "patching_rect" : [ 96.0, 277.0, 50.0, 22.0 ] 74 | } 75 | 76 | } 77 | , { 78 | "box" : { 79 | "id" : "obj-16", 80 | "linecount" : 2, 81 | "maxclass" : "comment", 82 | "numinlets" : 1, 83 | "numoutlets" : 0, 84 | "patching_rect" : [ 59.0, 64.0, 45.0, 33.0 ], 85 | "text" : "metro\ninput" 86 | } 87 | 88 | } 89 | , { 90 | "box" : { 91 | "id" : "obj-14", 92 | "linecount" : 2, 93 | "maxclass" : "comment", 94 | "numinlets" : 1, 95 | "numoutlets" : 0, 96 | "patching_rect" : [ 265.0, 64.0, 62.0, 33.0 ], 97 | "text" : "restart the count" 98 | } 99 | 100 | } 101 | , { 102 | "box" : { 103 | "id" : "obj-9", 104 | "maxclass" : "newobj", 105 | "numinlets" : 1, 106 | "numoutlets" : 2, 107 | "outlettype" : [ "", "" ], 108 | "patching_rect" : [ 277.0, 192.0, 91.0, 22.0 ], 109 | "text" : "patcherargs 16" 110 | } 111 | 112 | } 113 | , { 114 | "box" : { 115 | "id" : "obj-7", 116 | "maxclass" : "newobj", 117 | "numinlets" : 5, 118 | "numoutlets" : 4, 119 | "outlettype" : [ "int", "", "", "int" ], 120 | "patching_rect" : [ 59.0, 232.0, 91.0, 22.0 ], 121 | "text" : "counter 0 1 16" 122 | } 123 | 124 | } 125 | , { 126 | "box" : { 127 | "comment" : "", 128 | "id" : "obj-5", 129 | "index" : 1, 130 | "maxclass" : "outlet", 131 | "numinlets" : 1, 132 | "numoutlets" : 0, 133 | "patching_rect" : [ 59.0, 301.0, 30.0, 30.0 ] 134 | } 135 | 136 | } 137 | , { 138 | "box" : { 139 | "comment" : "", 140 | "id" : "obj-3", 141 | "index" : 2, 142 | "maxclass" : "inlet", 143 | "numinlets" : 0, 144 | "numoutlets" : 1, 145 | "outlettype" : [ "bang" ], 146 | "patching_rect" : [ 291.0, 109.0, 30.0, 30.0 ] 147 | } 148 | 149 | } 150 | , { 151 | "box" : { 152 | "comment" : "", 153 | "id" : "obj-1", 154 | "index" : 1, 155 | "maxclass" : "inlet", 156 | "numinlets" : 0, 157 | "numoutlets" : 1, 158 | "outlettype" : [ "" ], 159 | "patching_rect" : [ 59.0, 109.0, 30.0, 30.0 ] 160 | } 161 | 162 | } 163 | ], 164 | "lines" : [ { 165 | "patchline" : { 166 | "destination" : [ "obj-7", 0 ], 167 | "source" : [ "obj-1", 0 ] 168 | } 169 | 170 | } 171 | , { 172 | "patchline" : { 173 | "destination" : [ "obj-18", 0 ], 174 | "source" : [ "obj-12", 0 ] 175 | } 176 | 177 | } 178 | , { 179 | "patchline" : { 180 | "destination" : [ "obj-7", 3 ], 181 | "source" : [ "obj-18", 0 ] 182 | } 183 | 184 | } 185 | , { 186 | "patchline" : { 187 | "destination" : [ "obj-12", 0 ], 188 | "midpoints" : [ 300.5, 152.0, 122.5, 152.0 ], 189 | "source" : [ "obj-3", 0 ] 190 | } 191 | 192 | } 193 | , { 194 | "patchline" : { 195 | "destination" : [ "obj-5", 0 ], 196 | "order" : 1, 197 | "source" : [ "obj-7", 0 ] 198 | } 199 | 200 | } 201 | , { 202 | "patchline" : { 203 | "destination" : [ "obj-6", 0 ], 204 | "order" : 0, 205 | "source" : [ "obj-7", 0 ] 206 | } 207 | 208 | } 209 | , { 210 | "patchline" : { 211 | "destination" : [ "obj-7", 4 ], 212 | "midpoints" : [ 286.5, 218.5, 140.5, 218.5 ], 213 | "source" : [ "obj-9", 0 ] 214 | } 215 | 216 | } 217 | ], 218 | "bgcolor" : [ 1.0, 1.0, 1.0, 1.0 ] 219 | } 220 | 221 | } 222 | -------------------------------------------------------------------------------- /subpatches/list_dup.maxpat: -------------------------------------------------------------------------------- 1 | { 2 | "patcher" : { 3 | "fileversion" : 1, 4 | "appversion" : { 5 | "major" : 8, 6 | "minor" : 1, 7 | "revision" : 8, 8 | "architecture" : "x64", 9 | "modernui" : 1 10 | } 11 | , 12 | "classnamespace" : "box", 13 | "rect" : [ 145.0, 330.0, 940.0, 656.0 ], 14 | "bglocked" : 0, 15 | "openinpresentation" : 0, 16 | "default_fontsize" : 12.0, 17 | "default_fontface" : 0, 18 | "default_fontname" : "Arial", 19 | "gridonopen" : 1, 20 | "gridsize" : [ 15.0, 15.0 ], 21 | "gridsnaponopen" : 1, 22 | "objectsnaponopen" : 1, 23 | "statusbarvisible" : 2, 24 | "toolbarvisible" : 1, 25 | "lefttoolbarpinned" : 0, 26 | "toptoolbarpinned" : 0, 27 | "righttoolbarpinned" : 0, 28 | "bottomtoolbarpinned" : 0, 29 | "toolbars_unpinned_last_save" : 0, 30 | "tallnewobj" : 0, 31 | "boxanimatetime" : 200, 32 | "enablehscroll" : 1, 33 | "enablevscroll" : 1, 34 | "devicewidth" : 0.0, 35 | "description" : "", 36 | "digest" : "", 37 | "tags" : "", 38 | "style" : "", 39 | "subpatcher_template" : "", 40 | "assistshowspatchername" : 0, 41 | "boxes" : [ { 42 | "box" : { 43 | "id" : "obj-11", 44 | "maxclass" : "newobj", 45 | "numinlets" : 1, 46 | "numoutlets" : 1, 47 | "outlettype" : [ "" ], 48 | "patching_rect" : [ 723.0, 154.0, 158.0, 22.0 ], 49 | "text" : "loadmess 0 0 0 0 0 0 0 0 0" 50 | } 51 | 52 | } 53 | , { 54 | "box" : { 55 | "id" : "obj-14", 56 | "linecount" : 3, 57 | "maxclass" : "comment", 58 | "numinlets" : 1, 59 | "numoutlets" : 0, 60 | "patching_rect" : [ 759.0, 286.0, 71.0, 47.0 ], 61 | "text" : "filter with \"track freeze\"" 62 | } 63 | 64 | } 65 | , { 66 | "box" : { 67 | "id" : "obj-10", 68 | "maxclass" : "newobj", 69 | "numinlets" : 2, 70 | "numoutlets" : 1, 71 | "outlettype" : [ "" ], 72 | "patching_rect" : [ 445.0, 406.0, 52.0, 22.0 ], 73 | "text" : "gate 1 1" 74 | } 75 | 76 | } 77 | , { 78 | "box" : { 79 | "comment" : "", 80 | "id" : "obj-9", 81 | "index" : 3, 82 | "maxclass" : "inlet", 83 | "numinlets" : 0, 84 | "numoutlets" : 1, 85 | "outlettype" : [ "" ], 86 | "patching_rect" : [ 691.0, 148.0, 30.0, 30.0 ] 87 | } 88 | 89 | } 90 | , { 91 | "box" : { 92 | "id" : "obj-12", 93 | "maxclass" : "newobj", 94 | "numinlets" : 2, 95 | "numoutlets" : 1, 96 | "outlettype" : [ "int" ], 97 | "patching_rect" : [ 691.0, 344.0, 29.5, 22.0 ], 98 | "text" : "- 1" 99 | } 100 | 101 | } 102 | , { 103 | "box" : { 104 | "id" : "obj-2", 105 | "maxclass" : "newobj", 106 | "numinlets" : 1, 107 | "numoutlets" : 2, 108 | "outlettype" : [ "bang", "int" ], 109 | "patching_rect" : [ 718.0, 267.0, 29.5, 22.0 ], 110 | "text" : "t b i" 111 | } 112 | 113 | } 114 | , { 115 | "box" : { 116 | "id" : "obj-3", 117 | "maxclass" : "newobj", 118 | "numinlets" : 2, 119 | "numoutlets" : 2, 120 | "outlettype" : [ "", "" ], 121 | "patching_rect" : [ 691.0, 309.0, 56.5, 22.0 ], 122 | "text" : "zl.nth" 123 | } 124 | 125 | } 126 | , { 127 | "box" : { 128 | "id" : "obj-7", 129 | "maxclass" : "newobj", 130 | "numinlets" : 2, 131 | "numoutlets" : 1, 132 | "outlettype" : [ "" ], 133 | "patching_rect" : [ 385.0, 406.0, 52.0, 22.0 ], 134 | "text" : "gate 1 1" 135 | } 136 | 137 | } 138 | , { 139 | "box" : { 140 | "id" : "obj-8", 141 | "maxclass" : "newobj", 142 | "numinlets" : 2, 143 | "numoutlets" : 2, 144 | "outlettype" : [ "", "" ], 145 | "patching_rect" : [ 718.0, 235.0, 47.0, 22.0 ], 146 | "text" : "zl.nth 2" 147 | } 148 | 149 | } 150 | , { 151 | "box" : { 152 | "comment" : "", 153 | "id" : "obj-6", 154 | "index" : 2, 155 | "maxclass" : "inlet", 156 | "numinlets" : 0, 157 | "numoutlets" : 1, 158 | "outlettype" : [ "" ], 159 | "patching_rect" : [ 555.0, 154.0, 30.0, 30.0 ] 160 | } 161 | 162 | } 163 | , { 164 | "box" : { 165 | "comment" : "", 166 | "id" : "obj-5", 167 | "index" : 2, 168 | "maxclass" : "outlet", 169 | "numinlets" : 1, 170 | "numoutlets" : 0, 171 | "patching_rect" : [ 445.0, 439.0, 30.0, 30.0 ] 172 | } 173 | 174 | } 175 | , { 176 | "box" : { 177 | "comment" : "", 178 | "id" : "obj-4", 179 | "index" : 1, 180 | "maxclass" : "outlet", 181 | "numinlets" : 1, 182 | "numoutlets" : 0, 183 | "patching_rect" : [ 385.0, 439.0, 30.0, 30.0 ] 184 | } 185 | 186 | } 187 | , { 188 | "box" : { 189 | "comment" : "", 190 | "id" : "obj-1", 191 | "index" : 1, 192 | "maxclass" : "inlet", 193 | "numinlets" : 0, 194 | "numoutlets" : 1, 195 | "outlettype" : [ "" ], 196 | "patching_rect" : [ 378.0, 154.0, 30.0, 30.0 ] 197 | } 198 | 199 | } 200 | , { 201 | "box" : { 202 | "id" : "obj-25", 203 | "maxclass" : "newobj", 204 | "numinlets" : 2, 205 | "numoutlets" : 2, 206 | "outlettype" : [ "", "" ], 207 | "patching_rect" : [ 425.0, 304.0, 39.0, 22.0 ], 208 | "text" : "zl.join" 209 | } 210 | 211 | } 212 | , { 213 | "box" : { 214 | "id" : "obj-26", 215 | "maxclass" : "newobj", 216 | "numinlets" : 2, 217 | "numoutlets" : 2, 218 | "outlettype" : [ "", "" ], 219 | "patching_rect" : [ 378.0, 304.0, 39.0, 22.0 ], 220 | "text" : "zl.join" 221 | } 222 | 223 | } 224 | , { 225 | "box" : { 226 | "id" : "obj-27", 227 | "maxclass" : "newobj", 228 | "numinlets" : 2, 229 | "numoutlets" : 2, 230 | "outlettype" : [ "", "" ], 231 | "patching_rect" : [ 414.0, 262.0, 61.0, 22.0 ], 232 | "text" : "zl.slice #2" 233 | } 234 | 235 | } 236 | , { 237 | "box" : { 238 | "id" : "obj-28", 239 | "maxclass" : "newobj", 240 | "numinlets" : 2, 241 | "numoutlets" : 2, 242 | "outlettype" : [ "", "" ], 243 | "patching_rect" : [ 378.0, 231.0, 61.0, 22.0 ], 244 | "text" : "zl.slice #1" 245 | } 246 | 247 | } 248 | ], 249 | "lines" : [ { 250 | "patchline" : { 251 | "destination" : [ "obj-28", 0 ], 252 | "source" : [ "obj-1", 0 ] 253 | } 254 | 255 | } 256 | , { 257 | "patchline" : { 258 | "destination" : [ "obj-5", 0 ], 259 | "source" : [ "obj-10", 0 ] 260 | } 261 | 262 | } 263 | , { 264 | "patchline" : { 265 | "destination" : [ "obj-3", 0 ], 266 | "midpoints" : [ 732.5, 192.0, 700.5, 192.0 ], 267 | "source" : [ "obj-11", 0 ] 268 | } 269 | 270 | } 271 | , { 272 | "patchline" : { 273 | "destination" : [ "obj-10", 0 ], 274 | "midpoints" : [ 700.5, 381.0, 454.5, 381.0 ], 275 | "order" : 0, 276 | "source" : [ "obj-12", 0 ] 277 | } 278 | 279 | } 280 | , { 281 | "patchline" : { 282 | "destination" : [ "obj-7", 0 ], 283 | "midpoints" : [ 700.5, 381.0, 394.5, 381.0 ], 284 | "order" : 1, 285 | "source" : [ "obj-12", 0 ] 286 | } 287 | 288 | } 289 | , { 290 | "patchline" : { 291 | "destination" : [ "obj-3", 1 ], 292 | "source" : [ "obj-2", 1 ] 293 | } 294 | 295 | } 296 | , { 297 | "patchline" : { 298 | "destination" : [ "obj-3", 0 ], 299 | "source" : [ "obj-2", 0 ] 300 | } 301 | 302 | } 303 | , { 304 | "patchline" : { 305 | "destination" : [ "obj-10", 1 ], 306 | "source" : [ "obj-25", 0 ] 307 | } 308 | 309 | } 310 | , { 311 | "patchline" : { 312 | "destination" : [ "obj-7", 1 ], 313 | "source" : [ "obj-26", 0 ] 314 | } 315 | 316 | } 317 | , { 318 | "patchline" : { 319 | "destination" : [ "obj-25", 1 ], 320 | "source" : [ "obj-27", 1 ] 321 | } 322 | 323 | } 324 | , { 325 | "patchline" : { 326 | "destination" : [ "obj-26", 1 ], 327 | "source" : [ "obj-27", 0 ] 328 | } 329 | 330 | } 331 | , { 332 | "patchline" : { 333 | "destination" : [ "obj-25", 0 ], 334 | "order" : 0, 335 | "source" : [ "obj-28", 0 ] 336 | } 337 | 338 | } 339 | , { 340 | "patchline" : { 341 | "destination" : [ "obj-26", 0 ], 342 | "order" : 1, 343 | "source" : [ "obj-28", 0 ] 344 | } 345 | 346 | } 347 | , { 348 | "patchline" : { 349 | "destination" : [ "obj-27", 0 ], 350 | "source" : [ "obj-28", 1 ] 351 | } 352 | 353 | } 354 | , { 355 | "patchline" : { 356 | "destination" : [ "obj-12", 0 ], 357 | "source" : [ "obj-3", 0 ] 358 | } 359 | 360 | } 361 | , { 362 | "patchline" : { 363 | "destination" : [ "obj-10", 1 ], 364 | "midpoints" : [ 564.5, 392.5, 487.5, 392.5 ], 365 | "order" : 1, 366 | "source" : [ "obj-6", 0 ] 367 | } 368 | 369 | } 370 | , { 371 | "patchline" : { 372 | "destination" : [ "obj-7", 1 ], 373 | "midpoints" : [ 564.5, 391.5, 427.5, 391.5 ], 374 | "order" : 2, 375 | "source" : [ "obj-6", 0 ] 376 | } 377 | 378 | } 379 | , { 380 | "patchline" : { 381 | "destination" : [ "obj-8", 0 ], 382 | "midpoints" : [ 564.5, 221.0, 727.5, 221.0 ], 383 | "order" : 0, 384 | "source" : [ "obj-6", 0 ] 385 | } 386 | 387 | } 388 | , { 389 | "patchline" : { 390 | "destination" : [ "obj-4", 0 ], 391 | "source" : [ "obj-7", 0 ] 392 | } 393 | 394 | } 395 | , { 396 | "patchline" : { 397 | "destination" : [ "obj-2", 0 ], 398 | "source" : [ "obj-8", 0 ] 399 | } 400 | 401 | } 402 | , { 403 | "patchline" : { 404 | "destination" : [ "obj-3", 0 ], 405 | "source" : [ "obj-9", 0 ] 406 | } 407 | 408 | } 409 | ], 410 | "styles" : [ { 411 | "name" : "tap", 412 | "default" : { 413 | "fontname" : [ "Lato Light" ] 414 | } 415 | , 416 | "parentstyle" : "", 417 | "multi" : 0 418 | } 419 | ] 420 | } 421 | 422 | } 423 | -------------------------------------------------------------------------------- /subpatches/makenote_for_me.maxpat: -------------------------------------------------------------------------------- 1 | { 2 | "patcher" : { 3 | "fileversion" : 1, 4 | "appversion" : { 5 | "major" : 8, 6 | "minor" : 1, 7 | "revision" : 0, 8 | "architecture" : "x64", 9 | "modernui" : 1 10 | } 11 | , 12 | "classnamespace" : "box", 13 | "rect" : [ 123.0, 366.0, 1408.0, 581.0 ], 14 | "bglocked" : 0, 15 | "openinpresentation" : 0, 16 | "default_fontsize" : 12.0, 17 | "default_fontface" : 0, 18 | "default_fontname" : "Arial", 19 | "gridonopen" : 1, 20 | "gridsize" : [ 15.0, 15.0 ], 21 | "gridsnaponopen" : 1, 22 | "objectsnaponopen" : 1, 23 | "statusbarvisible" : 2, 24 | "toolbarvisible" : 1, 25 | "lefttoolbarpinned" : 0, 26 | "toptoolbarpinned" : 0, 27 | "righttoolbarpinned" : 0, 28 | "bottomtoolbarpinned" : 0, 29 | "toolbars_unpinned_last_save" : 2, 30 | "tallnewobj" : 0, 31 | "boxanimatetime" : 200, 32 | "enablehscroll" : 1, 33 | "enablevscroll" : 1, 34 | "devicewidth" : 0.0, 35 | "description" : "", 36 | "digest" : "", 37 | "tags" : "", 38 | "style" : "", 39 | "subpatcher_template" : "no_top", 40 | "boxes" : [ { 41 | "box" : { 42 | "id" : "obj-7", 43 | "maxclass" : "newobj", 44 | "numinlets" : 1, 45 | "numoutlets" : 2, 46 | "outlettype" : [ "bang", "float" ], 47 | "patching_rect" : [ 686.0, 158.0, 29.5, 22.0 ], 48 | "text" : "t b f" 49 | } 50 | 51 | } 52 | , { 53 | "box" : { 54 | "format" : 6, 55 | "id" : "obj-23", 56 | "maxclass" : "flonum", 57 | "maximum" : 3.0, 58 | "minimum" : 0.0, 59 | "numinlets" : 1, 60 | "numoutlets" : 2, 61 | "outlettype" : [ "", "bang" ], 62 | "parameter_enable" : 0, 63 | "patching_rect" : [ 777.0, 95.0, 50.0, 22.0 ] 64 | } 65 | 66 | } 67 | , { 68 | "box" : { 69 | "comment" : "", 70 | "id" : "obj-21", 71 | "index" : 2, 72 | "maxclass" : "inlet", 73 | "numinlets" : 0, 74 | "numoutlets" : 1, 75 | "outlettype" : [ "" ], 76 | "patching_rect" : [ 777.0, 60.0, 30.0, 30.0 ] 77 | } 78 | 79 | } 80 | , { 81 | "box" : { 82 | "id" : "obj-20", 83 | "maxclass" : "newobj", 84 | "numinlets" : 2, 85 | "numoutlets" : 1, 86 | "outlettype" : [ "float" ], 87 | "patching_rect" : [ 537.0, 195.0, 178.5, 22.0 ], 88 | "text" : "* 1." 89 | } 90 | 91 | } 92 | , { 93 | "box" : { 94 | "id" : "obj-16", 95 | "maxclass" : "toggle", 96 | "numinlets" : 1, 97 | "numoutlets" : 1, 98 | "outlettype" : [ "int" ], 99 | "parameter_enable" : 0, 100 | "patching_rect" : [ 411.25, 280.0, 24.0, 24.0 ] 101 | } 102 | 103 | } 104 | , { 105 | "box" : { 106 | "id" : "obj-14", 107 | "maxclass" : "toggle", 108 | "numinlets" : 1, 109 | "numoutlets" : 1, 110 | "outlettype" : [ "int" ], 111 | "parameter_enable" : 0, 112 | "patching_rect" : [ 283.2833251953125, 296.0, 24.0, 24.0 ] 113 | } 114 | 115 | } 116 | , { 117 | "box" : { 118 | "id" : "obj-9", 119 | "maxclass" : "newobj", 120 | "numinlets" : 3, 121 | "numoutlets" : 3, 122 | "outlettype" : [ "", "", "" ], 123 | "patching_rect" : [ 918.0, 84.0, 127.0, 22.0 ], 124 | "text" : "route velocity timeshift" 125 | } 126 | 127 | } 128 | , { 129 | "box" : { 130 | "id" : "obj-5", 131 | "maxclass" : "newobj", 132 | "numinlets" : 1, 133 | "numoutlets" : 2, 134 | "outlettype" : [ "", "" ], 135 | "patching_rect" : [ 729.0, 28.0, 208.0, 22.0 ], 136 | "text" : "patcherargs @velocity 1 @timeshift 1" 137 | } 138 | 139 | } 140 | , { 141 | "box" : { 142 | "id" : "obj-51", 143 | "linecount" : 3, 144 | "maxclass" : "comment", 145 | "numinlets" : 1, 146 | "numoutlets" : 0, 147 | "patching_rect" : [ 340.25, 308.0, 151.0, 47.0 ], 148 | "text" : "When we don't use generated velocity values, use fixed value instead." 149 | } 150 | 151 | } 152 | , { 153 | "box" : { 154 | "id" : "obj-43", 155 | "maxclass" : "newobj", 156 | "numinlets" : 2, 157 | "numoutlets" : 2, 158 | "outlettype" : [ "", "" ], 159 | "patching_rect" : [ 260.73333740234375, 195.0, 123.0, 22.0 ], 160 | "text" : "routepass 0" 161 | } 162 | 163 | } 164 | , { 165 | "box" : { 166 | "id" : "obj-42", 167 | "maxclass" : "newobj", 168 | "numinlets" : 2, 169 | "numoutlets" : 1, 170 | "outlettype" : [ "int" ], 171 | "patching_rect" : [ 283.5333251953125, 333.0, 29.5, 22.0 ], 172 | "text" : "+ 1" 173 | } 174 | 175 | } 176 | , { 177 | "box" : { 178 | "id" : "obj-39", 179 | "maxclass" : "newobj", 180 | "numinlets" : 2, 181 | "numoutlets" : 1, 182 | "outlettype" : [ "" ], 183 | "patching_rect" : [ 411.20001220703125, 375.0, 68.0, 22.0 ], 184 | "text" : "gate 1 1" 185 | } 186 | 187 | } 188 | , { 189 | "box" : { 190 | "id" : "obj-38", 191 | "maxclass" : "newobj", 192 | "numinlets" : 1, 193 | "numoutlets" : 1, 194 | "outlettype" : [ "int" ], 195 | "patching_rect" : [ 323.133331298828125, 282.0, 29.0, 22.0 ], 196 | "text" : "t 80" 197 | } 198 | 199 | } 200 | , { 201 | "box" : { 202 | "id" : "obj-35", 203 | "maxclass" : "newobj", 204 | "numinlets" : 3, 205 | "numoutlets" : 1, 206 | "outlettype" : [ "" ], 207 | "patching_rect" : [ 283.5333251953125, 362.0, 100.20001220703125, 22.0 ], 208 | "text" : "switch 2 2" 209 | } 210 | 211 | } 212 | , { 213 | "box" : { 214 | "id" : "obj-24", 215 | "maxclass" : "newobj", 216 | "numinlets" : 2, 217 | "numoutlets" : 1, 218 | "outlettype" : [ "float" ], 219 | "patching_rect" : [ 460.20001220703125, 200.0, 39.0, 22.0 ], 220 | "text" : "/ 127." 221 | } 222 | 223 | } 224 | , { 225 | "box" : { 226 | "id" : "obj-19", 227 | "maxclass" : "newobj", 228 | "numinlets" : 2, 229 | "numoutlets" : 1, 230 | "outlettype" : [ "float" ], 231 | "patching_rect" : [ 460.20001220703125, 229.0, 95.79998779296875, 22.0 ], 232 | "text" : "* 0." 233 | } 234 | 235 | } 236 | , { 237 | "box" : { 238 | "id" : "obj-18", 239 | "maxclass" : "newobj", 240 | "numinlets" : 4, 241 | "numoutlets" : 3, 242 | "outlettype" : [ "", "", "" ], 243 | "patching_rect" : [ 213.0, 403.0, 162.20001220703125, 22.0 ], 244 | "text" : "pipe 0 0 0 0" 245 | } 246 | 247 | } 248 | , { 249 | "box" : { 250 | "id" : "obj-17", 251 | "maxclass" : "comment", 252 | "numinlets" : 1, 253 | "numoutlets" : 0, 254 | "patching_rect" : [ 593.0, 144.0, 24.0, 20.0 ], 255 | "text" : "ms" 256 | } 257 | 258 | } 259 | , { 260 | "box" : { 261 | "id" : "obj-13", 262 | "maxclass" : "comment", 263 | "numinlets" : 1, 264 | "numoutlets" : 0, 265 | "patching_rect" : [ 575.0, 79.0, 164.0, 20.0 ], 266 | "text" : "resolution of generated beats" 267 | } 268 | 269 | } 270 | , { 271 | "box" : { 272 | "id" : "obj-11", 273 | "maxclass" : "newobj", 274 | "numinlets" : 1, 275 | "numoutlets" : 1, 276 | "outlettype" : [ "bang" ], 277 | "patching_rect" : [ 537.0, 51.0, 58.0, 22.0 ], 278 | "text" : "loadbang" 279 | } 280 | 281 | } 282 | , { 283 | "box" : { 284 | "format" : 6, 285 | "id" : "obj-10", 286 | "maxclass" : "flonum", 287 | "numinlets" : 1, 288 | "numoutlets" : 2, 289 | "outlettype" : [ "", "bang" ], 290 | "parameter_enable" : 0, 291 | "patching_rect" : [ 537.0, 143.0, 50.0, 22.0 ] 292 | } 293 | 294 | } 295 | , { 296 | "box" : { 297 | "id" : "obj-6", 298 | "maxclass" : "message", 299 | "numinlets" : 2, 300 | "numoutlets" : 1, 301 | "outlettype" : [ "" ], 302 | "patching_rect" : [ 537.0, 79.0, 29.5, 22.0 ], 303 | "text" : "32n" 304 | } 305 | 306 | } 307 | , { 308 | "box" : { 309 | "id" : "obj-2", 310 | "maxclass" : "newobj", 311 | "numinlets" : 1, 312 | "numoutlets" : 1, 313 | "outlettype" : [ "" ], 314 | "patching_rect" : [ 537.0, 110.0, 162.0, 22.0 ], 315 | "text" : "translate bars.beats.units ms" 316 | } 317 | 318 | } 319 | , { 320 | "box" : { 321 | "id" : "obj-44", 322 | "maxclass" : "newobj", 323 | "numinlets" : 3, 324 | "numoutlets" : 2, 325 | "outlettype" : [ "float", "float" ], 326 | "patching_rect" : [ 213.0, 441.66668701171875, 162.20001220703125, 22.0 ], 327 | "text" : "makenote" 328 | } 329 | 330 | } 331 | , { 332 | "box" : { 333 | "id" : "obj-29", 334 | "maxclass" : "newobj", 335 | "numinlets" : 1, 336 | "numoutlets" : 6, 337 | "outlettype" : [ "", "", "", "", "", "" ], 338 | "patching_rect" : [ 213.0, 145.0, 257.66668701171875, 22.0 ], 339 | "text" : "unjoin 5" 340 | } 341 | 342 | } 343 | , { 344 | "box" : { 345 | "comment" : "", 346 | "id" : "obj-4", 347 | "index" : 2, 348 | "maxclass" : "outlet", 349 | "numinlets" : 1, 350 | "numoutlets" : 0, 351 | "patching_rect" : [ 356.20001220703125, 479.0, 30.0, 30.0 ] 352 | } 353 | 354 | } 355 | , { 356 | "box" : { 357 | "comment" : "", 358 | "id" : "obj-3", 359 | "index" : 1, 360 | "maxclass" : "outlet", 361 | "numinlets" : 1, 362 | "numoutlets" : 0, 363 | "patching_rect" : [ 213.0, 475.0, 30.0, 30.0 ] 364 | } 365 | 366 | } 367 | , { 368 | "box" : { 369 | "comment" : "", 370 | "id" : "obj-1", 371 | "index" : 1, 372 | "maxclass" : "inlet", 373 | "numinlets" : 0, 374 | "numoutlets" : 1, 375 | "outlettype" : [ "" ], 376 | "patching_rect" : [ 213.0, 91.0, 30.0, 30.0 ] 377 | } 378 | 379 | } 380 | ], 381 | "lines" : [ { 382 | "patchline" : { 383 | "destination" : [ "obj-29", 0 ], 384 | "source" : [ "obj-1", 0 ] 385 | } 386 | 387 | } 388 | , { 389 | "patchline" : { 390 | "destination" : [ "obj-20", 0 ], 391 | "source" : [ "obj-10", 0 ] 392 | } 393 | 394 | } 395 | , { 396 | "patchline" : { 397 | "destination" : [ "obj-6", 0 ], 398 | "source" : [ "obj-11", 0 ] 399 | } 400 | 401 | } 402 | , { 403 | "patchline" : { 404 | "destination" : [ "obj-42", 0 ], 405 | "source" : [ "obj-14", 0 ] 406 | } 407 | 408 | } 409 | , { 410 | "patchline" : { 411 | "destination" : [ "obj-39", 0 ], 412 | "source" : [ "obj-16", 0 ] 413 | } 414 | 415 | } 416 | , { 417 | "patchline" : { 418 | "destination" : [ "obj-44", 2 ], 419 | "source" : [ "obj-18", 2 ] 420 | } 421 | 422 | } 423 | , { 424 | "patchline" : { 425 | "destination" : [ "obj-44", 1 ], 426 | "source" : [ "obj-18", 1 ] 427 | } 428 | 429 | } 430 | , { 431 | "patchline" : { 432 | "destination" : [ "obj-44", 0 ], 433 | "source" : [ "obj-18", 0 ] 434 | } 435 | 436 | } 437 | , { 438 | "patchline" : { 439 | "destination" : [ "obj-39", 1 ], 440 | "source" : [ "obj-19", 0 ] 441 | } 442 | 443 | } 444 | , { 445 | "patchline" : { 446 | "destination" : [ "obj-10", 0 ], 447 | "source" : [ "obj-2", 0 ] 448 | } 449 | 450 | } 451 | , { 452 | "patchline" : { 453 | "destination" : [ "obj-19", 1 ], 454 | "source" : [ "obj-20", 0 ] 455 | } 456 | 457 | } 458 | , { 459 | "patchline" : { 460 | "destination" : [ "obj-23", 0 ], 461 | "source" : [ "obj-21", 0 ] 462 | } 463 | 464 | } 465 | , { 466 | "patchline" : { 467 | "destination" : [ "obj-7", 0 ], 468 | "midpoints" : [ 786.5, 149.0, 743.5, 149.0, 743.5, 150.0, 695.5, 150.0 ], 469 | "source" : [ "obj-23", 0 ] 470 | } 471 | 472 | } 473 | , { 474 | "patchline" : { 475 | "destination" : [ "obj-19", 0 ], 476 | "source" : [ "obj-24", 0 ] 477 | } 478 | 479 | } 480 | , { 481 | "patchline" : { 482 | "destination" : [ "obj-18", 2 ], 483 | "source" : [ "obj-29", 2 ] 484 | } 485 | 486 | } 487 | , { 488 | "patchline" : { 489 | "destination" : [ "obj-18", 0 ], 490 | "source" : [ "obj-29", 0 ] 491 | } 492 | 493 | } 494 | , { 495 | "patchline" : { 496 | "destination" : [ "obj-24", 0 ], 497 | "source" : [ "obj-29", 3 ] 498 | } 499 | 500 | } 501 | , { 502 | "patchline" : { 503 | "destination" : [ "obj-43", 0 ], 504 | "source" : [ "obj-29", 1 ] 505 | } 506 | 507 | } 508 | , { 509 | "patchline" : { 510 | "destination" : [ "obj-18", 1 ], 511 | "source" : [ "obj-35", 0 ] 512 | } 513 | 514 | } 515 | , { 516 | "patchline" : { 517 | "destination" : [ "obj-35", 1 ], 518 | "source" : [ "obj-38", 0 ] 519 | } 520 | 521 | } 522 | , { 523 | "patchline" : { 524 | "destination" : [ "obj-18", 3 ], 525 | "source" : [ "obj-39", 0 ] 526 | } 527 | 528 | } 529 | , { 530 | "patchline" : { 531 | "destination" : [ "obj-35", 0 ], 532 | "source" : [ "obj-42", 0 ] 533 | } 534 | 535 | } 536 | , { 537 | "patchline" : { 538 | "destination" : [ "obj-18", 1 ], 539 | "source" : [ "obj-43", 0 ] 540 | } 541 | 542 | } 543 | , { 544 | "patchline" : { 545 | "destination" : [ "obj-35", 2 ], 546 | "order" : 0, 547 | "source" : [ "obj-43", 1 ] 548 | } 549 | 550 | } 551 | , { 552 | "patchline" : { 553 | "destination" : [ "obj-38", 0 ], 554 | "order" : 1, 555 | "source" : [ "obj-43", 1 ] 556 | } 557 | 558 | } 559 | , { 560 | "patchline" : { 561 | "destination" : [ "obj-3", 0 ], 562 | "source" : [ "obj-44", 0 ] 563 | } 564 | 565 | } 566 | , { 567 | "patchline" : { 568 | "destination" : [ "obj-4", 0 ], 569 | "source" : [ "obj-44", 1 ] 570 | } 571 | 572 | } 573 | , { 574 | "patchline" : { 575 | "destination" : [ "obj-9", 0 ], 576 | "source" : [ "obj-5", 1 ] 577 | } 578 | 579 | } 580 | , { 581 | "patchline" : { 582 | "destination" : [ "obj-2", 0 ], 583 | "source" : [ "obj-6", 0 ] 584 | } 585 | 586 | } 587 | , { 588 | "patchline" : { 589 | "destination" : [ "obj-20", 1 ], 590 | "source" : [ "obj-7", 1 ] 591 | } 592 | 593 | } 594 | , { 595 | "patchline" : { 596 | "destination" : [ "obj-20", 0 ], 597 | "midpoints" : [ 695.5, 186.5, 546.5, 186.5 ], 598 | "source" : [ "obj-7", 0 ] 599 | } 600 | 601 | } 602 | , { 603 | "patchline" : { 604 | "destination" : [ "obj-14", 0 ], 605 | "midpoints" : [ 927.5, 273.5, 292.7833251953125, 273.5 ], 606 | "source" : [ "obj-9", 0 ] 607 | } 608 | 609 | } 610 | , { 611 | "patchline" : { 612 | "destination" : [ "obj-16", 0 ], 613 | "midpoints" : [ 981.5, 261.5, 420.75, 261.5 ], 614 | "source" : [ "obj-9", 1 ] 615 | } 616 | 617 | } 618 | ], 619 | "bgcolor" : [ 1.0, 1.0, 1.0, 1.0 ] 620 | } 621 | 622 | } 623 | -------------------------------------------------------------------------------- /subpatches/setup_1_16.maxpat: -------------------------------------------------------------------------------- 1 | { 2 | "patcher" : { 3 | "fileversion" : 1, 4 | "appversion" : { 5 | "major" : 8, 6 | "minor" : 1, 7 | "revision" : 8, 8 | "architecture" : "x64", 9 | "modernui" : 1 10 | } 11 | , 12 | "classnamespace" : "box", 13 | "rect" : [ 867.0, 335.0, 973.0, 427.0 ], 14 | "bglocked" : 0, 15 | "openinpresentation" : 0, 16 | "default_fontsize" : 12.0, 17 | "default_fontface" : 0, 18 | "default_fontname" : "Arial", 19 | "gridonopen" : 1, 20 | "gridsize" : [ 15.0, 15.0 ], 21 | "gridsnaponopen" : 1, 22 | "objectsnaponopen" : 1, 23 | "statusbarvisible" : 2, 24 | "toolbarvisible" : 1, 25 | "lefttoolbarpinned" : 0, 26 | "toptoolbarpinned" : 0, 27 | "righttoolbarpinned" : 0, 28 | "bottomtoolbarpinned" : 0, 29 | "toolbars_unpinned_last_save" : 0, 30 | "tallnewobj" : 0, 31 | "boxanimatetime" : 200, 32 | "enablehscroll" : 1, 33 | "enablevscroll" : 1, 34 | "devicewidth" : 0.0, 35 | "description" : "", 36 | "digest" : "", 37 | "tags" : "", 38 | "style" : "", 39 | "subpatcher_template" : "no_top", 40 | "assistshowspatchername" : 0, 41 | "boxes" : [ { 42 | "box" : { 43 | "id" : "obj-3", 44 | "maxclass" : "comment", 45 | "numinlets" : 1, 46 | "numoutlets" : 0, 47 | "patching_rect" : [ 270.0, 173.0, 141.0, 20.0 ], 48 | "text" : "basic sequencer settings" 49 | } 50 | 51 | } 52 | , { 53 | "box" : { 54 | "id" : "obj-14", 55 | "maxclass" : "newobj", 56 | "numinlets" : 1, 57 | "numoutlets" : 1, 58 | "outlettype" : [ "" ], 59 | "patcher" : { 60 | "fileversion" : 1, 61 | "appversion" : { 62 | "major" : 8, 63 | "minor" : 1, 64 | "revision" : 8, 65 | "architecture" : "x64", 66 | "modernui" : 1 67 | } 68 | , 69 | "classnamespace" : "box", 70 | "rect" : [ 84.0, 129.0, 640.0, 480.0 ], 71 | "bglocked" : 0, 72 | "openinpresentation" : 0, 73 | "default_fontsize" : 12.0, 74 | "default_fontface" : 0, 75 | "default_fontname" : "Arial", 76 | "gridonopen" : 1, 77 | "gridsize" : [ 15.0, 15.0 ], 78 | "gridsnaponopen" : 1, 79 | "objectsnaponopen" : 1, 80 | "statusbarvisible" : 2, 81 | "toolbarvisible" : 1, 82 | "lefttoolbarpinned" : 0, 83 | "toptoolbarpinned" : 0, 84 | "righttoolbarpinned" : 0, 85 | "bottomtoolbarpinned" : 0, 86 | "toolbars_unpinned_last_save" : 0, 87 | "tallnewobj" : 0, 88 | "boxanimatetime" : 200, 89 | "enablehscroll" : 1, 90 | "enablevscroll" : 1, 91 | "devicewidth" : 0.0, 92 | "description" : "", 93 | "digest" : "", 94 | "tags" : "", 95 | "style" : "", 96 | "subpatcher_template" : "no_top", 97 | "assistshowspatchername" : 0, 98 | "boxes" : [ { 99 | "box" : { 100 | "id" : "obj-11", 101 | "maxclass" : "message", 102 | "numinlets" : 2, 103 | "numoutlets" : 1, 104 | "outlettype" : [ "" ], 105 | "patching_rect" : [ 238.0, 179.0, 191.0, 22.0 ], 106 | "text" : "target_seq $1, nstep 48, loop 1 48" 107 | } 108 | 109 | } 110 | , { 111 | "box" : { 112 | "id" : "obj-6", 113 | "maxclass" : "newobj", 114 | "numinlets" : 2, 115 | "numoutlets" : 1, 116 | "outlettype" : [ "int" ], 117 | "patching_rect" : [ 50.0, 127.0, 29.5, 22.0 ], 118 | "text" : "- 1" 119 | } 120 | 121 | } 122 | , { 123 | "box" : { 124 | "id" : "obj-2", 125 | "maxclass" : "newobj", 126 | "numinlets" : 2, 127 | "numoutlets" : 3, 128 | "outlettype" : [ "bang", "bang", "int" ], 129 | "patching_rect" : [ 50.0, 100.0, 40.0, 22.0 ], 130 | "text" : "uzi 9" 131 | } 132 | 133 | } 134 | , { 135 | "box" : { 136 | "id" : "obj-76", 137 | "maxclass" : "message", 138 | "numinlets" : 2, 139 | "numoutlets" : 1, 140 | "outlettype" : [ "" ], 141 | "patching_rect" : [ 66.0, 211.0, 113.0, 22.0 ], 142 | "text" : "fold_pitch $1, fold 1" 143 | } 144 | 145 | } 146 | , { 147 | "box" : { 148 | "id" : "obj-66", 149 | "maxclass" : "newobj", 150 | "numinlets" : 1, 151 | "numoutlets" : 3, 152 | "outlettype" : [ "", "", "" ], 153 | "patching_rect" : [ 50.0, 181.0, 51.0, 22.0 ], 154 | "text" : "unjoin 2" 155 | } 156 | 157 | } 158 | , { 159 | "box" : { 160 | "coll_data" : { 161 | "count" : 9, 162 | "data" : [ { 163 | "key" : 0, 164 | "value" : [ "bass_drum", 36 ] 165 | } 166 | , { 167 | "key" : 1, 168 | "value" : [ "snare_drum", 38 ] 169 | } 170 | , { 171 | "key" : 2, 172 | "value" : [ "closed_hihat", 42 ] 173 | } 174 | , { 175 | "key" : 3, 176 | "value" : [ "open_hihat", 46 ] 177 | } 178 | , { 179 | "key" : 4, 180 | "value" : [ "low_tom", 41 ] 181 | } 182 | , { 183 | "key" : 5, 184 | "value" : [ "mid_tom", 45 ] 185 | } 186 | , { 187 | "key" : 6, 188 | "value" : [ "high_tom", 48 ] 189 | } 190 | , { 191 | "key" : 7, 192 | "value" : [ "hand_clap", 39 ] 193 | } 194 | , { 195 | "key" : 8, 196 | "value" : [ "rim_shot", 37 ] 197 | } 198 | ] 199 | } 200 | , 201 | "id" : "obj-60", 202 | "maxclass" : "newobj", 203 | "numinlets" : 1, 204 | "numoutlets" : 4, 205 | "outlettype" : [ "", "", "", "" ], 206 | "patching_rect" : [ 50.0, 154.0, 137.0, 22.0 ], 207 | "saved_object_attributes" : { 208 | "embed" : 1, 209 | "precision" : 6 210 | } 211 | , 212 | "text" : "coll seq_id_to_midi_vae" 213 | } 214 | 215 | } 216 | , { 217 | "box" : { 218 | "comment" : "", 219 | "id" : "obj-12", 220 | "index" : 1, 221 | "maxclass" : "inlet", 222 | "numinlets" : 0, 223 | "numoutlets" : 1, 224 | "outlettype" : [ "bang" ], 225 | "patching_rect" : [ 50.0, 40.0, 30.0, 30.0 ] 226 | } 227 | 228 | } 229 | , { 230 | "box" : { 231 | "comment" : "", 232 | "id" : "obj-13", 233 | "index" : 1, 234 | "maxclass" : "outlet", 235 | "numinlets" : 1, 236 | "numoutlets" : 0, 237 | "patching_rect" : [ 66.0, 294.0, 30.0, 30.0 ] 238 | } 239 | 240 | } 241 | ], 242 | "lines" : [ { 243 | "patchline" : { 244 | "destination" : [ "obj-13", 0 ], 245 | "source" : [ "obj-11", 0 ] 246 | } 247 | 248 | } 249 | , { 250 | "patchline" : { 251 | "destination" : [ "obj-2", 0 ], 252 | "source" : [ "obj-12", 0 ] 253 | } 254 | 255 | } 256 | , { 257 | "patchline" : { 258 | "destination" : [ "obj-11", 0 ], 259 | "order" : 0, 260 | "source" : [ "obj-2", 0 ] 261 | } 262 | 263 | } 264 | , { 265 | "patchline" : { 266 | "destination" : [ "obj-6", 0 ], 267 | "order" : 1, 268 | "source" : [ "obj-2", 0 ] 269 | } 270 | 271 | } 272 | , { 273 | "patchline" : { 274 | "destination" : [ "obj-60", 0 ], 275 | "source" : [ "obj-6", 0 ] 276 | } 277 | 278 | } 279 | , { 280 | "patchline" : { 281 | "destination" : [ "obj-66", 0 ], 282 | "source" : [ "obj-60", 0 ] 283 | } 284 | 285 | } 286 | , { 287 | "patchline" : { 288 | "destination" : [ "obj-76", 0 ], 289 | "source" : [ "obj-66", 1 ] 290 | } 291 | 292 | } 293 | , { 294 | "patchline" : { 295 | "destination" : [ "obj-13", 0 ], 296 | "source" : [ "obj-76", 0 ] 297 | } 298 | 299 | } 300 | ] 301 | } 302 | , 303 | "patching_rect" : [ 115.0, 235.0, 90.0, 22.0 ], 304 | "saved_object_attributes" : { 305 | "description" : "", 306 | "digest" : "", 307 | "globalpatchername" : "", 308 | "tags" : "" 309 | } 310 | , 311 | "text" : "p" 312 | } 313 | 314 | } 315 | , { 316 | "box" : { 317 | "id" : "obj-8", 318 | "maxclass" : "button", 319 | "numinlets" : 1, 320 | "numoutlets" : 1, 321 | "outlettype" : [ "bang" ], 322 | "parameter_enable" : 0, 323 | "patching_rect" : [ 115.0, 200.0, 24.0, 24.0 ] 324 | } 325 | 326 | } 327 | , { 328 | "box" : { 329 | "comment" : "", 330 | "id" : "obj-4", 331 | "index" : 1, 332 | "maxclass" : "outlet", 333 | "numinlets" : 1, 334 | "numoutlets" : 0, 335 | "patching_rect" : [ 115.0, 364.0, 30.0, 30.0 ] 336 | } 337 | 338 | } 339 | , { 340 | "box" : { 341 | "id" : "obj-25", 342 | "linecount" : 2, 343 | "maxclass" : "message", 344 | "numinlets" : 2, 345 | "numoutlets" : 1, 346 | "outlettype" : [ "" ], 347 | "patching_rect" : [ 238.0, 200.0, 634.0, 35.0 ], 348 | "text" : "nseq 9, nstep 48, mode 0, loopruler 0, usestepcolor2 1, pitch_active 1, velocity_active 1, duration_active 1, loop 1 48, display_seq 1, target_seq 1" 349 | } 350 | 351 | } 352 | , { 353 | "box" : { 354 | "comment" : "", 355 | "id" : "obj-1", 356 | "index" : 1, 357 | "maxclass" : "inlet", 358 | "numinlets" : 0, 359 | "numoutlets" : 1, 360 | "outlettype" : [ "bang" ], 361 | "patching_rect" : [ 115.0, 84.0, 30.0, 30.0 ] 362 | } 363 | 364 | } 365 | ], 366 | "lines" : [ { 367 | "patchline" : { 368 | "destination" : [ "obj-25", 0 ], 369 | "order" : 0, 370 | "source" : [ "obj-1", 0 ] 371 | } 372 | 373 | } 374 | , { 375 | "patchline" : { 376 | "destination" : [ "obj-8", 0 ], 377 | "order" : 1, 378 | "source" : [ "obj-1", 0 ] 379 | } 380 | 381 | } 382 | , { 383 | "patchline" : { 384 | "destination" : [ "obj-4", 0 ], 385 | "source" : [ "obj-14", 0 ] 386 | } 387 | 388 | } 389 | , { 390 | "patchline" : { 391 | "destination" : [ "obj-4", 0 ], 392 | "source" : [ "obj-25", 0 ] 393 | } 394 | 395 | } 396 | , { 397 | "patchline" : { 398 | "destination" : [ "obj-14", 0 ], 399 | "source" : [ "obj-8", 0 ] 400 | } 401 | 402 | } 403 | ], 404 | "styles" : [ { 405 | "name" : "tap", 406 | "default" : { 407 | "fontname" : [ "Lato Light" ] 408 | } 409 | , 410 | "parentstyle" : "", 411 | "multi" : 0 412 | } 413 | ], 414 | "bgcolor" : [ 1.0, 1.0, 1.0, 1.0 ] 415 | } 416 | 417 | } 418 | -------------------------------------------------------------------------------- /subpatches/shuffle_metro.maxpat: -------------------------------------------------------------------------------- 1 | { 2 | "patcher" : { 3 | "fileversion" : 1, 4 | "appversion" : { 5 | "major" : 8, 6 | "minor" : 1, 7 | "revision" : 8, 8 | "architecture" : "x64", 9 | "modernui" : 1 10 | } 11 | , 12 | "classnamespace" : "box", 13 | "rect" : [ 534.0, 269.0, 885.0, 771.0 ], 14 | "bglocked" : 0, 15 | "openinpresentation" : 0, 16 | "default_fontsize" : 12.0, 17 | "default_fontface" : 0, 18 | "default_fontname" : "Arial", 19 | "gridonopen" : 1, 20 | "gridsize" : [ 15.0, 15.0 ], 21 | "gridsnaponopen" : 1, 22 | "objectsnaponopen" : 1, 23 | "statusbarvisible" : 2, 24 | "toolbarvisible" : 1, 25 | "lefttoolbarpinned" : 0, 26 | "toptoolbarpinned" : 0, 27 | "righttoolbarpinned" : 0, 28 | "bottomtoolbarpinned" : 0, 29 | "toolbars_unpinned_last_save" : 2, 30 | "tallnewobj" : 0, 31 | "boxanimatetime" : 200, 32 | "enablehscroll" : 1, 33 | "enablevscroll" : 1, 34 | "devicewidth" : 0.0, 35 | "description" : "", 36 | "digest" : "", 37 | "tags" : "", 38 | "style" : "", 39 | "subpatcher_template" : "no_top", 40 | "assistshowspatchername" : 0, 41 | "boxes" : [ { 42 | "box" : { 43 | "id" : "obj-59", 44 | "maxclass" : "newobj", 45 | "numinlets" : 2, 46 | "numoutlets" : 1, 47 | "outlettype" : [ "int" ], 48 | "patching_rect" : [ 195.0, 303.0, 29.5, 22.0 ], 49 | "text" : "+" 50 | } 51 | 52 | } 53 | , { 54 | "box" : { 55 | "id" : "obj-58", 56 | "maxclass" : "number", 57 | "numinlets" : 1, 58 | "numoutlets" : 2, 59 | "outlettype" : [ "", "bang" ], 60 | "parameter_enable" : 0, 61 | "patching_rect" : [ 117.0, 380.0, 50.0, 22.0 ] 62 | } 63 | 64 | } 65 | , { 66 | "box" : { 67 | "id" : "obj-56", 68 | "maxclass" : "newobj", 69 | "numinlets" : 2, 70 | "numoutlets" : 1, 71 | "outlettype" : [ "int" ], 72 | "patching_rect" : [ 117.0, 337.0, 29.5, 22.0 ], 73 | "text" : "+" 74 | } 75 | 76 | } 77 | , { 78 | "box" : { 79 | "id" : "obj-41", 80 | "maxclass" : "newobj", 81 | "numinlets" : 1, 82 | "numoutlets" : 2, 83 | "outlettype" : [ "int", "int" ], 84 | "patching_rect" : [ 293.0, 278.0, 29.5, 22.0 ], 85 | "text" : "t i i" 86 | } 87 | 88 | } 89 | , { 90 | "box" : { 91 | "id" : "obj-32", 92 | "maxclass" : "newobj", 93 | "numinlets" : 2, 94 | "numoutlets" : 1, 95 | "outlettype" : [ "int" ], 96 | "patching_rect" : [ 304.25, 316.0, 29.5, 22.0 ], 97 | "text" : "% 2" 98 | } 99 | 100 | } 101 | , { 102 | "box" : { 103 | "id" : "obj-42", 104 | "maxclass" : "newobj", 105 | "numinlets" : 2, 106 | "numoutlets" : 1, 107 | "outlettype" : [ "int" ], 108 | "patching_rect" : [ 117.0, 617.0, 36.0, 22.0 ], 109 | "text" : "% 96" 110 | } 111 | 112 | } 113 | , { 114 | "box" : { 115 | "id" : "obj-40", 116 | "maxclass" : "newobj", 117 | "numinlets" : 2, 118 | "numoutlets" : 1, 119 | "outlettype" : [ "int" ], 120 | "patching_rect" : [ 117.0, 645.0, 29.5, 22.0 ], 121 | "text" : "+ 1" 122 | } 123 | 124 | } 125 | , { 126 | "box" : { 127 | "id" : "obj-36", 128 | "maxclass" : "newobj", 129 | "numinlets" : 1, 130 | "numoutlets" : 3, 131 | "outlettype" : [ "", "int", "int" ], 132 | "patching_rect" : [ 117.0, 671.0, 48.0, 22.0 ], 133 | "text" : "change" 134 | } 135 | 136 | } 137 | , { 138 | "box" : { 139 | "id" : "obj-65", 140 | "maxclass" : "newobj", 141 | "numinlets" : 2, 142 | "numoutlets" : 1, 143 | "outlettype" : [ "int" ], 144 | "patching_rect" : [ 117.0, 291.0, 30.0, 22.0 ], 145 | "text" : "* 48" 146 | } 147 | 148 | } 149 | , { 150 | "box" : { 151 | "id" : "obj-64", 152 | "maxclass" : "newobj", 153 | "numinlets" : 2, 154 | "numoutlets" : 1, 155 | "outlettype" : [ "int" ], 156 | "patching_rect" : [ 117.0, 228.0, 29.5, 22.0 ], 157 | "text" : "- 1" 158 | } 159 | 160 | } 161 | , { 162 | "box" : { 163 | "id" : "obj-51", 164 | "maxclass" : "newobj", 165 | "numinlets" : 2, 166 | "numoutlets" : 1, 167 | "outlettype" : [ "int" ], 168 | "patching_rect" : [ 195.0, 228.0, 29.5, 22.0 ], 169 | "text" : "- 1" 170 | } 171 | 172 | } 173 | , { 174 | "box" : { 175 | "id" : "obj-43", 176 | "maxclass" : "newobj", 177 | "numinlets" : 2, 178 | "numoutlets" : 1, 179 | "outlettype" : [ "int" ], 180 | "patching_rect" : [ 195.0, 256.0, 30.0, 22.0 ], 181 | "text" : "* 12" 182 | } 183 | 184 | } 185 | , { 186 | "box" : { 187 | "id" : "obj-29", 188 | "maxclass" : "newobj", 189 | "numinlets" : 2, 190 | "numoutlets" : 1, 191 | "outlettype" : [ "int" ], 192 | "patching_rect" : [ 117.0, 258.0, 29.5, 22.0 ], 193 | "text" : "% 2" 194 | } 195 | 196 | } 197 | , { 198 | "box" : { 199 | "id" : "obj-33", 200 | "maxclass" : "number", 201 | "numinlets" : 1, 202 | "numoutlets" : 2, 203 | "outlettype" : [ "", "bang" ], 204 | "parameter_enable" : 0, 205 | "patching_rect" : [ 580.5, 323.0, 50.0, 22.0 ] 206 | } 207 | 208 | } 209 | , { 210 | "box" : { 211 | "id" : "obj-31", 212 | "maxclass" : "newobj", 213 | "numinlets" : 2, 214 | "numoutlets" : 1, 215 | "outlettype" : [ "float" ], 216 | "patching_rect" : [ 580.5, 265.0, 101.5, 22.0 ], 217 | "text" : "/ 3." 218 | } 219 | 220 | } 221 | , { 222 | "box" : { 223 | "id" : "obj-13", 224 | "maxclass" : "newobj", 225 | "numinlets" : 2, 226 | "numoutlets" : 1, 227 | "outlettype" : [ "int" ], 228 | "patching_rect" : [ 117.0, 581.0, 29.5, 22.0 ], 229 | "text" : "* 1" 230 | } 231 | 232 | } 233 | , { 234 | "box" : { 235 | "comment" : "", 236 | "id" : "obj-2", 237 | "index" : 3, 238 | "maxclass" : "inlet", 239 | "numinlets" : 0, 240 | "numoutlets" : 1, 241 | "outlettype" : [ "" ], 242 | "patching_rect" : [ 763.0, 48.0, 30.0, 30.0 ] 243 | } 244 | 245 | } 246 | , { 247 | "box" : { 248 | "id" : "obj-24", 249 | "maxclass" : "number", 250 | "numinlets" : 1, 251 | "numoutlets" : 2, 252 | "outlettype" : [ "", "bang" ], 253 | "parameter_enable" : 0, 254 | "patching_rect" : [ 313.25, 181.0, 50.0, 22.0 ] 255 | } 256 | 257 | } 258 | , { 259 | "box" : { 260 | "id" : "obj-12", 261 | "maxclass" : "newobj", 262 | "numinlets" : 2, 263 | "numoutlets" : 1, 264 | "outlettype" : [ "int" ], 265 | "patching_rect" : [ 313.25, 153.0, 29.5, 22.0 ], 266 | "text" : "/ 12" 267 | } 268 | 269 | } 270 | , { 271 | "box" : { 272 | "id" : "obj-16", 273 | "maxclass" : "newobj", 274 | "numinlets" : 2, 275 | "numoutlets" : 1, 276 | "outlettype" : [ "int" ], 277 | "patching_rect" : [ 293.0, 223.0, 38.75, 22.0 ], 278 | "text" : "/ 120" 279 | } 280 | 281 | } 282 | , { 283 | "box" : { 284 | "id" : "obj-14", 285 | "maxclass" : "newobj", 286 | "numinlets" : 2, 287 | "numoutlets" : 1, 288 | "outlettype" : [ "bang" ], 289 | "patching_rect" : [ 221.0, 79.0, 63.0, 22.0 ], 290 | "text" : "metro 48n" 291 | } 292 | 293 | } 294 | , { 295 | "box" : { 296 | "comment" : "", 297 | "id" : "obj-8", 298 | "index" : 1, 299 | "maxclass" : "outlet", 300 | "numinlets" : 1, 301 | "numoutlets" : 0, 302 | "patching_rect" : [ 117.0, 703.0, 30.0, 30.0 ] 303 | } 304 | 305 | } 306 | , { 307 | "box" : { 308 | "id" : "obj-95", 309 | "maxclass" : "newobj", 310 | "numinlets" : 2, 311 | "numoutlets" : 9, 312 | "outlettype" : [ "int", "int", "float", "float", "float", "", "int", "float", "" ], 313 | "patching_rect" : [ 221.0, 107.452991366386414, 177.0, 22.0 ], 314 | "text" : "transport" 315 | } 316 | 317 | } 318 | , { 319 | "box" : { 320 | "id" : "obj-6", 321 | "maxclass" : "newobj", 322 | "numinlets" : 1, 323 | "numoutlets" : 1, 324 | "outlettype" : [ "" ], 325 | "patching_rect" : [ 580.5, 199.0, 83.0, 22.0 ], 326 | "text" : "loadmess 16n" 327 | } 328 | 329 | } 330 | , { 331 | "box" : { 332 | "comment" : "", 333 | "id" : "obj-10", 334 | "index" : 1, 335 | "maxclass" : "inlet", 336 | "numinlets" : 0, 337 | "numoutlets" : 1, 338 | "outlettype" : [ "" ], 339 | "patching_rect" : [ 221.0, -25.0, 30.0, 30.0 ] 340 | } 341 | 342 | } 343 | , { 344 | "box" : { 345 | "id" : "obj-9", 346 | "maxclass" : "toggle", 347 | "numinlets" : 1, 348 | "numoutlets" : 1, 349 | "outlettype" : [ "int" ], 350 | "parameter_enable" : 0, 351 | "patching_rect" : [ 221.0, 16.0, 24.0, 24.0 ] 352 | } 353 | 354 | } 355 | , { 356 | "box" : { 357 | "id" : "obj-7", 358 | "maxclass" : "message", 359 | "numinlets" : 2, 360 | "numoutlets" : 1, 361 | "outlettype" : [ "" ], 362 | "patching_rect" : [ 221.0, 48.0, 57.0, 22.0 ], 363 | "text" : "active $1" 364 | } 365 | 366 | } 367 | , { 368 | "box" : { 369 | "id" : "obj-3", 370 | "maxclass" : "newobj", 371 | "numinlets" : 1, 372 | "numoutlets" : 2, 373 | "outlettype" : [ "", "" ], 374 | "patching_rect" : [ 515.5, 113.0, 101.0, 22.0 ], 375 | "text" : "patcherargs 0.25" 376 | } 377 | 378 | } 379 | , { 380 | "box" : { 381 | "id" : "obj-39", 382 | "maxclass" : "newobj", 383 | "numinlets" : 2, 384 | "numoutlets" : 1, 385 | "outlettype" : [ "float" ], 386 | "patching_rect" : [ 352.0, 459.0, 29.5, 22.0 ], 387 | "text" : "* 1." 388 | } 389 | 390 | } 391 | , { 392 | "box" : { 393 | "comment" : "", 394 | "id" : "obj-35", 395 | "index" : 2, 396 | "maxclass" : "inlet", 397 | "numinlets" : 0, 398 | "numoutlets" : 1, 399 | "outlettype" : [ "" ], 400 | "patching_rect" : [ 490.0, 40.0, 30.0, 30.0 ] 401 | } 402 | 403 | } 404 | , { 405 | "box" : { 406 | "id" : "obj-34", 407 | "maxclass" : "newobj", 408 | "numinlets" : 2, 409 | "numoutlets" : 1, 410 | "outlettype" : [ "" ], 411 | "patching_rect" : [ 152.0, 533.0, 78.0, 22.0 ], 412 | "text" : "pipe" 413 | } 414 | 415 | } 416 | , { 417 | "box" : { 418 | "id" : "obj-22", 419 | "maxclass" : "newobj", 420 | "numinlets" : 1, 421 | "numoutlets" : 1, 422 | "outlettype" : [ "" ], 423 | "patching_rect" : [ 580.5, 233.0, 135.0, 22.0 ], 424 | "text" : "translate notevalues ms" 425 | } 426 | 427 | } 428 | , { 429 | "box" : { 430 | "id" : "obj-19", 431 | "maxclass" : "newobj", 432 | "numinlets" : 2, 433 | "numoutlets" : 1, 434 | "outlettype" : [ "int" ], 435 | "patching_rect" : [ 304.25, 396.0, 29.5, 22.0 ], 436 | "text" : "+ 1" 437 | } 438 | 439 | } 440 | , { 441 | "box" : { 442 | "id" : "obj-17", 443 | "maxclass" : "newobj", 444 | "numinlets" : 2, 445 | "numoutlets" : 2, 446 | "outlettype" : [ "", "" ], 447 | "patching_rect" : [ 117.0, 448.0, 54.0, 22.0 ], 448 | "text" : "gate 2 1" 449 | } 450 | 451 | } 452 | ], 453 | "lines" : [ { 454 | "patchline" : { 455 | "destination" : [ "obj-9", 0 ], 456 | "source" : [ "obj-10", 0 ] 457 | } 458 | 459 | } 460 | , { 461 | "patchline" : { 462 | "destination" : [ "obj-24", 0 ], 463 | "source" : [ "obj-12", 0 ] 464 | } 465 | 466 | } 467 | , { 468 | "patchline" : { 469 | "destination" : [ "obj-42", 0 ], 470 | "source" : [ "obj-13", 0 ] 471 | } 472 | 473 | } 474 | , { 475 | "patchline" : { 476 | "destination" : [ "obj-95", 0 ], 477 | "source" : [ "obj-14", 0 ] 478 | } 479 | 480 | } 481 | , { 482 | "patchline" : { 483 | "destination" : [ "obj-41", 0 ], 484 | "source" : [ "obj-16", 0 ] 485 | } 486 | 487 | } 488 | , { 489 | "patchline" : { 490 | "destination" : [ "obj-13", 0 ], 491 | "source" : [ "obj-17", 0 ] 492 | } 493 | 494 | } 495 | , { 496 | "patchline" : { 497 | "destination" : [ "obj-34", 0 ], 498 | "source" : [ "obj-17", 1 ] 499 | } 500 | 501 | } 502 | , { 503 | "patchline" : { 504 | "destination" : [ "obj-17", 0 ], 505 | "midpoints" : [ 313.75, 443.5, 126.5, 443.5 ], 506 | "source" : [ "obj-19", 0 ] 507 | } 508 | 509 | } 510 | , { 511 | "patchline" : { 512 | "destination" : [ "obj-13", 1 ], 513 | "midpoints" : [ 772.5, 574.0, 137.0, 574.0 ], 514 | "source" : [ "obj-2", 0 ] 515 | } 516 | 517 | } 518 | , { 519 | "patchline" : { 520 | "destination" : [ "obj-31", 0 ], 521 | "source" : [ "obj-22", 0 ] 522 | } 523 | 524 | } 525 | , { 526 | "patchline" : { 527 | "destination" : [ "obj-16", 1 ], 528 | "source" : [ "obj-24", 0 ] 529 | } 530 | 531 | } 532 | , { 533 | "patchline" : { 534 | "destination" : [ "obj-65", 0 ], 535 | "source" : [ "obj-29", 0 ] 536 | } 537 | 538 | } 539 | , { 540 | "patchline" : { 541 | "destination" : [ "obj-39", 0 ], 542 | "midpoints" : [ 525.0, 305.5, 361.5, 305.5 ], 543 | "source" : [ "obj-3", 0 ] 544 | } 545 | 546 | } 547 | , { 548 | "patchline" : { 549 | "destination" : [ "obj-33", 0 ], 550 | "source" : [ "obj-31", 0 ] 551 | } 552 | 553 | } 554 | , { 555 | "patchline" : { 556 | "destination" : [ "obj-19", 0 ], 557 | "source" : [ "obj-32", 0 ] 558 | } 559 | 560 | } 561 | , { 562 | "patchline" : { 563 | "destination" : [ "obj-39", 1 ], 564 | "source" : [ "obj-33", 0 ] 565 | } 566 | 567 | } 568 | , { 569 | "patchline" : { 570 | "destination" : [ "obj-13", 0 ], 571 | "midpoints" : [ 161.5, 567.5, 126.5, 567.5 ], 572 | "source" : [ "obj-34", 0 ] 573 | } 574 | 575 | } 576 | , { 577 | "patchline" : { 578 | "destination" : [ "obj-39", 0 ], 579 | "midpoints" : [ 499.5, 307.5, 361.5, 307.5 ], 580 | "source" : [ "obj-35", 0 ] 581 | } 582 | 583 | } 584 | , { 585 | "patchline" : { 586 | "destination" : [ "obj-8", 0 ], 587 | "source" : [ "obj-36", 0 ] 588 | } 589 | 590 | } 591 | , { 592 | "patchline" : { 593 | "destination" : [ "obj-34", 1 ], 594 | "midpoints" : [ 361.5, 506.5, 220.5, 506.5 ], 595 | "source" : [ "obj-39", 0 ] 596 | } 597 | 598 | } 599 | , { 600 | "patchline" : { 601 | "destination" : [ "obj-36", 0 ], 602 | "source" : [ "obj-40", 0 ] 603 | } 604 | 605 | } 606 | , { 607 | "patchline" : { 608 | "destination" : [ "obj-32", 0 ], 609 | "midpoints" : [ 313.0, 303.0, 313.75, 303.0 ], 610 | "source" : [ "obj-41", 1 ] 611 | } 612 | 613 | } 614 | , { 615 | "patchline" : { 616 | "destination" : [ "obj-59", 1 ], 617 | "source" : [ "obj-41", 0 ] 618 | } 619 | 620 | } 621 | , { 622 | "patchline" : { 623 | "destination" : [ "obj-40", 0 ], 624 | "source" : [ "obj-42", 0 ] 625 | } 626 | 627 | } 628 | , { 629 | "patchline" : { 630 | "destination" : [ "obj-59", 0 ], 631 | "source" : [ "obj-43", 0 ] 632 | } 633 | 634 | } 635 | , { 636 | "patchline" : { 637 | "destination" : [ "obj-43", 0 ], 638 | "source" : [ "obj-51", 0 ] 639 | } 640 | 641 | } 642 | , { 643 | "patchline" : { 644 | "destination" : [ "obj-58", 0 ], 645 | "source" : [ "obj-56", 0 ] 646 | } 647 | 648 | } 649 | , { 650 | "patchline" : { 651 | "destination" : [ "obj-17", 1 ], 652 | "midpoints" : [ 126.5, 424.5, 161.5, 424.5 ], 653 | "source" : [ "obj-58", 0 ] 654 | } 655 | 656 | } 657 | , { 658 | "patchline" : { 659 | "destination" : [ "obj-56", 1 ], 660 | "source" : [ "obj-59", 0 ] 661 | } 662 | 663 | } 664 | , { 665 | "patchline" : { 666 | "destination" : [ "obj-22", 0 ], 667 | "source" : [ "obj-6", 0 ] 668 | } 669 | 670 | } 671 | , { 672 | "patchline" : { 673 | "destination" : [ "obj-29", 0 ], 674 | "source" : [ "obj-64", 0 ] 675 | } 676 | 677 | } 678 | , { 679 | "patchline" : { 680 | "destination" : [ "obj-56", 0 ], 681 | "source" : [ "obj-65", 0 ] 682 | } 683 | 684 | } 685 | , { 686 | "patchline" : { 687 | "destination" : [ "obj-14", 0 ], 688 | "source" : [ "obj-7", 0 ] 689 | } 690 | 691 | } 692 | , { 693 | "patchline" : { 694 | "destination" : [ "obj-7", 0 ], 695 | "source" : [ "obj-9", 0 ] 696 | } 697 | 698 | } 699 | , { 700 | "patchline" : { 701 | "destination" : [ "obj-12", 0 ], 702 | "source" : [ "obj-95", 3 ] 703 | } 704 | 705 | } 706 | , { 707 | "patchline" : { 708 | "destination" : [ "obj-16", 0 ], 709 | "source" : [ "obj-95", 2 ] 710 | } 711 | 712 | } 713 | , { 714 | "patchline" : { 715 | "destination" : [ "obj-51", 0 ], 716 | "source" : [ "obj-95", 1 ] 717 | } 718 | 719 | } 720 | , { 721 | "patchline" : { 722 | "destination" : [ "obj-64", 0 ], 723 | "source" : [ "obj-95", 0 ] 724 | } 725 | 726 | } 727 | ], 728 | "styles" : [ { 729 | "name" : "tap", 730 | "default" : { 731 | "fontname" : [ "Lato Light" ] 732 | } 733 | , 734 | "parentstyle" : "", 735 | "multi" : 0 736 | } 737 | ], 738 | "bgcolor" : [ 1.0, 1.0, 1.0, 1.0 ] 739 | } 740 | 741 | } 742 | --------------------------------------------------------------------------------