Skip to content

CUBigDataClass/Mamba-Music

Repository files navigation

Mamba Music

AI Generated Music Radio.

Mamba Music is a machine learning platform for music generation, powered by Tensorflow's state of the art Magenta models. Additionally, Mamba Art is generated by a Tensorflow Fast Neural Style Transfer model.

Our Platform:

Here's how Mamba Music looks. You can sign in with your Google account and select songs from 7 different artists (each artist is a different model). These songs can be downloaded, and you can thumbs-up/down a song, so our system will intelligently recommend you ones similar/dissimilar to previously rated songs!

alt text

Members:

Navigation

Frontend:

cd mamba-frontend
npm install
npm start

Backend

cd mamba-api

ML Models

Python3.6 or above is required. Eventually, these models will be moved into a separate repository as a high level api for some of Tensorflow's Magenta models.

sudo apt-get update
sudo apt-get -y install build-essential libbz2-dev libasound2-dev libjack-dev libav-tools \
  sox
  
cd mamba-magenta/mamba-magenta
sudo apt-get install fluidsynth
pip3 -r install requirements.txt
# to explicitly get tensorflow gpu:
pip3 uninstall tensorflow
pip3 install tensorflow-gpu==1.15.0

# usage

To get the Spotify API up and running, first create an app in Spotify. Make sure to specify the Spotify client ID and the Spotify client secret.

echo 'export SPOTIFY_CLIENT_ID="<id>"' >> ~/.bashrc
echo 'export SPOTIFY_CLIENT_SECRET="<id>"' >> ~/.bashrc
sudo apt install jackd jack qjackctl openjdk-8-jdk

# gcloud python api.
pip3 install --upgrade google-cloud-storage

# get the gcloud cli
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list

sudo apt-get install apt-transport-https ca-certificates gnupg

curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -

sudo apt-get update && sudo apt-get install google-cloud-sdk

# to get started
gcloud init

Fluidsynth configurations:

mkdir ~/.fluidsynth

cp /usr/share/sounds/sf2/FluidR3_GM.sf2 ~/.fluidsynth/default_sound_font.sf2

If you want to use our awesome Salamander piano soundfount, go here. Download the sounfdount, and place it in ~/.fluidsynth/.

python3 mamba_magenta_api.py -a <artists> -g <genre> -t <temperature> -l <length> -n <numgenerations>

NEW: Neural Transfer

cd mamba-magenta/mamba-magenta/neural_style
./generate_art.sh

This command will generate pictures and put them in mamba-magenta/mamba-magenta/neural_style/generated. Make sure to have pictures in mamba-magenta/mamba-magenta/neural_style/generated and mamba-magenta/mamba-magenta/neural_style/content.