Server for WebSocket MIDI example
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
static
templates
.gitignore
Procfile
README.org
main.py
requirements.txt

README.org

-*- mode: org; mode: visual-line; -*-

websocket-midi-server

MIDI note echoing between browsers using WebSockets. Server written in Python

Server

Flask server. Python 2 is fine (and Python 3 virtual environments are broken in macOS.) Create and activate a virtual environment:

virtualenv ~/Desktop/venv2
. ~/Desktop/venv2/bin/activate

Install packages:

pip install flask
pip install flask-socketio
pip install flask-cors

(flask-cors to temporarily enable cross-scripting - see here.)

See main.py for running instructions (either locally, or deployed).

Client ClojureScript/Javascript code gets planted from the websocket-midi-cljs project (see its deploy.sh). In development, the code here will attempt to connect to ws://localhost:3449.

Heroku

  • instructions. Boilerplate for deploying the “getting started” Python app:
    heroku login
    git clone https://github.com/heroku/python-getting-started.git
    cd python-getting-started
    heroku create
    git push heroku master
        
  • Looking through the Gunicorn guide. Need to add Gunicorn to deps, and Eventlet:
    pip install gunicorn
    pip install eventlet
        
  • Dump out to requirements.txt:
    pip freeze > requirements.txt