Composer is a music generation application hosted on an iOS mobile device. The purpose of the app is to generate music from a provided input and generate harmonization for a given melody.
The aim of the project is to take the input of any music source and create something completely new. For example, Composer could sample an eight-second Musical Instrument Digital Interface (MIDI) file clip and come up with the rest, forming a new song right away. This new song would consist of harmonies that accompany the music piece as well.
User should already have an account on AWS console, and have already created an AWS EC2 instance with the Deep Learning AMI (which has the necessary PyTorch libraries etc).
app.py, credentials.py should be in the same directory as the other python training scripts (e.g. lstm_train.py)
Dependencies required: gunicorn3, Flask
-
Start the EC2 instance from AWS console.
-
SSH into EC2 instance through Ubuntu (for example). More details can be found on the AWS website.
-
Update nginx configuration by first entering
cd /etc/nginx/sites-enabled
then copy theflaskapp
file to the current working directory. Update server_name variable to the public IPv4 DNS of the EC2 instance (can be found on AWS console). Entersudo service nginx restart
in the shell after updating server_name variable. -
cd to application folder (where app.py is located)
-
Activate pytorch_p36 environment on the remote server by running
source activate pytorch_p36
-
Update app.py and credentials.py with personal AWS services information.
-
Run the application with
sudo gunicorn3 app:app
. Can execute with set timeout option using-t 120
if necessary.