Monday, April 30, 2012

Sonification project - sounds of sand

Sand spectrum - I want to listen to the sound of the shapes of sand grains. This seems a weird idea but it is a standard geological technique. The outline of a sand grain is first extracted by image processing:
And then the roughness of the grain outline is translated into a series of harmonics by Fourier analysis. This is a more formal description of sphericity, roundness or roughness:
Different grains with different provenance have different spectra:

The technique is described in these research papers:
  • On the shapes of natural sand grains - David R. Barclay and Michael J. Buckingham - Published 21 February 2009 - JOURNAL OF GEOPHYSICAL RESEARCH, VOL. 114 - Link
  • Particle Shape Characterisation using Fourier Analysis - Elisabeth T. Bowman, Kenichi Saga & Tom W. Drummond - CUED/D-SoWTR315 (2000) - Link
Software tools discarded - I've spent a lot of time searching for tools. I need tools for image processing and sound synthesis. These don't often go together. I've discarded the following options:
  • Matlab - Has image and sound and mathematics. But is prohibitively expensive and probably a steep learning curve.
  • Scilab and SIP (Scilab Image Processing Toolbox) - Free and functionality looks sufficient. But I'm worried about stability, reliability and the steep learning curve.
  • Processing - Not many examples of image processing, I'm not sure it's powerful enough.
  • Supercollider and PureData - I'm afraid of the learning curve.
Software tools chosen - Finally I've settled on tools written in Python. I already know the language, it is portable to both Windows and Linux and it has both image processing and sound synthesis tools. These are the tools I'm going forward with:
  • Python Vision - This seems a workable set of image processing tools. I'll just try it for a first start. It consists of a set of image processing tools, described here.
  • Python XY - Most of the tool set can be installed in Windows 7 in one go from here. You have to deinstall all other Python software first.
  • Two additional modules:
  • Pymorph - Downloadable from here. Install by: python install. No problems here.
  • Mahotas - Downloadable from here. This one is more tricky to get working. You get a well known error that is described here. But the solution is different from what is written here. You don't need to install MinGW and you don't need to set the path. I think Python-XY has done that already. You just need to install the module with a different command: python install build --compiler=mingw32. This worked for me after some googling and experimentation.
I've not yet chosen which tools I'll use for sonification of the images. But there seem to be sufficient tools available. At first sight this looks sufficient:
  • Nsound - Seems sufficient. I'm still a bit dubious about the 'buffer' format. Can I write random data into a buffer or am I limited by the functions in the nsound library? The usage of the library looks a bit weird to me.
We'll see if these choices work. I think it would be difficult to find a better match between learning curve and functional power. But I'm open for advice!


  1. You've got lots of options for sonification. Plenty of people use Max, but you might want something more direct.

    You're also likely already aware of various efforts to sonify events captured by the Large Hadron Collider. One recent example used Max:

    But Lily Asquith, one of the original LHC Sounds people, posted a lot about sonification using other tools:

    She was interviewed in 2010-2011 by British and US press about these exploits, but some of the websites devoted to it now seem a bit neglected.

    I'm just an occasional visitor but always enjoy your posts, point of view.

    1. Your site also looks very interesting, I'll have to browse around a bit:

      Thanks for the links, these are new to me. I did not know about MAX, it sound interesting.
      I have already found much new interesting stuff, I'll write about it in the next blog post.

    2. I'm afraid you'll plumb wikigong's depths in an instant, at least until a bit more time passes and more forays can be made. It's very art time activity compared to the triggering obsession. Feel free to reuse anything you find interesting there.

      An old pal studied with Miller Puckette at UCSD while wending down the computer music/composition road and was an early Max proselyte, which is how I came to know about it. My stuff tends to start and end audio, and doesn't quite jump out of the original reference plane like opto-audio (or particle/spatial/elecro-magnetic to audio).

      I see you're running at warp speed as usual, am looking forward to the next branch point(s).