{"id":13812010,"url":"https://github.com/MattVitelli/GRUV","last_synced_at":"2025-05-14T20:31:26.958Z","repository":{"id":35479816,"uuid":"39748713","full_name":"MattVitelli/GRUV","owner":"MattVitelli","description":"GRUV is a Python project for algorithmic music generation. ","archived":false,"fork":false,"pushed_at":"2020-11-28T18:30:27.000Z","size":3022,"stargazers_count":798,"open_issues_count":28,"forks_count":165,"subscribers_count":46,"default_branch":"master","last_synced_at":"2024-11-19T06:53:31.963Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MattVitelli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-27T01:16:52.000Z","updated_at":"2024-11-12T15:40:22.000Z","dependencies_parsed_at":"2022-07-29T18:39:39.190Z","dependency_job_id":null,"html_url":"https://github.com/MattVitelli/GRUV","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MattVitelli%2FGRUV","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MattVitelli%2FGRUV/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MattVitelli%2FGRUV/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MattVitelli%2FGRUV/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MattVitelli","download_url":"https://codeload.github.com/MattVitelli/GRUV/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254222181,"owners_count":22034836,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T04:00:44.821Z","updated_at":"2025-05-14T20:31:26.521Z","avatar_url":"https://github.com/MattVitelli.png","language":"Python","funding_links":[],"categories":["GitHub projects","Deep Learning","Music"],"sub_categories":["Programming"],"readme":"# GRUV\nGRUV is a Python project for algorithmic music generation using recurrent neural networks.\n\nNote: This code works with Keras v. 0.1.0, later versions of Keras may not work.\n\nFor a demonstration of our project on raw audio waveforms (as opposed to the standard MIDI), see here: https://www.youtube.com/watch?v=0VTI1BBLydE\n\nCopyright (C) 2015 Matt Vitelli matthew.vitelli@gmail.com and Aran Nayebi aran.nayebi@gmail.com\n\n# Dependencies\nIn order to use GRUV, you will first need to install the following dependencies:\n\nTheano: http://deeplearning.net/software/theano/#download\n\nKeras: https://github.com/fchollet/keras.git\n\nNumPy: http://www.numpy.org/\n\nSciPy: http://www.scipy.org/\n\nLAME (for MP3 source files): http://lame.sourceforge.net/ \n\nSoX (for FLAC source files): http://sox.sourceforge.net/\n\nh5py (for serializing the model): http://www.h5py.org/\n\nOnce that's taken care of, you can try training a model of your own as follows:\n# Step 1. Prepare the data\nCopy your music into ./datasets/YourMusicLibrary/ and type the following command into Terminal:\n\u003e    python convert_directory.py\n\nThis will convert all mp3s in ./datasets/YourMusicLibrary/ into WAVs and convert the WAVs into a useful representation for the deep learning algorithms.\n\n# Step 2. Train your model\nAt this point, you should have four files named YourMusicLibraryNP_x.npy, YourMusicLibraryNP_y.npy, YourMusicLibraryNP_var.npy, and YourMusicLibraryNP_mean.npy.\n\nYourMusicLibraryNP_x contains the input sequences for training\nYourMusicLibraryNP_y contains the output sequences for training\nYourMusicLibraryNP_mean contains the mean for each feature computed from the training set\nYourMusicLibraryNP_var contains the variance for each feature computed from the training set\n\nYou can train your very first model by typing the following command into Terminal:\n\u003e    python train.py\n\nTraining will take a while depending on the length and number of songs used\nIf you get an error of the following form:\nError allocating X bytes of device memory (out of memory). Driver report Y bytes free and Z bytes total\nyou must adjust the parameters in train.py - specifically, decrease the batch_size to something smaller. If you still have out of memory errors, you can also decrease the hidden_dims parameter in train.py and generate.py, although this will have a significant impact on the quality of the generated music.\n\n# Step 3. Generation\nAfter you've finished training your model, it's time to generate some music!\nType the following command into Terminal:\n\u003e    python generate.py\n\nAfter some amount of time, you should have a file called generated_song.wav\n\nFuture work:\nImprove generation algorithms. Our current generation scheme uses the training / testing data as a seed sequence, which tends to produce verbatum copies of the original songs. One might imagine that we could improve these results by taking linear combinations of the hidden states for different songs and projecting the combinations back into the frequency space and using those as seed sequences. You can find the core components of the generation algorithms in gen_utils/seed_generator.py and gen_utils/sequence_generator.py\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMattVitelli%2FGRUV","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMattVitelli%2FGRUV","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMattVitelli%2FGRUV/lists"}