LUNCZ: PLAYING DATA
Final Project by Dror Ayalon
Course: Software Synthesis @ NYU
Lecturer: Jean-Luc Cohen
December 22nd, 2016
OVERVIEW: MUSIC AS A TOOL
Luncz allows musicians to record a 10 second snippet of live music played on an acoustic or an amplified instrument, and analyzes the recording to extract the notes, the tempo, and the intensity level of the music. Using this data, Luncz generates new music to accompany the musician.
The music being played by Luncz was not designed for listening. Instead, using the right tempo and harmonics, Luncz helps the musician to stay within the musical context of the original idea, and leaves enough room for this idea to be developed.
HOW TO PLAY: INSTRUCTIONS
Luncz is being run by two Python scripts:
input.py' - Responsible for recoding live music using PyAudio, analyzing the recording using librosa, and dumping a WAV file with the recorded audio, a TXT file with the estimated tempo of the recording, and a CSV file with the beats onset data.
output.py' - Responsible for initiating Csound (‘Luncz.csd’), collecting the files, reading the data, and sending score events to the Csound engine using Csound’s the Python API and ctcsound, a Python wrapper for the C Csound API.
The following steps should be taken in order to experience Luncz:
If you don’t have Homebrew installed, please open terminal and run:
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
If you don’t have portaudio installed, please run the following command on your terminal:
$ brew install portaudio
While on the project main directory, using virtualenv, create a virtual environment for the project:
$ virtualenv env
While on the project main directory, activate your virtual environment by running :
$ source env/bin/activate
While on the project main directory, install Python dependencies - Using virtualenv, install the dependencies specified in ‘requirements.txt’. Run:
$ pip install -r requirements.txt
Add ‘ctcsound’ to you site packages:
csoundSession.pyfiles from the
- Paste the files on
While on the project main directory, run
output.pyto start the background music:
$ python output.py
Open a new terminal window, and go to the project main folder. While on the project main directory, run
input.pyto record analog audio signal:
$ python input.py
Hear the background music changes based on the analysis of the recorded audio.
Repeat step 3 as many times as you like.
In case where you’re getting the following error:
RuntimeError: Python is not installed as a framework. The Mac OS X backend will not be able to function correctly if Python is not installed as a framework. See the Python documentation for more information on installing Python as a framework on Mac OS X. Please either reinstall Python as a framework, or try one of the other backends. If you are Working with Matplotlib in a virtual enviroment see 'Working with Matplotlib in Virtual environments' in the Matplotlib FAQ.
Do the following actions:
In you terminal, type:
$ nano matplotlibrc
Add the following line to the matplotlibrc file:
$ backend: TkAgg