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

2003-03-31 Thread Henning Meier-Geinitz
Hi,

On Sun, Mar 30, 2003 at 11:52:33PM +0200, Martin Langer wrote:
> Then it would be depend on a specific scanner and a general solution would
> be much nicer.

It does depend on the scanner. There is nothing we can do about that.

> Ok, I will look to the backend part of my umax, but such things
> should be IMHO part of a middleware level.

Motor movement is absulute low low level for me :-)

> There is no middleware level in the sane architecture - Is that
> right?

There are no real "levels" for SANE at all. Basically the backends do
all the hardware stuff and encapsulate the scanner properties in
options. These are the drivers. The frontends "just" present the options
to the user and handle the scan data.

You could talk about meta backends as "middle level". They are both
frontends and backends. Examples are the dll meta-backen which loads
other backends dynamically or the net/saned combination which allows
scanning over the net. You could do other stuff like image filters
throught meta backends. But it doesn't make sense to use them for
hardware-dependent stuff.

> Yes. There are 1000 ideas to generate some notes, but there are not 1000 
> developers to do it and the companies want to sell more hardware instead of
> using existing hardware for strange things. But linux offers this general
> concepts of ALSA+SANE for a wide range of scanners and soundcards. And I
> like the idea to use it for more than normal things :-) 

Once you get ALSA to scan images we'll talk about implementing music
in SANE. Don't say it's impossible, you could add a CCD element to the
mic input and motors to the left and right speaker outputs ... :-)

Bye,
  Henning


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

2003-03-31 Thread Henning Meier-Geinitz
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


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

2003-03-31 Thread John Coppens
Hi Martin

Just an idea: Scanners are quite slow, and would provide little
interactivity. Wouldn't it be more usefull to use a web-cam (or better)
for this? Maybe a cheap webcam might not provide enough resolution (320
pix horizontally or so) but a medium quality camera can give 640, op to
1600 or more pixels/line - at 6 octaves, that's 100 pixels/octave or more!

If you want the 'touch effect' of the glass, use a glass pane, with
backlighting and the camera on the other side.

This way you can have up to 50 (60) images/second and a much faster
reaction speed for your musical instrument. 

Just a thought...

John

On Sun, 30 Mar 2003 22:14:07 +0200
Martin Langer  wrote:

> 
> Hi,
> 
> I've just had an idea about a crazy scanner frontend:
> 
> 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? Is there
> any developer information available? 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.
> 
> Is there a counterpart to "sane_get_parameters()" for setting those
> parameters, like lines and pixels? 
> 
> Anybody out there, who can give me some hints or who can say: "Forget
> It!"
> 
> 
> thanks,
> martin
> 
> 
> 
> ___
> Sane-devel mailing list
> sane-de...@www.mostang.com
> http://www.mostang.com/mailman/listinfo/sane-devel


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

2003-03-30 Thread Martin Langer
On Sun, Mar 30, 2003 at 09:56:53PM +0100, Major A 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. 
> 
> 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!
> 

I'm not really sure, about my final goals. On one hand I can have a three
dimensional keyboard (RGB) and on the other hand I don't know how to use
it. But we will see. My first idea was playing an invisible keyboard with my
finger tips on the scanner surface, but there are more possibilities, that's
right and I don't see them all.

> > 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.

Then it would be depend on a specific scanner and a general solution would
be much nicer. Ok, I will look to the backend part of my umax, but such things
should be IMHO part of a middleware level. There is no middleware level in
the sane architecture - Is that right?

> 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.

Yes. There are 1000 ideas to generate some notes, but there are not 1000 
developers to do it and the companies want to sell more hardware instead of
using existing hardware for strange things. But linux offers this general
concepts of ALSA+SANE for a wide range of scanners and soundcards. And I
like the idea to use it for more than normal things :-) 

but up to now it's not much more than an idea!

martin


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

2003-03-30 Thread Martin Langer
Hi,

I've just had an idea about a crazy scanner frontend:

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? Is there any
developer information available? 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.

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

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


thanks,
martin





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

2003-03-30 Thread Major A
> 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: and...@users.sourceforge.net
www:http://andras.webhop.org/
===