From: Cortez
Subject: Displaying floating point data in ACL Common Graphics
Date: 
Message-ID: <c642250b-2aa2-46a1-a32a-ca4f500047f4@l64g2000hse.googlegroups.com>
Hello,

I am designing a graphical application in ACL for displaying spectral
analysis data (for a related post see
http://groups.google.com/group/comp.lang.lisp/browse_thread/thread/5d1ded8824bc750b/46a585e0fb7a439b?lnk=gst&q=sdif#46a585e0fb7a439b).
The data itself consists of (either) single- or double-floats, which,
since drawing in ACL is pixel-based, I am forced to round to integers.
I would like to find some way of avoiding this - I expect to have to
round my values to some extent, but using pure integers for display
compromises the integrity of the data too much.

I have been assuming some kind of upwards scaling would be effective.
The kind of numbers I am dealing with typically represent non-integer
frequency values, for example 453.687564Hz. If I want a y-axis value
which represents this number rounded to three decimal places then I
would simply do -

(round (*  453.687564 1000))
=> 453688

and pass this to the appropriate drawing functions. The value is also
displayed in the status bar of the window as the mouse moves over that
point, but divided by 1000 in order to yield 435.688. I am happy with
this degree of accuracy, but since I could be dealing with numbers
representing frequencies up to 20000Hz it means that I have to work
with a massive drawing canvas. I have experimented with ACL's scaling-
stream mixin, which I mix with my base window class and which allows
me to greatly increase the number of points per pixel. Even with that,
however, I still have memory issues (I am sub-classing my base class
from bitmap-window, which is admittedly memory-intensive since it uses
a backing store, but anything else gives me unsatisfactory redisplay).
Is there anything else I could try? I have also experimented with
McClim, which uses continuous coordinates, but would prefer to stay
with ACL if possible.

Many thanks,
Cortez

From: Kenny
Subject: Re: Displaying floating point data in ACL Common Graphics
Date: 
Message-ID: <489b5dbd$0$20941$607ed4bc@cv.net>
Cortez wrote:
> Hello,
> 
> I am designing a graphical application in ACL for displaying spectral
> analysis data (for a related post see
> http://groups.google.com/group/comp.lang.lisp/browse_thread/thread/5d1ded8824bc750b/46a585e0fb7a439b?lnk=gst&q=sdif#46a585e0fb7a439b).
> The data itself consists of (either) single- or double-floats, which,
> since drawing in ACL is pixel-based, I am forced to round to integers.
> I would like to find some way of avoiding this - I expect to have to
> round my values to some extent, but using pure integers for display
> compromises the integrity of the data too much.
> 
> I have been assuming some kind of upwards scaling would be effective.
> The kind of numbers I am dealing with typically represent non-integer
> frequency values, for example 453.687564Hz. If I want a y-axis value
> which represents this number rounded to three decimal places then I
> would simply do -
> 
> (round (*  453.687564 1000))
> => 453688
> 
> and pass this to the appropriate drawing functions. The value is also
> displayed in the status bar of the window as the mouse moves over that
> point, but divided by 1000 in order to yield 435.688. I am happy with
> this degree of accuracy, but since I could be dealing with numbers
> representing frequencies up to 20000Hz it means that I have to work
> with a massive drawing canvas. I have experimented with ACL's scaling-
> stream mixin, which I mix with my base window class and which allows
> me to greatly increase the number of points per pixel. Even with that,
> however, I still have memory issues (I am sub-classing my base class
> from bitmap-window, which is admittedly memory-intensive since it uses
> a backing store, but anything else gives me unsatisfactory redisplay).
> Is there anything else I could try? 

OpenGL. Cells-Gtk or Celtk. The former is better packaged/easier install.

kt
From: Cortez
Subject: Re: Displaying floating point data in ACL Common Graphics
Date: 
Message-ID: <f4b1ad2e-9b2a-487f-ab20-c7b36aa36e68@t54g2000hsg.googlegroups.com>
On Aug 7, 9:40 pm, Kenny <·········@gmail.com> wrote:
> Cortez wrote:
> > Hello,
>
> > I am designing a graphical application in ACL for displaying spectral
> > analysis data (for a related post see
> >http://groups.google.com/group/comp.lang.lisp/browse_thread/thread/5d...).
> > The data itself consists of (either) single- or double-floats, which,
> > since drawing in ACL is pixel-based, I am forced to round to integers.
> > I would like to find some way of avoiding this - I expect to have to
> > round my values to some extent, but using pure integers for display
> > compromises the integrity of the data too much.
>
> > I have been assuming some kind of upwards scaling would be effective.
> > The kind of numbers I am dealing with typically represent non-integer
> > frequency values, for example 453.687564Hz. If I want a y-axis value
> > which represents this number rounded to three decimal places then I
> > would simply do -
>
> > (round (*  453.687564 1000))
> > => 453688
>
> > and pass this to the appropriate drawing functions. The value is also
> > displayed in the status bar of the window as the mouse moves over that
> > point, but divided by 1000 in order to yield 435.688. I am happy with
> > this degree of accuracy, but since I could be dealing with numbers
> > representing frequencies up to 20000Hz it means that I have to work
> > with a massive drawing canvas. I have experimented with ACL's scaling-
> > stream mixin, which I mix with my base window class and which allows
> > me to greatly increase the number of points per pixel. Even with that,
> > however, I still have memory issues (I am sub-classing my base class
> > from bitmap-window, which is admittedly memory-intensive since it uses
> > a backing store, but anything else gives me unsatisfactory redisplay).
> > Is there anything else I could try?
>
> OpenGL. Cells-Gtk or Celtk. The former is better packaged/easier install.
>
> kt

Thanks Kenny. I've looked at things like Cells-Gtk and Ltk, but I'm
pretty keen to write the GUI purely in Lisp, without having to resort
to a wrapper library. Having said that, if I can't find a reasonable
Lisp solution to this I'll have to.
From: Kenny
Subject: Re: Displaying floating point data in ACL Common Graphics
Date: 
Message-ID: <489b827a$0$7340$607ed4bc@cv.net>
Cortez wrote:
> On Aug 7, 9:40 pm, Kenny <·········@gmail.com> wrote:
>> Cortez wrote:
>>> Hello,
>>> I am designing a graphical application in ACL for displaying spectral
>>> analysis data (for a related post see
>>> http://groups.google.com/group/comp.lang.lisp/browse_thread/thread/5d...).
>>> The data itself consists of (either) single- or double-floats, which,
>>> since drawing in ACL is pixel-based, I am forced to round to integers.
>>> I would like to find some way of avoiding this - I expect to have to
>>> round my values to some extent, but using pure integers for display
>>> compromises the integrity of the data too much.
>>> I have been assuming some kind of upwards scaling would be effective.
>>> The kind of numbers I am dealing with typically represent non-integer
>>> frequency values, for example 453.687564Hz. If I want a y-axis value
>>> which represents this number rounded to three decimal places then I
>>> would simply do -
>>> (round (*  453.687564 1000))
>>> => 453688
>>> and pass this to the appropriate drawing functions. The value is also
>>> displayed in the status bar of the window as the mouse moves over that
>>> point, but divided by 1000 in order to yield 435.688. I am happy with
>>> this degree of accuracy, but since I could be dealing with numbers
>>> representing frequencies up to 20000Hz it means that I have to work
>>> with a massive drawing canvas. I have experimented with ACL's scaling-
>>> stream mixin, which I mix with my base window class and which allows
>>> me to greatly increase the number of points per pixel. Even with that,
>>> however, I still have memory issues (I am sub-classing my base class
>>> from bitmap-window, which is admittedly memory-intensive since it uses
>>> a backing store, but anything else gives me unsatisfactory redisplay).
>>> Is there anything else I could try?
>> OpenGL. Cells-Gtk or Celtk. The former is better packaged/easier install.
>>
>> kt
> 
> Thanks Kenny. I've looked at things like Cells-Gtk and Ltk, but I'm
> pretty keen to write the GUI purely in Lisp, without having to resort
> to a wrapper library. 

Hey, it is not even clear to me that OpenGL solves your problem, but if 
it does I wonder if the pure Lisp library you are using might support 
you coding up the OpenGL yourself via the windows API. Tk and Gtk do. Or 
get cl-opengl with Freeglut or OpenGlut or whatever it uses. I know, 
Glut is not a pure Lisp library...

Are you sure the ACL library is pure underneath?

I am using tcl/Tk day in and day out and I do not even know it... ah, 
but I am using Cello which does not use Tk widgets or layout, just one 
thing: the TK OpenGL widget.

yes, sorry, you want Cello, not Celtk. It's the unwrapper wrapper, if 
you remember your 7-Up.


kenny
From: Thomas A. Russ
Subject: Re: Displaying floating point data in ACL Common Graphics
Date: 
Message-ID: <ymifxpbe14u.fsf@blackcat.isi.edu>
Cortez <············@hotmail.co.uk> writes:

> (round (*  453.687564 1000))
> => 453688

n.B.  You can achieve the same result by using the optional argument to
round, and not (explicitly) doing the multiplication:

  (round 453.687564 0.001)

  (round 453.687564 1/1000)

-- 
Thomas A. Russ,  USC/Information Sciences Institute