Skip to content
forked from samim23/polymath

Convert any music library into a music production sample-library with ML

License

Notifications You must be signed in to change notification settings

hmbemba/polymath

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Polymath

This is a fork of the original Polymath project with several aims.

  1. Clean up and organizing the original codebase to make it easier to read

  2. Utilize a human readable database

  3. Create a more intuitive cli

How it works

This fork utilizies tinydb to create a Json database and fire to create the cli

Folder structure

/polymath
	cli.py 
	/internals
	/content          
		/db
			db.json
			/FrequencyFrames
		/ytdl_content
		/processed
		/stems 

content

  • 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

db

  • 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

ytdl_content

  • This directory contains all the downloaded audio files from youtube-dl

processed

  • 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.

stems

  • This directory contains the separated stems generated the processed audio filess

cli.py

  • This is the main script to run the command line interface (CLI).

The database

  • 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"
      }
    }

Install

git clone https://github.com/hmbemba/polymath.git

cd polymath

pip install -r requirements.txt

Usage

  • These are the current core features with more to come

Add Song

  • Add a local song to the database
python cli.py addSong "path/to/song.mp3" 

splitstems

  • The "-ss" boolean flag will split the stems right after
python cli.py addSong "path/too/song.mp3"  -ss

Add Video

  • 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"

Split Song

python cli.py split "path/to/song.mp3" "output/dir" 

Credits

About

Convert any music library into a music production sample-library with ML

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.6%
  • Dockerfile 0.4%