Snd

Snd is a sound editor.  It currently runs on the SGI, Sun, UnixWare 2,
OpenServer 5, HPUX, DEC Alpha, MkLinux with Lesstif, and Linux with
Metrolink's Motif (see below for Lesstif notes).  To build it, get the
sources from ftp://ccrma-ftp.stanford.edu/pub/Lisp/snd.tar.gz, go to
an empty directory,

  gzip -d snd.tar.gz
  tar xvf snd.tar
  rm snd.tar

Then 

SGI:            make -f makefile.sgi
Linux:          make -f makefile.linux
Openware 2:     make -f makefile.uw2
OpenServer 5:   make -f makefile.sco5
Solaris:        make -f makefile.solaris
DEC Alpha:      make -f makefile.alpha
MkLinux:        make -f makefile.mklinux

In HPUX, fixup the makefile.hpux include and library paths, then:
  make -f makefile.hpux


If none of these fits your needs, try

  ./configure
  make

and let me (bil@ccrma.stanford.edu) know what happens! 
(If you use configure and the make process fails, please 
send me the files config.h and makefile, created (or updated) 
by configure).


Currently, in all cases, the Guile support is off by default.  I'm not
sure how many Snd users have Guile yet, or want the programming
extension to Snd that it provides.  To load it, go to the relevant
makefile and set the CFLAGS variable to include the option
-DHAVE_GUILE=1, and the LIBS variable to include -lguile.  Guile is
available in the gnu distributions (prep.ai.mit.edu) or from
ftp.red-bean.com.

Another extension is the XmHTML widget available from
http://www.xs4all.nl/~ripley/XmHTML.  If you have this, add
-DHAVE_XmHTML=1 to the CFLAGS variable, and the libXmHTML.a path to
LIBS in the relevant makefile.  This widget is used, if it is
available, in the Help sections of Snd.  The XmHTML widget needs
access to snd.html.  If it is not on the current directory, nor
/usr/doc/snd-2 (the RPM documentation location), then you need to set
the htmldir resource (see snd.html).  (One drawback of this widget is
that it makes the Snd image much larger).

Normally the makefiles assume you have the XPM library.  A few cases
(e.g. makefile.sgi) do not.  In this case, if you have the XPM
library, add -DXPM and the libxpm path to the relevant makefile.  If
it is available, it is used to create some cute icons.

If you're loading Guile and want dynamically loaded C modules, include
-ldl in the LIBS list.  It is otherwise unneeded.

In all cases you need Motif.


