├── .gitignore ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── demo_1 ├── data │ └── mel_small │ │ ├── converter.json │ │ ├── decoder_multi_rnn_cell_cell_0_lstm_cell_bias │ │ ├── decoder_multi_rnn_cell_cell_0_lstm_cell_kernel │ │ ├── decoder_multi_rnn_cell_cell_1_lstm_cell_bias │ │ ├── decoder_multi_rnn_cell_cell_1_lstm_cell_kernel │ │ ├── decoder_output_projection_bias │ │ ├── decoder_output_projection_kernel │ │ ├── decoder_z_to_initial_state_bias │ │ ├── decoder_z_to_initial_state_kernel │ │ ├── encoder_cell_0_bidirectional_rnn_bw_multi_rnn_cell_cell_0_lstm_cell_bias │ │ ├── encoder_cell_0_bidirectional_rnn_bw_multi_rnn_cell_cell_0_lstm_cell_kernel │ │ ├── encoder_cell_0_bidirectional_rnn_fw_multi_rnn_cell_cell_0_lstm_cell_bias │ │ ├── encoder_cell_0_bidirectional_rnn_fw_multi_rnn_cell_cell_0_lstm_cell_kernel │ │ ├── encoder_mu_bias │ │ ├── encoder_mu_kernel │ │ ├── encoder_sigma_bias │ │ ├── encoder_sigma_kernel │ │ └── manifest.json ├── demo_1.js ├── index.html └── libraries │ └── musicvae.js ├── demo_2 ├── data │ └── mel_small │ │ ├── converter.json │ │ ├── decoder_multi_rnn_cell_cell_0_lstm_cell_bias │ │ ├── decoder_multi_rnn_cell_cell_0_lstm_cell_kernel │ │ ├── decoder_multi_rnn_cell_cell_1_lstm_cell_bias │ │ ├── decoder_multi_rnn_cell_cell_1_lstm_cell_kernel │ │ ├── decoder_output_projection_bias │ │ ├── decoder_output_projection_kernel │ │ ├── decoder_z_to_initial_state_bias │ │ ├── decoder_z_to_initial_state_kernel │ │ ├── encoder_cell_0_bidirectional_rnn_bw_multi_rnn_cell_cell_0_lstm_cell_bias │ │ ├── encoder_cell_0_bidirectional_rnn_bw_multi_rnn_cell_cell_0_lstm_cell_kernel │ │ ├── encoder_cell_0_bidirectional_rnn_fw_multi_rnn_cell_cell_0_lstm_cell_bias │ │ ├── encoder_cell_0_bidirectional_rnn_fw_multi_rnn_cell_cell_0_lstm_cell_kernel │ │ ├── encoder_mu_bias │ │ ├── encoder_mu_kernel │ │ ├── encoder_sigma_bias │ │ ├── encoder_sigma_kernel │ │ └── manifest.json ├── demo_2.js ├── index.html └── libraries │ ├── musicvae.js │ └── p5.js ├── demo_3 ├── data │ ├── mel_small │ │ ├── converter.json │ │ ├── decoder_multi_rnn_cell_cell_0_lstm_cell_bias │ │ ├── decoder_multi_rnn_cell_cell_0_lstm_cell_kernel │ │ ├── decoder_multi_rnn_cell_cell_1_lstm_cell_bias │ │ ├── decoder_multi_rnn_cell_cell_1_lstm_cell_kernel │ │ ├── decoder_output_projection_bias │ │ ├── decoder_output_projection_kernel │ │ ├── decoder_z_to_initial_state_bias │ │ ├── decoder_z_to_initial_state_kernel │ │ ├── encoder_cell_0_bidirectional_rnn_bw_multi_rnn_cell_cell_0_lstm_cell_bias │ │ ├── encoder_cell_0_bidirectional_rnn_bw_multi_rnn_cell_cell_0_lstm_cell_kernel │ │ ├── encoder_cell_0_bidirectional_rnn_fw_multi_rnn_cell_cell_0_lstm_cell_bias │ │ ├── encoder_cell_0_bidirectional_rnn_fw_multi_rnn_cell_cell_0_lstm_cell_kernel │ │ ├── encoder_mu_bias │ │ ├── encoder_mu_kernel │ │ ├── encoder_sigma_bias │ │ ├── encoder_sigma_kernel │ │ └── manifest.json │ └── piano │ │ ├── 100.mp3 │ │ ├── 101.mp3 │ │ ├── 102.mp3 │ │ ├── 103.mp3 │ │ ├── 104.mp3 │ │ ├── 105.mp3 │ │ ├── 106.mp3 │ │ ├── 107.mp3 │ │ ├── 108.mp3 │ │ ├── 21.mp3 │ │ ├── 22.mp3 │ │ ├── 23.mp3 │ │ ├── 24.mp3 │ │ ├── 25.mp3 │ │ ├── 26.mp3 │ │ ├── 27.mp3 │ │ ├── 28.mp3 │ │ ├── 29.mp3 │ │ ├── 30.mp3 │ │ ├── 31.mp3 │ │ ├── 32.mp3 │ │ ├── 33.mp3 │ │ ├── 34.mp3 │ │ ├── 35.mp3 │ │ ├── 36.mp3 │ │ ├── 37.mp3 │ │ ├── 38.mp3 │ │ ├── 39.mp3 │ │ ├── 40.mp3 │ │ ├── 41.mp3 │ │ ├── 42.mp3 │ │ ├── 43.mp3 │ │ ├── 44.mp3 │ │ ├── 45.mp3 │ │ ├── 46.mp3 │ │ ├── 47.mp3 │ │ ├── 48.mp3 │ │ ├── 49.mp3 │ │ ├── 50.mp3 │ │ ├── 51.mp3 │ │ ├── 52.mp3 │ │ ├── 53.mp3 │ │ ├── 54.mp3 │ │ ├── 55.mp3 │ │ ├── 56.mp3 │ │ ├── 57.mp3 │ │ ├── 58.mp3 │ │ ├── 59.mp3 │ │ ├── 60.mp3 │ │ ├── 61.mp3 │ │ ├── 62.mp3 │ │ ├── 63.mp3 │ │ ├── 64.mp3 │ │ ├── 65.mp3 │ │ ├── 66.mp3 │ │ ├── 67.mp3 │ │ ├── 68.mp3 │ │ ├── 69.mp3 │ │ ├── 70.mp3 │ │ ├── 71.mp3 │ │ ├── 72.mp3 │ │ ├── 73.mp3 │ │ ├── 74.mp3 │ │ ├── 75.mp3 │ │ ├── 76.mp3 │ │ ├── 77.mp3 │ │ ├── 78.mp3 │ │ ├── 79.mp3 │ │ ├── 80.mp3 │ │ ├── 81.mp3 │ │ ├── 82.mp3 │ │ ├── 83.mp3 │ │ ├── 84.mp3 │ │ ├── 85.mp3 │ │ ├── 86.mp3 │ │ ├── 87.mp3 │ │ ├── 88.mp3 │ │ ├── 89.mp3 │ │ ├── 90.mp3 │ │ ├── 91.mp3 │ │ ├── 92.mp3 │ │ ├── 93.mp3 │ │ ├── 94.mp3 │ │ ├── 95.mp3 │ │ ├── 96.mp3 │ │ ├── 97.mp3 │ │ ├── 98.mp3 │ │ └── 99.mp3 ├── demo_3.js ├── index.html └── libraries │ ├── musicvae.js │ ├── p5.js │ └── tone.js ├── demo_4 ├── data │ ├── images │ │ ├── about-icon.svg │ │ ├── ai-experiment.svg │ │ ├── favicon-melody-mixer-small.png │ │ ├── favicon-melody-mixer.png │ │ ├── friends-at-google.svg │ │ ├── icon-round-facebook.svg │ │ ├── icon-round-twitter.svg │ │ ├── magenta-logo.png │ │ ├── melody-mixer-og2.jpeg │ │ ├── melody-mixer.gif │ │ ├── pause-button.svg │ │ ├── play-button.svg │ │ └── tempo.svg │ ├── mel_small │ │ ├── converter.json │ │ ├── decoder_multi_rnn_cell_cell_0_lstm_cell_bias │ │ ├── decoder_multi_rnn_cell_cell_0_lstm_cell_kernel │ │ ├── decoder_multi_rnn_cell_cell_1_lstm_cell_bias │ │ ├── decoder_multi_rnn_cell_cell_1_lstm_cell_kernel │ │ ├── decoder_output_projection_bias │ │ ├── decoder_output_projection_kernel │ │ ├── decoder_z_to_initial_state_bias │ │ ├── decoder_z_to_initial_state_kernel │ │ ├── encoder_cell_0_bidirectional_rnn_bw_multi_rnn_cell_cell_0_lstm_cell_bias │ │ ├── encoder_cell_0_bidirectional_rnn_bw_multi_rnn_cell_cell_0_lstm_cell_kernel │ │ ├── encoder_cell_0_bidirectional_rnn_fw_multi_rnn_cell_cell_0_lstm_cell_bias │ │ ├── encoder_cell_0_bidirectional_rnn_fw_multi_rnn_cell_cell_0_lstm_cell_kernel │ │ ├── encoder_mu_bias │ │ ├── encoder_mu_kernel │ │ ├── encoder_sigma_bias │ │ ├── encoder_sigma_kernel │ │ └── manifest.json │ └── piano │ │ ├── 100.mp3 │ │ ├── 101.mp3 │ │ ├── 102.mp3 │ │ ├── 103.mp3 │ │ ├── 104.mp3 │ │ ├── 105.mp3 │ │ ├── 106.mp3 │ │ ├── 107.mp3 │ │ ├── 108.mp3 │ │ ├── 21.mp3 │ │ ├── 22.mp3 │ │ ├── 23.mp3 │ │ ├── 24.mp3 │ │ ├── 25.mp3 │ │ ├── 26.mp3 │ │ ├── 27.mp3 │ │ ├── 28.mp3 │ │ ├── 29.mp3 │ │ ├── 30.mp3 │ │ ├── 31.mp3 │ │ ├── 32.mp3 │ │ ├── 33.mp3 │ │ ├── 34.mp3 │ │ ├── 35.mp3 │ │ ├── 36.mp3 │ │ ├── 37.mp3 │ │ ├── 38.mp3 │ │ ├── 39.mp3 │ │ ├── 40.mp3 │ │ ├── 41.mp3 │ │ ├── 42.mp3 │ │ ├── 43.mp3 │ │ ├── 44.mp3 │ │ ├── 45.mp3 │ │ ├── 46.mp3 │ │ ├── 47.mp3 │ │ ├── 48.mp3 │ │ ├── 49.mp3 │ │ ├── 50.mp3 │ │ ├── 51.mp3 │ │ ├── 52.mp3 │ │ ├── 53.mp3 │ │ ├── 54.mp3 │ │ ├── 55.mp3 │ │ ├── 56.mp3 │ │ ├── 57.mp3 │ │ ├── 58.mp3 │ │ ├── 59.mp3 │ │ ├── 60.mp3 │ │ ├── 61.mp3 │ │ ├── 62.mp3 │ │ ├── 63.mp3 │ │ ├── 64.mp3 │ │ ├── 65.mp3 │ │ ├── 66.mp3 │ │ ├── 67.mp3 │ │ ├── 68.mp3 │ │ ├── 69.mp3 │ │ ├── 70.mp3 │ │ ├── 71.mp3 │ │ ├── 72.mp3 │ │ ├── 73.mp3 │ │ ├── 74.mp3 │ │ ├── 75.mp3 │ │ ├── 76.mp3 │ │ ├── 77.mp3 │ │ ├── 78.mp3 │ │ ├── 79.mp3 │ │ ├── 80.mp3 │ │ ├── 81.mp3 │ │ ├── 82.mp3 │ │ ├── 83.mp3 │ │ ├── 84.mp3 │ │ ├── 85.mp3 │ │ ├── 86.mp3 │ │ ├── 87.mp3 │ │ ├── 88.mp3 │ │ ├── 89.mp3 │ │ ├── 90.mp3 │ │ ├── 91.mp3 │ │ ├── 92.mp3 │ │ ├── 93.mp3 │ │ ├── 94.mp3 │ │ ├── 95.mp3 │ │ ├── 96.mp3 │ │ ├── 97.mp3 │ │ ├── 98.mp3 │ │ └── 99.mp3 ├── demo_4.js ├── index.html ├── libraries │ ├── musicvae.js │ ├── p5.js │ └── tone.js ├── preset-melodies.js └── style.css └── third_party ├── musicvae ├── LICENSE └── musicvae.js ├── p5 ├── LICENSE └── p5.js └── tone ├── LICENSE └── tone.js /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .idea 3 | .vscode 4 | *.swp 5 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to Contribute 2 | 3 | We'd love to accept your patches and contributions to this project. There are 4 | just a few small guidelines you need to follow. 5 | 6 | ## Contributor License Agreement 7 | 8 | Contributions to this project must be accompanied by a Contributor License 9 | Agreement. You (or your employer) retain the copyright to your contribution, 10 | this simply gives us permission to use and redistribute your contributions as 11 | part of the project. Head over to to see 12 | your current agreements on file or to sign a new one. 13 | 14 | You generally only need to submit a CLA once, so if you've already submitted one 15 | (even if it was for a different project), you probably don't need to do it 16 | again. 17 | 18 | ## Code reviews 19 | 20 | All submissions, including submissions by project members, require review. We 21 | use GitHub pull requests for this purpose. Consult 22 | [GitHub Help](https://help.github.com/articles/about-pull-requests/) for more 23 | information on using pull requests. 24 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright 2017 Google Inc. 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Melody Mixer Demos 2 | Meldoy Mixer is a series of short demos, each building on the last showing how to use Magenta's new machine learning library [MusicVAE.js](https://goo.gl/magenta/musicvae-js) to blend between melodies in real time in the browser, as well as visualize the melodies with [p5.js](https://p5js.org/), and play back the melodies using [Tone.js](https://tonejs.github.io/). 3 | 4 | For a step by step guide on how build Melody Mixer check out the [blogpost](https://goo.gl/sW5QrS ). 5 | 6 | ![Gif of two tiles containing melodies dragged apart and filled with new melodies generated with machine learning](https://storage.googleapis.com/melody-mixer/melody-mixer.gif) 7 | 8 | Demo1: Setup MusicVAE.js 9 | 10 | Demo2: Visualize Melodies with p5.js 11 | 12 | Demo3: Playback Audio with Tone.js 13 | 14 | Demo4: Add interaction with P5.js(this is the live melodymixer website) 15 | 16 | ## Usage 17 | Each folder includes all of the files necessary to run, just [start a static file server](https://github.com/processing/p5.js/wiki/Local-server) and click on the demo. 18 | 19 | ## Contributors 20 | Made by: [Torin Blankensmith](http://torinblankensmith.com), and [Kyle Phillips](http://haptic-data.com) in collaboration [Adam Roberts](https://github.com/adarob) from the Magenta team and built with friends at the Google Creative Lab. 21 | 22 | ## License 23 | Copyright 2017 Google Inc. 24 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 25 | http://www.apache.org/licenses/LICENSE-2.0 26 | 27 | 28 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 29 | 30 | ## Final Thoughts 31 | We encourage open sourcing projects as a way of learning from each other. Please respect our and other creators’ rights, including copyright and trademark rights when present, when sharing these works and creating derivative work. 32 | 33 | If you want more info on Google's policy, you can find that [here](https://www.google.com/policies/). 34 | -------------------------------------------------------------------------------- /demo_1/data/mel_small/converter.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "MelodyConverter", 3 | "args": { 4 | "minPitch": 21, 5 | "maxPitch": 108, 6 | "numSteps": 32 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /demo_1/data/mel_small/decoder_multi_rnn_cell_cell_0_lstm_cell_bias: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_1/data/mel_small/decoder_multi_rnn_cell_cell_0_lstm_cell_bias -------------------------------------------------------------------------------- /demo_1/data/mel_small/decoder_multi_rnn_cell_cell_0_lstm_cell_kernel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_1/data/mel_small/decoder_multi_rnn_cell_cell_0_lstm_cell_kernel -------------------------------------------------------------------------------- /demo_1/data/mel_small/decoder_multi_rnn_cell_cell_1_lstm_cell_bias: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_1/data/mel_small/decoder_multi_rnn_cell_cell_1_lstm_cell_bias -------------------------------------------------------------------------------- /demo_1/data/mel_small/decoder_multi_rnn_cell_cell_1_lstm_cell_kernel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_1/data/mel_small/decoder_multi_rnn_cell_cell_1_lstm_cell_kernel -------------------------------------------------------------------------------- /demo_1/data/mel_small/decoder_output_projection_bias: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_1/data/mel_small/decoder_output_projection_bias -------------------------------------------------------------------------------- /demo_1/data/mel_small/decoder_output_projection_kernel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_1/data/mel_small/decoder_output_projection_kernel -------------------------------------------------------------------------------- /demo_1/data/mel_small/decoder_z_to_initial_state_bias: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_1/data/mel_small/decoder_z_to_initial_state_bias -------------------------------------------------------------------------------- /demo_1/data/mel_small/decoder_z_to_initial_state_kernel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_1/data/mel_small/decoder_z_to_initial_state_kernel -------------------------------------------------------------------------------- /demo_1/data/mel_small/encoder_cell_0_bidirectional_rnn_bw_multi_rnn_cell_cell_0_lstm_cell_bias: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_1/data/mel_small/encoder_cell_0_bidirectional_rnn_bw_multi_rnn_cell_cell_0_lstm_cell_bias -------------------------------------------------------------------------------- /demo_1/data/mel_small/encoder_cell_0_bidirectional_rnn_bw_multi_rnn_cell_cell_0_lstm_cell_kernel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_1/data/mel_small/encoder_cell_0_bidirectional_rnn_bw_multi_rnn_cell_cell_0_lstm_cell_kernel -------------------------------------------------------------------------------- /demo_1/data/mel_small/encoder_cell_0_bidirectional_rnn_fw_multi_rnn_cell_cell_0_lstm_cell_bias: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_1/data/mel_small/encoder_cell_0_bidirectional_rnn_fw_multi_rnn_cell_cell_0_lstm_cell_bias -------------------------------------------------------------------------------- /demo_1/data/mel_small/encoder_cell_0_bidirectional_rnn_fw_multi_rnn_cell_cell_0_lstm_cell_kernel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_1/data/mel_small/encoder_cell_0_bidirectional_rnn_fw_multi_rnn_cell_cell_0_lstm_cell_kernel -------------------------------------------------------------------------------- /demo_1/data/mel_small/encoder_mu_bias: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_1/data/mel_small/encoder_mu_bias -------------------------------------------------------------------------------- /demo_1/data/mel_small/encoder_mu_kernel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_1/data/mel_small/encoder_mu_kernel -------------------------------------------------------------------------------- /demo_1/data/mel_small/encoder_sigma_bias: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_1/data/mel_small/encoder_sigma_bias -------------------------------------------------------------------------------- /demo_1/data/mel_small/encoder_sigma_kernel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_1/data/mel_small/encoder_sigma_kernel -------------------------------------------------------------------------------- /demo_1/data/mel_small/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "decoder/multi_rnn_cell/cell_0/lstm_cell/bias": { 3 | "filename": "decoder_multi_rnn_cell_cell_0_lstm_cell_bias", 4 | "shape": [ 5 | 1024 6 | ] 7 | }, 8 | "decoder/multi_rnn_cell/cell_0/lstm_cell/kernel": { 9 | "filename": "decoder_multi_rnn_cell_cell_0_lstm_cell_kernel", 10 | "shape": [ 11 | 602, 12 | 1024 13 | ] 14 | }, 15 | "decoder/multi_rnn_cell/cell_1/lstm_cell/bias": { 16 | "filename": "decoder_multi_rnn_cell_cell_1_lstm_cell_bias", 17 | "shape": [ 18 | 1024 19 | ] 20 | }, 21 | "decoder/multi_rnn_cell/cell_1/lstm_cell/kernel": { 22 | "filename": "decoder_multi_rnn_cell_cell_1_lstm_cell_kernel", 23 | "shape": [ 24 | 512, 25 | 1024 26 | ] 27 | }, 28 | "decoder/output_projection/bias": { 29 | "filename": "decoder_output_projection_bias", 30 | "shape": [ 31 | 90 32 | ] 33 | }, 34 | "decoder/output_projection/kernel": { 35 | "filename": "decoder_output_projection_kernel", 36 | "shape": [ 37 | 256, 38 | 90 39 | ] 40 | }, 41 | "decoder/z_to_initial_state/bias": { 42 | "filename": "decoder_z_to_initial_state_bias", 43 | "shape": [ 44 | 1024 45 | ] 46 | }, 47 | "decoder/z_to_initial_state/kernel": { 48 | "filename": "decoder_z_to_initial_state_kernel", 49 | "shape": [ 50 | 256, 51 | 1024 52 | ] 53 | }, 54 | "encoder/cell_0/bidirectional_rnn/bw/multi_rnn_cell/cell_0/lstm_cell/bias": { 55 | "filename": "encoder_cell_0_bidirectional_rnn_bw_multi_rnn_cell_cell_0_lstm_cell_bias", 56 | "shape": [ 57 | 2048 58 | ] 59 | }, 60 | "encoder/cell_0/bidirectional_rnn/bw/multi_rnn_cell/cell_0/lstm_cell/kernel": { 61 | "filename": "encoder_cell_0_bidirectional_rnn_bw_multi_rnn_cell_cell_0_lstm_cell_kernel", 62 | "shape": [ 63 | 602, 64 | 2048 65 | ] 66 | }, 67 | "encoder/cell_0/bidirectional_rnn/fw/multi_rnn_cell/cell_0/lstm_cell/bias": { 68 | "filename": "encoder_cell_0_bidirectional_rnn_fw_multi_rnn_cell_cell_0_lstm_cell_bias", 69 | "shape": [ 70 | 2048 71 | ] 72 | }, 73 | "encoder/cell_0/bidirectional_rnn/fw/multi_rnn_cell/cell_0/lstm_cell/kernel": { 74 | "filename": "encoder_cell_0_bidirectional_rnn_fw_multi_rnn_cell_cell_0_lstm_cell_kernel", 75 | "shape": [ 76 | 602, 77 | 2048 78 | ] 79 | }, 80 | "encoder/mu/bias": { 81 | "filename": "encoder_mu_bias", 82 | "shape": [ 83 | 256 84 | ] 85 | }, 86 | "encoder/mu/kernel": { 87 | "filename": "encoder_mu_kernel", 88 | "shape": [ 89 | 1024, 90 | 256 91 | ] 92 | }, 93 | "encoder/sigma/bias": { 94 | "filename": "encoder_sigma_bias", 95 | "shape": [ 96 | 256 97 | ] 98 | }, 99 | "encoder/sigma/kernel": { 100 | "filename": "encoder_sigma_kernel", 101 | "shape": [ 102 | 1024, 103 | 256 104 | ] 105 | } 106 | } -------------------------------------------------------------------------------- /demo_1/demo_1.js: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | 16 | 17 | 18 | //Play with this to get back a larger or smaller blend of melodies 19 | var numInterpolations = 4; //numInterpolations containing 32 notes 20 | 21 | // generates an array where indices correspond to midi notes 22 | var everyNote = 'C,C#,D,D#,E,F,F#,G,G#,A,A#,B,'.repeat(20).split(',').map( function(x,i) { 23 | return x + '' + Math.floor(i/12); 24 | }); 25 | 26 | //returns the midi pitch value for the given note. 27 | //returns -1 if not found 28 | function toMidi(note) { 29 | return everyNote.indexOf(note); 30 | } 31 | 32 | //If you want to try out other melodies copy and paste any of these in https://github..... 33 | var MELODY1 = { notes: [ 34 | {pitch: toMidi('A3'), quantizedStartStep: 0, quantizedEndStep: 4}, 35 | {pitch: toMidi('D4'), quantizedStartStep: 4, quantizedEndStep: 6}, 36 | {pitch: toMidi('E4'), quantizedStartStep: 6, quantizedEndStep: 8}, 37 | {pitch: toMidi('F4'), quantizedStartStep: 8, quantizedEndStep: 10}, 38 | {pitch: toMidi('D4'), quantizedStartStep: 10, quantizedEndStep: 12}, 39 | {pitch: toMidi('E4'), quantizedStartStep: 12, quantizedEndStep: 16}, 40 | {pitch: toMidi('C4'), quantizedStartStep: 16, quantizedEndStep: 20}, 41 | {pitch: toMidi('D4'), quantizedStartStep: 20, quantizedEndStep: 26}, 42 | {pitch: toMidi('A3'), quantizedStartStep: 26, quantizedEndStep: 28}, 43 | {pitch: toMidi('A3'), quantizedStartStep: 28, quantizedEndStep: 32} 44 | ]}; 45 | 46 | //you can also just put in the midi pitch note if you know it 47 | var MELODY2 = { notes: [ 48 | {pitch: 50, quantizedStartStep: 0, quantizedEndStep: 1}, 49 | {pitch: 53, quantizedStartStep: 1, quantizedEndStep: 2}, 50 | {pitch: 58, quantizedStartStep: 2, quantizedEndStep: 3}, 51 | {pitch: 58, quantizedStartStep: 3, quantizedEndStep: 4}, 52 | {pitch: 58, quantizedStartStep: 4, quantizedEndStep: 5}, 53 | {pitch: 53, quantizedStartStep: 5, quantizedEndStep: 6}, 54 | {pitch: 53, quantizedStartStep: 6, quantizedEndStep: 7}, 55 | {pitch: 53, quantizedStartStep: 7, quantizedEndStep: 8}, 56 | {pitch: 52, quantizedStartStep: 8, quantizedEndStep: 9}, 57 | {pitch: 55, quantizedStartStep: 9, quantizedEndStep: 10}, 58 | {pitch: 60, quantizedStartStep: 10, quantizedEndStep: 11}, 59 | {pitch: 60, quantizedStartStep: 11, quantizedEndStep: 12}, 60 | {pitch: 60, quantizedStartStep: 12, quantizedEndStep: 13}, 61 | {pitch: 60, quantizedStartStep: 13, quantizedEndStep: 14}, 62 | {pitch: 60, quantizedStartStep: 14, quantizedEndStep: 15}, 63 | {pitch: 52, quantizedStartStep: 15, quantizedEndStep: 16}, 64 | {pitch: 57, quantizedStartStep: 16, quantizedEndStep: 17}, 65 | {pitch: 57, quantizedStartStep: 17, quantizedEndStep: 18}, 66 | {pitch: 57, quantizedStartStep: 18, quantizedEndStep: 19}, 67 | {pitch: 65, quantizedStartStep: 19, quantizedEndStep: 20}, 68 | {pitch: 65, quantizedStartStep: 20, quantizedEndStep: 21}, 69 | {pitch: 65, quantizedStartStep: 21, quantizedEndStep: 22}, 70 | {pitch: 57, quantizedStartStep: 22, quantizedEndStep: 23}, 71 | {pitch: 57, quantizedStartStep: 23, quantizedEndStep: 24}, 72 | {pitch: 57, quantizedStartStep: 24, quantizedEndStep: 25}, 73 | {pitch: 57, quantizedStartStep: 25, quantizedEndStep: 26}, 74 | {pitch: 62, quantizedStartStep: 26, quantizedEndStep: 27}, 75 | {pitch: 62, quantizedStartStep: 27, quantizedEndStep: 28}, 76 | {pitch: 65, quantizedStartStep: 28, quantizedEndStep: 29}, 77 | {pitch: 65, quantizedStartStep: 29, quantizedEndStep: 30}, 78 | {pitch: 69, quantizedStartStep: 30, quantizedEndStep: 31}, 79 | {pitch: 69, quantizedStartStep: 31, quantizedEndStep: 32} 80 | ]}; 81 | 82 | 83 | // go to https://http://goo.gl/magenta/musicvae-checkpoints to see more checkpoint urls 84 | // var melodiesModelCheckPoint = 'https://storage.googleapis.com/download.magenta.tensorflow.org/models/music_vae/dljs/mel_small'; 85 | var melodiesModelCheckPoint = './data/mel_small'; 86 | 87 | //Uses promises to chain together asynchronous operations. 88 | //Check out https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises for info on promises 89 | new musicvae.MusicVAE(melodiesModelCheckPoint) 90 | .initialize() 91 | .then(function(musicVAE) { 92 | //blends between the given two melodies and returns numInterpolations note sequences 93 | var noteSequences = musicVAE.interpolate([MELODY1, MELODY2], numInterpolations); 94 | noteSequences.forEach(function(noteSequence, index) { 95 | displayMelodies(noteSequence.notes, index); 96 | }); 97 | }); 98 | 99 | // takes the given array of notes and index. updates the output 100 | function displayMelodies(notes, index) { 101 | var output = 'Melody ' + index + '
'; 102 | output += JSON.stringify(notes, null, ' ') + '

'; 103 | document.querySelector('.output' + index).innerHTML = output; 104 | } 105 | -------------------------------------------------------------------------------- /demo_1/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 14 | 32 | 33 | 34 | 35 |
36 |
Downloading ML Model
37 |

38 |     

39 |     
  
40 |   
41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /demo_2/data/mel_small/converter.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "MelodyConverter", 3 | "args": { 4 | "minPitch": 21, 5 | "maxPitch": 108, 6 | "numSteps": 32 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /demo_2/data/mel_small/decoder_multi_rnn_cell_cell_0_lstm_cell_bias: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_2/data/mel_small/decoder_multi_rnn_cell_cell_0_lstm_cell_bias -------------------------------------------------------------------------------- /demo_2/data/mel_small/decoder_multi_rnn_cell_cell_0_lstm_cell_kernel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_2/data/mel_small/decoder_multi_rnn_cell_cell_0_lstm_cell_kernel -------------------------------------------------------------------------------- /demo_2/data/mel_small/decoder_multi_rnn_cell_cell_1_lstm_cell_bias: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_2/data/mel_small/decoder_multi_rnn_cell_cell_1_lstm_cell_bias -------------------------------------------------------------------------------- /demo_2/data/mel_small/decoder_multi_rnn_cell_cell_1_lstm_cell_kernel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_2/data/mel_small/decoder_multi_rnn_cell_cell_1_lstm_cell_kernel -------------------------------------------------------------------------------- /demo_2/data/mel_small/decoder_output_projection_bias: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_2/data/mel_small/decoder_output_projection_bias -------------------------------------------------------------------------------- /demo_2/data/mel_small/decoder_output_projection_kernel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_2/data/mel_small/decoder_output_projection_kernel -------------------------------------------------------------------------------- /demo_2/data/mel_small/decoder_z_to_initial_state_bias: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_2/data/mel_small/decoder_z_to_initial_state_bias -------------------------------------------------------------------------------- /demo_2/data/mel_small/decoder_z_to_initial_state_kernel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_2/data/mel_small/decoder_z_to_initial_state_kernel -------------------------------------------------------------------------------- /demo_2/data/mel_small/encoder_cell_0_bidirectional_rnn_bw_multi_rnn_cell_cell_0_lstm_cell_bias: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_2/data/mel_small/encoder_cell_0_bidirectional_rnn_bw_multi_rnn_cell_cell_0_lstm_cell_bias -------------------------------------------------------------------------------- /demo_2/data/mel_small/encoder_cell_0_bidirectional_rnn_bw_multi_rnn_cell_cell_0_lstm_cell_kernel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_2/data/mel_small/encoder_cell_0_bidirectional_rnn_bw_multi_rnn_cell_cell_0_lstm_cell_kernel -------------------------------------------------------------------------------- /demo_2/data/mel_small/encoder_cell_0_bidirectional_rnn_fw_multi_rnn_cell_cell_0_lstm_cell_bias: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_2/data/mel_small/encoder_cell_0_bidirectional_rnn_fw_multi_rnn_cell_cell_0_lstm_cell_bias -------------------------------------------------------------------------------- /demo_2/data/mel_small/encoder_cell_0_bidirectional_rnn_fw_multi_rnn_cell_cell_0_lstm_cell_kernel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_2/data/mel_small/encoder_cell_0_bidirectional_rnn_fw_multi_rnn_cell_cell_0_lstm_cell_kernel -------------------------------------------------------------------------------- /demo_2/data/mel_small/encoder_mu_bias: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_2/data/mel_small/encoder_mu_bias -------------------------------------------------------------------------------- /demo_2/data/mel_small/encoder_mu_kernel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_2/data/mel_small/encoder_mu_kernel -------------------------------------------------------------------------------- /demo_2/data/mel_small/encoder_sigma_bias: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_2/data/mel_small/encoder_sigma_bias -------------------------------------------------------------------------------- /demo_2/data/mel_small/encoder_sigma_kernel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_2/data/mel_small/encoder_sigma_kernel -------------------------------------------------------------------------------- /demo_2/data/mel_small/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "decoder/multi_rnn_cell/cell_0/lstm_cell/bias": { 3 | "filename": "decoder_multi_rnn_cell_cell_0_lstm_cell_bias", 4 | "shape": [ 5 | 1024 6 | ] 7 | }, 8 | "decoder/multi_rnn_cell/cell_0/lstm_cell/kernel": { 9 | "filename": "decoder_multi_rnn_cell_cell_0_lstm_cell_kernel", 10 | "shape": [ 11 | 602, 12 | 1024 13 | ] 14 | }, 15 | "decoder/multi_rnn_cell/cell_1/lstm_cell/bias": { 16 | "filename": "decoder_multi_rnn_cell_cell_1_lstm_cell_bias", 17 | "shape": [ 18 | 1024 19 | ] 20 | }, 21 | "decoder/multi_rnn_cell/cell_1/lstm_cell/kernel": { 22 | "filename": "decoder_multi_rnn_cell_cell_1_lstm_cell_kernel", 23 | "shape": [ 24 | 512, 25 | 1024 26 | ] 27 | }, 28 | "decoder/output_projection/bias": { 29 | "filename": "decoder_output_projection_bias", 30 | "shape": [ 31 | 90 32 | ] 33 | }, 34 | "decoder/output_projection/kernel": { 35 | "filename": "decoder_output_projection_kernel", 36 | "shape": [ 37 | 256, 38 | 90 39 | ] 40 | }, 41 | "decoder/z_to_initial_state/bias": { 42 | "filename": "decoder_z_to_initial_state_bias", 43 | "shape": [ 44 | 1024 45 | ] 46 | }, 47 | "decoder/z_to_initial_state/kernel": { 48 | "filename": "decoder_z_to_initial_state_kernel", 49 | "shape": [ 50 | 256, 51 | 1024 52 | ] 53 | }, 54 | "encoder/cell_0/bidirectional_rnn/bw/multi_rnn_cell/cell_0/lstm_cell/bias": { 55 | "filename": "encoder_cell_0_bidirectional_rnn_bw_multi_rnn_cell_cell_0_lstm_cell_bias", 56 | "shape": [ 57 | 2048 58 | ] 59 | }, 60 | "encoder/cell_0/bidirectional_rnn/bw/multi_rnn_cell/cell_0/lstm_cell/kernel": { 61 | "filename": "encoder_cell_0_bidirectional_rnn_bw_multi_rnn_cell_cell_0_lstm_cell_kernel", 62 | "shape": [ 63 | 602, 64 | 2048 65 | ] 66 | }, 67 | "encoder/cell_0/bidirectional_rnn/fw/multi_rnn_cell/cell_0/lstm_cell/bias": { 68 | "filename": "encoder_cell_0_bidirectional_rnn_fw_multi_rnn_cell_cell_0_lstm_cell_bias", 69 | "shape": [ 70 | 2048 71 | ] 72 | }, 73 | "encoder/cell_0/bidirectional_rnn/fw/multi_rnn_cell/cell_0/lstm_cell/kernel": { 74 | "filename": "encoder_cell_0_bidirectional_rnn_fw_multi_rnn_cell_cell_0_lstm_cell_kernel", 75 | "shape": [ 76 | 602, 77 | 2048 78 | ] 79 | }, 80 | "encoder/mu/bias": { 81 | "filename": "encoder_mu_bias", 82 | "shape": [ 83 | 256 84 | ] 85 | }, 86 | "encoder/mu/kernel": { 87 | "filename": "encoder_mu_kernel", 88 | "shape": [ 89 | 1024, 90 | 256 91 | ] 92 | }, 93 | "encoder/sigma/bias": { 94 | "filename": "encoder_sigma_bias", 95 | "shape": [ 96 | 256 97 | ] 98 | }, 99 | "encoder/sigma/kernel": { 100 | "filename": "encoder_sigma_kernel", 101 | "shape": [ 102 | 1024, 103 | 256 104 | ] 105 | } 106 | } -------------------------------------------------------------------------------- /demo_2/demo_2.js: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | 16 | 17 | 18 | //Play with this to get back a larger or smaller blend of melodies 19 | var numInterpolations = 5; //numInterpolations containing 32 notes 20 | 21 | // generates an array where indices correspond to midi notes 22 | var everyNote = 'C,C#,D,D#,E,F,F#,G,G#,A,A#,B,'.repeat(20).split(',').map( function(x,i) { 23 | return x + '' + Math.floor(i/12); 24 | }); 25 | 26 | //returns the midi pitch value for the given note. 27 | //returns -1 if not found 28 | function toMidi(note) { 29 | return everyNote.indexOf(note); 30 | } 31 | 32 | //If you want to try out other melodies copy and paste any of these in https://github..... 33 | var MELODY1 = { notes: [ 34 | {pitch: toMidi('A3'), quantizedStartStep: 0, quantizedEndStep: 4}, 35 | {pitch: toMidi('D4'), quantizedStartStep: 4, quantizedEndStep: 6}, 36 | {pitch: toMidi('E4'), quantizedStartStep: 6, quantizedEndStep: 8}, 37 | {pitch: toMidi('F4'), quantizedStartStep: 8, quantizedEndStep: 10}, 38 | {pitch: toMidi('D4'), quantizedStartStep: 10, quantizedEndStep: 12}, 39 | {pitch: toMidi('E4'), quantizedStartStep: 12, quantizedEndStep: 16}, 40 | {pitch: toMidi('C4'), quantizedStartStep: 16, quantizedEndStep: 20}, 41 | {pitch: toMidi('D4'), quantizedStartStep: 20, quantizedEndStep: 26}, 42 | {pitch: toMidi('A3'), quantizedStartStep: 26, quantizedEndStep: 28}, 43 | {pitch: toMidi('A3'), quantizedStartStep: 28, quantizedEndStep: 32} 44 | ]}; 45 | 46 | //you can also just put in the midi pitch note if you know it 47 | var MELODY2 = { notes: [ 48 | {pitch: 50, quantizedStartStep: 0, quantizedEndStep: 1}, 49 | {pitch: 53, quantizedStartStep: 1, quantizedEndStep: 2}, 50 | {pitch: 58, quantizedStartStep: 2, quantizedEndStep: 3}, 51 | {pitch: 58, quantizedStartStep: 3, quantizedEndStep: 4}, 52 | {pitch: 58, quantizedStartStep: 4, quantizedEndStep: 5}, 53 | {pitch: 53, quantizedStartStep: 5, quantizedEndStep: 6}, 54 | {pitch: 53, quantizedStartStep: 6, quantizedEndStep: 7}, 55 | {pitch: 53, quantizedStartStep: 7, quantizedEndStep: 8}, 56 | {pitch: 52, quantizedStartStep: 8, quantizedEndStep: 9}, 57 | {pitch: 55, quantizedStartStep: 9, quantizedEndStep: 10}, 58 | {pitch: 60, quantizedStartStep: 10, quantizedEndStep: 11}, 59 | {pitch: 60, quantizedStartStep: 11, quantizedEndStep: 12}, 60 | {pitch: 60, quantizedStartStep: 12, quantizedEndStep: 13}, 61 | {pitch: 60, quantizedStartStep: 13, quantizedEndStep: 14}, 62 | {pitch: 60, quantizedStartStep: 14, quantizedEndStep: 15}, 63 | {pitch: 52, quantizedStartStep: 15, quantizedEndStep: 16}, 64 | {pitch: 57, quantizedStartStep: 16, quantizedEndStep: 17}, 65 | {pitch: 57, quantizedStartStep: 17, quantizedEndStep: 18}, 66 | {pitch: 57, quantizedStartStep: 18, quantizedEndStep: 19}, 67 | {pitch: 65, quantizedStartStep: 19, quantizedEndStep: 20}, 68 | {pitch: 65, quantizedStartStep: 20, quantizedEndStep: 21}, 69 | {pitch: 65, quantizedStartStep: 21, quantizedEndStep: 22}, 70 | {pitch: 57, quantizedStartStep: 22, quantizedEndStep: 23}, 71 | {pitch: 57, quantizedStartStep: 23, quantizedEndStep: 24}, 72 | {pitch: 57, quantizedStartStep: 24, quantizedEndStep: 25}, 73 | {pitch: 57, quantizedStartStep: 25, quantizedEndStep: 26}, 74 | {pitch: 62, quantizedStartStep: 26, quantizedEndStep: 27}, 75 | {pitch: 62, quantizedStartStep: 27, quantizedEndStep: 28}, 76 | {pitch: 65, quantizedStartStep: 28, quantizedEndStep: 29}, 77 | {pitch: 65, quantizedStartStep: 29, quantizedEndStep: 30}, 78 | {pitch: 69, quantizedStartStep: 30, quantizedEndStep: 31}, 79 | {pitch: 69, quantizedStartStep: 31, quantizedEndStep: 32} 80 | ]}; 81 | 82 | // go to https://goo.gl/magenta/musicvae-checkpoints to see more checkpoint urls 83 | // var melodiesModelCheckPoint = 'https://storage.googleapis.com/download.magenta.tensorflow.org/models/music_vae/dljs/mel_small'; 84 | var melodiesModelCheckPoint = './data/mel_small'; 85 | 86 | // musicvae is trained on sequences of notes that are 2 bars, so 32 note per sequences. 87 | // Input needs to be the the same format 88 | var NUM_STEPS = 32; // DO NOT CHANGE. 89 | var NUM_NOTES = 88; 90 | var MIDI_START_NOTE = 21; //lowest piano midi note 91 | var interpolatedNoteSequences; 92 | 93 | //Uses promises to chain together asynchronous operations. 94 | //Check out https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises for info on promises 95 | new musicvae.MusicVAE(melodiesModelCheckPoint) 96 | .initialize() 97 | .then(function(musicVAE) { 98 | //blends between the given two melodies and returns numInterpolations note sequences 99 | interpolatedNoteSequences = musicVAE.interpolate([MELODY1, MELODY2], numInterpolations); 100 | document.querySelector('.loading').innerHTML = ' '; 101 | }); 102 | 103 | var sequenceIndex = -1; 104 | var stepIndex = -1; 105 | 106 | /////////////////////////////// 107 | //p5.js setup 108 | var TILE_SIZE = 150; 109 | var WIDTH = TILE_SIZE * numInterpolations; 110 | var HEIGHT = 170; 111 | var START_COLOR; 112 | var END_COLOR; 113 | 114 | function setup() { 115 | createCanvas(WIDTH , HEIGHT); 116 | START_COLOR = color(60, 180, 203); 117 | END_COLOR = color(233, 72, 88); 118 | noStroke(); 119 | } 120 | 121 | function draw() { 122 | //Draw Tiles + Notes 123 | background(38); 124 | for(var i = 0; i < numInterpolations; i++){ 125 | var x = i * TILE_SIZE; 126 | var y = HEIGHT-TILE_SIZE; 127 | var currColor = lerpColor(START_COLOR, END_COLOR, i / numInterpolations); 128 | //use currColor but at 50% opacity 129 | fill(red(currColor), green(currColor), blue(currColor), 125); 130 | rect(x, y, TILE_SIZE, TILE_SIZE); 131 | fill(currColor); 132 | if(interpolatedNoteSequences){ 133 | drawNotes(interpolatedNoteSequences[i].notes, x, y, TILE_SIZE, TILE_SIZE); 134 | } 135 | } 136 | fill(255, 64);} 137 | 138 | function mousePressed() { 139 | if(!interpolatedNoteSequences) { 140 | return; 141 | } 142 | } 143 | 144 | function drawNotes(notes, x, y, width, height) { 145 | push(); 146 | translate(x, y); 147 | var cellWidth = width / NUM_STEPS; 148 | var cellHeight = height / NUM_NOTES; 149 | notes.forEach(function(note) { 150 | var emptyNoteSpacer = 1; 151 | rect(emptyNoteSpacer + cellWidth * note.quantizedStartStep, height - cellHeight * (note.pitch-MIDI_START_NOTE), 152 | cellWidth * (note.quantizedEndStep - note.quantizedStartStep) - emptyNoteSpacer, cellHeight); 153 | }); 154 | pop(); 155 | } 156 | -------------------------------------------------------------------------------- /demo_2/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 13 | 33 | 34 | 35 | 36 | Downloading ML Model... 37 | 38 | 39 | -------------------------------------------------------------------------------- /demo_3/data/mel_small/converter.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "MelodyConverter", 3 | "args": { 4 | "minPitch": 21, 5 | "maxPitch": 108, 6 | "numSteps": 32 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /demo_3/data/mel_small/decoder_multi_rnn_cell_cell_0_lstm_cell_bias: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/mel_small/decoder_multi_rnn_cell_cell_0_lstm_cell_bias -------------------------------------------------------------------------------- /demo_3/data/mel_small/decoder_multi_rnn_cell_cell_0_lstm_cell_kernel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/mel_small/decoder_multi_rnn_cell_cell_0_lstm_cell_kernel -------------------------------------------------------------------------------- /demo_3/data/mel_small/decoder_multi_rnn_cell_cell_1_lstm_cell_bias: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/mel_small/decoder_multi_rnn_cell_cell_1_lstm_cell_bias -------------------------------------------------------------------------------- /demo_3/data/mel_small/decoder_multi_rnn_cell_cell_1_lstm_cell_kernel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/mel_small/decoder_multi_rnn_cell_cell_1_lstm_cell_kernel -------------------------------------------------------------------------------- /demo_3/data/mel_small/decoder_output_projection_bias: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/mel_small/decoder_output_projection_bias -------------------------------------------------------------------------------- /demo_3/data/mel_small/decoder_output_projection_kernel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/mel_small/decoder_output_projection_kernel -------------------------------------------------------------------------------- /demo_3/data/mel_small/decoder_z_to_initial_state_bias: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/mel_small/decoder_z_to_initial_state_bias -------------------------------------------------------------------------------- /demo_3/data/mel_small/decoder_z_to_initial_state_kernel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/mel_small/decoder_z_to_initial_state_kernel -------------------------------------------------------------------------------- /demo_3/data/mel_small/encoder_cell_0_bidirectional_rnn_bw_multi_rnn_cell_cell_0_lstm_cell_bias: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/mel_small/encoder_cell_0_bidirectional_rnn_bw_multi_rnn_cell_cell_0_lstm_cell_bias -------------------------------------------------------------------------------- /demo_3/data/mel_small/encoder_cell_0_bidirectional_rnn_bw_multi_rnn_cell_cell_0_lstm_cell_kernel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/mel_small/encoder_cell_0_bidirectional_rnn_bw_multi_rnn_cell_cell_0_lstm_cell_kernel -------------------------------------------------------------------------------- /demo_3/data/mel_small/encoder_cell_0_bidirectional_rnn_fw_multi_rnn_cell_cell_0_lstm_cell_bias: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/mel_small/encoder_cell_0_bidirectional_rnn_fw_multi_rnn_cell_cell_0_lstm_cell_bias -------------------------------------------------------------------------------- /demo_3/data/mel_small/encoder_cell_0_bidirectional_rnn_fw_multi_rnn_cell_cell_0_lstm_cell_kernel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/mel_small/encoder_cell_0_bidirectional_rnn_fw_multi_rnn_cell_cell_0_lstm_cell_kernel -------------------------------------------------------------------------------- /demo_3/data/mel_small/encoder_mu_bias: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/mel_small/encoder_mu_bias -------------------------------------------------------------------------------- /demo_3/data/mel_small/encoder_mu_kernel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/mel_small/encoder_mu_kernel -------------------------------------------------------------------------------- /demo_3/data/mel_small/encoder_sigma_bias: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/mel_small/encoder_sigma_bias -------------------------------------------------------------------------------- /demo_3/data/mel_small/encoder_sigma_kernel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/mel_small/encoder_sigma_kernel -------------------------------------------------------------------------------- /demo_3/data/mel_small/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "decoder/multi_rnn_cell/cell_0/lstm_cell/bias": { 3 | "filename": "decoder_multi_rnn_cell_cell_0_lstm_cell_bias", 4 | "shape": [ 5 | 1024 6 | ] 7 | }, 8 | "decoder/multi_rnn_cell/cell_0/lstm_cell/kernel": { 9 | "filename": "decoder_multi_rnn_cell_cell_0_lstm_cell_kernel", 10 | "shape": [ 11 | 602, 12 | 1024 13 | ] 14 | }, 15 | "decoder/multi_rnn_cell/cell_1/lstm_cell/bias": { 16 | "filename": "decoder_multi_rnn_cell_cell_1_lstm_cell_bias", 17 | "shape": [ 18 | 1024 19 | ] 20 | }, 21 | "decoder/multi_rnn_cell/cell_1/lstm_cell/kernel": { 22 | "filename": "decoder_multi_rnn_cell_cell_1_lstm_cell_kernel", 23 | "shape": [ 24 | 512, 25 | 1024 26 | ] 27 | }, 28 | "decoder/output_projection/bias": { 29 | "filename": "decoder_output_projection_bias", 30 | "shape": [ 31 | 90 32 | ] 33 | }, 34 | "decoder/output_projection/kernel": { 35 | "filename": "decoder_output_projection_kernel", 36 | "shape": [ 37 | 256, 38 | 90 39 | ] 40 | }, 41 | "decoder/z_to_initial_state/bias": { 42 | "filename": "decoder_z_to_initial_state_bias", 43 | "shape": [ 44 | 1024 45 | ] 46 | }, 47 | "decoder/z_to_initial_state/kernel": { 48 | "filename": "decoder_z_to_initial_state_kernel", 49 | "shape": [ 50 | 256, 51 | 1024 52 | ] 53 | }, 54 | "encoder/cell_0/bidirectional_rnn/bw/multi_rnn_cell/cell_0/lstm_cell/bias": { 55 | "filename": "encoder_cell_0_bidirectional_rnn_bw_multi_rnn_cell_cell_0_lstm_cell_bias", 56 | "shape": [ 57 | 2048 58 | ] 59 | }, 60 | "encoder/cell_0/bidirectional_rnn/bw/multi_rnn_cell/cell_0/lstm_cell/kernel": { 61 | "filename": "encoder_cell_0_bidirectional_rnn_bw_multi_rnn_cell_cell_0_lstm_cell_kernel", 62 | "shape": [ 63 | 602, 64 | 2048 65 | ] 66 | }, 67 | "encoder/cell_0/bidirectional_rnn/fw/multi_rnn_cell/cell_0/lstm_cell/bias": { 68 | "filename": "encoder_cell_0_bidirectional_rnn_fw_multi_rnn_cell_cell_0_lstm_cell_bias", 69 | "shape": [ 70 | 2048 71 | ] 72 | }, 73 | "encoder/cell_0/bidirectional_rnn/fw/multi_rnn_cell/cell_0/lstm_cell/kernel": { 74 | "filename": "encoder_cell_0_bidirectional_rnn_fw_multi_rnn_cell_cell_0_lstm_cell_kernel", 75 | "shape": [ 76 | 602, 77 | 2048 78 | ] 79 | }, 80 | "encoder/mu/bias": { 81 | "filename": "encoder_mu_bias", 82 | "shape": [ 83 | 256 84 | ] 85 | }, 86 | "encoder/mu/kernel": { 87 | "filename": "encoder_mu_kernel", 88 | "shape": [ 89 | 1024, 90 | 256 91 | ] 92 | }, 93 | "encoder/sigma/bias": { 94 | "filename": "encoder_sigma_bias", 95 | "shape": [ 96 | 256 97 | ] 98 | }, 99 | "encoder/sigma/kernel": { 100 | "filename": "encoder_sigma_kernel", 101 | "shape": [ 102 | 1024, 103 | 256 104 | ] 105 | } 106 | } -------------------------------------------------------------------------------- /demo_3/data/piano/100.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/100.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/101.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/101.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/102.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/102.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/103.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/103.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/104.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/104.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/105.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/105.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/106.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/106.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/107.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/107.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/108.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/108.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/21.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/21.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/22.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/22.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/23.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/23.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/24.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/24.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/25.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/25.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/26.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/26.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/27.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/27.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/28.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/28.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/29.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/29.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/30.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/30.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/31.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/31.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/32.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/32.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/33.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/33.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/34.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/34.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/35.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/35.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/36.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/36.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/37.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/37.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/38.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/38.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/39.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/39.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/40.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/40.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/41.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/41.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/42.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/42.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/43.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/43.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/44.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/44.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/45.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/45.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/46.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/46.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/47.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/47.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/48.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/48.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/49.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/49.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/50.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/50.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/51.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/51.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/52.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/52.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/53.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/53.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/54.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/54.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/55.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/55.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/56.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/56.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/57.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/57.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/58.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/58.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/59.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/59.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/60.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/60.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/61.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/61.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/62.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/62.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/63.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/63.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/64.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/64.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/65.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/65.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/66.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/66.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/67.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/67.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/68.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/68.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/69.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/69.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/70.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/70.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/71.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/71.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/72.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/72.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/73.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/73.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/74.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/74.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/75.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/75.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/76.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/76.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/77.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/77.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/78.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/78.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/79.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/79.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/80.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/80.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/81.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/81.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/82.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/82.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/83.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/83.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/84.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/84.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/85.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/85.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/86.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/86.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/87.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/87.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/88.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/88.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/89.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/89.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/90.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/90.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/91.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/91.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/92.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/92.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/93.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/93.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/94.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/94.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/95.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/95.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/96.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/96.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/97.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/97.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/98.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/98.mp3 -------------------------------------------------------------------------------- /demo_3/data/piano/99.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_3/data/piano/99.mp3 -------------------------------------------------------------------------------- /demo_3/demo_3.js: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | 16 | 17 | 18 | //Play with this to get back a larger or smaller blend of melodies 19 | var numInterpolations = 5; //numInterpolations containing 32 notes 20 | 21 | // generates an array where indices correspond to midi notes 22 | var everyNote = 'C,C#,D,D#,E,F,F#,G,G#,A,A#,B,'.repeat(20).split(',').map( function(x,i) { 23 | return x + '' + Math.floor(i/12); 24 | }); 25 | 26 | //returns the midi pitch value for the given note. 27 | //returns -1 if not found 28 | function toMidi(note) { 29 | return everyNote.indexOf(note); 30 | } 31 | 32 | //If you want to try out other melodies copy and paste any of these in https://github..... 33 | var MELODY1 = { notes: [ 34 | {pitch: toMidi('A3'), quantizedStartStep: 0, quantizedEndStep: 4}, 35 | {pitch: toMidi('D4'), quantizedStartStep: 4, quantizedEndStep: 6}, 36 | {pitch: toMidi('E4'), quantizedStartStep: 6, quantizedEndStep: 8}, 37 | {pitch: toMidi('F4'), quantizedStartStep: 8, quantizedEndStep: 10}, 38 | {pitch: toMidi('D4'), quantizedStartStep: 10, quantizedEndStep: 12}, 39 | {pitch: toMidi('E4'), quantizedStartStep: 12, quantizedEndStep: 16}, 40 | {pitch: toMidi('C4'), quantizedStartStep: 16, quantizedEndStep: 20}, 41 | {pitch: toMidi('D4'), quantizedStartStep: 20, quantizedEndStep: 26}, 42 | {pitch: toMidi('A3'), quantizedStartStep: 26, quantizedEndStep: 28}, 43 | {pitch: toMidi('A3'), quantizedStartStep: 28, quantizedEndStep: 32} 44 | ]}; 45 | 46 | //you can also just put in the midi pitch note if you know it 47 | var MELODY2 = { notes: [ 48 | {pitch: 50, quantizedStartStep: 0, quantizedEndStep: 1}, 49 | {pitch: 53, quantizedStartStep: 1, quantizedEndStep: 2}, 50 | {pitch: 58, quantizedStartStep: 2, quantizedEndStep: 3}, 51 | {pitch: 58, quantizedStartStep: 3, quantizedEndStep: 4}, 52 | {pitch: 58, quantizedStartStep: 4, quantizedEndStep: 5}, 53 | {pitch: 53, quantizedStartStep: 5, quantizedEndStep: 6}, 54 | {pitch: 53, quantizedStartStep: 6, quantizedEndStep: 7}, 55 | {pitch: 53, quantizedStartStep: 7, quantizedEndStep: 8}, 56 | {pitch: 52, quantizedStartStep: 8, quantizedEndStep: 9}, 57 | {pitch: 55, quantizedStartStep: 9, quantizedEndStep: 10}, 58 | {pitch: 60, quantizedStartStep: 10, quantizedEndStep: 11}, 59 | {pitch: 60, quantizedStartStep: 11, quantizedEndStep: 12}, 60 | {pitch: 60, quantizedStartStep: 12, quantizedEndStep: 13}, 61 | {pitch: 60, quantizedStartStep: 13, quantizedEndStep: 14}, 62 | {pitch: 60, quantizedStartStep: 14, quantizedEndStep: 15}, 63 | {pitch: 52, quantizedStartStep: 15, quantizedEndStep: 16}, 64 | {pitch: 57, quantizedStartStep: 16, quantizedEndStep: 17}, 65 | {pitch: 57, quantizedStartStep: 17, quantizedEndStep: 18}, 66 | {pitch: 57, quantizedStartStep: 18, quantizedEndStep: 19}, 67 | {pitch: 65, quantizedStartStep: 19, quantizedEndStep: 20}, 68 | {pitch: 65, quantizedStartStep: 20, quantizedEndStep: 21}, 69 | {pitch: 65, quantizedStartStep: 21, quantizedEndStep: 22}, 70 | {pitch: 57, quantizedStartStep: 22, quantizedEndStep: 23}, 71 | {pitch: 57, quantizedStartStep: 23, quantizedEndStep: 24}, 72 | {pitch: 57, quantizedStartStep: 24, quantizedEndStep: 25}, 73 | {pitch: 57, quantizedStartStep: 25, quantizedEndStep: 26}, 74 | {pitch: 62, quantizedStartStep: 26, quantizedEndStep: 27}, 75 | {pitch: 62, quantizedStartStep: 27, quantizedEndStep: 28}, 76 | {pitch: 65, quantizedStartStep: 28, quantizedEndStep: 29}, 77 | {pitch: 65, quantizedStartStep: 29, quantizedEndStep: 30}, 78 | {pitch: 69, quantizedStartStep: 30, quantizedEndStep: 31}, 79 | {pitch: 69, quantizedStartStep: 31, quantizedEndStep: 32} 80 | ]}; 81 | 82 | 83 | // go to https://goo.gl/magenta/musicvae-checkpoints to see more checkpoint urls 84 | // try the 500mb mel_big for a really smooth interpolation 85 | // var melodiesModelCheckPoint = 'https://storage.googleapis.com/download.magenta.tensorflow.org/models/music_vae/dljs/mel_big'; 86 | var melodiesModelCheckPoint = './data/mel_small'; 87 | 88 | // musicvae is trained on sequences of notes that are 2 bars, so 32 note per sequences. 89 | // Input needs to be the the same format 90 | var NUM_STEPS = 32; // DO NOT CHANGE. 91 | var interpolatedNoteSequences; 92 | 93 | //Uses promises to chain together asynchronous operations. 94 | //Check out https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises for info on promises 95 | new musicvae.MusicVAE(melodiesModelCheckPoint) 96 | .initialize() 97 | .then(function(musicVAE) { 98 | //blends between the given two melodies and returns numInterpolations note sequences 99 | // MELODY1 = musicVAE.sample(1, 0.5)[0]; //generates 1 new melody with 0.5 temperature. More temp means crazier melodies 100 | return musicVAE.interpolate([MELODY1, MELODY2], numInterpolations); 101 | }) 102 | .then(function(noteSequences) { 103 | var text = 'Click to Play a blend from Melody 1 to Melody 2 in ' + numInterpolations + ' interpolations'; 104 | document.querySelector('.loading').innerHTML = text; 105 | interpolatedNoteSequences = noteSequences; 106 | }); 107 | 108 | /////////////////////////////// 109 | //TONE.js setup for audio play back 110 | var samplesPath = 'https://storage.googleapis.com/melody-mixer/piano/'; 111 | var samples = {}; 112 | var NUM_NOTES = 88; 113 | var MIDI_START_NOTE = 21; 114 | for (var i = MIDI_START_NOTE; i < NUM_NOTES + MIDI_START_NOTE; i++) { 115 | samples[i] = samplesPath + i + '.mp3'; 116 | } 117 | 118 | var players = new Tone.Players(samples, function onPlayersLoaded(){ 119 | console.log("Tone.js players loaded"); 120 | }).toMaster(); 121 | 122 | 123 | function playNote(midiNote, numNoteHolds){ 124 | var duration = Tone.Transport.toSeconds('8n') * (numNoteHolds || 1); 125 | var player = players.get(midiNote); 126 | player.fadeOut = 0.05; 127 | player.fadeIn = 0.01; 128 | player.start(Tone.now(), 0, duration); 129 | } 130 | 131 | var sequenceIndex = -1; 132 | var stepIndex = -1; 133 | 134 | /////////////////////////////// 135 | //p5.js setup 136 | var TILE_SIZE = 150; 137 | var WIDTH = TILE_SIZE * numInterpolations; 138 | var HEIGHT = 170; 139 | var START_COLOR; 140 | var END_COLOR; 141 | 142 | function setup() { 143 | createCanvas(WIDTH , HEIGHT); 144 | START_COLOR = color(60, 180, 203); 145 | END_COLOR = color(233, 72, 88); 146 | noStroke(); 147 | } 148 | 149 | function draw() { 150 | //here we calculate the percentage through melodies, between 0-1 151 | var totalPlayTime = (Tone.Transport.bpm.value * NUM_STEPS * numInterpolations) / 1000; 152 | var percent = Tone.Transport.seconds / totalPlayTime % 1; 153 | 154 | //here we calculate the index of interpolatedNoteSequences 155 | //and currStepIndex is the note between 0-31 of that playback 156 | var currSequenceIndex = Math.floor(percent * numInterpolations); 157 | var currStepIndex = Math.floor((percent * numInterpolations - currSequenceIndex) * NUM_STEPS); 158 | function isCurrentStep(note) { 159 | return note.quantizedStartStep === currStepIndex; 160 | } 161 | if(Tone.Transport.state === 'started') { //playback started 162 | if(currStepIndex != stepIndex) { 163 | //here we search through all notes and find any that match our current step index 164 | var notes = interpolatedNoteSequences[currSequenceIndex].notes.filter(isCurrentStep); 165 | notes.forEach(function(note) { 166 | var noteDuration = note.quantizedEndStep - note.quantizedStartStep; 167 | playNote(note.pitch, noteDuration); 168 | }); 169 | } 170 | sequenceIndex = currSequenceIndex; 171 | stepIndex = currStepIndex; 172 | } 173 | 174 | //Draw Tiles + Notes 175 | //Drawing Tiles + notes 176 | background(38); 177 | for(var i = 0; i < numInterpolations; i++){ 178 | var x = i * TILE_SIZE; 179 | var y = HEIGHT-TILE_SIZE; 180 | var currColor = lerpColor(START_COLOR, END_COLOR, i / numInterpolations); 181 | //use currColor but at 50% opacity 182 | fill(red(currColor), green(currColor), blue(currColor), 125); 183 | rect(x, y, TILE_SIZE, TILE_SIZE); 184 | fill(currColor); 185 | if(interpolatedNoteSequences){ 186 | drawNotes(interpolatedNoteSequences[i].notes, x, y, TILE_SIZE, TILE_SIZE); 187 | } 188 | 189 | } 190 | fill(255, 64); 191 | rect(percent * WIDTH, 0, TILE_SIZE / NUM_STEPS, HEIGHT); 192 | text(sequenceIndex + " - " + currStepIndex, 15, 15); 193 | } 194 | 195 | function mousePressed() { 196 | if(!interpolatedNoteSequences) { 197 | return; 198 | } 199 | var loadingSpan = document.querySelector('.loading'); 200 | if(Tone.Transport.state === 'started') { 201 | Tone.Transport.stop(); 202 | loadingSpan.innerHTML = 'Play'; 203 | } else { 204 | Tone.Transport.start(); 205 | loadingSpan.innerHTML = 'Pause'; 206 | } 207 | } 208 | 209 | function drawNotes(notes, x, y, width, height) { 210 | push(); 211 | translate(x, y); 212 | var cellWidth = width / NUM_STEPS; 213 | var cellHeight = height / NUM_NOTES; 214 | notes.forEach(function(note) { 215 | var emptyNoteSpacer = 1; 216 | rect(emptyNoteSpacer + cellWidth * note.quantizedStartStep, height - cellHeight * (note.pitch-MIDI_START_NOTE), 217 | cellWidth * (note.quantizedEndStep - note.quantizedStartStep) - emptyNoteSpacer, cellHeight); 218 | }); 219 | pop(); 220 | } 221 | -------------------------------------------------------------------------------- /demo_3/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 16 | 36 | 37 | 38 | 39 | Downloading ML Model... 40 | 41 | 42 | -------------------------------------------------------------------------------- /demo_4/data/images/about-icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | about-icon 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /demo_4/data/images/ai-experiment.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | 10 | 12 | 13 | 15 | 17 | 19 | 22 | 25 | 27 | 29 | 32 | 35 | 37 | 39 | 41 | 43 | 45 | 48 | 50 | 53 | 56 | 58 | 59 | -------------------------------------------------------------------------------- /demo_4/data/images/favicon-melody-mixer-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/images/favicon-melody-mixer-small.png -------------------------------------------------------------------------------- /demo_4/data/images/favicon-melody-mixer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/images/favicon-melody-mixer.png -------------------------------------------------------------------------------- /demo_4/data/images/friends-at-google.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | 10 | 13 | 16 | 19 | 21 | 23 | 25 | 27 | 30 | 33 | 36 | 39 | 41 | 43 | 45 | 48 | 50 | 53 | 56 | 58 | 60 | 63 | 66 | 69 | 72 | 76 | 77 | 80 | 83 | 84 | -------------------------------------------------------------------------------- /demo_4/data/images/icon-round-facebook.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Created with Sketch. 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /demo_4/data/images/icon-round-twitter.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Created with Sketch. 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /demo_4/data/images/magenta-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/images/magenta-logo.png -------------------------------------------------------------------------------- /demo_4/data/images/melody-mixer-og2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/images/melody-mixer-og2.jpeg -------------------------------------------------------------------------------- /demo_4/data/images/melody-mixer.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/images/melody-mixer.gif -------------------------------------------------------------------------------- /demo_4/data/images/pause-button.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Shape 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /demo_4/data/images/play-button.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Shape 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /demo_4/data/images/tempo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | tempo 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /demo_4/data/mel_small/converter.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "MelodyConverter", 3 | "args": { 4 | "minPitch": 21, 5 | "maxPitch": 108, 6 | "numSteps": 32 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /demo_4/data/mel_small/decoder_multi_rnn_cell_cell_0_lstm_cell_bias: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/mel_small/decoder_multi_rnn_cell_cell_0_lstm_cell_bias -------------------------------------------------------------------------------- /demo_4/data/mel_small/decoder_multi_rnn_cell_cell_0_lstm_cell_kernel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/mel_small/decoder_multi_rnn_cell_cell_0_lstm_cell_kernel -------------------------------------------------------------------------------- /demo_4/data/mel_small/decoder_multi_rnn_cell_cell_1_lstm_cell_bias: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/mel_small/decoder_multi_rnn_cell_cell_1_lstm_cell_bias -------------------------------------------------------------------------------- /demo_4/data/mel_small/decoder_multi_rnn_cell_cell_1_lstm_cell_kernel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/mel_small/decoder_multi_rnn_cell_cell_1_lstm_cell_kernel -------------------------------------------------------------------------------- /demo_4/data/mel_small/decoder_output_projection_bias: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/mel_small/decoder_output_projection_bias -------------------------------------------------------------------------------- /demo_4/data/mel_small/decoder_output_projection_kernel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/mel_small/decoder_output_projection_kernel -------------------------------------------------------------------------------- /demo_4/data/mel_small/decoder_z_to_initial_state_bias: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/mel_small/decoder_z_to_initial_state_bias -------------------------------------------------------------------------------- /demo_4/data/mel_small/decoder_z_to_initial_state_kernel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/mel_small/decoder_z_to_initial_state_kernel -------------------------------------------------------------------------------- /demo_4/data/mel_small/encoder_cell_0_bidirectional_rnn_bw_multi_rnn_cell_cell_0_lstm_cell_bias: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/mel_small/encoder_cell_0_bidirectional_rnn_bw_multi_rnn_cell_cell_0_lstm_cell_bias -------------------------------------------------------------------------------- /demo_4/data/mel_small/encoder_cell_0_bidirectional_rnn_bw_multi_rnn_cell_cell_0_lstm_cell_kernel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/mel_small/encoder_cell_0_bidirectional_rnn_bw_multi_rnn_cell_cell_0_lstm_cell_kernel -------------------------------------------------------------------------------- /demo_4/data/mel_small/encoder_cell_0_bidirectional_rnn_fw_multi_rnn_cell_cell_0_lstm_cell_bias: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/mel_small/encoder_cell_0_bidirectional_rnn_fw_multi_rnn_cell_cell_0_lstm_cell_bias -------------------------------------------------------------------------------- /demo_4/data/mel_small/encoder_cell_0_bidirectional_rnn_fw_multi_rnn_cell_cell_0_lstm_cell_kernel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/mel_small/encoder_cell_0_bidirectional_rnn_fw_multi_rnn_cell_cell_0_lstm_cell_kernel -------------------------------------------------------------------------------- /demo_4/data/mel_small/encoder_mu_bias: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/mel_small/encoder_mu_bias -------------------------------------------------------------------------------- /demo_4/data/mel_small/encoder_mu_kernel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/mel_small/encoder_mu_kernel -------------------------------------------------------------------------------- /demo_4/data/mel_small/encoder_sigma_bias: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/mel_small/encoder_sigma_bias -------------------------------------------------------------------------------- /demo_4/data/mel_small/encoder_sigma_kernel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/mel_small/encoder_sigma_kernel -------------------------------------------------------------------------------- /demo_4/data/mel_small/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "decoder/multi_rnn_cell/cell_0/lstm_cell/bias": { 3 | "filename": "decoder_multi_rnn_cell_cell_0_lstm_cell_bias", 4 | "shape": [ 5 | 1024 6 | ] 7 | }, 8 | "decoder/multi_rnn_cell/cell_0/lstm_cell/kernel": { 9 | "filename": "decoder_multi_rnn_cell_cell_0_lstm_cell_kernel", 10 | "shape": [ 11 | 602, 12 | 1024 13 | ] 14 | }, 15 | "decoder/multi_rnn_cell/cell_1/lstm_cell/bias": { 16 | "filename": "decoder_multi_rnn_cell_cell_1_lstm_cell_bias", 17 | "shape": [ 18 | 1024 19 | ] 20 | }, 21 | "decoder/multi_rnn_cell/cell_1/lstm_cell/kernel": { 22 | "filename": "decoder_multi_rnn_cell_cell_1_lstm_cell_kernel", 23 | "shape": [ 24 | 512, 25 | 1024 26 | ] 27 | }, 28 | "decoder/output_projection/bias": { 29 | "filename": "decoder_output_projection_bias", 30 | "shape": [ 31 | 90 32 | ] 33 | }, 34 | "decoder/output_projection/kernel": { 35 | "filename": "decoder_output_projection_kernel", 36 | "shape": [ 37 | 256, 38 | 90 39 | ] 40 | }, 41 | "decoder/z_to_initial_state/bias": { 42 | "filename": "decoder_z_to_initial_state_bias", 43 | "shape": [ 44 | 1024 45 | ] 46 | }, 47 | "decoder/z_to_initial_state/kernel": { 48 | "filename": "decoder_z_to_initial_state_kernel", 49 | "shape": [ 50 | 256, 51 | 1024 52 | ] 53 | }, 54 | "encoder/cell_0/bidirectional_rnn/bw/multi_rnn_cell/cell_0/lstm_cell/bias": { 55 | "filename": "encoder_cell_0_bidirectional_rnn_bw_multi_rnn_cell_cell_0_lstm_cell_bias", 56 | "shape": [ 57 | 2048 58 | ] 59 | }, 60 | "encoder/cell_0/bidirectional_rnn/bw/multi_rnn_cell/cell_0/lstm_cell/kernel": { 61 | "filename": "encoder_cell_0_bidirectional_rnn_bw_multi_rnn_cell_cell_0_lstm_cell_kernel", 62 | "shape": [ 63 | 602, 64 | 2048 65 | ] 66 | }, 67 | "encoder/cell_0/bidirectional_rnn/fw/multi_rnn_cell/cell_0/lstm_cell/bias": { 68 | "filename": "encoder_cell_0_bidirectional_rnn_fw_multi_rnn_cell_cell_0_lstm_cell_bias", 69 | "shape": [ 70 | 2048 71 | ] 72 | }, 73 | "encoder/cell_0/bidirectional_rnn/fw/multi_rnn_cell/cell_0/lstm_cell/kernel": { 74 | "filename": "encoder_cell_0_bidirectional_rnn_fw_multi_rnn_cell_cell_0_lstm_cell_kernel", 75 | "shape": [ 76 | 602, 77 | 2048 78 | ] 79 | }, 80 | "encoder/mu/bias": { 81 | "filename": "encoder_mu_bias", 82 | "shape": [ 83 | 256 84 | ] 85 | }, 86 | "encoder/mu/kernel": { 87 | "filename": "encoder_mu_kernel", 88 | "shape": [ 89 | 1024, 90 | 256 91 | ] 92 | }, 93 | "encoder/sigma/bias": { 94 | "filename": "encoder_sigma_bias", 95 | "shape": [ 96 | 256 97 | ] 98 | }, 99 | "encoder/sigma/kernel": { 100 | "filename": "encoder_sigma_kernel", 101 | "shape": [ 102 | 1024, 103 | 256 104 | ] 105 | } 106 | } -------------------------------------------------------------------------------- /demo_4/data/piano/100.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/100.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/101.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/101.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/102.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/102.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/103.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/103.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/104.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/104.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/105.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/105.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/106.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/106.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/107.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/107.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/108.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/108.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/21.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/21.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/22.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/22.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/23.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/23.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/24.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/24.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/25.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/25.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/26.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/26.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/27.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/27.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/28.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/28.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/29.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/29.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/30.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/30.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/31.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/31.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/32.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/32.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/33.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/33.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/34.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/34.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/35.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/35.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/36.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/36.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/37.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/37.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/38.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/38.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/39.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/39.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/40.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/40.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/41.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/41.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/42.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/42.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/43.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/43.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/44.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/44.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/45.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/45.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/46.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/46.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/47.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/47.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/48.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/48.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/49.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/49.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/50.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/50.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/51.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/51.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/52.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/52.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/53.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/53.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/54.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/54.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/55.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/55.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/56.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/56.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/57.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/57.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/58.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/58.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/59.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/59.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/60.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/60.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/61.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/61.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/62.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/62.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/63.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/63.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/64.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/64.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/65.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/65.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/66.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/66.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/67.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/67.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/68.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/68.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/69.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/69.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/70.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/70.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/71.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/71.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/72.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/72.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/73.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/73.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/74.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/74.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/75.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/75.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/76.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/76.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/77.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/77.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/78.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/78.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/79.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/79.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/80.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/80.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/81.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/81.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/82.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/82.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/83.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/83.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/84.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/84.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/85.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/85.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/86.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/86.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/87.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/87.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/88.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/88.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/89.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/89.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/90.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/90.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/91.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/91.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/92.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/92.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/93.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/93.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/94.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/94.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/95.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/95.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/96.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/96.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/97.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/97.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/98.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/98.mp3 -------------------------------------------------------------------------------- /demo_4/data/piano/99.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecreativelab/melody-mixer/a118ffe252d151f5c55579e91728609b8ba4ad70/demo_4/data/piano/99.mp3 -------------------------------------------------------------------------------- /demo_4/demo_4.js: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | //we can't support edge or IE :( or Samsung S6 16 | var isSupported = !(/(edge|trident|SM-G920|SM-G925)/i.test(navigator.userAgent)); 17 | 18 | if(!isSupported) { 19 | document.querySelector('.device-supported').style.display = 'none'; 20 | document.querySelector('.device-not-supported').style.display = 'block'; 21 | } 22 | 23 | 24 | /////////////////////////////// 25 | //Splash Page 26 | var displayingSplash = true; 27 | function onPlay() { 28 | var splash = document.querySelector('.splash'); 29 | splash.style.opacity = 0.0; 30 | setTimeout(function() { //duration of fade 31 | splash.style.display = 'none'; 32 | displayingSplash = false; 33 | }, 500); 34 | } 35 | 36 | //Play with this to get back a larger or smaller blend of melodies 37 | var numInterpolations = 2; //numInterpolations containing 32 notes 38 | 39 | var MELODY1 = presetMelodies['Melody 1']; 40 | var MELODY2 = presetMelodies['Melody 2']; 41 | 42 | 43 | function getGeneratedMelodyColor(selectorIndex){ 44 | var colorOptions = ([ 45 | [ 46 | [51, 137, 0], 47 | [46, 196, 91], 48 | [41, 255, 181] 49 | ], 50 | [ 51 | [48, 17, 234], 52 | [24, 78, 211], 53 | [8, 139, 188] 54 | ] 55 | ])[selectorIndex]; 56 | return colorOptions[floor(random(0, colorOptions.length))]; 57 | } 58 | 59 | 60 | 61 | // go to https://goo.gl/magenta/musicvae-checkpoints to see more checkpoint urls 62 | // var melodiesModelCheckPoint = 'https://storage.googleapis.com/download.magenta.tensorflow.org/models/music_vae/dljs/mel_small'; 63 | var melodiesModelCheckPoint = './data/mel_small'; 64 | 65 | // musicvae is trained on sequences of notes that are 2 bars, so 32 note per sequences. 66 | // Input needs to be the the same format 67 | var NUM_STEPS = 32; // DO NOT CHANGE. 68 | var interpolatedNoteSequences; 69 | var numTiles; 70 | 71 | 72 | //Uses promises to chain together asynchronous operations. 73 | //Check out https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises for info on promises 74 | 75 | var musicVAE = new musicvae.MusicVAE(melodiesModelCheckPoint); 76 | if(isSupported){ 77 | musicVAE.initialize() 78 | .then(function(musicVAE) { 79 | //blends between the given two melodies and returns numInterpolations note sequences 80 | interpolateMelodies(); 81 | 82 | //enable splash play button 83 | var splashPlayButton = document.querySelector('.splash-play-button'); 84 | splashPlayButton.innerHTML = "PLAY"; 85 | splashPlayButton.disabled = false; 86 | }); 87 | } 88 | 89 | /////////////////////////////// 90 | //Drop Down Presets Setup 91 | var melodySelectors = document.querySelectorAll('.drop-down'); 92 | var options = Object.keys(presetMelodies) 93 | .concat(['Generated']) 94 | .map(function(presetName) { 95 | return ''; 96 | }).join(''); 97 | 98 | melodySelectors.forEach(function(selector, index){ 99 | selector.innerHTML = options; 100 | selector.addEventListener('input', onSelectorInput); 101 | }); 102 | 103 | melodySelectors[1].children[1].selected = 'selected'; 104 | 105 | function onSelectorInput(event){ 106 | updateSelector(event.target, true); 107 | } 108 | 109 | function updateSelector(selector, shouldInterpolate){ 110 | var preset = presetMelodies[selector.value]; 111 | var selectedColor; 112 | if(selector === melodySelectors[0]) { 113 | MELODY1 = preset || musicVAE.sample(1)[0]; 114 | selectedColor = preset ? preset.color : getGeneratedMelodyColor(0); 115 | sequences.colorA = color(selectedColor); 116 | } else { 117 | MELODY2 = preset || musicVAE.sample(1)[0]; 118 | selectedColor = preset ? preset.color : getGeneratedMelodyColor(1); 119 | sequences.colorB = color(selectedColor); 120 | } 121 | selector.style.backgroundColor = 'rgb(' + selectedColor.join(',') + ')'; 122 | if(shouldInterpolate){ 123 | interpolateMelodies(); 124 | } 125 | 126 | } 127 | 128 | function interpolateMelodies(){ 129 | interpolatedNoteSequences = musicVAE.interpolate([MELODY1, MELODY2], numInterpolations); 130 | //it is possible that the original melodies will shift slightly depending on the model 131 | //lets preserve the original melodies 132 | interpolatedNoteSequences[0] = MELODY1; 133 | interpolatedNoteSequences[interpolatedNoteSequences.length-1] = MELODY2; 134 | } 135 | 136 | 137 | /////////////////////////////// 138 | //TONE.js setup for audio play back 139 | // var samplesPath = './data/piano/'; 140 | var samplesPath = "https://storage.googleapis.com/melody-mixer/piano/" 141 | var samples = {}; 142 | var NUM_NOTES = 88; 143 | var MIDI_START_NOTE = 21; 144 | for (var i = MIDI_START_NOTE; i < NUM_NOTES + MIDI_START_NOTE; i++) { 145 | samples[i] = samplesPath + i + '.mp3'; 146 | } 147 | 148 | var players = new Tone.Players(samples, function onPlayersLoaded(){ 149 | console.log("Tone.js players loaded"); 150 | // Tone.startMobile(); 151 | }).toMaster(); 152 | 153 | 154 | function playNote(midiNote, numNoteHolds){ 155 | var duration = Tone.Transport.toSeconds('8n') * (numNoteHolds || 1); 156 | var player = players.get(midiNote); 157 | player.fadeOut = 0.05; 158 | player.fadeIn = 0.01; 159 | // console.log(`Playing ${midiNote}`); 160 | player.start(Tone.now(), 0, duration); 161 | } 162 | 163 | //used to play back audio on ios 164 | StartAudioContext(Tone.context, '.play-pause-button').then(function(){ 165 | console.log('audio context started'); 166 | }); 167 | 168 | var sequenceIndex = -1; 169 | var stepIndex = -1; 170 | 171 | /////////////////////////////// 172 | //p5.js setup 173 | var SCRUB_BAR_HEIGHT = 20; 174 | var SCRUB_BAR_GAP = 20; 175 | var mouseDownPosition = null; 176 | var MAX_TILE_SIZE = 100; 177 | 178 | var sequences = { 179 | tileSize: MAX_TILE_SIZE, 180 | width: 100 * 2, 181 | targetWidth: 100 * 2, 182 | colorA: null, 183 | colorB: null 184 | }; 185 | 186 | function setup() { 187 | melodySelectors.forEach(function(selector){ 188 | updateSelector(selector, false); 189 | }); 190 | windowResized(); 191 | noStroke(); 192 | } 193 | 194 | var percent = 0.0; 195 | function draw() { 196 | //playback logic 197 | var totalPlayTime = (Tone.Transport.bpm.value * NUM_STEPS * numInterpolations) / 1000; 198 | percent = Tone.Transport.seconds / totalPlayTime % 1; 199 | if(Tone.Transport.state === 'started') { 200 | var currSequenceIndex = Math.floor(percent * numInterpolations); 201 | var currStepIndex = Math.floor((percent * numInterpolations - currSequenceIndex) * NUM_STEPS); 202 | if(currStepIndex != stepIndex) { 203 | var notes = interpolatedNoteSequences[currSequenceIndex].notes.filter(function(note) { return note.quantizedStartStep === currStepIndex}); 204 | notes.forEach(function(note) { 205 | var noteDuration = note.quantizedEndStep - note.quantizedStartStep; 206 | playNote(note.pitch, noteDuration); 207 | }); 208 | } 209 | sequenceIndex = currSequenceIndex; 210 | stepIndex = currStepIndex; 211 | } 212 | 213 | translate(0, height/2 - sequences.tileSize/2 - SCRUB_BAR_HEIGHT); 214 | //Drawing Tiles + notes 215 | noStroke(); 216 | background(50); 217 | fill(53, 53, 53); 218 | rect(0, 0, width, SCRUB_BAR_HEIGHT); 219 | fill(249, 10); 220 | rect(0, SCRUB_BAR_GAP + SCRUB_BAR_HEIGHT, width, sequences.tileSize); 221 | 222 | //move our origin (0,0) to the main tile area to simplify coordinates 223 | push(); 224 | translate(0, SCRUB_BAR_GAP + SCRUB_BAR_HEIGHT); 225 | stroke(255); 226 | strokeWeight(2); 227 | 228 | tweenSequences(); 229 | drawSequences(); 230 | 231 | pop(); 232 | //origin is now back to top-left corner 233 | if(mousePressedInScrubBar()) { 234 | var seekTime = 0.0; 235 | if(mouseX > tileLeft(0) && mouseX < tileRight(numInterpolations-1)){ 236 | seekTime = (mouseX - tileLeft(0)) / calcCurrentSequenceWidth() * totalPlayTime; 237 | } else if(mouseX > tileRight(numInterpolations - 1)) { 238 | seekTime = totalPlayTime - 0.00001 ; //make sure it sticks to the end 239 | } 240 | Tone.Transport.seconds = seekTime; 241 | } 242 | drawPlayhead(new p5.Vector(tileLeft(0) + percent * calcCurrentSequenceWidth() , SCRUB_BAR_HEIGHT), SCRUB_BAR_GAP); 243 | } 244 | 245 | function windowResized(){ 246 | var numTiles = sequences.targetWidth / sequences.tileSize; 247 | var nextSize = min(MAX_TILE_SIZE, windowWidth / max(8, floor(numTiles))); 248 | sequences.targetWidth = numTiles * nextSize; 249 | sequences.tileSize = nextSize; 250 | var totalHeight = sequences.tileSize + SCRUB_BAR_GAP + SCRUB_BAR_HEIGHT; 251 | createCanvas(windowWidth, totalHeight); 252 | } 253 | 254 | 255 | function mousePressed(){ 256 | if(displayingSplash){ 257 | return; 258 | } 259 | mouseDownPosition = new p5.Vector(mouseX, mouseY); 260 | } 261 | 262 | function setSelectorToLast(selector, i){ 263 | selector.value = selector.options[selector.length -1].value; 264 | updateSelector(selector, true); 265 | } 266 | 267 | function keyPressed() { 268 | if(keyCode === 32) { //space bar pressed 269 | togglePlayback(); 270 | } else if(keyCode == 13) { //ENTER key pressed 271 | var samples = musicVAE.sample(2); 272 | MELODY1 = samples[0]; 273 | MELODY2 = samples[1]; 274 | melodySelectors.forEach(setSelectorToLast); 275 | } 276 | } 277 | 278 | function togglePlayback(){ 279 | if(!interpolatedNoteSequences || !players) { 280 | return; 281 | } 282 | if(Tone.Transport.state === 'started') { 283 | Tone.Transport.pause(); 284 | } else { 285 | Tone.Transport.start(); 286 | } 287 | } 288 | 289 | function mouseReleased(){ 290 | sequences.width = calcCurrentSequenceWidth(); 291 | var numTiles = round(sequences.width / sequences.tileSize); 292 | sequences.targetWidth = numTiles * sequences.tileSize; 293 | mouseDownPosition = null; 294 | numInterpolations = numTiles; 295 | 296 | interpolateMelodies(); 297 | } 298 | 299 | /** 300 | * render the triangle and line of where we are currently playing 301 | * @param {p5.Vector} pos 302 | * @param {Number} triangleHeight 303 | */ 304 | function drawPlayhead(pos, triangleHeight){ 305 | var width = 20; 306 | var hWidth = width / 2; 307 | 308 | fill(255); 309 | triangle( 310 | pos.x - hWidth, pos.y, 311 | pos.x, pos.y + triangleHeight, 312 | pos.x + hWidth, pos.y 313 | ); 314 | stroke(255); 315 | strokeWeight(2); 316 | line( 317 | pos.x, pos.y + 2, 318 | pos.x, sequences.tileSize + pos.y + triangleHeight 319 | ); 320 | } 321 | 322 | 323 | function drawSequences(){ 324 | var left = tileLeft(0); 325 | var right = tileRight(0); 326 | 327 | //how many tiles completely fit in this size 328 | var numTiles = calcCurrentSequenceWidth() / sequences.tileSize; 329 | var completedTiles = Math.floor(numTiles); 330 | var partSize = (numTiles - completedTiles) * sequences.tileSize; 331 | 332 | noStroke(); 333 | for(var i=0; i 0 ? completedTiles : completedTiles - 1; 335 | var color; 336 | var x = left + sequences.tileSize * i; 337 | if(i < completedTiles - 1){ 338 | color = lerpColor(sequences.colorA, sequences.colorB, i / ceilTiles); 339 | fill(color); 340 | rect(x, 0, sequences.tileSize, sequences.tileSize); 341 | } else { 342 | if(partSize > 0){ 343 | color = lerpColor(sequences.colorA, sequences.colorB, i / ceilTiles); 344 | fill(color); 345 | rect(x, sequences.tileSize / 2 - partSize/2, partSize, partSize); 346 | } 347 | x += partSize; 348 | var t = partSize > 0 ? i + 1 : i; 349 | color = lerpColor(sequences.colorA, sequences.colorB, t / ceilTiles); 350 | fill(color); 351 | rect(x, 0, sequences.tileSize, sequences.tileSize); 352 | } 353 | // fill(255); 354 | // text(i, x + 20, 20); 355 | } 356 | 357 | if(interpolatedNoteSequences){ 358 | if(mousePressedInSequenceTiles() || sequences.width !== sequences.targetWidth){ 359 | drawNotes(interpolatedNoteSequences[0].notes, tileLeft(0), sequences.tileSize); 360 | drawNotes(interpolatedNoteSequences[interpolatedNoteSequences.length-1].notes, tileLeft(completedTiles-1) + partSize, sequences.tileSize); 361 | } else { 362 | for(var i=0; i i) { 364 | drawNotes(interpolatedNoteSequences[i].notes, tileLeft(i), sequences.tileSize); 365 | } 366 | } 367 | } 368 | } 369 | } 370 | 371 | function drawNotes(notes, x, size) { 372 | push(); 373 | translate(x, 0); 374 | fill(255); 375 | var cellWidth = size / NUM_STEPS; 376 | var cellHeight = size / NUM_NOTES; 377 | notes.forEach(function(note) { 378 | var emptyNoteSpacer = 1; 379 | rect(emptyNoteSpacer + cellWidth * note.quantizedStartStep, size - cellHeight * (note.pitch-MIDI_START_NOTE), 380 | cellWidth * (note.quantizedEndStep - note.quantizedStartStep) - emptyNoteSpacer, cellHeight); 381 | }); 382 | pop(); 383 | } 384 | 385 | //tween the sequence width towards its destination size 386 | function tweenSequences(){ 387 | if(sequences.targetWidth !== sequences.width){ 388 | sequences.width += (sequences.targetWidth - sequences.width) * 0.1; 389 | if( abs(sequences.width - sequences.targetWidth) < 0.05){ 390 | sequences.width = sequences.targetWidth; 391 | } 392 | } 393 | } 394 | 395 | //the left-side of the sequences rect 396 | function tileLeft(index){ 397 | return width / 2 - (calcCurrentSequenceWidth()/2) + (sequences.tileSize * index); 398 | } 399 | //the right-side of the sequences rect 400 | function tileRight(index){ 401 | return tileLeft(index) + sequences.tileSize; 402 | } 403 | 404 | function mousePressedInSequenceTiles() { 405 | return mouseDownPosition && mouseDownPosition.y < height / 2 + SCRUB_BAR_HEIGHT + sequences.tileSize /2 && 406 | mouseDownPosition.y > height / 2 - sequences.tileSize /2 + SCRUB_BAR_HEIGHT; 407 | } 408 | 409 | function mousePressedInScrubBar() { 410 | return mouseDownPosition && mouseDownPosition.y < height / 2 + SCRUB_BAR_HEIGHT - sequences.tileSize /2 && 411 | mouseDownPosition.y > height / 2 - sequences.tileSize /2; 412 | } 413 | 414 | //calculate how long the sequences width should currently be 415 | function calcCurrentSequenceWidth(){ 416 | if(!mousePressedInSequenceTiles()){ 417 | return sequences.width; 418 | } 419 | var isMovingTowardsCenter = abs(mouseX - width/2) < abs(mouseDownPosition.x - width/2); 420 | //-1 if on left on center, 1 if on right 421 | var a = mouseX < width/2 ? -1 : 1; 422 | var b = mouseDownPosition.x < width / 2 ? -1 : 1; 423 | var didCrossCenter = a * b < 0; 424 | var currWidth; 425 | if(didCrossCenter){ 426 | currWidth = abs(mouseX - width/2) * 2; 427 | } else if(isMovingTowardsCenter){ 428 | currWidth = sequences.width - abs(mouseX-mouseDownPosition.x) * 2; 429 | } else { 430 | currWidth = sequences.width + abs(mouseX - mouseDownPosition.x) * 2; 431 | } 432 | return Math.min(Math.max(currWidth, sequences.tileSize * 2), width - (width % sequences.tileSize)) ; 433 | } 434 | 435 | function randomColor() { 436 | var r = random(0, 360); 437 | colorMode(HSB); 438 | var c = color(r, 80, 100); 439 | colorMode(RGB); 440 | return c; 441 | } 442 | 443 | function randomComplimentaryColors() { 444 | var r = random(0, 360); 445 | 446 | colorMode(HSB); 447 | var c = color(r, 80, 100); 448 | var c2 = color(abs(180-r), 80, 100); 449 | colorMode(RGB); 450 | return [c, c2]; 451 | } 452 | 453 | var playPauseButton = document.querySelector('.play-pause-button'); 454 | playPauseButton.addEventListener('click', togglePlayback); 455 | 456 | Tone.Transport 457 | .on('start', function(){ playPauseButton.classList.add('active'); }) 458 | .on('pause', function(){ playPauseButton.classList.remove('active'); }); 459 | 460 | -------------------------------------------------------------------------------- /demo_4/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Melody Mixer 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 |
41 |
42 | Melody Mixer icon 43 |

MELODY MIXER

44 |
45 |

A fun way to explore music using machine learning. 46 |
Just pull the blocks apart to see what melodies you discover. 47 |

48 | 49 |

50 |

51 |

52 | Built with deeplearn.js + p5.js + musicvae.js. 53 |
Learn more about how it works. 54 |

55 | 56 |
57 | 61 |
62 |
63 | 64 |
65 | 66 |
67 | 68 | 69 |
Built using Magenta 70 |
71 |
72 |
73 |
74 | Privacy & 75 | Terms 76 |
77 |
78 | 79 | 80 |
81 | 87 | 88 | 94 |
95 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /demo_4/preset-melodies.js: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | 16 | 17 | 18 | // generates an array where indices correspond to midi notes 19 | var everyNote = 'C,C#,D,D#,E,F,F#,G,G#,A,A#,B,'.repeat(20).split(',').map( function(x,i) { 20 | return x + '' + Math.floor(i/12); 21 | }); 22 | 23 | //returns the midi pitch value for the given note. 24 | //returns -1 if not found 25 | function toMidi(note) { 26 | return everyNote.indexOf(note); 27 | } 28 | 29 | var presetMelodies = { 30 | 'Twinkle' : { 31 | notes: [ 32 | {pitch: 60, quantizedStartStep: 0, quantizedEndStep: 2}, 33 | {pitch: 60, quantizedStartStep: 2, quantizedEndStep: 4}, 34 | {pitch: 67, quantizedStartStep: 4, quantizedEndStep: 6}, 35 | {pitch: 67, quantizedStartStep: 6, quantizedEndStep: 8}, 36 | {pitch: 69, quantizedStartStep: 8, quantizedEndStep: 10}, 37 | {pitch: 69, quantizedStartStep: 10, quantizedEndStep: 12}, 38 | {pitch: 67, quantizedStartStep: 12, quantizedEndStep: 16}, 39 | {pitch: 65, quantizedStartStep: 16, quantizedEndStep: 18}, 40 | {pitch: 65, quantizedStartStep: 18, quantizedEndStep: 20}, 41 | {pitch: 64, quantizedStartStep: 20, quantizedEndStep: 22}, 42 | {pitch: 64, quantizedStartStep: 22, quantizedEndStep: 24}, 43 | {pitch: 62, quantizedStartStep: 24, quantizedEndStep: 26}, 44 | {pitch: 62, quantizedStartStep: 26, quantizedEndStep: 28}, 45 | {pitch: 60, quantizedStartStep: 28, quantizedEndStep: 32} 46 | ], 47 | color : [113, 20, 221] 48 | }, 49 | 'Sparse' : { 50 | notes:[ 51 | {pitch: 64, quantizedStartStep: 0, quantizedEndStep: 1}, 52 | {pitch: 62, quantizedStartStep: 1, quantizedEndStep: 2}, 53 | {pitch: 64, quantizedStartStep: 2, quantizedEndStep: 3}, 54 | {pitch: 65, quantizedStartStep: 3, quantizedEndStep: 4}, 55 | {pitch: 67, quantizedStartStep: 4, quantizedEndStep: 8}, 56 | {pitch: 60, quantizedStartStep: 16, quantizedEndStep: 17}, 57 | {pitch: 59, quantizedStartStep: 17, quantizedEndStep: 18}, 58 | {pitch: 60, quantizedStartStep: 18, quantizedEndStep: 19}, 59 | {pitch: 62, quantizedStartStep: 19, quantizedEndStep: 20}, 60 | {pitch: 64, quantizedStartStep: 20, quantizedEndStep: 24} 61 | ], 62 | color : [245, 109, 49] 63 | }, 64 | 'Arpeggiated' : { 65 | notes : [ 66 | {pitch: 48, quantizedStartStep: 0, quantizedEndStep: 2}, 67 | {pitch: 52, quantizedStartStep: 2, quantizedEndStep: 4}, 68 | {pitch: 55, quantizedStartStep: 4, quantizedEndStep: 6}, 69 | {pitch: 60, quantizedStartStep: 6, quantizedEndStep: 8}, 70 | {pitch: 64, quantizedStartStep: 8, quantizedEndStep: 10}, 71 | {pitch: 67, quantizedStartStep: 10, quantizedEndStep: 12}, 72 | {pitch: 64, quantizedStartStep: 12, quantizedEndStep: 14}, 73 | {pitch: 60, quantizedStartStep: 14, quantizedEndStep: 16}, 74 | {pitch: 57, quantizedStartStep: 16, quantizedEndStep: 18}, 75 | {pitch: 60, quantizedStartStep: 18, quantizedEndStep: 20}, 76 | {pitch: 64, quantizedStartStep: 20, quantizedEndStep: 22}, 77 | {pitch: 69, quantizedStartStep: 22, quantizedEndStep: 24}, 78 | {pitch: 72, quantizedStartStep: 24, quantizedEndStep: 26}, 79 | {pitch: 76, quantizedStartStep: 26, quantizedEndStep: 28}, 80 | {pitch: 72, quantizedStartStep: 28, quantizedEndStep: 30}, 81 | {pitch: 69, quantizedStartStep: 30, quantizedEndStep: 32} 82 | ], 83 | 84 | color : [221, 219, 20] 85 | }, 86 | // 'Dense' : { 87 | // notes:[ 88 | // {pitch: 72, quantizedStartStep: 0, quantizedEndStep: 1}, 89 | // {pitch: 75, quantizedStartStep: 1, quantizedEndStep: 2}, 90 | // {pitch: 80, quantizedStartStep: 2, quantizedEndStep: 3}, 91 | // {pitch: 75, quantizedStartStep: 3, quantizedEndStep: 4}, 92 | // {pitch: 84, quantizedStartStep: 4, quantizedEndStep: 5}, 93 | // {pitch: 80, quantizedStartStep: 5, quantizedEndStep: 6}, 94 | // {pitch: 75, quantizedStartStep: 6, quantizedEndStep: 7}, 95 | // {pitch: 72, quantizedStartStep: 7, quantizedEndStep: 8}, 96 | // {pitch: 74, quantizedStartStep: 8, quantizedEndStep: 9}, 97 | // {pitch: 77, quantizedStartStep: 9, quantizedEndStep: 10}, 98 | // {pitch: 82, quantizedStartStep: 10, quantizedEndStep: 11}, 99 | // {pitch: 77, quantizedStartStep: 11, quantizedEndStep: 12}, 100 | // {pitch: 86, quantizedStartStep: 12, quantizedEndStep: 13}, 101 | // {pitch: 82, quantizedStartStep: 13, quantizedEndStep: 14}, 102 | // {pitch: 77, quantizedStartStep: 14, quantizedEndStep: 15}, 103 | // {pitch: 74, quantizedStartStep: 15, quantizedEndStep: 16}, 104 | // {pitch: 75, quantizedStartStep: 16, quantizedEndStep: 17}, 105 | // {pitch: 79, quantizedStartStep: 17, quantizedEndStep: 18}, 106 | // {pitch: 84, quantizedStartStep: 18, quantizedEndStep: 19}, 107 | // {pitch: 79, quantizedStartStep: 19, quantizedEndStep: 20}, 108 | // {pitch: 87, quantizedStartStep: 20, quantizedEndStep: 21}, 109 | // {pitch: 84, quantizedStartStep: 21, quantizedEndStep: 22}, 110 | // {pitch: 79, quantizedStartStep: 22, quantizedEndStep: 23}, 111 | // {pitch: 75, quantizedStartStep: 23, quantizedEndStep: 24}, 112 | // {pitch: 75, quantizedStartStep: 24, quantizedEndStep: 25}, 113 | // {pitch: 79, quantizedStartStep: 25, quantizedEndStep: 26}, 114 | // {pitch: 84, quantizedStartStep: 26, quantizedEndStep: 27}, 115 | // {pitch: 84, quantizedStartStep: 27, quantizedEndStep: 28}, 116 | // {pitch: 87, quantizedStartStep: 28, quantizedEndStep: 29}, 117 | // {pitch: 91, quantizedStartStep: 29, quantizedEndStep: 30}, 118 | // {pitch: 84, quantizedStartStep: 30, quantizedEndStep: 31}, 119 | // {pitch: 91, quantizedStartStep: 31, quantizedEndStep: 32} 120 | // ], 121 | // color : [242, 61, 91] 122 | // }, 123 | 'Bounce' : { 124 | notes:[ 125 | {pitch: 64, quantizedStartStep: 0, quantizedEndStep: 2}, 126 | {pitch: 60, quantizedStartStep: 2, quantizedEndStep: 4}, 127 | {pitch: 64, quantizedStartStep: 4, quantizedEndStep: 6}, 128 | {pitch: 60, quantizedStartStep: 6, quantizedEndStep: 8}, 129 | {pitch: 65, quantizedStartStep: 8, quantizedEndStep: 10}, 130 | {pitch: 60, quantizedStartStep: 10, quantizedEndStep: 12}, 131 | {pitch: 65, quantizedStartStep: 12, quantizedEndStep: 14}, 132 | {pitch: 60, quantizedStartStep: 14, quantizedEndStep: 16}, 133 | {pitch: 67, quantizedStartStep: 16, quantizedEndStep: 18}, 134 | {pitch: 60, quantizedStartStep: 18, quantizedEndStep: 20}, 135 | {pitch: 67, quantizedStartStep: 20, quantizedEndStep: 22}, 136 | {pitch: 60, quantizedStartStep: 22, quantizedEndStep: 24}, 137 | {pitch: 62, quantizedStartStep: 24, quantizedEndStep: 26}, 138 | {pitch: 59, quantizedStartStep: 26, quantizedEndStep: 28}, 139 | {pitch: 62, quantizedStartStep: 28, quantizedEndStep: 30}, 140 | {pitch: 59, quantizedStartStep: 30, quantizedEndStep: 32} 141 | ], 142 | color : [221, 44, 87] 143 | }, 144 | /* 145 | 'Melody 1' : { 146 | notes: [ 147 | {pitch: toMidi('A3'), quantizedStartStep: 0, quantizedEndStep: 4}, 148 | {pitch: toMidi('D4'), quantizedStartStep: 4, quantizedEndStep: 6}, 149 | {pitch: toMidi('E4'), quantizedStartStep: 6, quantizedEndStep: 8}, 150 | {pitch: toMidi('F4'), quantizedStartStep: 8, quantizedEndStep: 10}, 151 | {pitch: toMidi('D4'), quantizedStartStep: 10, quantizedEndStep: 12}, 152 | {pitch: toMidi('E4'), quantizedStartStep: 12, quantizedEndStep: 16}, 153 | {pitch: toMidi('C4'), quantizedStartStep: 16, quantizedEndStep: 20}, 154 | {pitch: toMidi('D4'), quantizedStartStep: 20, quantizedEndStep: 26}, 155 | {pitch: toMidi('A3'), quantizedStartStep: 26, quantizedEndStep: 28}, 156 | {pitch: toMidi('A3'), quantizedStartStep: 28, quantizedEndStep: 32} 157 | ], 158 | color : [242, 61, 91] 159 | }, 160 | 'Melody 2' : { 161 | notes: [ 162 | {pitch: 50, quantizedStartStep: 0, quantizedEndStep: 1}, 163 | {pitch: 53, quantizedStartStep: 1, quantizedEndStep: 2}, 164 | {pitch: 58, quantizedStartStep: 2, quantizedEndStep: 3}, 165 | {pitch: 58, quantizedStartStep: 3, quantizedEndStep: 4}, 166 | {pitch: 58, quantizedStartStep: 4, quantizedEndStep: 5}, 167 | {pitch: 53, quantizedStartStep: 5, quantizedEndStep: 6}, 168 | {pitch: 53, quantizedStartStep: 6, quantizedEndStep: 7}, 169 | {pitch: 53, quantizedStartStep: 7, quantizedEndStep: 8}, 170 | {pitch: 52, quantizedStartStep: 8, quantizedEndStep: 9}, 171 | {pitch: 55, quantizedStartStep: 9, quantizedEndStep: 10}, 172 | {pitch: 60, quantizedStartStep: 10, quantizedEndStep: 11}, 173 | {pitch: 60, quantizedStartStep: 11, quantizedEndStep: 12}, 174 | {pitch: 60, quantizedStartStep: 12, quantizedEndStep: 13}, 175 | {pitch: 60, quantizedStartStep: 13, quantizedEndStep: 14}, 176 | {pitch: 60, quantizedStartStep: 14, quantizedEndStep: 15}, 177 | {pitch: 52, quantizedStartStep: 15, quantizedEndStep: 16}, 178 | {pitch: 57, quantizedStartStep: 16, quantizedEndStep: 17}, 179 | {pitch: 57, quantizedStartStep: 17, quantizedEndStep: 18}, 180 | {pitch: 57, quantizedStartStep: 18, quantizedEndStep: 19}, 181 | {pitch: 65, quantizedStartStep: 19, quantizedEndStep: 20}, 182 | {pitch: 65, quantizedStartStep: 20, quantizedEndStep: 21}, 183 | {pitch: 65, quantizedStartStep: 21, quantizedEndStep: 22}, 184 | {pitch: 57, quantizedStartStep: 22, quantizedEndStep: 23}, 185 | {pitch: 57, quantizedStartStep: 23, quantizedEndStep: 24}, 186 | {pitch: 57, quantizedStartStep: 24, quantizedEndStep: 25}, 187 | {pitch: 57, quantizedStartStep: 25, quantizedEndStep: 26}, 188 | {pitch: 62, quantizedStartStep: 26, quantizedEndStep: 27}, 189 | {pitch: 62, quantizedStartStep: 27, quantizedEndStep: 28}, 190 | {pitch: 65, quantizedStartStep: 28, quantizedEndStep: 29}, 191 | {pitch: 65, quantizedStartStep: 29, quantizedEndStep: 30}, 192 | {pitch: 69, quantizedStartStep: 30, quantizedEndStep: 31}, 193 | {pitch: 69, quantizedStartStep: 31, quantizedEndStep: 32} 194 | ], 195 | color : [108, 57, 234] 196 | }, 197 | */ 198 | }; 199 | 200 | -------------------------------------------------------------------------------- /demo_4/style.css: -------------------------------------------------------------------------------- 1 | body, html { 2 | width: 100%; 3 | height: 100%; 4 | } 5 | 6 | body { 7 | overflow: hidden; 8 | position: fixed; 9 | margin: 0; 10 | background-color: rgba(32, 32, 32, 0.9); 11 | margin: 0; 12 | padding: 0em; 13 | overflow: none; 14 | font-weight: medium; 15 | text-align: center; 16 | font-family: Poppins, Arial, sans-serif; 17 | -webkit-text-size-adjust:100%; 18 | -moz-text-size-adjust:100%; 19 | -ms-text-size-adjust:100%; 20 | } 21 | 22 | canvas { 23 | position: fixed; 24 | top: 50%; 25 | cursor: pointer; 26 | 27 | transform: translate(-50%, -50%); 28 | -webkit-touch-callout: none; /* iOS Safari */ 29 | -webkit-user-select: none; /* Safari */ 30 | -khtml-user-select: none; /* Konqueror HTML */ 31 | -moz-user-select: none; /* Firefox */ 32 | -ms-user-select: none; /* Internet Explorer/Edge */ 33 | user-select: none; /* Non-prefixed version, currently 34 | supported by Chrome and Opera */ 35 | } 36 | 37 | .control-container { 38 | position: fixed; 39 | z-index: 1; 40 | height: auto; 41 | min-width: 342px; 42 | left: 50%; 43 | bottom: 5%; 44 | transform: translate(-50%, 0); 45 | } 46 | 47 | .play-pause-button { 48 | margin: 0px 20px 0px 20px; 49 | width: 100px; 50 | height: 100px; 51 | outline: none; 52 | background-color: rgba(255, 255, 255, 0.8); 53 | border-radius: 52px; 54 | 55 | background-image: url("https://storage.googleapis.com/melody-mixer/images/play-button.svg"); 56 | background-position: 53% 49%; 57 | background-size: 22px; 58 | background-repeat: no-repeat; 59 | cursor: pointer; 60 | transition: background-color 300ms ease-in-out; 61 | } 62 | 63 | .play-pause-button.active{ 64 | background-position: 51% 50%; 65 | background-size: 22px; 66 | background-image: url("https://storage.googleapis.com/melody-mixer/images/pause-button.svg"); 67 | } 68 | 69 | .play-pause-button:hover { 70 | background-color: white; 71 | } 72 | 73 | /* removed double arrow from IE */ 74 | select::-ms-expand { display: none; } 75 | 76 | .drop-down-container { 77 | display: inline-block; 78 | transform: translate(0, -20%); 79 | -moz-transform: translate(0, 60%); 80 | } 81 | 82 | .drop-down-container label { 83 | color: gray; 84 | text-transform: uppercase; 85 | font-size: 80%; 86 | } 87 | 88 | .drop-down { 89 | margin-bottom: 8px; 90 | display: block; 91 | background: url(data:image/svg+xml;base64,PHN2ZyBpZD0iTGF5ZXJfMSIgZGF0YS1uYW1lPSJMYXllciAxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0Ljk1IDEwIj48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2ZmZjt9LmNscy0ye2ZpbGw6IzQ0NDt9PC9zdHlsZT48L2RlZnM+PHRpdGxlPmFycm93czwvdGl0bGU+PHJlY3QgY2xhc3M9ImNscy0xIiB3aWR0aD0iNC45NSIgaGVpZ2h0PSIxMCIvPjxwb2x5Z29uIGNsYXNzPSJjbHMtMiIgcG9pbnRzPSIxLjQxIDQuNjcgMi40OCAzLjE4IDMuNTQgNC42NyAxLjQxIDQuNjciLz48cG9seWdvbiBjbGFzcz0iY2xzLTIiIHBvaW50cz0iMy41NCA1LjMzIDIuNDggNi44MiAxLjQxIDUuMzMgMy41NCA1LjMzIi8+PC9zdmc+) no-repeat 100% 50%; 92 | position: relative; 93 | font-family: Poppins, Arial, sans-serif; 94 | -moz-appearance: none; 95 | -webkit-appearance: none; 96 | /* height: 30px; */ 97 | outline: none; 98 | width: auto; 99 | padding: 5px 20px 5px 10px; 100 | text-align-last: center; 101 | font-size: 16px; 102 | line-height: 20px; 103 | color: rgba(255, 255, 255, 0.8); 104 | background-color: #4b4b4b; 105 | border: none; 106 | text-align: center; 107 | outline: none; 108 | cursor: pointer; 109 | transition: background-color 300ms ease-in-out; 110 | } 111 | 112 | /* fixes dotted line around select in firefox */ 113 | select::-moz-focus-inner { 114 | outline: none !important; 115 | } 116 | select:-moz-focusring { 117 | color: transparent; 118 | text-shadow: 0 0 0 #fff; 119 | } 120 | option:not(:checked) { 121 | color: fff; /* prevent