21M.385 | Fall 2016 | Undergraduate

Interactive Music Systems

Tools

Overview

21M.385 uses Kivy - an application / graphics framework for Python. We also use a few other packages: numpy, pyAudio (which uses PortAudio), FluidSynth, and rtmidi.

Follow the steps below to install everything you need for Mac or Windows.

Mac Installation Instructions

  • Install Homebrew if you don’t already have it.
  • You will also need Xcode and the Xcode command line tools. Get Xcode from the App store. Make sure to actually run Xcode once to accept the license agreement.
  • Get the OSX install package and unzip it.
  • Open a terminal window and cd to the OSX installation directory (for example, if the OSX package is in Downloads type cd downloads/osx).
  • The rest of the installation is handled by running:      
    $ ./install_osx.sh

Note this can take a while.

  • Test the installation by running:      
    $ python check_install.py

Windows Installation Instructions

  • Install the latest Python 2.7. I recommend using Miniconda. Select the 32-bit Python 2.7 for Windows. If you already have Python installed, please make sure that:
    • You have the latest Python - 2.7.12
    • It is Python2 (not Python3)
    • It is the 32bit version of Python (not 64bit)
  • Make sure that the correct version of Python is in your PATH and runnable from the command line. If you installed Python with Miniconda, you will automatically have the PATH set up for you by the installer.
  • Get the ASIO drivers. The default windows audio drivers are often bad - exhibiting a lot of latency.
  • GET MSVCR110. You’ll need the Microsoft MSVC redistrib library. Choose vcredist_x86.exe (the 32bit library) and run to install.
  • Get the win install package and unzip it.
  • From the cmd line, cd to the win directory you just unzipped and run:      
    $ .\install_win.bat

This might take a while.

  • Test the installation by running:      
    $ python check_install.py

Linux Installation Instructions*

Tested on Arch Linux with a Leap Motion controller. Commands use pacman; on other distributions, substitute your package manager accordingly.

Installation files (ZIP) (this ZIP file contains 1 .py file, 1 .sh file, 1 .sf2 file, and 1 .txt file)

Install uv, which manages an isolated project environment in place of Homebrew or Miniconda (on Arch, sudo pacman -S uv works too):

curl -LsSf https://astral.sh/uv/install.sh | sh

Create the project environment. The Python version is set here, at creation time:

uv init imc --python 3.11 

cd imc

Install the Python packages. Inside a uv project, uv add replaces pip install:

uv add kivy numpy pyaudio pyfluidsynth python-rtmidi python-osc

Make sure the system has a working audio setup with the development libraries the packages need; on most current distributions the default audio server is sufficient.

Copy check_install.py and the check directory from linux.zip into the imc directory. The Mac and Windows packages bundle three Python 2 components (OSC.py, fluidsynth.py, rtmidi_python); on Linux these are the maintained packages python-osc, pyfluidsynth, and python-rtmidi installed above. Course code importing rtmidi_python should import rtmidi instead.

Test the installation:

uv run python check_install.py

Leap Motion

Some assignments use a Leap Motion controller. The SDK 2.3.1 is on Arch as the AUR packages leap-motion-driver and leap-motion-sdk; the ksandom/installUltraleap repository packages the same SDK with a systemd service. Once installed, start it and run LeapControlPanel to confirm tracking:

sudo systemctl enable --now leapd

The SDK Python binding (Leap.py) is Python 2 only, so it cannot be imported into the Python 3 environment. The hardware and driver work; using Leap from Python 3 would need a rebuilt binding.

*Linux instructions contributed by Lydia Krifka-Dobes.

Course Info

Lecture Notes
Presentation Assignments
Problem Sets
Projects with Examples