https://github.com/bdshrk/neuraldrummer
A neural network for generating drum tracks for songs using Python and TensorFlow.
https://github.com/bdshrk/neuraldrummer
computational-creativity creativity deep-learning drum-machine drumkit drums machine-learning neural-network python tensorflow
Last synced: 7 months ago
JSON representation
A neural network for generating drum tracks for songs using Python and TensorFlow.
- Host: GitHub
- URL: https://github.com/bdshrk/neuraldrummer
- Owner: bdshrk
- License: mit
- Created: 2023-05-09T22:35:30.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-06T19:26:55.000Z (over 1 year ago)
- Last Synced: 2025-01-22T12:45:55.431Z (9 months ago)
- Topics: computational-creativity, creativity, deep-learning, drum-machine, drumkit, drums, machine-learning, neural-network, python, tensorflow
- Language: Python
- Homepage:
- Size: 9.77 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NeuralDrummer
**A neural network for generating drum tracks for songs.**
Practical project for the COMP6590: Computational Creativity module.
## Usage
The code can be run from the Jupyter notebook file `main.ipynb`.
You will need `TensorFlow` installed in your Python environment and
also `PrettyMIDI`, `Mido`, `numpy`, and `matplotlib`.
Please use `requirements.txt` or the following command:```
pip install pretty_midi mido numpy tensorflow matplotlib
```Each cell in the notebook should be executed consecutively with the
exception of the `nn.train()` and `nn.plot()` cells (which are for training
the network if you wish.) The model saves its weights to the
`/saved/` directory and can be loaded in the cell `nn.load()`.Feel free to modify the `INPUT_PATH` in the final cell to point to a MIDI
file of your choosing. You can also modify the cut-off parameter of the
`tokeniser.add_drum_track()` within the same cell to adjust the sensitivity
of the result. You should find the output as a file named `combined.mid`.In order for the model to learn, you will require a collection of MIDI files
containing drum tracks.
During development, I used the *"Lakh MIDI Dataset Clean"*, available
[here](https://colinraffel.com/projects/lmd/). Once the MIDI files have been
pre-processed, the original files are no longer needed. The result of the
pre-processing is stored in a file named `saved.txt`.Note: You will need a fair amount of memory to load the neural network and
the inputs from the saved file.