├── LICENSE
├── README.md
├── drumsep
└── drumsepInstall
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2024 Iñaki Goyeneche
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # drumsep
2 | Drum separation based on a [Hybrid Demucs](https://github.com/facebookresearch/demucs) model.
3 | Code to facilitate access to the model presented in the thesis "Separación de fuentes en grabaciones de batería mediante aprendizaje automático" (2022).
4 |
5 |
6 |
7 |
8 |
9 | The model takes as input an audio file (mp3, wav, flac, or ogg) corresponding to a drum recording and exports 4 audio files classified as:
10 | * Bombo (Kick)
11 | * Redoblante (Snare)
12 | * Platillos (Cymbals)
13 | * Toms
14 |
15 |
16 | ### With Google Colab
17 | To easily use the model online:
18 | [drumsep Notebook](https://colab.research.google.com/drive/14uxUczAYP9EUZLZmA_uWv5I_mDU7iqJS?usp=sharing)
19 |
20 | ### With Linux
21 | Having pip installed.
22 | 1. Clone repo.
23 | 2. Install.
24 | ```bash
25 | bash drumsepInstall
26 | ```
27 | 3. Separate
28 | Path to the audio file or directory containing audio files to be separated.
29 | Path to the directory where the generated audio files will be exported.
30 | ```bash
31 | bash drumsep "" ""
32 | ```
33 |
34 | (Efforts are currently underway to advance research and document progress for this project, with the ultimate objective of sharing valuable insights with the wider community).
35 |
--------------------------------------------------------------------------------
/drumsep:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | if [ $# -ne 2 ]; then
3 | exit 1
4 | fi
5 | input=${1}
6 | output=${2}
7 | shopt -s nullglob
8 | if [ -d "$1" ]; then
9 | for file in $input/*.{mp3,wav,ogg,flac}; do
10 | demucs --repo "model" -o "$output" -n 49469ca8 "$file"
11 | done
12 | else
13 | demucs --repo "model" -o "$output" -n 49469ca8 "$input"
14 | fi
15 | exit 0
16 |
--------------------------------------------------------------------------------
/drumsepInstall:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | if [ $# -ne 0 ]; then
3 | exit 1
4 | fi
5 | if [ "$(pip list | grep -F demucs)" == "" ]; then
6 | pip install demucs
7 | fi
8 | if [ ! -d "model" ] && [ $? -eq 0 ]; then
9 | mkdir "model"
10 | cd "model"
11 | if [ "$(pip list | grep -F gdown)" == "" ]; then
12 | pip install gdown
13 | fi
14 | gdown 1-Dm666ScPkg8Gt2-lK3Ua0xOudWHZBGC
15 | cd ../
16 | fi
17 | exit 0
18 |
--------------------------------------------------------------------------------