LispPlot 1.01 for LispMe 2.8

Dafydd Gibbon

24.4.2000, 18.11.2000
(Text generated: November 18, 2000)

Distribution

  1. This file in HTML, iSilo, text, PS and PDF formats

  2. pedit32 format: LispPlot101All.txt, full source file (concatenation of 7 memo files), 20kB

  3. DOC format: LispPlotDOC.pdb, full source file (DOC header generated by pedit32), 20kB

  4. MemoPad format: 7 separate module files in TGZ ZIP formats, each $<$ 4kB:
    1. a-PlotUtils.lm: plotter
    2. b-Fun-IO-csv.lm: object format data export/import
    3. c-Fun-IO-struc.lm: CSV format data export/import
    4. d-Operations.lm: Register and operation
    5. e-Statistics.lm: basic statistics
    6. f-Functions.lm: generator
    7. g-FunXtras.lm: examples of function parametrisation
    8. h-LispPlot.lm: main generation, statistics, plotter caller
    9. i-PlotDemo.lm: demo of various built-in plottable functions

Licence

The standard GNU General Public Licence (GPL) conditions apply. In particular, no warranty whatsover for consequences of the use of this software is given. If you use this software or ideas from this software, the decent thing to do would be to send me a free copy of any software which is influenced by this software. Please send bug reports, enhancements, suggestions, comments to gibbon@spectrum.uni-bielefeld.de

Description

LispPlot is a small and very basic plotter, signal generator and statistics package written in Scheme, and was first implemented by the author in Vlisp for TRS-80 around 1983 and in Texas Instruments PC-Scheme around 1988. This version is adapted to run in the LispMe 2.8 environment running on the PalmPilot platform. It will not run on LispMe 2.6 and before because the graphics functions are not compatible. A demo application is provided which shows the basic capabilities of the package: after loading, evaluate (demo). The source files total 20 kBytes, and are distributed in the following formats, any of which can be loaded into LispMe 2.8:

  1. 7 MemoPad files each under 4096 bytes (LispMe $>$= 2.7).
  2. 1 pedit32 memo-style file 20kB, consisting of the 7 MemoPad files concatenated in correct loading order (LispMe $>$= 2.8).
  3. 1 DOC file 20kB generated by pedit32 from the pedit32 file (LispMe $>$= 2.8).

Requirements:

LispPlot 1.01 is supplied in source file format, and requires LispMe 2.8 to be installed on the handheld, both for compiling the sources, and for the run-time environment.

Optional:

The MemoPad is used as the basic archive for files; files can therefore be written on-board with the MemoPad editor, with LispMe's internal editor, or with Paul Nevai's pedit. However, MemoPad files are limited to 4 kB by the Palm Windows Desktop and the internal MemoPad editor. The 4 kB barrier can be broken in a number of ways:

  1. LispMe's internal editor (which uses MemoPad),
  2. Paul Nevai's pedit32 (which uses its own database) and peditPro which uses the pedit32 database when in pedit32 mode,
  3. handheld DOC files (not to be confused with MS formats).

LispMe 2.8 can handle any of these, and the source code for LispPlot 1.01 is supplied in all these formats.

Changes in LispPlot 1.01

Pseudo-FAQ

Why LispPlot?
I use LispPlot for quick and easy generation and display of example functions for acoustics and phonetics teaching, and have made various versions as various computing platforms came and went over the years. As far as I know, there is no comparable easy-to-use application on any platform which does just what I need for this (except my PlotPilot in PocketC, which was originally a port of LispPlot).

