Repository: brannondorsey/midi-rnn
Branch: master
Commit: d4822e453aa3
Files: 192
Total size: 72.4 KB
Directory structure:
gitextract_st_rvfoo/
├── .gitignore
├── GPL.txt
├── LICENSE
├── README.md
├── data/
│ └── midi/
│ ├── 006c4bcdf2f453be54e499f9676c4517.mid_19101494-8bdb-4c07-bace-7e5b42e46160.mid
│ ├── 006c4bcdf2f453be54e499f9676c4517.mid_239ec2f0-77f9-43b7-9f27-c67199342ca9.mid
│ ├── 024bb9f00d4c41237ca39dbc2ce0b14b.mid_9194767e-9449-424e-a445-87f7170aa0d8.mid
│ ├── 024bdf7815ae8b97ac8cac959cce3c5f.mid_93dbe968-d18a-4bc7-b89a-1711d24d7cf0.mid
│ ├── 0259153dc0bb402da5e783eb331491ba.mid_58abc8ad-e6fc-4822-9106-b5af2b7e922d.mid
│ ├── 029e9ea0f8c083158664cb5c0b868e0d.mid_00cc0b48-8198-4b61-a64a-88430816f73a.mid
│ ├── 03625a89da61afe76ed334bbfc9be3de.mid_3e6cc60d-c183-4284-a9cc-3aad97f64cc3.mid
│ ├── 03af990cb42904fc25f668d22a2f865d.mid_7b435c05-2691-4522-9c1a-c6fe36d61002.mid
│ ├── 03fadb7c93acb8e76324efdb307b028c.mid_ba71667a-74e7-47ac-8685-35a040e6566d.mid
│ ├── 06916e1b8d24da0cae8a7910d15221b4.mid_76d199f5-a371-440b-95b8-41f10b4447a2.mid
│ ├── 07d726086824cae751f579dd359cb7cd.mid_45f3f18a-d8d6-446c-b47e-67ac17ef737b.mid
│ ├── 0c0a26eb521cf6b03948129dff925783.mid_8dd5dc13-5d4a-43fb-9400-b8d8670d6e86.mid
│ ├── 0c2f13e003a25ebdf94fcab6847b41c2.mid_e0cf4d68-8f25-48ca-a817-091acd5bd889.mid
│ ├── 0d339ad8e9d1526953c9b077d760463c.mid_fa6b7251-854b-47bf-aa0b-61ae96416b2e.mid
│ ├── 0d34fc60d036cbe8ad8ee67e79418ccc.mid_eacf483a-4126-4740-b8a1-f734f8866ad0.mid
│ ├── 0efb6b93879c79806c003f990ee5e7c6.mid_25df40dc-0bfa-4a5f-b847-4804eb846307.mid
│ ├── 0efb6b93879c79806c003f990ee5e7c6.mid_8197fa6d-ec6b-4813-b802-0c5d0204bcf5.mid
│ ├── 105ad0ef28c9887a34007ef7f72b3c0c.mid_6438395b-f61f-41f4-9273-a6b8a63c8ae2.mid
│ ├── 1402adcba040a9544567aae132c8fdc9.mid_6621f84f-cccc-45b5-bd14-4a2fde52dd47.mid
│ ├── 184af974fd533135ad744793b592d90e.mid_b5b344f2-90ac-4e07-b0b8-431aff7412d3.mid
│ ├── 1f0ed37c82bf4f39001cfb4cf22ea1ed.mid_64bfec26-748b-430f-8dcc-24de515235a1.mid
│ ├── 1f0ed37c82bf4f39001cfb4cf22ea1ed.mid_cf4c534a-b0a1-47ce-ad46-9f52ff9915e6.mid
│ ├── 1f0ed37c82bf4f39001cfb4cf22ea1ed.mid_d193fa9e-4a44-47fb-a3e6-46a95d813395.mid
│ ├── 20dc03b9614db979d8941fb7595488af.mid_76c6eb09-2432-4ad6-bb92-990cae657f65.mid
│ ├── 242f3d3f7f353ddccdef404b34a33743.mid_c775346d-e664-4a5a-a659-9da4c436198c.mid
│ ├── 25418daf547b53cf72e62d4b81c77aa1.mid_951716c7-efee-4005-be04-c1f4040ba4ab.mid
│ ├── 25a0e2321105de4862838aa853cd4556.mid_7ebddc50-c87c-4327-88be-c6a00dab5cae.mid
│ ├── 25a0e2321105de4862838aa853cd4556.mid_9d3829fa-b29b-4b87-8505-fff22d31d76a.mid
│ ├── 25a0e2321105de4862838aa853cd4556.mid_ce42480a-d7fd-4c4f-8c13-8c1ea41a64ed.mid
│ ├── 26f94af7643bf6b5a014a4a3ca0b1f69.mid_846e95e0-d16f-4997-8dde-7400d67a57b1.mid
│ ├── 2851b64689c37294348c33b89d43e068.mid_24237e29-a544-433b-9928-af45cbc9709e.mid
│ ├── 2ad9178f35c95a6611b0d1d3bc684500.mid_01535e05-31f9-4c8c-ac3c-800ce6b3c923.mid
│ ├── 2b3612e871fed048a7a3d686b730b844.mid_58306771-5ea7-4a18-b203-1582f08d8664.mid
│ ├── 2f84f3f0912323f35c3396224bc6ec39.mid_70c208d0-9814-4659-a60f-54866e73bf35.mid
│ ├── 30ac1dd46dcc2042d6cb4dc8554dabbe.mid_c6b5a8e2-3fb6-4e99-8d2f-7112b064b11a.mid
│ ├── 321022ce567bdf35a0959955921ed74d.mid_21dd6d97-3d90-421f-8e9b-824f34764832.mid
│ ├── 321022ce567bdf35a0959955921ed74d.mid_3ed6d794-1a5c-471f-a7e7-568ff071b1a8.mid
│ ├── 321022ce567bdf35a0959955921ed74d.mid_ce882c7c-96c1-4f9e-a5fa-113fc8e85d7d.mid
│ ├── 335cef9bde48d149b8bb10e96efb3de5.mid_372fca09-41a6-4f0a-b98d-8101027d2d0b.mid
│ ├── 34127feacbb9237ef5060876a10464b2.mid_deb2a9af-4ae8-4c3d-aaea-0b100b797f92.mid
│ ├── 3730ea35b5f82a395aed3be08fd6baf5.mid_7cb04bd5-2151-423d-b3e9-fca176f3b493.mid
│ ├── 39339848e9ffb24b07b33647790ee101.mid_f12870b2-90c1-418f-a306-741ecaa0cdda.mid
│ ├── 3b1be96bb4f03a555f0ebb30f36a8ae9.mid_7d191755-aaf0-4d6d-bcbf-2cc2c36c8050.mid
│ ├── 3b1be96bb4f03a555f0ebb30f36a8ae9.mid_c511d07d-d6c8-4e7c-ac76-f09a56c678ad.mid
│ ├── 3cf7536eb8c1b2ba6cb77f2eb5c95ea7.mid_37d3c359-1a18-4e18-8f39-915d7fee384a.mid
│ ├── 3ff8620db8903ecd78e762f6a904792f.mid_03d111fc-3841-4ecf-a32a-63abef1e7aa4.mid
│ ├── 40b71244f5a700fc0da0e7528f044849.mid_2e0cba88-a330-4091-a2e1-1eeed77f2a8b.mid
│ ├── 40b71244f5a700fc0da0e7528f044849.mid_7b0d0177-0d4f-4539-855c-9b60fcd55755.mid
│ ├── 422c553660359a28145597bf0e0c16f6.mid_9dd7935d-7aa9-4450-9463-22682229cf0c.mid
│ ├── 42fd4e40a3bfa72cc7cbe08db7bfd08f.mid_9fe8de27-ad88-4198-b82f-dbbb0824cad5.mid
│ ├── 43e038a542310ca593ae5b2d104639b6.mid_61ab337b-bae1-4a07-94e8-bbf3acb09529.mid
│ ├── 4538694106d643db46fb240762fade8a.mid_c8a55a45-e14a-4643-8d6c-22cb950b2f93.mid
│ ├── 4546c60c2eeb1845aede126b9136b051.mid_f9cf573b-3f42-4fc9-8478-4b3a4314a8f8.mid
│ ├── 48e536a285b8d674101e5c23e15801ec.mid_1187bad7-87e7-4760-b79c-1bc9352e366a.mid
│ ├── 4cc05de563107720f2affa67573394ea.mid_b16efe87-2282-46db-a1d2-84969e612c09.mid
│ ├── 4d76b33720ff81c50307ea73a7d3788b.mid_a56339a8-5064-45ca-8c9b-0b92b6ed7e4d.mid
│ ├── 4d76b33720ff81c50307ea73a7d3788b.mid_c5a8000e-5681-46a9-b3dc-08a6a158b415.mid
│ ├── 4fb43d0e8e8d263a5c97a797d8343a08.mid_5618843b-1230-4b46-b988-2610fc399061.mid
│ ├── 4fe9f5ce63029ebb23f717954117a257.mid_0f83126e-a8ae-4f28-b876-fd0a2d2dde01.mid
│ ├── 53653b612181e54ce041ab9846d802df.mid_9c6e1981-3448-4570-9522-6fa24a42922f.mid
│ ├── 54ba9cbd9977e3925c7e85cab4d57637.mid_937e9bb1-7226-4f61-92cf-556376495087.mid
│ ├── 54d2a7c5ea68ee82a929ca83a0a2d27c.mid_550adfb4-17aa-4c49-b6e3-f2b8d58e7a78.mid
│ ├── 54dc97982e367364bbf958bd188ba2d7.mid_11ddbf2a-e5c8-4910-aec1-15262536641c.mid
│ ├── 54dc97982e367364bbf958bd188ba2d7.mid_5c29aaca-7895-4b78-a20b-e463c7da01ba.mid
│ ├── 57e69ed1cb86fb56e8715309f74740fb.mid_5d87e417-2fd4-4221-928e-455df4f5f1e5.mid
│ ├── 591e012a14033c82ca3b1bff8fab18c6.mid_c34a55b1-8b07-4f20-a00a-2c55c1bf2cdf.mid
│ ├── 593ab7439efa04431dae6e2c14cdc39c.mid_32663588-49a5-4159-9c17-25d835afe904.mid
│ ├── 593ab7439efa04431dae6e2c14cdc39c.mid_95ce529a-580a-4c4f-867c-ea6e0122ebb7.mid
│ ├── 59c5912ff7ff38d72a765babb7b5f95f.mid_82845a88-8005-4638-ae71-065bb8fac7f6.mid
│ ├── 5b8de194d3d89b1f79f2bf1a75ca98f7.mid_1a2e2945-6766-4344-a523-e4c6dae45f65.mid
│ ├── 5c01eccc1ede08df4f16ccd7f188d031.mid_f144d778-488f-4f25-8097-caa794e7a494.mid
│ ├── 5e7a3ba1af2a2c705963f26e8108ae50.mid_5b7c28c8-3bfb-4ca0-9956-11dab9eb1fd3.mid
│ ├── 5ebe814b2183bd3ea73a753123b2a33f.mid_3a53be98-bc1e-4b60-8c80-52e5e27ea3ab.mid
│ ├── 602066376225e859c7a851b59fefc725.mid_764f40a8-aa54-446b-bb80-df5f9ccfaaf4.mid
│ ├── 60823851229d6721e081bb06681caf41.mid_62e2e290-604d-4312-814c-b7593f2b495b.mid
│ ├── 60ae5427ef0494da2e2752f3fd0e4a91.mid_50d8c71d-1af7-46e8-8698-62913c3a8ba2.mid
│ ├── 6144ed4b666ae16048b59bc20dbb0ffe.mid_982a3053-ed48-40c6-922a-6d57ed364ab8.mid
│ ├── 61e4d79124bcdbb35de9e4ba25441359.mid_0cc816dc-b7f7-452f-8dee-094e6040b7bd.mid
│ ├── 63875e40a0ea8640b3eb05ede1bb9222.mid_42f426ba-1867-47bc-b748-0bb1f738c2b6.mid
│ ├── 646091bdbd4f3f44c8f30d3f68f4fb4b.mid_244efe3c-7043-4f54-80d7-259b2b5e5954.mid
│ ├── 646091bdbd4f3f44c8f30d3f68f4fb4b.mid_ebb38eac-6496-4c98-8fda-277ed98c34bb.mid
│ ├── 67514962006aae910228e3822799cac1.mid_7b183b72-02ab-4d06-a175-45108c1fa981.mid
│ ├── 67514962006aae910228e3822799cac1.mid_b9d3f1fd-fa3d-4d44-b22c-87896b14b868.mid
│ ├── 68cfae4a63b88e9cfc912529d87f6986.mid_80e8a913-54f9-431f-aa99-c13a9f51fb16.mid
│ ├── 69d568a6c40802c8b4e974ea7b180e13.mid_1026b451-9302-47c3-b052-9a15a5b289d8.mid
│ ├── 69d568a6c40802c8b4e974ea7b180e13.mid_bbe87465-ff92-4786-b42a-60aacae27b3c.mid
│ ├── 6b5660f4d9cd478389560cf83e559a6f.mid_eb3132ca-04c4-4720-a42d-402d9e6743c8.mid
│ ├── 6e6048c793d9476f06d7a31f9bad8bc1.mid_ee2b7ef3-9203-4e82-941a-46100aa35225.mid
│ ├── 71b0a2364b2090b37fce0157690a8e7f.mid_36654613-e937-4901-998f-fb8a15439906.mid
│ ├── 73345197f3af89e4e4374e959a92b0d2.mid_0d4a76b1-ffe9-46f9-9983-0c6a8e7b0d8e.mid
│ ├── 7952bee0d37cceee9b0154c5493a3234.mid_41d1b7a5-128d-47c3-a810-25501c86579b.mid
│ ├── 7964d78f25cac1c97e79fa6353fcc090.mid_42994ff4-12fe-4dda-8727-f1dcc94d1725.mid
│ ├── 7c6617690cb8c7a96898e244d778606e.mid_fc88808a-ecc5-4aed-8cbb-0902c2c8781a.mid
│ ├── 7d96421d4ce45b9015600971216b701e.mid_e66ada70-8f7f-4072-ba9a-609970863abf.mid
│ ├── 7e7820fab4e36bd162ef20140157ed38.mid_17b247eb-318e-4241-8e45-7e39ceb982ab.mid
│ ├── 7e7820fab4e36bd162ef20140157ed38.mid_5300bb9b-eecc-4571-8f8d-b4a49e2bf1ed.mid
│ ├── 7ee93ef4323075d3c5d095767606bc79.mid_34ff0b8d-adc2-43cf-b214-6b92122afb64.mid
│ ├── 7fadae7d82d7f4c6ca5b94ce27ac1506.mid_f1ed7c7b-3308-4334-b6a0-27365ad86dc1.mid
│ ├── 81476f40e9af8c88d5310054f7a09bfb.mid_8e19204a-64dd-4960-85d7-a95d51376c0b.mid
│ ├── 8898e6d16b14b909c1e6c53b66a2fc8b.mid_7ba1be45-18c3-4cec-9c2c-b6992af81d38.mid
│ ├── 88b7dd23a988193bd1dae7262af92660.mid_5e283f7f-ed65-47d2-9679-7a6927536b2e.mid
│ ├── 88b7dd23a988193bd1dae7262af92660.mid_71c1c3e3-56bc-4237-a4b6-f4adfe0c8f3d.mid
│ ├── 88b7dd23a988193bd1dae7262af92660.mid_f748ca3c-e599-499e-a7ac-e11a023132b5.mid
│ ├── 8aa123a8449f8eb64b53620602fcd02e.mid_1d0ae432-c26d-49e7-8c6a-e365230488f3.mid
│ ├── 8aa123a8449f8eb64b53620602fcd02e.mid_70b31e06-b8f0-4402-b2c0-3e2a8ad13ea3.mid
│ ├── 8b8203562250de56123cb688fa360ec7.mid_c3cda7e5-fc96-4532-8253-e8c9d6cebed8.mid
│ ├── 8c98e373dc2cfb0627a71ef1a0a3ba67.mid_fcc604eb-ce22-43ee-b0c2-2946c34bc78a.mid
│ ├── 8c9f5ec3af2105e813a46eb252a29250.mid_36d4b188-d980-4c92-abc6-db46763728b6.mid
│ ├── 8d5bbbeec9c970e43412c393a85c6adc.mid_9c77c45b-6082-457b-a7b3-c51c6443e835.mid
│ ├── 92f258cf435d0b5d6cfaa530f57dd8f9.mid_b62b718e-5a53-4c3d-8692-83fe858e3615.mid
│ ├── 950cde1e401e67d3226b9241be4c91a8.mid_5fbfcba0-b4ff-4c30-b19c-efabf7ec5186.mid
│ ├── 9e6121c6bdf0e5111d94085f241eed49.mid_cf789e06-fff2-405a-9844-fd25974e1c21.mid
│ ├── 9e6121c6bdf0e5111d94085f241eed49.mid_e6e2934c-58bd-443c-83e8-bad46fbc5713.mid
│ ├── 9ebea87b095c310ea922143e009d8597.mid_4dd2e6df-6fce-4199-abe9-22c1dc4d19d9.mid
│ ├── 9f738e356cbe2c62f167b28e2061b459.mid_a02f511a-9a20-4198-ad10-97570c7afbab.mid
│ ├── a4118d72c67b67bba1dd69005143dc32.mid_24c0369a-9290-4abb-90ea-1307d0767a30.mid
│ ├── a5af527971ab453549a69426e86344d9.mid_f4e34d37-12dd-42d2-9168-d845840a201a.mid
│ ├── a61274d8bc0ffdb50e667435402d2693.mid_e13f3df0-f969-4040-bb9f-1d545a1a452a.mid
│ ├── a66c4c305f6919927187bbfa5f0b9d30.mid_3218d61d-a300-422f-a62a-d1a3620f0a9a.mid
│ ├── aa783f35c7a4e5f7622c9ef970e5ef66.mid_18402bf9-cfd2-4a7d-bea9-73f88d14a6a4.mid
│ ├── adca0112f04527431148930f661eaff5.mid_96237349-710e-4e5a-8b9c-005f7bef2e8b.mid
│ ├── af1813dcebb0b3494c6d8b7fb8433bfd.mid_1a0d4934-cff5-4452-8eca-705c768169cf.mid
│ ├── b0f7d6b283ebe3a4fcd3153cda37ce84.mid_3b7e1387-55ca-444d-9d62-72a1452fb5f8.mid
│ ├── b3e5265f3443d61bbf2494825a453219.mid_20a850ce-0154-4258-a8f3-6e9a4aea6ac6.mid
│ ├── b51c65ae7141737aeb86702ee41895b0.mid_116bfaed-36ac-46fc-a532-ed269a80d1ee.mid
│ ├── b77bf6a3b244e1382d3e7136344aa7cc.mid_09bf26b0-2efa-43c7-96c3-0f4129d4cbad.mid
│ ├── b7d550f4cd7ab6f69f182c7b98e4d7af.mid_ea39691f-eac3-4f8b-ac5c-829425870283.mid
│ ├── b7df0b512ad48ea6a96bb29a51838858.mid_7028c2fd-9934-46f0-ad84-505573b844fa.mid
│ ├── b8405436e24de17b0c15c0d0d016980a.mid_b5e8619a-3ded-49fa-8add-f0f3ef623c4a.mid
│ ├── b8a2494ac64f04700dc2d2910ccb8e7d.mid_0c80be57-30c9-4df6-81d2-ceafdf902f7f.mid
│ ├── ba029f51e2f5709ebe37eec0888c613d.mid_207257bb-080b-4dee-b682-fe9db1430dc0.mid
│ ├── bbe6f78fb6fcc9918727d1d0d40c32aa.mid_e5b171be-70cd-4bb6-ac20-179b970665d3.mid
│ ├── bcd3da9d4a5afcbcdf4ec747639dc0b0.mid_1f0033d8-c3fa-4672-a81c-5e9cca943f04.mid
│ ├── c0f19516339892362e68910ea08b12a1.mid_a21e710d-c476-4b13-b18e-778eed1a62a3.mid
│ ├── c40ad18dd5218bdd7e9f3caf88f94acd.mid_c90f311d-578e-4444-b3b7-df6ce9614d67.mid
│ ├── c503266e7046930029e253de3213a0e8.mid_25d62412-f488-40bc-84ec-9ce854c09581.mid
│ ├── c53a5bb0e5f3b1abed3e6cf2f9a6c29f.mid_aa8e7d49-9c35-4951-9c47-a31506070f81.mid
│ ├── c5be65db3377d5c5ab72d3048cfafae9.mid_321fc737-a51e-4786-90c4-6752104b4934.mid
│ ├── c67307063fca6428823648033fec19ea.mid_8247ea78-8f43-40d0-a456-6b6557960051.mid
│ ├── c71a976810c8fe51da5ada5c19ab5c9c.mid_0156cbe9-3675-4535-bfe6-8e367eb0488f.mid
│ ├── c9d81e24f6c3608017f50edc62e091cb.mid_73e1d946-4d42-42f8-b84f-82688e83ea1b.mid
│ ├── ca61743187bbb4f66e4a37bbbcff0676.mid_4b35fd01-7493-454a-9d11-bff41cc421b5.mid
│ ├── cbaebc08f0c67301912d7273aab2bddd.mid_58b0b62b-9e15-407f-811a-6f98d581f103.mid
│ ├── ccadca776cb1299d23e842ba2264a560.mid_47bef30c-c73b-4f4d-b117-a851876da03a.mid
│ ├── ccadca776cb1299d23e842ba2264a560.mid_8aaaf1fe-3641-4011-b2f7-6fc8f47ca697.mid
│ ├── cd786c0daae30c797e54b343dfb672e9.mid_64985a76-4e88-410b-be0b-4216e546f629.mid
│ ├── cda2dda17b6dbb1eb73a6c4372fd8d4e.mid_92cdd22a-74e6-44de-bbe8-bbde80254307.mid
│ ├── cfb49b3f705e9c6422c88c139fc6ea3d.mid_678e6726-3f88-4a56-a987-2e7ba4c540c6.mid
│ ├── d06fa6163d7ea6973160cd0c8fda1d07.mid_7aa7b17a-82d9-4e5a-9449-5540f599016c.mid
│ ├── d0765789e2cdd5c879292aa059338e8a.mid_67e454e2-5138-4cd2-b9c0-69f398eed264.mid
│ ├── d34d0fdda18bc3d38e955f4fd517ae37.mid_da23ca35-a790-4862-81ba-3e14c771e56e.mid
│ ├── d3be9dce190b09c2e7f5c607b5aa7500.mid_e4a57c5f-ee12-4a16-bb0f-dceb89ec4df7.mid
│ ├── d4c75ab42108e3a56ce2b76f5e67350d.mid_e42e5474-c09d-4c09-9b4c-69564d677531.mid
│ ├── d75b804faf21bf577e0b7fef50b77324.mid_2a25de88-db33-41d7-8a19-1855583e1683.mid
│ ├── d7b24dfa54343be8726d1d1d2d0323ff.mid_9cc79a88-5e07-4fb1-8096-fb106192e4c8.mid
│ ├── d977ef0870cfade1ca280cd7929e5cf9.mid_68ca3cd7-4ef4-4b7f-9c43-622f37e593ad.mid
│ ├── db3128e96bd352b1206c875173f12b67.mid_1a5da5e5-a23a-4043-bd37-e3de42eb5c5a.mid
│ ├── ddc45237a1688520100e80f82aa4f329.mid_341ce981-ab28-4082-8a64-6bf778f4c7bd.mid
│ ├── deea33b4add3b750643fc13c69d63e5b.mid_3a736fc3-88f1-46e2-b52c-08b127382b4b.mid
│ ├── df2c18107b7688d9f2e31b4effe11914.mid_864216bd-7829-4f21-a822-a332e3b02644.mid
│ ├── df3b885d8ed0ca0d0cc5485e24f81777.mid_937a36ef-9cd7-4a8e-ac05-97c0351bcaa8.mid
│ ├── e07b45a8ef4233b50ed2f151de2ef1cb.mid_925aa1e8-bbfe-45b8-846d-dee0712c6ff2.mid
│ ├── e0a38c7f4851dfb3eb8a4e159e313089.mid_c8f3fb76-3964-4059-aa44-b3024432ce49.mid
│ ├── e0d08b315371a3c408152f2e30426b74.mid_b1cc8b4d-ae6a-45fc-954f-2c963458ea40.mid
│ ├── e2dd59c5e85e1866cd4a4b103c227871.mid_1a91173b-307f-450f-ac48-cb661018c9cf.mid
│ ├── e2dd59c5e85e1866cd4a4b103c227871.mid_964b62b2-009d-422b-b987-4da09cef99ef.mid
│ ├── e2dd59c5e85e1866cd4a4b103c227871.mid_dee12dbd-d413-40db-a693-b5f4d53edbe7.mid
│ ├── e4dd410992af54719abbc2df5729a787.mid_d2fe5698-e36c-4c2d-8f47-12fb63ba934e.mid
│ ├── eda08b8a031cf61c69bd705ccf8cc20c.mid_751f20a2-e4ac-486a-8eeb-e055fe7d59dd.mid
│ ├── eda81567a81db716d45a4c62eb45e399.mid_77832351-e540-4c77-9b11-072392718fcd.mid
│ ├── effa6f7ef21c66e3959283a2e359c39d.mid_b21622d3-03ec-46ad-b3df-2043bb346212.mid
│ ├── f1d47874b6da4b5eaa0dde4df09a4865.mid_3c466d75-9803-4e4f-8a4f-aa80d925bde4.mid
│ ├── f1f3f49f1df547ad52aef6ff98683e36.mid_38fe73c2-782c-4a89-a9a9-3c89b51f5a62.mid
│ ├── f2ef4e8bc1e5addb2959f81c582110eb.mid_44f0f87e-0c99-4f58-b356-e0d70bbd5d5c.mid
│ ├── f5bb09e644905465a0effcbd95f1272f.mid_fb8f0eaa-881a-4f49-ad72-21a5cdd57834.mid
│ ├── f6a98e69f145799030b5c186631990cb.mid_d70b3bcc-7a5f-4b3d-b401-5b22248c4c23.mid
│ ├── f84a84f20104c111108f96d5a8104576.mid_38d8a2cc-57d5-41a9-b664-857b8fa0c734.mid
│ ├── fa3638f113119b5ddc8bcff32ba29e36.mid_74c597d2-763d-4453-bb26-d1614838e307.mid
│ ├── fb6e6920f6219098a76a14f19a7cd2de.mid_97230078-a07d-470b-994d-f1b03e6d3700.mid
│ ├── fc5ca5ef1174efdf9f115716d93d86bc.mid_0a6abef2-6bc7-422d-bbb0-b1fde516f91f.mid
│ ├── fdf5f92b60ad734d4e83170bbd863829.mid_66593596-311f-4ed8-9d29-e97da5006a48.mid
│ ├── fe8ce9798137d9f41d55958eaeb7ea5f.mid_6dee4239-2ff3-4a6e-8d0e-1f7a05a589df.mid
│ └── ff2cb4d08a1fd485edd3b77b77384c3c.mid_1a54d679-2681-4f82-9892-53e3431ee07b.mid
├── experiments/
│ └── .gitkeep
├── requirements.txt
├── sample.py
├── train.py
└── utils.py
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
venv
experiments/*
!experiments/.gitkeep
*.pyc
================================================
FILE: GPL.txt
================================================
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
{one line to give the program's name and a brief idea of what it does.}
Copyright (C) {year} {name of author}
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
{project} Copyright (C) {year} {fullname}
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
================================================
FILE: LICENSE
================================================
Copyright (C) 2017 Brannon Dorsey
2017 Branger_Briz, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
================================================
FILE: README.md
================================================
# MIDI RNN
Generate monophonic melodies using a basic LSTM RNN. Great for machine learning MIDI generation baselines. For more info, check out our [blog post](https://brangerbriz.com/blog/using-machine-learning-to-create-new-melodies) about the project. Made using Keras.
## Getting Started
`midi-rnn` should work in MacOS and Linux environments. Open a terminal and run:
```bash
# clone this repo
git clone https://github.com/brannondorsey/midi-rnn.git
# Install the dependencies. You may need to prepend sudo to
# this command if you get an error
pip install -r requirements.txt
```
If you have CUDA installed and would like to train using your GPU, additionally run (if you don't know what that means, no worries, you can skip this):
```bash
pip install tensorflow-gpu
```
## Training a Model
First create a folder of MIDI files that you would like to train your model with. I've included ~130 files from the [Lakh MIDI Dataset](http://colinraffel.com/projects/lmd/) inside `data/midi` that you can use to get started. Note that is basic RNN learns only from the monophonic tracks in MIDI files and simply ignores tracks that are observed to include polyphony.
Once you've got a collection of MIDI files you can train your model with `train.py`.
```bash
python train.py --data_dir data/midi
```
For a list of supported command line flags, run:
```
python train.py --help
```
Or [see below](#trainpy) for a detailed description of each option. By default, model checkpoints are saved in auto-incrementing folders inside of `experiments`, however, their location can be set explicitly with the `--experiment_dir` flag.
### Monitoring Training with Tensorboard
`model-rnn` logs training metrics using [Tensorboard](https://www.tensorflow.org/get_started/summaries_and_tensorboard). These logs are stored in a folder called `tensorboard-logs` inside of your `--experiment_dir`.
```
# Compare the training metrics of all of your experiments at once
tensorboard --logdir experiments/
```
Once Tensorboard is running, navigate your web browser to `http://localhost:6006` to view the training metrics for your model in real time.
## Generating MIDI
Once you've trained your model, you can generate MIDI files using `sample.py`.
```bash
python sample.py
```
By default, this creates 10 MIDI files using a model checkpoint from the most recent folder in `experiments/` and saves the generated files to `generated/` inside of that experiment directory (e.g. `experiments/01/generated/`). You can specify which model you would like to use when generating using the `--experiment_dir` flag. You can also specify where you would like to save the generated files by including a value for the `--save_dir` flag. For a complete list of command line flags, see below.
## Command Line Arguments
### `train.py`
- `--data_dir`: A folder containing `.mid` (or `.midi`) files to use for training. All files in this folder will be used for training.
- `--experiment_dir`: The name of the folder to use when saving the model checkpoints and Tensorboard logs. If omitted, a new folder will be created with an auto-incremented number inside of `experiments/`.
- `--rnn_size` (default: 64): The number of neurons in hidden layers.
- `--num_layers` (default: 1): The number of hidden layers.
- `--learning_rate` (default: the recommended value for your optimizer): The learning rate to use with the optimizer. It is recomended to adjust this value in multiples of 10.
- `--window_size` (default: 20): The number of previous notes (and rests) to use as input to the network at each step (measured in 16th notes). It is helpful to think of this as the fixed width of a piano roll rather than individual events.
- `--batch_size` (default: 32): The number of samples to pass through the network before updating weights.
- `--num_epochs` (default: 10): The number of epochs before completing training. One epoch is equal to one full pass through all midi files in `--data_dir`. Because of the way files are lazy loaded, this number can only be an estimate.
- `--dropout` (default: 0.2): The normalized percentage (0-1) of weights to randomly turn "off" in each layer during a training step. This is a regularization technique called which helps prevent model overfitting. Recommended values are between 0.2 and 0.5, or 20% and 50%.
- `--optimizer` (default: "adam"): The optimization algorithm to use when minimizing your loss function. See https://keras.io/optimizers for a list of supported optimizers and and links to their descriptions.
- `--grad_clip` (default: 5.0): Clip backpropagated gradients to this value.
- `--message`: An optional note that can be used to describe your experiment. This text will be saved to `message.txt` inside of `--experiment_dir`. Including a value for this flag is very helpful if you find yourself running many experiments.
- `--n_jobs` (default 1): The number of CPU cores to use when loading and parsing MIDI files from `--data_dir`. Increasing this value can dramatically speed up training. I commonly set this value to use all cores, which for my quad-core machine is 8 (Intel CPUs often have 2 virtual cores per CPU).
- `--max_files_in_ram` (default: 25): Files in `--data_dir` are loaded into RAM in small batches, processed, and then released to avoid having to load all training files into memory at once (which may be impossible when training on hundreds of files on a machine with limited memory). This value specifies the maximum number of MIDI files to keep in RAM at any one time. Using a larger number significantly speeds up training, however it also runs the risk of using too much RAM and causing your machine to start [thrashing](https://en.wikipedia.org/wiki/Thrashing_(computer_science)) or crash. You can find a nice balance by inspecting your system monitor (Activity Monitor on MacOS and Monitor on Ubuntu) while training and adjust accourdingly.
```
usage: train.py [-h] [--data_dir DATA_DIR] [--experiment_dir EXPERIMENT_DIR]
[--rnn_size RNN_SIZE] [--num_layers NUM_LAYERS]
[--learning_rate LEARNING_RATE] [--window_size WINDOW_SIZE]
[--batch_size BATCH_SIZE] [--num_epochs NUM_EPOCHS]
[--dropout DROPOUT]
[--optimizer {sgd,rmsprop,adagrad,adadelta,adam,adamax,nadam}]
[--grad_clip GRAD_CLIP] [--message MESSAGE] [--n_jobs N_JOBS]
[--max_files_in_ram MAX_FILES_IN_RAM]
optional arguments:
-h, --help show this help message and exit
--data_dir DATA_DIR data directory containing .mid files to use
fortraining (default: data/midi)
--experiment_dir EXPERIMENT_DIR
directory to store checkpointed models and tensorboard
logs.if omitted, will create a new numbered folder in
experiments/. (default: experiments/default)
--rnn_size RNN_SIZE size of RNN hidden state (default: 64)
--num_layers NUM_LAYERS
number of layers in the RNN (default: 1)
--learning_rate LEARNING_RATE
learning rate. If not specified, the recommended
learning rate for the chosen optimizer is used.
(default: None)
--window_size WINDOW_SIZE
Window size for RNN input per step. (default: 20)
--batch_size BATCH_SIZE
minibatch size (default: 32)
--num_epochs NUM_EPOCHS
number of epochs before stopping training. (default:
10)
--dropout DROPOUT percentage of weights that are turned off every
training set step. This is a popular regularization
that can help with overfitting. Recommended values are
0.2-0.5 (default: 0.2)
--optimizer {sgd,rmsprop,adagrad,adadelta,adam,adamax,nadam}
The optimization algorithm to use. See
https://keras.io/optimizers for a full list of
optimizers. (default: adam)
--grad_clip GRAD_CLIP
clip gradients at this value. (default: 5.0)
--message MESSAGE, -m MESSAGE
a note to self about the experiment saved to
message.txt in --experiment_dir. (default: None)
--n_jobs N_JOBS, -j N_JOBS
Number of CPUs to use when loading and parsing midi
files. (default: 1)
--max_files_in_ram MAX_FILES_IN_RAM
The maximum number of midi files to load into RAM at
once. A higher value trains faster but uses more RAM.
A lower value uses less RAM but takes significantly
longer to train. (default: 25)
```
### `sample.py`
- `--experiment_dir` (default: most recent folder in `experiments/`): Directory from which to load model checkpoints. If left unspecified, it loads the model from the most recently added folder in `experiments/`.
- `--save_dir` (default: `generated/` inside of `--experiment_dir`): Directory to save generated files to.
- `--midi_instrument` (default: "Acoustic Grand Piano"): The name (or program number, `0-127`) of the General MIDI instrument to use for the generated files. A complete list of General MIDI instruments can be found [here](https://www.midi.org/specifications/item/).
- `--num_files` (default: 10): The number of MIDI files to generate.
- `--file_length` (default: 1000): The length of each generated MIDI file, specified in 16th notes.
- `--prime_file`: The path to a `.mid` file to use to prime/seed the generated files. A random window of this file will be used to seed each generated file.
- `--data_dir`: Used to select random files to prime/seed from if `--prime_file` is not specified.
```
usage: sample.py [-h] [--experiment_dir EXPERIMENT_DIR] [--save_dir SAVE_DIR]
[--midi_instrument MIDI_INSTRUMENT] [--num_files NUM_FILES]
[--file_length FILE_LENGTH] [--prime_file PRIME_FILE]
[--data_dir DATA_DIR]
optional arguments:
-h, --help show this help message and exit
--experiment_dir EXPERIMENT_DIR
directory to load saved model from. If omitted, it
will use the most recent directory from experiments/.
(default: experiments/default)
--save_dir SAVE_DIR directory to save generated files to. Directory will
be created if it doesn't already exist. If not
specified, files will be saved to generated/ inside
--experiment_dir. (default: None)
--midi_instrument MIDI_INSTRUMENT
MIDI instrument name (or number) to use for the
generated files. See
https://www.midi.org/specifications/item/gm-level-1
-sound-set for a full list of instrument names.
(default: Acoustic Grand Piano)
--num_files NUM_FILES
number of midi files to sample. (default: 10)
--file_length FILE_LENGTH
Length of each file, measured in 16th notes. (default:
1000)
--prime_file PRIME_FILE
prime generated files from midi file. If not specified
random windows from the validation dataset will be
used for for seeding. (default: None)
--data_dir DATA_DIR data directory containing .mid files to use
forseeding/priming. Required if --prime_file is not
specified (default: data/midi)
```
## How it works
This is a _very_ basic LSTM Recurrent Neural Network (RNN). It uses windows of 129-class one-hot encoded (0-127 = MIDI note numbers + 1 class to represent rests) as input for each step and creates a softmax probability distrobution over these 129 classes which it samples from to predict the next note in the sequence. That note is then appended to the window (poping the first note off the list to keep a fixed size window) and that window is then used as input for the prediction in the next time step. Many methods could be used to improve its performance (like for instance, using an encoder-decoder sequence-2-sequence model), however, `midi-rnn` should serve as a nice "naive" baseline to compare other machine learning MIDI generation tasks and algorithms against.
================================================
FILE: experiments/.gitkeep
================================================
================================================
FILE: requirements.txt
================================================
appdirs==1.4.3
funcsigs==1.0.2
h5py==2.7.0
Keras==2.0.3
mido==1.2.4
mock==2.0.0
numpy==1.12.1
packaging==16.8
pbr==2.1.0
pretty-midi==0.2.7
protobuf==3.2.0
pyparsing==2.2.0
PyYAML==3.12
scipy==0.19.0
six==1.10.0
tensorflow==1.0.1
Theano==0.9.0
================================================
FILE: sample.py
================================================
#!/usr/bin/env python
import argparse, os, pdb
import pretty_midi
import train
import utils
def parse_args():
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('--experiment_dir', type=str,
default='experiments/default',
help='directory to load saved model from. ' \
'If omitted, it will use the most recent directory from ' \
'experiments/.')
parser.add_argument('--save_dir', type=str,
help='directory to save generated files to. Directory will be ' \
'created if it doesn\'t already exist. If not specified, ' \
'files will be saved to generated/ inside --experiment_dir.')
parser.add_argument('--midi_instrument', default='Acoustic Grand Piano',
help='MIDI instrument name (or number) to use for the ' \
'generated files. See https://www.midi.org/specifications/item/'\
'gm-level-1-sound-set for a full list of instrument names.')
parser.add_argument('--num_files', type=int, default=10,
help='number of midi files to sample.')
parser.add_argument('--file_length', type=int, default=1000,
help='Length of each file, measured in 16th notes.')
parser.add_argument('--prime_file', type=str,
help='prime generated files from midi file. If not specified ' \
'random windows from the validation dataset will be used for ' \
'for seeding.')
parser.add_argument('--data_dir', type=str, default='data/midi',
help='data directory containing .mid files to use for' \
'seeding/priming. Required if --prime_file is not specified')
return parser.parse_args()
def get_experiment_dir(experiment_dir):
if experiment_dir == 'experiments/default':
dirs_ = [os.path.join('experiments', d) for d in os.listdir('experiments') \
if os.path.isdir(os.path.join('experiments', d))]
experiment_dir = max(dirs_, key=os.path.getmtime)
if not os.path.exists(os.path.join(experiment_dir, 'model.json')):
utils.log('Error: {} does not exist. ' \
'Are you sure that {} is a valid experiment?' \
'Exiting.'.format(os.path.join(args.experiment_dir), 'model.json',
experiment_dir), True)
exit(1)
return experiment_dir
def main():
args = parse_args()
args.verbose = True
# prime file validation
if args.prime_file and not os.path.exists(args.prime_file):
utils.log('Error: prime file {} does not exist. Exiting.'.format(args.prime_file),
True)
exit(1)
else:
if not os.path.isdir(args.data_dir):
utils.log('Error: data dir {} does not exist. Exiting.'.format(args.prime_file),
True)
exit(1)
midi_files = [ args.prime_file ] if args.prime_file else \
[ os.path.join(args.data_dir, f) for f in os.listdir(args.data_dir) \
if '.mid' in f or '.midi' in f ]
experiment_dir = get_experiment_dir(args.experiment_dir)
utils.log('Using {} as --experiment_dir'.format(experiment_dir), args.verbose)
if not args.save_dir:
args.save_dir = os.path.join(experiment_dir, 'generated')
if not os.path.isdir(args.save_dir):
os.makedirs(args.save_dir)
utils.log('Created directory {}'.format(args.save_dir), args.verbose)
model, epoch = train.get_model(args, experiment_dir=experiment_dir)
utils.log('Model loaded from {}'.format(os.path.join(experiment_dir, 'model.json')),
args.verbose)
window_size = model.layers[0].get_input_shape_at(0)[1]
seed_generator = utils.get_data_generator(midi_files,
window_size=window_size,
batch_size=32,
num_threads=1,
max_files_in_ram=10)
# validate midi instrument name
try:
# try and parse the instrument name as an int
instrument_num = int(args.midi_instrument)
if not (instrument_num >= 0 and instrument_num <=127):
utils.log('Error: {} is not a supported instrument. Number values must be ' \
'be 0-127. Exiting'.format(args.midi_instrument), True)
exit(1)
args.midi_instrument = pretty_midi.program_to_instrument_name(instrument_num)
except ValueError as err:
# if the instrument name is a string
try:
# validate that it can be converted to a program number
_ = pretty_midi.instrument_name_to_program(args.midi_instrument)
except ValueError as er:
utils.log('Error: {} is not a valid General MIDI instrument. Exiting.'\
.format(args.midi_instrument), True)
exit(1)
# generate 10 tracks using random seeds
utils.log('Loading seed files...', args.verbose)
X, y = next(seed_generator)
generated = utils.generate(model, X, window_size,
args.file_length, args.num_files, args.midi_instrument)
for i, midi in enumerate(generated):
file = os.path.join(args.save_dir, '{}.mid'.format(i + 1))
midi.write(file.format(i + 1))
utils.log('wrote midi file to {}'.format(file), True)
if __name__ == '__main__':
main()
================================================
FILE: train.py
================================================
#!/usr/bin/env python
import os, argparse, time
import utils
from keras.models import Sequential
from keras.layers import Dense, Activation, Dropout
from keras.layers import LSTM
from keras.callbacks import ModelCheckpoint, ReduceLROnPlateau, TensorBoard
from keras.optimizers import SGD, RMSprop, Adagrad, Adadelta, Adam, Adamax, Nadam
OUTPUT_SIZE = 129 # 0-127 notes + 1 for rests
def parse_args():
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('--data_dir', type=str, default='data/midi',
help='data directory containing .mid files to use for' \
'training')
parser.add_argument('--experiment_dir', type=str,
default='experiments/default',
help='directory to store checkpointed models and tensorboard logs.' \
'if omitted, will create a new numbered folder in experiments/.')
parser.add_argument('--rnn_size', type=int, default=64,
help='size of RNN hidden state')
parser.add_argument('--num_layers', type=int, default=1,
help='number of layers in the RNN')
parser.add_argument('--learning_rate', type=float, default=None,
help='learning rate. If not specified, the recommended learning '\
'rate for the chosen optimizer is used.')
parser.add_argument('--window_size', type=int, default=20,
help='Window size for RNN input per step.')
parser.add_argument('--batch_size', type=int, default=32,
help='minibatch size')
parser.add_argument('--num_epochs', type=int, default=10,
help='number of epochs before stopping training.')
parser.add_argument('--dropout', type=float, default=0.2,
help='percentage of weights that are turned off every training '\
'set step. This is a popular regularization that can help with '\
'overfitting. Recommended values are 0.2-0.5')
parser.add_argument('--optimizer',
choices=['sgd', 'rmsprop', 'adagrad', 'adadelta',
'adam', 'adamax', 'nadam'], default='adam',
help='The optimization algorithm to use. '\
'See https://keras.io/optimizers for a full list of optimizers.')
parser.add_argument('--grad_clip', type=float, default=5.0,
help='clip gradients at this value.')
parser.add_argument('--message', '-m', type=str,
help='a note to self about the experiment saved to message.txt '\
'in --experiment_dir.')
parser.add_argument('--n_jobs', '-j', type=int, default=1,
help='Number of CPUs to use when loading and parsing midi files.')
parser.add_argument('--max_files_in_ram', default=25, type=int,
help='The maximum number of midi files to load into RAM at once.'\
' A higher value trains faster but uses more RAM. A lower value '\
'uses less RAM but takes significantly longer to train.')
return parser.parse_args()
# create or load a saved model
# returns the model and the epoch number (>1 if loaded from checkpoint)
def get_model(args, experiment_dir=None):
epoch = 0
if not experiment_dir:
model = Sequential()
for layer_index in range(args.num_layers):
kwargs = dict()
kwargs['units'] = args.rnn_size
# if this is the first layer
if layer_index == 0:
kwargs['input_shape'] = (args.window_size, OUTPUT_SIZE)
if args.num_layers == 1:
kwargs['return_sequences'] = False
else:
kwargs['return_sequences'] = True
model.add(LSTM(**kwargs))
else:
# if this is a middle layer
if not layer_index == args.num_layers - 1:
kwargs['return_sequences'] = True
model.add(LSTM(**kwargs))
else: # this is the last layer
kwargs['return_sequences'] = False
model.add(LSTM(**kwargs))
model.add(Dropout(args.dropout))
model.add(Dense(OUTPUT_SIZE))
model.add(Activation('softmax'))
else:
model, epoch = utils.load_model_from_checkpoint(experiment_dir)
# these cli args aren't specified if get_model() is being
# being called from sample.py
if 'grad_clip' in args and 'optimizer' in args:
kwargs = { 'clipvalue': args.grad_clip }
if args.learning_rate:
kwargs['lr'] = args.learning_rate
# select the optimizers
if args.optimizer == 'sgd':
optimizer = SGD(**kwargs)
elif args.optimizer == 'rmsprop':
optimizer = RMSprop(**kwargs)
elif args.optimizer == 'adagrad':
optimizer = Adagrad(**kwargs)
elif args.optimizer == 'adadelta':
optimizer = Adadelta(**kwargs)
elif args.optimizer == 'adam':
optimizer = Adam(**kwargs)
elif args.optimizer == 'adamax':
optimizer = Adamax(**kwargs)
elif args.optimizer == 'nadam':
optimizer = Nadam(**kwargs)
else:
utils.log(
'Error: {} is not a supported optimizer. Exiting.'.format(args.optimizer),
True)
exit(1)
else: # so instead lets use a default (no training occurs anyway)
optimizer = Adam()
model.compile(loss='categorical_crossentropy',
optimizer=optimizer,
metrics=['accuracy'])
return model, epoch
def get_callbacks(experiment_dir, checkpoint_monitor='val_acc'):
callbacks = []
# save model checkpoints
filepath = os.path.join(experiment_dir,
'checkpoints',
'checkpoint-epoch_{epoch:03d}-val_acc_{val_acc:.3f}.hdf5')
callbacks.append(ModelCheckpoint(filepath,
monitor=checkpoint_monitor,
verbose=1,
save_best_only=False,
mode='max'))
callbacks.append(ReduceLROnPlateau(monitor='val_loss',
factor=0.5,
patience=3,
verbose=1,
mode='auto',
epsilon=0.0001,
cooldown=0,
min_lr=0))
callbacks.append(TensorBoard(log_dir=os.path.join(experiment_dir, 'tensorboard-logs'),
histogram_freq=0,
write_graph=True,
write_images=False))
return callbacks
def main():
args = parse_args()
args.verbose = True
try:
# get paths to midi files in --data_dir
midi_files = [os.path.join(args.data_dir, path) \
for path in os.listdir(args.data_dir) \
if '.mid' in path or '.midi' in path]
except OSError as e:
log('Error: Invalid --data_dir, {} directory does not exist. Exiting.', args.verbose)
exit(1)
utils.log(
'Found {} midi files in {}'.format(len(midi_files), args.data_dir),
args.verbose
)
if len(midi_files) < 1:
utils.log(
'Error: no midi files found in {}. Exiting.'.format(args.data_dir),
args.verbose
)
exit(1)
# create the experiment directory and return its name
experiment_dir = utils.create_experiment_dir(args.experiment_dir, args.verbose)
# write --message to experiment_dir
if args.message:
with open(os.path.join(experiment_dir, 'message.txt'), 'w') as f:
f.write(args.message)
utils.log('Wrote {} bytes to {}'.format(len(args.message),
os.path.join(experiment_dir, 'message.txt')), args.verbose)
val_split = 0.2 # use 20 percent for validation
val_split_index = int(float(len(midi_files)) * val_split)
# use generators to lazy load train/validation data, ensuring that the
# user doesn't have to load all midi files into RAM at once
train_generator = utils.get_data_generator(midi_files[0:val_split_index],
window_size=args.window_size,
batch_size=args.batch_size,
num_threads=args.n_jobs,
max_files_in_ram=args.max_files_in_ram)
val_generator = utils.get_data_generator(midi_files[val_split_index:],
window_size=args.window_size,
batch_size=args.batch_size,
num_threads=args.n_jobs,
max_files_in_ram=args.max_files_in_ram)
model, epoch = get_model(args)
if args.verbose:
print(model.summary())
utils.save_model(model, experiment_dir)
utils.log('Saved model to {}'.format(os.path.join(experiment_dir, 'model.json')),
args.verbose)
callbacks = get_callbacks(experiment_dir)
print('fitting model...')
# this is a somewhat magic number which is the average number of length-20 windows
# calculated from ~5K MIDI files from the Lakh MIDI Dataset.
magic_number = 827
start_time = time.time()
model.fit_generator(train_generator,
steps_per_epoch=len(midi_files) * magic_number / args.batch_size,
epochs=args.num_epochs,
validation_data=val_generator,
validation_steps=len(midi_files) * 0.2 * magic_number / args.batch_size,
verbose=1,
callbacks=callbacks,
initial_epoch=epoch)
utils.log('Finished in {:.2f} seconds'.format(time.time() - start_time), args.verbose)
if __name__ == '__main__':
main()
================================================
FILE: utils.py
================================================
import os, glob, random
import pretty_midi
import numpy as np
from keras.models import model_from_json
from multiprocessing import Pool as ThreadPool
def log(message, verbose):
if verbose:
print('[*] {}'.format(message))
def parse_midi(path):
midi = None
try:
midi = pretty_midi.PrettyMIDI(path)
midi.remove_invalid_notes()
except Exception as e:
raise Exception(("%s\nerror readying midi file %s" % (e, path)))
return midi
def get_percent_monophonic(pm_instrument_roll):
mask = pm_instrument_roll.T > 0
notes = np.sum(mask, axis=1)
n = np.count_nonzero(notes)
single = np.count_nonzero(notes == 1)
if single > 0:
return float(single) / float(n)
elif single == 0 and n > 0:
return 0.0
else: # no notes of any kind
return 0.0
def filter_monophonic(pm_instruments, percent_monophonic=0.99):
return [i for i in pm_instruments if \
get_percent_monophonic(i.get_piano_roll()) >= percent_monophonic]
# if the experiment dir doesn't exist create it and its subfolders
def create_experiment_dir(experiment_dir, verbose=False):
# if the experiment directory was specified and already exists
if experiment_dir != 'experiments/default' and \
os.path.exists(experiment_dir):
# raise an error
raise Exception('Error: Invalid --experiemnt_dir, {} already exists' \
.format(experiment_dir))
# if the experiment directory was not specified, create a new numeric folder
if experiment_dir == 'experiments/default':
experiments = os.listdir('experiments')
experiments = [dir_ for dir_ in experiments \
if os.path.isdir(os.path.join('experiments', dir_))]
most_recent_exp = 0
for dir_ in experiments:
try:
most_recent_exp = max(int(dir_), most_recent_exp)
except ValueError as e:
# ignrore non-numeric folders in experiments/
pass
experiment_dir = os.path.join('experiments',
str(most_recent_exp + 1).rjust(2, '0'))
os.mkdir(experiment_dir)
log('Created experiment directory {}'.format(experiment_dir), verbose)
os.mkdir(os.path.join(experiment_dir, 'checkpoints'))
log('Created checkpoint directory {}'.format(os.path.join(experiment_dir, 'checkpoints')),
verbose)
os.mkdir(os.path.join(experiment_dir, 'tensorboard-logs'))
log('Created log directory {}'.format(os.path.join(experiment_dir, 'tensorboard-logs')),
verbose)
return experiment_dir
# load data with a lazzy loader
def get_data_generator(midi_paths,
window_size=20,
batch_size=32,
num_threads=8,
max_files_in_ram=170):
if num_threads > 1:
# load midi data
pool = ThreadPool(num_threads)
load_index = 0
while True:
load_files = midi_paths[load_index:load_index + max_files_in_ram]
# print('length of load files: {}'.format(len(load_files)))
load_index = (load_index + max_files_in_ram) % len(midi_paths)
# print('loading large batch: {}'.format(max_files_in_ram))
# print('Parsing midi files...')
# start_time = time.time()
if num_threads > 1:
parsed = pool.map(parse_midi, load_files)
else:
parsed = map(parse_midi, load_files)
# print('Finished in {:.2f} seconds'.format(time.time() - start_time))
# print('parsed, now extracting data')
data = _windows_from_monophonic_instruments(parsed, window_size)
batch_index = 0
while batch_index + batch_size < len(data[0]):
# print('getting data...')
# print('yielding small batch: {}'.format(batch_size))
res = (data[0][batch_index: batch_index + batch_size],
data[1][batch_index: batch_index + batch_size])
yield res
batch_index = batch_index + batch_size
# probably unneeded but why not
del parsed # free the mem
del data # free the mem
def save_model(model, model_dir):
with open(os.path.join(model_dir, 'model.json'), 'w') as f:
f.write(model.to_json())
def load_model_from_checkpoint(model_dir):
'''Loads the best performing model from checkpoint_dir'''
with open(os.path.join(model_dir, 'model.json'), 'r') as f:
model = model_from_json(f.read())
epoch = 0
newest_checkpoint = max(glob.iglob(model_dir +
'/checkpoints/*.hdf5'),
key=os.path.getctime)
if newest_checkpoint:
epoch = int(newest_checkpoint[-22:-19])
model.load_weights(newest_checkpoint)
return model, epoch
def generate(model, seeds, window_size, length, num_to_gen, instrument_name):
# generate a pretty midi file from a model using a seed
def _gen(model, seed, window_size, length):
generated = []
# ring buffer
buf = np.copy(seed).tolist()
while len(generated) < length:
arr = np.expand_dims(np.asarray(buf), 0)
pred = model.predict(arr)
# argmax sampling (NOT RECOMMENDED), or...
# index = np.argmax(pred)
# prob distrobuition sampling
index = np.random.choice(range(0, seed.shape[1]), p=pred[0])
pred = np.zeros(seed.shape[1])
pred[index] = 1
generated.append(pred)
buf.pop(0)
buf.append(pred)
return generated
midis = []
for i in range(0, num_to_gen):
seed = seeds[random.randint(0, len(seeds) - 1)]
gen = _gen(model, seed, window_size, length)
midis.append(_network_output_to_midi(gen, instrument_name))
return midis
# create a pretty midi file with a single instrument using the one-hot encoding
# output of keras model.predict.
def _network_output_to_midi(windows,
instrument_name='Acoustic Grand Piano',
allow_represses=False):
# Create a PrettyMIDI object
midi = pretty_midi.PrettyMIDI()
# Create an Instrument instance for a cello instrument
instrument_program = pretty_midi.instrument_name_to_program(instrument_name)
instrument = pretty_midi.Instrument(program=instrument_program)
cur_note = None # an invalid note to start with
cur_note_start = None
clock = 0
# Iterate over note names, which will be converted to note number later
for step in windows:
note_num = np.argmax(step) - 1
# a note has changed
if allow_represses or note_num != cur_note:
# if a note has been played before and it wasn't a rest
if cur_note is not None and cur_note >= 0:
# add the last note, now that we have its end time
note = pretty_midi.Note(velocity=127,
pitch=int(cur_note),
start=cur_note_start,
end=clock)
instrument.notes.append(note)
# update the current note
cur_note = note_num
cur_note_start = clock
# update the clock
clock = clock + 1.0 / 4
# Add the cello instrument to the PrettyMIDI object
midi.instruments.append(instrument)
return midi
# returns X, y data windows from all monophonic instrument
# tracks in a pretty midi file
def _windows_from_monophonic_instruments(midi, window_size):
X, y = [], []
for m in midi:
if m is not None:
melody_instruments = filter_monophonic(m.instruments, 1.0)
for instrument in melody_instruments:
if len(instrument.notes) > window_size:
windows = _encode_sliding_windows(instrument, window_size)
for w in windows:
X.append(w[0])
y.append(w[1])
return (np.asarray(X), np.asarray(y))
# one-hot encode a sliding window of notes from a pretty midi instrument.
# This approach uses the piano roll method, where each step in the sliding
# window represents a constant unit of time (fs=4, or 1 sec / 4 = 250ms).
# This allows us to encode rests.
# expects pm_instrument to be monophonic.
def _encode_sliding_windows(pm_instrument, window_size):
roll = np.copy(pm_instrument.get_piano_roll(fs=4).T)
# trim beginning silence
summed = np.sum(roll, axis=1)
mask = (summed > 0).astype(float)
roll = roll[np.argmax(mask):]
# transform note velocities into 1s
roll = (roll > 0).astype(float)
# calculate the percentage of the events that are rests
# s = np.sum(roll, axis=1)
# num_silence = len(np.where(s == 0)[0])
# print('{}/{} {:.2f} events are rests'.format(num_silence, len(roll), float(num_silence)/float(len(roll))))
# append a feature: 1 to rests and 0 to notes
rests = np.sum(roll, axis=1)
rests = (rests != 1).astype(float)
roll = np.insert(roll, 0, rests, axis=1)
windows = []
for i in range(0, roll.shape[0] - window_size - 1):
windows.append((roll[i:i + window_size], roll[i + window_size + 1]))
return windows
gitextract_st_rvfoo/ ├── .gitignore ├── GPL.txt ├── LICENSE ├── README.md ├── data/ │ └── midi/ │ ├── 006c4bcdf2f453be54e499f9676c4517.mid_19101494-8bdb-4c07-bace-7e5b42e46160.mid │ ├── 006c4bcdf2f453be54e499f9676c4517.mid_239ec2f0-77f9-43b7-9f27-c67199342ca9.mid │ ├── 024bb9f00d4c41237ca39dbc2ce0b14b.mid_9194767e-9449-424e-a445-87f7170aa0d8.mid │ ├── 024bdf7815ae8b97ac8cac959cce3c5f.mid_93dbe968-d18a-4bc7-b89a-1711d24d7cf0.mid │ ├── 0259153dc0bb402da5e783eb331491ba.mid_58abc8ad-e6fc-4822-9106-b5af2b7e922d.mid │ ├── 029e9ea0f8c083158664cb5c0b868e0d.mid_00cc0b48-8198-4b61-a64a-88430816f73a.mid │ ├── 03625a89da61afe76ed334bbfc9be3de.mid_3e6cc60d-c183-4284-a9cc-3aad97f64cc3.mid │ ├── 03af990cb42904fc25f668d22a2f865d.mid_7b435c05-2691-4522-9c1a-c6fe36d61002.mid │ ├── 03fadb7c93acb8e76324efdb307b028c.mid_ba71667a-74e7-47ac-8685-35a040e6566d.mid │ ├── 06916e1b8d24da0cae8a7910d15221b4.mid_76d199f5-a371-440b-95b8-41f10b4447a2.mid │ ├── 07d726086824cae751f579dd359cb7cd.mid_45f3f18a-d8d6-446c-b47e-67ac17ef737b.mid │ ├── 0c0a26eb521cf6b03948129dff925783.mid_8dd5dc13-5d4a-43fb-9400-b8d8670d6e86.mid │ ├── 0c2f13e003a25ebdf94fcab6847b41c2.mid_e0cf4d68-8f25-48ca-a817-091acd5bd889.mid │ ├── 0d339ad8e9d1526953c9b077d760463c.mid_fa6b7251-854b-47bf-aa0b-61ae96416b2e.mid │ ├── 0d34fc60d036cbe8ad8ee67e79418ccc.mid_eacf483a-4126-4740-b8a1-f734f8866ad0.mid │ ├── 0efb6b93879c79806c003f990ee5e7c6.mid_25df40dc-0bfa-4a5f-b847-4804eb846307.mid │ ├── 0efb6b93879c79806c003f990ee5e7c6.mid_8197fa6d-ec6b-4813-b802-0c5d0204bcf5.mid │ ├── 105ad0ef28c9887a34007ef7f72b3c0c.mid_6438395b-f61f-41f4-9273-a6b8a63c8ae2.mid │ ├── 1402adcba040a9544567aae132c8fdc9.mid_6621f84f-cccc-45b5-bd14-4a2fde52dd47.mid │ ├── 184af974fd533135ad744793b592d90e.mid_b5b344f2-90ac-4e07-b0b8-431aff7412d3.mid │ ├── 1f0ed37c82bf4f39001cfb4cf22ea1ed.mid_64bfec26-748b-430f-8dcc-24de515235a1.mid │ ├── 1f0ed37c82bf4f39001cfb4cf22ea1ed.mid_cf4c534a-b0a1-47ce-ad46-9f52ff9915e6.mid │ ├── 1f0ed37c82bf4f39001cfb4cf22ea1ed.mid_d193fa9e-4a44-47fb-a3e6-46a95d813395.mid │ ├── 20dc03b9614db979d8941fb7595488af.mid_76c6eb09-2432-4ad6-bb92-990cae657f65.mid │ ├── 242f3d3f7f353ddccdef404b34a33743.mid_c775346d-e664-4a5a-a659-9da4c436198c.mid │ ├── 25418daf547b53cf72e62d4b81c77aa1.mid_951716c7-efee-4005-be04-c1f4040ba4ab.mid │ ├── 25a0e2321105de4862838aa853cd4556.mid_7ebddc50-c87c-4327-88be-c6a00dab5cae.mid │ ├── 25a0e2321105de4862838aa853cd4556.mid_9d3829fa-b29b-4b87-8505-fff22d31d76a.mid │ ├── 25a0e2321105de4862838aa853cd4556.mid_ce42480a-d7fd-4c4f-8c13-8c1ea41a64ed.mid │ ├── 26f94af7643bf6b5a014a4a3ca0b1f69.mid_846e95e0-d16f-4997-8dde-7400d67a57b1.mid │ ├── 2851b64689c37294348c33b89d43e068.mid_24237e29-a544-433b-9928-af45cbc9709e.mid │ ├── 2ad9178f35c95a6611b0d1d3bc684500.mid_01535e05-31f9-4c8c-ac3c-800ce6b3c923.mid │ ├── 2b3612e871fed048a7a3d686b730b844.mid_58306771-5ea7-4a18-b203-1582f08d8664.mid │ ├── 2f84f3f0912323f35c3396224bc6ec39.mid_70c208d0-9814-4659-a60f-54866e73bf35.mid │ ├── 30ac1dd46dcc2042d6cb4dc8554dabbe.mid_c6b5a8e2-3fb6-4e99-8d2f-7112b064b11a.mid │ ├── 321022ce567bdf35a0959955921ed74d.mid_21dd6d97-3d90-421f-8e9b-824f34764832.mid │ ├── 321022ce567bdf35a0959955921ed74d.mid_3ed6d794-1a5c-471f-a7e7-568ff071b1a8.mid │ ├── 321022ce567bdf35a0959955921ed74d.mid_ce882c7c-96c1-4f9e-a5fa-113fc8e85d7d.mid │ ├── 335cef9bde48d149b8bb10e96efb3de5.mid_372fca09-41a6-4f0a-b98d-8101027d2d0b.mid │ ├── 34127feacbb9237ef5060876a10464b2.mid_deb2a9af-4ae8-4c3d-aaea-0b100b797f92.mid │ ├── 3730ea35b5f82a395aed3be08fd6baf5.mid_7cb04bd5-2151-423d-b3e9-fca176f3b493.mid │ ├── 39339848e9ffb24b07b33647790ee101.mid_f12870b2-90c1-418f-a306-741ecaa0cdda.mid │ ├── 3b1be96bb4f03a555f0ebb30f36a8ae9.mid_7d191755-aaf0-4d6d-bcbf-2cc2c36c8050.mid │ ├── 3b1be96bb4f03a555f0ebb30f36a8ae9.mid_c511d07d-d6c8-4e7c-ac76-f09a56c678ad.mid │ ├── 3cf7536eb8c1b2ba6cb77f2eb5c95ea7.mid_37d3c359-1a18-4e18-8f39-915d7fee384a.mid │ ├── 3ff8620db8903ecd78e762f6a904792f.mid_03d111fc-3841-4ecf-a32a-63abef1e7aa4.mid │ ├── 40b71244f5a700fc0da0e7528f044849.mid_2e0cba88-a330-4091-a2e1-1eeed77f2a8b.mid │ ├── 40b71244f5a700fc0da0e7528f044849.mid_7b0d0177-0d4f-4539-855c-9b60fcd55755.mid │ ├── 422c553660359a28145597bf0e0c16f6.mid_9dd7935d-7aa9-4450-9463-22682229cf0c.mid │ ├── 42fd4e40a3bfa72cc7cbe08db7bfd08f.mid_9fe8de27-ad88-4198-b82f-dbbb0824cad5.mid │ ├── 43e038a542310ca593ae5b2d104639b6.mid_61ab337b-bae1-4a07-94e8-bbf3acb09529.mid │ ├── 4538694106d643db46fb240762fade8a.mid_c8a55a45-e14a-4643-8d6c-22cb950b2f93.mid │ ├── 4546c60c2eeb1845aede126b9136b051.mid_f9cf573b-3f42-4fc9-8478-4b3a4314a8f8.mid │ ├── 48e536a285b8d674101e5c23e15801ec.mid_1187bad7-87e7-4760-b79c-1bc9352e366a.mid │ ├── 4cc05de563107720f2affa67573394ea.mid_b16efe87-2282-46db-a1d2-84969e612c09.mid │ ├── 4d76b33720ff81c50307ea73a7d3788b.mid_a56339a8-5064-45ca-8c9b-0b92b6ed7e4d.mid │ ├── 4d76b33720ff81c50307ea73a7d3788b.mid_c5a8000e-5681-46a9-b3dc-08a6a158b415.mid │ ├── 4fb43d0e8e8d263a5c97a797d8343a08.mid_5618843b-1230-4b46-b988-2610fc399061.mid │ ├── 4fe9f5ce63029ebb23f717954117a257.mid_0f83126e-a8ae-4f28-b876-fd0a2d2dde01.mid │ ├── 53653b612181e54ce041ab9846d802df.mid_9c6e1981-3448-4570-9522-6fa24a42922f.mid │ ├── 54ba9cbd9977e3925c7e85cab4d57637.mid_937e9bb1-7226-4f61-92cf-556376495087.mid │ ├── 54d2a7c5ea68ee82a929ca83a0a2d27c.mid_550adfb4-17aa-4c49-b6e3-f2b8d58e7a78.mid │ ├── 54dc97982e367364bbf958bd188ba2d7.mid_11ddbf2a-e5c8-4910-aec1-15262536641c.mid │ ├── 54dc97982e367364bbf958bd188ba2d7.mid_5c29aaca-7895-4b78-a20b-e463c7da01ba.mid │ ├── 57e69ed1cb86fb56e8715309f74740fb.mid_5d87e417-2fd4-4221-928e-455df4f5f1e5.mid │ ├── 591e012a14033c82ca3b1bff8fab18c6.mid_c34a55b1-8b07-4f20-a00a-2c55c1bf2cdf.mid │ ├── 593ab7439efa04431dae6e2c14cdc39c.mid_32663588-49a5-4159-9c17-25d835afe904.mid │ ├── 593ab7439efa04431dae6e2c14cdc39c.mid_95ce529a-580a-4c4f-867c-ea6e0122ebb7.mid │ ├── 59c5912ff7ff38d72a765babb7b5f95f.mid_82845a88-8005-4638-ae71-065bb8fac7f6.mid │ ├── 5b8de194d3d89b1f79f2bf1a75ca98f7.mid_1a2e2945-6766-4344-a523-e4c6dae45f65.mid │ ├── 5c01eccc1ede08df4f16ccd7f188d031.mid_f144d778-488f-4f25-8097-caa794e7a494.mid │ ├── 5e7a3ba1af2a2c705963f26e8108ae50.mid_5b7c28c8-3bfb-4ca0-9956-11dab9eb1fd3.mid │ ├── 5ebe814b2183bd3ea73a753123b2a33f.mid_3a53be98-bc1e-4b60-8c80-52e5e27ea3ab.mid │ ├── 602066376225e859c7a851b59fefc725.mid_764f40a8-aa54-446b-bb80-df5f9ccfaaf4.mid │ ├── 60823851229d6721e081bb06681caf41.mid_62e2e290-604d-4312-814c-b7593f2b495b.mid │ ├── 60ae5427ef0494da2e2752f3fd0e4a91.mid_50d8c71d-1af7-46e8-8698-62913c3a8ba2.mid │ ├── 6144ed4b666ae16048b59bc20dbb0ffe.mid_982a3053-ed48-40c6-922a-6d57ed364ab8.mid │ ├── 61e4d79124bcdbb35de9e4ba25441359.mid_0cc816dc-b7f7-452f-8dee-094e6040b7bd.mid │ ├── 63875e40a0ea8640b3eb05ede1bb9222.mid_42f426ba-1867-47bc-b748-0bb1f738c2b6.mid │ ├── 646091bdbd4f3f44c8f30d3f68f4fb4b.mid_244efe3c-7043-4f54-80d7-259b2b5e5954.mid │ ├── 646091bdbd4f3f44c8f30d3f68f4fb4b.mid_ebb38eac-6496-4c98-8fda-277ed98c34bb.mid │ ├── 67514962006aae910228e3822799cac1.mid_7b183b72-02ab-4d06-a175-45108c1fa981.mid │ ├── 67514962006aae910228e3822799cac1.mid_b9d3f1fd-fa3d-4d44-b22c-87896b14b868.mid │ ├── 68cfae4a63b88e9cfc912529d87f6986.mid_80e8a913-54f9-431f-aa99-c13a9f51fb16.mid │ ├── 69d568a6c40802c8b4e974ea7b180e13.mid_1026b451-9302-47c3-b052-9a15a5b289d8.mid │ ├── 69d568a6c40802c8b4e974ea7b180e13.mid_bbe87465-ff92-4786-b42a-60aacae27b3c.mid │ ├── 6b5660f4d9cd478389560cf83e559a6f.mid_eb3132ca-04c4-4720-a42d-402d9e6743c8.mid │ ├── 6e6048c793d9476f06d7a31f9bad8bc1.mid_ee2b7ef3-9203-4e82-941a-46100aa35225.mid │ ├── 71b0a2364b2090b37fce0157690a8e7f.mid_36654613-e937-4901-998f-fb8a15439906.mid │ ├── 73345197f3af89e4e4374e959a92b0d2.mid_0d4a76b1-ffe9-46f9-9983-0c6a8e7b0d8e.mid │ ├── 7952bee0d37cceee9b0154c5493a3234.mid_41d1b7a5-128d-47c3-a810-25501c86579b.mid │ ├── 7964d78f25cac1c97e79fa6353fcc090.mid_42994ff4-12fe-4dda-8727-f1dcc94d1725.mid │ ├── 7c6617690cb8c7a96898e244d778606e.mid_fc88808a-ecc5-4aed-8cbb-0902c2c8781a.mid │ ├── 7d96421d4ce45b9015600971216b701e.mid_e66ada70-8f7f-4072-ba9a-609970863abf.mid │ ├── 7e7820fab4e36bd162ef20140157ed38.mid_17b247eb-318e-4241-8e45-7e39ceb982ab.mid │ ├── 7e7820fab4e36bd162ef20140157ed38.mid_5300bb9b-eecc-4571-8f8d-b4a49e2bf1ed.mid │ ├── 7ee93ef4323075d3c5d095767606bc79.mid_34ff0b8d-adc2-43cf-b214-6b92122afb64.mid │ ├── 7fadae7d82d7f4c6ca5b94ce27ac1506.mid_f1ed7c7b-3308-4334-b6a0-27365ad86dc1.mid │ ├── 81476f40e9af8c88d5310054f7a09bfb.mid_8e19204a-64dd-4960-85d7-a95d51376c0b.mid │ ├── 8898e6d16b14b909c1e6c53b66a2fc8b.mid_7ba1be45-18c3-4cec-9c2c-b6992af81d38.mid │ ├── 88b7dd23a988193bd1dae7262af92660.mid_5e283f7f-ed65-47d2-9679-7a6927536b2e.mid │ ├── 88b7dd23a988193bd1dae7262af92660.mid_71c1c3e3-56bc-4237-a4b6-f4adfe0c8f3d.mid │ ├── 88b7dd23a988193bd1dae7262af92660.mid_f748ca3c-e599-499e-a7ac-e11a023132b5.mid │ ├── 8aa123a8449f8eb64b53620602fcd02e.mid_1d0ae432-c26d-49e7-8c6a-e365230488f3.mid │ ├── 8aa123a8449f8eb64b53620602fcd02e.mid_70b31e06-b8f0-4402-b2c0-3e2a8ad13ea3.mid │ ├── 8b8203562250de56123cb688fa360ec7.mid_c3cda7e5-fc96-4532-8253-e8c9d6cebed8.mid │ ├── 8c98e373dc2cfb0627a71ef1a0a3ba67.mid_fcc604eb-ce22-43ee-b0c2-2946c34bc78a.mid │ ├── 8c9f5ec3af2105e813a46eb252a29250.mid_36d4b188-d980-4c92-abc6-db46763728b6.mid │ ├── 8d5bbbeec9c970e43412c393a85c6adc.mid_9c77c45b-6082-457b-a7b3-c51c6443e835.mid │ ├── 92f258cf435d0b5d6cfaa530f57dd8f9.mid_b62b718e-5a53-4c3d-8692-83fe858e3615.mid │ ├── 950cde1e401e67d3226b9241be4c91a8.mid_5fbfcba0-b4ff-4c30-b19c-efabf7ec5186.mid │ ├── 9e6121c6bdf0e5111d94085f241eed49.mid_cf789e06-fff2-405a-9844-fd25974e1c21.mid │ ├── 9e6121c6bdf0e5111d94085f241eed49.mid_e6e2934c-58bd-443c-83e8-bad46fbc5713.mid │ ├── 9ebea87b095c310ea922143e009d8597.mid_4dd2e6df-6fce-4199-abe9-22c1dc4d19d9.mid │ ├── 9f738e356cbe2c62f167b28e2061b459.mid_a02f511a-9a20-4198-ad10-97570c7afbab.mid │ ├── a4118d72c67b67bba1dd69005143dc32.mid_24c0369a-9290-4abb-90ea-1307d0767a30.mid │ ├── a5af527971ab453549a69426e86344d9.mid_f4e34d37-12dd-42d2-9168-d845840a201a.mid │ ├── a61274d8bc0ffdb50e667435402d2693.mid_e13f3df0-f969-4040-bb9f-1d545a1a452a.mid │ ├── a66c4c305f6919927187bbfa5f0b9d30.mid_3218d61d-a300-422f-a62a-d1a3620f0a9a.mid │ ├── aa783f35c7a4e5f7622c9ef970e5ef66.mid_18402bf9-cfd2-4a7d-bea9-73f88d14a6a4.mid │ ├── adca0112f04527431148930f661eaff5.mid_96237349-710e-4e5a-8b9c-005f7bef2e8b.mid │ ├── af1813dcebb0b3494c6d8b7fb8433bfd.mid_1a0d4934-cff5-4452-8eca-705c768169cf.mid │ ├── b0f7d6b283ebe3a4fcd3153cda37ce84.mid_3b7e1387-55ca-444d-9d62-72a1452fb5f8.mid │ ├── b3e5265f3443d61bbf2494825a453219.mid_20a850ce-0154-4258-a8f3-6e9a4aea6ac6.mid │ ├── b51c65ae7141737aeb86702ee41895b0.mid_116bfaed-36ac-46fc-a532-ed269a80d1ee.mid │ ├── b77bf6a3b244e1382d3e7136344aa7cc.mid_09bf26b0-2efa-43c7-96c3-0f4129d4cbad.mid │ ├── b7d550f4cd7ab6f69f182c7b98e4d7af.mid_ea39691f-eac3-4f8b-ac5c-829425870283.mid │ ├── b7df0b512ad48ea6a96bb29a51838858.mid_7028c2fd-9934-46f0-ad84-505573b844fa.mid │ ├── b8405436e24de17b0c15c0d0d016980a.mid_b5e8619a-3ded-49fa-8add-f0f3ef623c4a.mid │ ├── b8a2494ac64f04700dc2d2910ccb8e7d.mid_0c80be57-30c9-4df6-81d2-ceafdf902f7f.mid │ ├── ba029f51e2f5709ebe37eec0888c613d.mid_207257bb-080b-4dee-b682-fe9db1430dc0.mid │ ├── bbe6f78fb6fcc9918727d1d0d40c32aa.mid_e5b171be-70cd-4bb6-ac20-179b970665d3.mid │ ├── bcd3da9d4a5afcbcdf4ec747639dc0b0.mid_1f0033d8-c3fa-4672-a81c-5e9cca943f04.mid │ ├── c0f19516339892362e68910ea08b12a1.mid_a21e710d-c476-4b13-b18e-778eed1a62a3.mid │ ├── c40ad18dd5218bdd7e9f3caf88f94acd.mid_c90f311d-578e-4444-b3b7-df6ce9614d67.mid │ ├── c503266e7046930029e253de3213a0e8.mid_25d62412-f488-40bc-84ec-9ce854c09581.mid │ ├── c53a5bb0e5f3b1abed3e6cf2f9a6c29f.mid_aa8e7d49-9c35-4951-9c47-a31506070f81.mid │ ├── c5be65db3377d5c5ab72d3048cfafae9.mid_321fc737-a51e-4786-90c4-6752104b4934.mid │ ├── c67307063fca6428823648033fec19ea.mid_8247ea78-8f43-40d0-a456-6b6557960051.mid │ ├── c71a976810c8fe51da5ada5c19ab5c9c.mid_0156cbe9-3675-4535-bfe6-8e367eb0488f.mid │ ├── c9d81e24f6c3608017f50edc62e091cb.mid_73e1d946-4d42-42f8-b84f-82688e83ea1b.mid │ ├── ca61743187bbb4f66e4a37bbbcff0676.mid_4b35fd01-7493-454a-9d11-bff41cc421b5.mid │ ├── cbaebc08f0c67301912d7273aab2bddd.mid_58b0b62b-9e15-407f-811a-6f98d581f103.mid │ ├── ccadca776cb1299d23e842ba2264a560.mid_47bef30c-c73b-4f4d-b117-a851876da03a.mid │ ├── ccadca776cb1299d23e842ba2264a560.mid_8aaaf1fe-3641-4011-b2f7-6fc8f47ca697.mid │ ├── cd786c0daae30c797e54b343dfb672e9.mid_64985a76-4e88-410b-be0b-4216e546f629.mid │ ├── cda2dda17b6dbb1eb73a6c4372fd8d4e.mid_92cdd22a-74e6-44de-bbe8-bbde80254307.mid │ ├── cfb49b3f705e9c6422c88c139fc6ea3d.mid_678e6726-3f88-4a56-a987-2e7ba4c540c6.mid │ ├── d06fa6163d7ea6973160cd0c8fda1d07.mid_7aa7b17a-82d9-4e5a-9449-5540f599016c.mid │ ├── d0765789e2cdd5c879292aa059338e8a.mid_67e454e2-5138-4cd2-b9c0-69f398eed264.mid │ ├── d34d0fdda18bc3d38e955f4fd517ae37.mid_da23ca35-a790-4862-81ba-3e14c771e56e.mid │ ├── d3be9dce190b09c2e7f5c607b5aa7500.mid_e4a57c5f-ee12-4a16-bb0f-dceb89ec4df7.mid │ ├── d4c75ab42108e3a56ce2b76f5e67350d.mid_e42e5474-c09d-4c09-9b4c-69564d677531.mid │ ├── d75b804faf21bf577e0b7fef50b77324.mid_2a25de88-db33-41d7-8a19-1855583e1683.mid │ ├── d7b24dfa54343be8726d1d1d2d0323ff.mid_9cc79a88-5e07-4fb1-8096-fb106192e4c8.mid │ ├── d977ef0870cfade1ca280cd7929e5cf9.mid_68ca3cd7-4ef4-4b7f-9c43-622f37e593ad.mid │ ├── db3128e96bd352b1206c875173f12b67.mid_1a5da5e5-a23a-4043-bd37-e3de42eb5c5a.mid │ ├── ddc45237a1688520100e80f82aa4f329.mid_341ce981-ab28-4082-8a64-6bf778f4c7bd.mid │ ├── deea33b4add3b750643fc13c69d63e5b.mid_3a736fc3-88f1-46e2-b52c-08b127382b4b.mid │ ├── df2c18107b7688d9f2e31b4effe11914.mid_864216bd-7829-4f21-a822-a332e3b02644.mid │ ├── df3b885d8ed0ca0d0cc5485e24f81777.mid_937a36ef-9cd7-4a8e-ac05-97c0351bcaa8.mid │ ├── e07b45a8ef4233b50ed2f151de2ef1cb.mid_925aa1e8-bbfe-45b8-846d-dee0712c6ff2.mid │ ├── e0a38c7f4851dfb3eb8a4e159e313089.mid_c8f3fb76-3964-4059-aa44-b3024432ce49.mid │ ├── e0d08b315371a3c408152f2e30426b74.mid_b1cc8b4d-ae6a-45fc-954f-2c963458ea40.mid │ ├── e2dd59c5e85e1866cd4a4b103c227871.mid_1a91173b-307f-450f-ac48-cb661018c9cf.mid │ ├── e2dd59c5e85e1866cd4a4b103c227871.mid_964b62b2-009d-422b-b987-4da09cef99ef.mid │ ├── e2dd59c5e85e1866cd4a4b103c227871.mid_dee12dbd-d413-40db-a693-b5f4d53edbe7.mid │ ├── e4dd410992af54719abbc2df5729a787.mid_d2fe5698-e36c-4c2d-8f47-12fb63ba934e.mid │ ├── eda08b8a031cf61c69bd705ccf8cc20c.mid_751f20a2-e4ac-486a-8eeb-e055fe7d59dd.mid │ ├── eda81567a81db716d45a4c62eb45e399.mid_77832351-e540-4c77-9b11-072392718fcd.mid │ ├── effa6f7ef21c66e3959283a2e359c39d.mid_b21622d3-03ec-46ad-b3df-2043bb346212.mid │ ├── f1d47874b6da4b5eaa0dde4df09a4865.mid_3c466d75-9803-4e4f-8a4f-aa80d925bde4.mid │ ├── f1f3f49f1df547ad52aef6ff98683e36.mid_38fe73c2-782c-4a89-a9a9-3c89b51f5a62.mid │ ├── f2ef4e8bc1e5addb2959f81c582110eb.mid_44f0f87e-0c99-4f58-b356-e0d70bbd5d5c.mid │ ├── f5bb09e644905465a0effcbd95f1272f.mid_fb8f0eaa-881a-4f49-ad72-21a5cdd57834.mid │ ├── f6a98e69f145799030b5c186631990cb.mid_d70b3bcc-7a5f-4b3d-b401-5b22248c4c23.mid │ ├── f84a84f20104c111108f96d5a8104576.mid_38d8a2cc-57d5-41a9-b664-857b8fa0c734.mid │ ├── fa3638f113119b5ddc8bcff32ba29e36.mid_74c597d2-763d-4453-bb26-d1614838e307.mid │ ├── fb6e6920f6219098a76a14f19a7cd2de.mid_97230078-a07d-470b-994d-f1b03e6d3700.mid │ ├── fc5ca5ef1174efdf9f115716d93d86bc.mid_0a6abef2-6bc7-422d-bbb0-b1fde516f91f.mid │ ├── fdf5f92b60ad734d4e83170bbd863829.mid_66593596-311f-4ed8-9d29-e97da5006a48.mid │ ├── fe8ce9798137d9f41d55958eaeb7ea5f.mid_6dee4239-2ff3-4a6e-8d0e-1f7a05a589df.mid │ └── ff2cb4d08a1fd485edd3b77b77384c3c.mid_1a54d679-2681-4f82-9892-53e3431ee07b.mid ├── experiments/ │ └── .gitkeep ├── requirements.txt ├── sample.py ├── train.py └── utils.py
SYMBOL INDEX (19 symbols across 3 files) FILE: sample.py function parse_args (line 7) | def parse_args(): function get_experiment_dir (line 36) | def get_experiment_dir(experiment_dir): function main (line 52) | def main(): FILE: train.py function parse_args (line 12) | def parse_args(): function get_model (line 60) | def get_model(args, experiment_dir=None): function get_callbacks (line 127) | def get_callbacks(experiment_dir, checkpoint_monitor='val_acc'): function main (line 158) | def main(): FILE: utils.py function log (line 7) | def log(message, verbose): function parse_midi (line 11) | def parse_midi(path): function get_percent_monophonic (line 20) | def get_percent_monophonic(pm_instrument_roll): function filter_monophonic (line 32) | def filter_monophonic(pm_instruments, percent_monophonic=0.99): function create_experiment_dir (line 38) | def create_experiment_dir(experiment_dir, verbose=False): function get_data_generator (line 77) | def get_data_generator(midi_paths, function save_model (line 118) | def save_model(model, model_dir): function load_model_from_checkpoint (line 122) | def load_model_from_checkpoint(model_dir): function generate (line 139) | def generate(model, seeds, window_size, length, num_to_gen, instrument_n... function _network_output_to_midi (line 174) | def _network_output_to_midi(windows, function _windows_from_monophonic_instruments (line 218) | def _windows_from_monophonic_instruments(midi, window_size): function _encode_sliding_windows (line 236) | def _encode_sliding_windows(pm_instrument, window_size):
Condensed preview — 192 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (76K chars).
[
{
"path": ".gitignore",
"chars": 47,
"preview": "venv\nexperiments/*\n!experiments/.gitkeep\n*.pyc\n"
},
{
"path": "GPL.txt",
"chars": 35141,
"preview": " GNU GENERAL PUBLIC LICENSE\n Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
},
{
"path": "LICENSE",
"chars": 686,
"preview": "Copyright (C) 2017 Brannon Dorsey\n 2017 Branger_Briz, Inc.\n\nThis program is free software: you can redist"
},
{
"path": "README.md",
"chars": 12578,
"preview": "# MIDI RNN\n\nGenerate monophonic melodies using a basic LSTM RNN. Great for machine learning MIDI generation baselines. F"
},
{
"path": "experiments/.gitkeep",
"chars": 0,
"preview": ""
},
{
"path": "requirements.txt",
"chars": 244,
"preview": "appdirs==1.4.3\nfuncsigs==1.0.2\nh5py==2.7.0\nKeras==2.0.3\nmido==1.2.4\nmock==2.0.0\nnumpy==1.12.1\npackaging==16.8\npbr==2.1.0"
},
{
"path": "sample.py",
"chars": 5510,
"preview": "#!/usr/bin/env python\nimport argparse, os, pdb\nimport pretty_midi\nimport train\nimport utils\n\ndef parse_args():\n parse"
},
{
"path": "train.py",
"chars": 10546,
"preview": "#!/usr/bin/env python\nimport os, argparse, time\nimport utils\nfrom keras.models import Sequential\nfrom keras.layers impor"
},
{
"path": "utils.py",
"chars": 9379,
"preview": "import os, glob, random\nimport pretty_midi\nimport numpy as np\nfrom keras.models import model_from_json\nfrom multiprocess"
}
]
// ... and 183 more files (download for full content)
About this extraction
This page contains the full source code of the brannondorsey/midi-rnn GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 192 files (72.4 KB), approximately 25.6k tokens, and a symbol index with 19 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.