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

Henning Meier-Geinitz henning@meier-geinitz.de
Mon, 31 Mar 2003 17:56:23 +0200


Hi,

On Sun, Mar 30, 2003 at 10:14:07PM +0200, Martin Langer wrote:
> 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. 
> 
> I'm more involved into the ALSA side of this problem and absolutely new to
> sane development. So my question:
> 
> 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?

Backend. Theoretically, a backend could define a SANE option to stop
the movement but I don't know any backend that does that.

You must chose a scanner that does the motor movement in the driver. A
lot of scanners do the low level stuff in the firmware of the scanner
so you can't influence the motor movement at all.

The scanners that are based on the gt68xx chips are able to scan
without motor movement. You must modify the gt68xx backend to do
that. See http://www.meier-geinitz.de/sane/gt68xx-backend/ for
scanners supported by that backend.

I'm sure there are other scanners that can also do that.

> Is there any developer information available?

Depends on what you want. For some scanners there is hardware
documentation. Docs about SANE are in the doc/ directory of
sane-backends source code, especially the SANE standard.

> I've just had a look to
> some command line frontends, but they don't touch this point (ok,
> it's possible that I'm blind!). But my impression was: they only
> handle complete scans, which I don't want to use. Or is there a
> general problem in the control of scanning devices, if I have this
> goal ..... because they were not build for this use.

For normal scan operation, it just doesn't make sense so the backends
don't provide this option. It's not related to the frontend. All
frontends (theoretically) provide the same set of options, because the
options are provided by the backend.

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

Yes, by setting options.

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

It's possible, but you must do some hacking on the code.

Bye,
  Henning