This is a fork of the original Polymath project with several aims.
-
Clean up and organizing the original codebase to make it easier to read
-
Utilize a human readable database
-
Create a more intuitive cli
This fork utilizies tinydb to create a Json database and fire to create the cli
/polymath
cli.py
/internals
/content
/db
db.json
/FrequencyFrames
/ytdl_content
/processed
/stems
-
The content dir and subdirectories are autogenerated if they do not already exist
-
You should see this message the first time you run any command
Created folder at:
C:\Users\...\polymath\content
Created folder at:
C:\Users\...\polymath\content\processed
Created folder at:
C:\Users\...\polymath\content\stems
Created folder at:
C:\Users\...\polymath\content\db
Created folder at:
C:\Users\...\polymath\content\db\frequencyFrames
Created folder at:
C:\Users\...\polymath\content\ytdl_content
-
The db directory contains a db.json file which is used as the main database for this project.
-
The frequencyFrames directory within the db directory contains frequency frames for each audio file added to the database as a text file
- This directory contains all the downloaded audio files from youtube-dl
-
Before a song is added to the database it is cleaned and processed by converting it to a WAV and resampling it a samplerate of 44100 if it is not already
-
This directory contains the processed audio files.
- This directory contains the separated stems generated the processed audio filess
- This is the main script to run the command line interface (CLI).
- When a song is added to the database it will populate a record that looks like this :
"1": {
"id": "song_name_ID",
"songName": "song_name",
"pathToFile": "C:\\Users\\...\\polymath\\content\\processed\\song_name_ID.wav",
"features": {
"id": "song_name_ID",
"tempo": "129.19921875",
"duration": "180.03591836734694",
"timbre": "-10.74387",
"timbre_frames": "[[...]]",
"pitch": "0.32957405",
"pitch_frames": "[[...]]",
"intensity": "-52.960995579585294",
"intensity_frames": "[[...]]",
"volume": "[...]",
"avg_volume": "0.19482724",
"loudness": "0.24210354685783386",
"beats": "[ ...]",
"segments_boundaries": "[...]",
"segments_labels": "[...]",
"frequency": "230.88860214871994",
"key": "A#3",
"frequencyFramesPath": "C:\\Users\\...\\polymath\\content\\db\\frequencyFrames\\song_name_ID_FrequencyFrames.txt"
}
}
git clone https://github.com/hmbemba/polymath.git
cd polymath
pip install -r requirements.txt
- These are the current core features with more to come
- Add a local song to the database
python cli.py addSong "path/to/song.mp3"
- The "-ss" boolean flag will split the stems right after
python cli.py addSong "path/too/song.mp3" -ss
-
Download a single song from youtube and add it to the database
-
Note : This is meant for a single video only not a playlist
python cli.py addVideo "https://youtu.be/dQw4w9WgXcQ"
python cli.py split "path/to/song.mp3" "output/dir"
- This project is a fork of the original Polymath project.
- The original project was developed by samim, and can be found at https://github.com/samim23/polymath