Friday, 30 July 2010

SAMI

We decided to change tack a little bit. So heres our work output for the last week or so. Its a framework for Sonification of images. The idea being that we can now easily write little scripts to do specific tasks, without having to worry about how they interact with each other. We also have quite a few little scripts, that take images and generate different sorts of music etcetc.

In technical terms, all the scripts are written in python, with a special header, and the GUI reads these headers, so it knows what data to give them, and then runs them in an embedded interpreter. Its also clever enough to maintain lists of information about an image (or images), handle different error messages from the scripts, as well as editing and reloading them.

http://www.mediafire.com/file/o5c0aaepfifo1jh/scripts.tar.gz

http://www.mediafire.com/file/92aj2kaia8c88se/Sonify-Framework-30-07-10--16-21.tar.gz

To compile it you'll need:
- Qt4.6 from qt.nokia.com
- python 2.6.5 from http://www.python.org/download/releases/2.6.5/
- numpy and scipy from http://www.scipy.org/Download
- possibly matplotlib from http://matplotlib.sourceforge.net/

Just load the .pro file in qt creator, and it should compile just fine. If you want the scripts directory to be one other than where the executable is, you'll need to create an environment variable PYTHONPATH, whose value is the scripts directory. You may also need to change QMAKE_CXXFLAGS in .pro file, to the values given by running 'import distutils.sysconfig;
distutils.sysconfig.get_config_var('LINKFORSHARED')' in the python interpreter.

If you have installed python in a weird place, you'll need to update the library and include flags etc in the .pro file to the location of the libraries and headers for python.

[I'm working on automating both of the above]

Sunday, 18 July 2010

Snapshot (now with support for multiple scanpaths and a slightly better GUI)

http://www.mediafire.com/file/1w9ysj7u5nqm1s1/Sonify-Gui-18-07-10--17-41.tar.gz

http://www.mediafire.com/file/gdhald0a9d5a871/Sonify-Script-18-07-10--17-41.tar.gz

Friday, 16 July 2010

Some Music

An example of what our software will produce, here is a fairly long bit of piano generated from this image.

Music

A First Attempt

Here is our first attempt at an image sonification program. To run it you'll need Python along with the numpy, scipy and matplotlib libraries. You will also need Max M's midi library.

There is also a GUI (literally a front-end to our python script) which was written using qt. The easiest way to compile it is probably using the wonderful qt creator IDE.

The python script and GUI should run smoothly on windows mac and linux.

Gui: http://www.mediafire.com/?ptvg40smt119v91
Python Script: http://www.mediafire.com/?97kyodc5ep9qreo

How the script works:
- You give it a couple of points on the image, and a spline is used to interpolate between the points and give a nice smooth 'scanline'.
- The RGB value or grayscale value at each point on the 'scanline' is analysed, and representative Pitch, Volume and Length are generated.
- The pitches are squeezed onto whichever scale has the most pitches in common with those of the image, and the output is written to a midi file.