[sane-devel] What about creating music with scanning devices?

Major A andras@users.sourceforge.net
Sun, 30 Mar 2003 21:56:53 +0100


> The basic idea is to use a scanner as music instrument and translate a scan
> line into music notes (x-scale for differnt notes and intensity for the
> volume). Therefore it would be nice to have a constant y value (I don't see an
> interesting use for y!). So it would be great to read out that one y-line 
> and produce MIDI notes until Ctrl-C is pressed. 

Just to make sure I'm getting the right ideas: you want a scanner to
scan a single line over and over quickly so that you can synthesize
music by moving objects above the scanner's glass surface? Sounds very
interesting indeed!

> Is it possible to solve this (read out one line without y movement) in a 
> frontend application? Or do I have to patch the backend part? Is there any

It has little to do with the frontend. Scanners are designed to scan
whole 2D documents, so making just a frontend will not be
enough. You'll probably have to find a scanner that can do this in
hardware (not easy, I suppose), then probably modify its backend.

> Is there a counterpart to "sane_get_parameters()" for setting those
> parameters, like lines and pixels? 

The name of sane_get_parameters() can be misleading. It is supposed to
return secondary values, i.e. values calculated from the scan options,
such as the total number of bytes. Options are set using
sane_control_option(), that's what you're looking for, I suppose.

> Anybody out there, who can give me some hints or who can say: "Forget It!"

Given that (most?) scanners weren't designed for real-time scanning,
I'd suggest you look at video cameras instead. It should be fairly
easy to do what you want by using a digital video camera, dissect the
DV stream so as to take one line only, then use that to generate your
music.

  Andras

===========================================================================
Major Andras
    e-mail: andras@users.sourceforge.net
    www:    http://andras.webhop.org/
===========================================================================