There are precompiled binaries available at the ccrma-ftp site
mentioned above: sgi-snd for the SGI, linux-snd for a new
(glibc-based) Linux on a PC, and linux-snd-libc5 for an old version;
also RPM (Redhat package management) files that contain the Linux/PC
version with documentation (snd-2-1.i386.rpm) and the sources (if
you're interested) snd-2-1.src.rpm). I expect to make new RPM files on
an occasional basis (say once or twice a year).  Starting with
the next version, I'll include snd-2-*.ppc.rpm for MkLinux.
If there's interest, I could probably make an SGI rpm version.


Included with Snd are five command-line programs that might
be of interest: sndplay, sndrecord, sndinfo, sndsine, and audinfo.  
You can make these by using the same makefile as before
and:

  make sndplay

or
  
  make -f makefile.sgi sndplay

or whatever.



--------------------------------

The documentation is snd.html (or snd.txt).

The mailing list for Snd is the same as that for Common Music:
cmdist@ccrma.stanford.edu.  To get your address added to or removed
from this list, send the request to cmdist-request@ccrma.stanford.edu.

This software is available to anyone who is interested, free gratis
for nothing, without warranties of any kind.  Send bug reports or
suggestions to bil@ccrma.stanford.edu.


The OpenServer and UnixWare ports are courtesy of Larry Plona.
The Solaris port is thanks to Volker Kuhlmann and Seppo Ingalsuo.
The HPUX port is thanks to Seppo Ingalsuo.
The DEC Alpha port is due to the persistence of Juan Reyes.


--------------------------------

On the NeXT, Snd compiles and loads, but dies (in CubXWindow)
while trying to make a TextField widget.  I haven't tracked
this problem down yet.

--------------------------------

In Windoze, Snd compiles happily in Hummingbird's Exceed X/Motif,
but the load process (in Watcom C) stops with various complaints
about what appear to me to be standard C-library entities.  I don't
know enough (actually, anything) about MS C libraries, so I'm stuck
at this point until I find time to poke around in the endless
directories filled with endless opaquely-named libraries that can't
be reached because there's a 12 character file name intervening;
a situation for JL Borges.

--------------------------------

Snd used to sort-of work in Lesstif, a free version of Motif available
at http://www.lesstif.org (version 0.83 is the one that tried harder).
I know of the following bugs (I didn't try to make an exhaustive
search!): 
  
*  map_across_children changing widget color in various cases misses 
   some widgets (actually gadgets); the result is that the file selection
   box, group editor, and others have Motif-blue widgets. 

*  Paned window initial pane sizes are screwed up -- when Snd first
   comes up, Lesstif opens the "controls" pane, despite efforts to
   keep it closed.  This also affects the "combined channels"
   option -- you end up with an empty pane. (This is a Lesstif "known bug").
   I think I could code around this using XmNheight, but it would
   be very tedious.

*  widget traversal does not work correctly -- there are many ways
   to end up unable to use the emacs-like commands at all (this is
   lesstif's "known bug 6"). This is a very serious bug from Snd's
   point of view.

*  The Record window has a variety of flaws (the dialog comes up
   the wrong size, the record button won't change color (it's a
   gadget I think), the text widget ignores attempts to load 
   it with a string, and so on).

But version 0.85 introduces some really serious bugs that I don't
have time to kludge around.  0.85 compiles/loads Snd, but dies
with an X error when trying to resize a form widget within a
paned window:

(gdb) run -sync ~/cl/oboe.snd
Starting program: /home/bil/snd/snd -sync ~/cl/oboe.snd
Breakpoint 1 at 0x402a4515: file exit.c, line 40.
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  12 (X_ConfigureWindow)
  Value in failed request:  0x0
  Serial number of failed request:  4001
  Current serial number in output stream:  4002

Breakpoint 1, exit (status=1) at exit.c:40
exit.c:40: No such file or directory.
(gdb) where
#0  exit (status=1) at exit.c:40
#1  0x40205713 in _XDefaultError ()
#2  0x40205810 in _XError ()
#3  0x40204228 in _XReply ()
#4  0x40200085 in XSync ()
#5  0x40200106 in _XSyncFunction ()
#6  0x401fc9ac in XConfigureWindow ()
#7  0x4019f16f in _XtMakeGeometryRequest ()
#8  0x4019f32c in XtMakeGeometryRequest ()
#9  0x4007e601 in _XmMakeGeometryRequest () at GeoUtils.c:1835
#10 0x400774ff in _XmFormGeomRequest (f=0x819f4b0, width=0xbffff21e, 
    height=0xbffff21c) at Form.c:2791
#11 0x40072ef3 in change_managed (w=0x819f4b0) at Form.c:839
#12 0x401a4ae2 in ManageChildren ()
#13 0x401a4c6e in XtManageChildren ()
#14 0x401a4d37 in XtManageChild ()
#15 0x40198824 in XtCreateManagedWidget ()
#16 0x80d7142 in add_sound_window (
    filename=0xbffffacb "/home/bil/cl/oboe.snd", state=0x813b520)
    at snd-xsnd.c:1687
#17 0x806f3ce in snd_open_file (filename=0xbffffacb "/home/bil/cl/oboe.snd", 
    ss=0x813b520) at snd-file.c:588
#18 0x80deb41 in startup_funcs (clientData=0x8157918) at snd-xmain.c:326
#19 0x401a6531 in CallWorkProc ()
#20 0x401a6747 in XtAppNextEvent ()
#21 0x4019d583 in XtAppMainLoop ()
#22 0x80dfce4 in snd_doit (state=0x813b520, argc=2, argv=0xbffff9d4)
    at snd-xmain.c:657
#23 0x80b3dd1 in main (argc=3, argv=0xbffff9d4) at snd.c:118

I poked around in the Lesstif code, but did not see any
obvious problem.  This problem did not exist in version 81, 
I think.  Then Lesstif got in a mode where it logged me
out every time I tried to run Snd!!

Currently Snd uses rowcolumn widgets in MkLinux/Lesstif, since
paned windows seem to be the main problem.  This means
most things work, but are not optimal.  Audio support is 
turned off in MkLinux.


--------------------------------
On the Alpha, there's no support yet for playing or recording
sounds -- I don't have any idea how audio works on that machine.
Any information would be much appreciated!

--------------------------------
If Snd complains that it can't find various colors upon
startup, the problem is that some other program (probably
Netscape) has grabbed all the color cells -- exit it and
try Snd again.

--------------------------------
XmHTML problem:

Several of my html files got segfaults from XmHTML
version 1104; the fix was to change src/layout.c line 1192
from:
	words[i-1]->posbits &= ~TEXT_SPACE_TRAIL;
to
	if (i>0) words[i-1]->posbits &= ~TEXT_SPACE_TRAIL;