Why LispMe?
LispMe is a compact and (for a PalmPilot) fast Scheme implementation by Fred Bayer for Palm handhelds, with an on-board development environment, and has brought `intelligence' to the handheld world. LispPlot was re-implemented entirely by stylus on the handheld, using this environment. Check Fred's LispMe pages, especially the discussion forum: http://www.lispme.de/

Why doesn't LispPlot work with LispMe 2.6?
LispPlot 1.0 did, but in LispMe 2.7 the graphics functions changed, and LispPlot 1.01 was changed to match. If you have LispMe 2.6, install LispMe 2.7. Or modify the graphics functions yourself.

How can I save my data?
There are two methods:
  1. Data can be saved to MemoPad as a LispMe object (a pair of vectors of floats). Data saved in this way can be re-loaded.
  2. Data can also be saved as CSV pairs of floats, with a header. Data saved in this way can also be re-loaded. The CSV save/load function is much slower than the object save/load function.

How can I exchange data with other applications?
You can import data from other sources via the MemoPad if they are formatted as CSV pairs of floats, with a header. You can also export data to other applications (e.g. spreadsheets, emailing, processing elsewhere) via the MemoPad using the CSV save technique.

Why is the code un-Lispy?
LispPlot has been ported into several other languages over the years, and to make life easier, explicit Lisp specific meta-functions such as lambda, let, letrec etc. (except for eval in a couple of places) have been avoided. Feel free to check the functions, improve the code, design, functionality, and add a Palm look-and-feel user interface.

Details

Functions are evaluated to cons pairs of vectors. A number of sample functions have been provisionally implemented and included for illustration:
rando/3 random values over a given range: (rando min max len)
linear/4 linear functions: (straightline min max factor len)
exponent/ exponential and asymptotic functions: (exponent min max exponent len)
parabola/3 square functions: (parabola min max len)
fourier/7 complex waveforms: (fourier offset ampl freq phase #harmon step_harmon len)

Any arbitrary function which generates a pair of equal-length vectors of floats can be simply included; the data generated by the function are stored in a designated global variable for manipulation with operations and for plotting.

Basic statistics for function vectors can be calculated, some of which are needed for plot scaling. The function (stats $<$vector$>$) evaluates all of these, returning a list of values in the order: (min max sum mean variance standard_deviation)

A bank of global variables is provided for use as registers to store and manipluate functions: *vec0* ... *vec8*, *fun1* ... *fun8* More can be defined as desired.

Some register manipulation functions are defined in order to provide basic register manipulation scripting:

swapxy/0 swaps x and y vectors of *fun1*
swapxx/0 swaps x vectors of *fun1* and *fun2*
swapyy/0 swaps y vectors of *fun1* and *fun2*
swapff/0 swaps *fun1* and *fun2*
fun?/1 checks for object arg match with LispPlot function type
addfun/0 pointwise add of y vectors of *fun1* and *fun2*, with x copied from *fun1*, result in *fun3*
multfun/0 pointwise multiply of y vectors of *fun1* and *fun2*, with x vector copied from *fun1*, result in *fun3*
superposefun/0 concatenation of vectors of *fun1* and *fun2*, result in *fun3*

The registers can be manipulated in the usual ways with (set! $<$var$>$ $<$object$>$) etc.

The basic plotter function is (genplot $<$function$>$ $<$lines$>$), where $<$lines$>$ can be 0 (unconnected dot display) or 1 (dots connected by lines).

A demo is provided, illustrating applications of all the built-in functions. Start by evaluating (demo) in the input field.

The functionality can easily be extended by implementing further generation and display functions in Scheme. Check the sources for further "howto" information and examples. For non-Schemers: the programming style is very straightforward and not very `lispy', except for the use of (eval $<$object$>$), so porting to other languages is not a major obstacle.

Installation

  1. Get LispMe 2.8 from:
    http://www.lispme.de/, or
    http://www.egroups.de/group/lispme/
    and install it using the instructions provided.
  2. Get LispPlot 1.01 from:
    http://coral.lili.uni-bielefeld.de/~gibbon/Downloads/,
    and install the sources as follows:
    1. Linux: use the pilot-link tool "install-memo" to install the individual memo files, or "pilot-xfer -i" to install the DOC file. There is a patch for the "install-memo" and "memos" applications at
      http://www.egroups.com/group/peditors/
      which is intended to permit pedit32 files to be imported and exported directly.
    2. Windows: Paste the memos to the Palm Desktop MemoPad and HotSync, or install the DOC file in the usual way.
    If you have installed the the DOC file, you can either use a DOC editor, or import it to Paul Nevai's pedit32 for editing. LispMe 2.8 can load ordinary memos, pedit32 files or DOC files.

  3. Start LispMe 2.8, define a new session called LispPlot, and select maximum memory sizes for all categories.

  4. Enter Load mode and select the format you plan to use. If you select the multiple file MemoPad format, note that there are dependencies between the functions which do not permit a completely free loading order, so use the order indicated by the initial letters in the filenames.

  5. Start the demo on the LispMe command line with (demo).
  6. You can tick a LispMe application icon option for LispPlot in the Switch option, and place the LispPlot icon in an appropriate Laucher category.

Contact

Dafydd Gibbon Universität Bielefeld
gibbon@spectrum.uni-bielefeld.de
http://coral.lili.uni-bielefeld.de/~gibbon/Downloads/

Dafydd Gibbon
2000-11-18