Bill Schottstaedt | 3 Apr 23:09 2015

Snd 15.5

Snd 15.5:

repl.scm to replace use of readline in various cases.  The main one is
  Snd without a GUI.  In this case, you need to tell Snd where to find
  repl.scm.  In my ~/.snd_s7 file, I have:

  (set! *load-path* (cons "/home/bil/cl" *load-path*))

  I think you can build this into Snd by using the SCRIPTS_DIR flag
  in the makefile.

checked: sbcl 1.2.9|10, gtk 3.15.10|11|12, 3.16.0

Thanks!: Mike Scholz, Tito Latini
Tito Latini | 3 Apr 14:27 2015

Snd: no tracking-cursor if one sound is stopped

I have another patch to fix a graphic problem when two or more sounds
are playing and with-tracking-cursor is not #f (or we start to play
the sounds with [Ctrl][Play]).


- (set! *with-tracking-cursor* #t)

- open and play two sounds

- stop one sound

  (the cursor of the other sound is motionless)
diff -ur snd-15~/snd-dac.c snd-15/snd-dac.c
--- snd-15~/snd-dac.c	2015-04-03 13:56:30.423019828 +0200
+++ snd-15/snd-dac.c	2015-04-03 13:56:40.722890341 +0200
 <at>  <at>  -611,6 +611,16  <at>  <at> 

+static bool something_is_playing(void)
+  int i;
+  if (play_list)
+    for (i = 0; i < dac_max_sounds; i++)
+      if (play_list[i]) return(true);
+  return(false);
(Continue reading)

Tito Latini | 3 Apr 00:13 2015

Snd: save-mix segfault

Hi, if a mix doesn't exist, Snd crashes after save-mix.

Example I

(define mix7 (integer->mix 7))
=> #<mix 7>

(mix? mix7)
=> #f

(save-mix mix7 "bye.snd")
-- segfault

Example II

- open-sound
- add a mix
- (define mix0 (caaar (mixes)))
- save-sound
- (save-mix mix0 "crash.snd")

The null pointer (returned by md_from_id) is in save_mix (snd-mix.c:3681),
called only by copy_mix and g_save_mix. copy_mix is safe because

  md = md_from_id(id);
  if (!md) return(-1);

save_mix returns a io_error_t and there is not a value suitable
for a mix, so the attached patch fixes the bug in g_save_mix.
(Continue reading)

Orm Finnendahl | 1 Apr 17:43 2015

[Snd] playback from marks


 I just compiled latest snd-15 with motif and that seems to resolve
the issue. Sorry for the noise...


Cmdist mailing list
Orm Finnendahl | 1 Apr 15:34 2015

[Snd] playback from marks


 I'm having the following problem trying to play a sound with mouse
interaction starting at a mark:

Hovering over the red triangle of the mark, the mouse cursor changes
into a right arrow. Clicking once locates the playback cursor to the
beginning of the sound (sample 0). Clicking a second time makes
the playpack cursor jump to the mark and start playback.

As the sound is rather long it's impossible to work like that if I
need to zoom in to a position where the beginning of the sound is not

Am I doing something wrong or is there a workaround?

The only customization from the standard I did is

(set! (with-tracking-cursor) #t)

I'm using snd 13.8

Any help appreciated!

Tito Latini | 27 Mar 19:38 2015

Snd: region's peak_envs not updated after editing

Hello, you can see this bug with the follow steps:

  - make a region, no too short otherwise `peak_env_usable' returns
    "false" and the waveform is correct

  - edit the created region

  - from Regions view, move the slider to right. During the sliding,
    when `peak_env_usable' returns "true" in snd-chn.c:1797, it starts
    to display the old waveform.

The attached patch is a possible solution.
diff -ur snd-15~/snd-region.c snd-15/snd-region.c
--- snd-15~/snd-region.c	2015-03-27 19:33:23.042250004 +0100
+++ snd-15/snd-region.c	2015-03-27 19:33:29.200172589 +0100
 <at>  <at>  -1246,9 +1246,13  <at>  <at> 

   for (i = 0; i < sp->nchans; i++)
+      chan_info *cp;
       mus_float_t val;
       val = channel_maxamp(sp->chans[i], AT_CURRENT_EDIT_POSITION);
       if (val > r->maxamp) r->maxamp = val;
+      if ((cp = sp->chans[i]))
+        r->peak_envs[i] = copy_peak_env_info(cp->edits[0]->peak_env, false);

(Continue reading)

Bill Schottstaedt | 24 Mar 16:44 2015

ccrma history

Andrew J Nelson's book about ccrma is available now:
"The Sound of Innovation: Stanford and the Computer
Music Revolution", about $30 at Amazon.  I certainly
enjoyed reading it, but I'm biased.  It's hard to believe
it was 46 years ago that I wandered into the Bay Area.
James Hearon | 22 Mar 20:32 2015

gtk mapped without transient parent

On f21 I'm getting an error thru the Grace editor.    Wondering if anyone else has this problem and might know the problem?  I did grep a bit and GTK part seems throughout Sndlib in CM, but I can't be sure that's the issue.

Save File:
GtkDialog mapped without a transient parent...File not saved.

On f21 I have a gtk2 and dev files, and a gtk3 with dev files.  I tried rebuilding Grace, but the problem persists.

Cmdist mailing list
Tito Latini | 20 Mar 11:54 2015

s7 (current) doesn't compile with GNU multiprecision arithmetic

Hi, attached a patch to fix a recent typo.

(please pardon me if it is not correct to report/fix recent changes)
diff -ur snd-15~/s7.c snd-15/s7.c
--- snd-15~/s7.c	2015-03-18 22:57:54.000000000 +0100
+++ snd-15/s7.c	2015-03-20 11:25:37.816183045 +0100
 <at>  <at>  -17380,7 +17380,7  <at>  <at> 
 	s7_pointer x;

 	NEW_CELL(sc, x, T_BIG_REAL);
-	add_bigreal(x);
+	add_bigreal(sc, x);
 	mpc_real(big_real(x), big_complex(p), GMP_RNDN);

 <at>  <at>  -17426,7 +17426,7  <at>  <at> 
 	s7_pointer x;
 	NEW_CELL(sc, x, T_BIG_REAL);
-	add_bigreal(x);
+	add_bigreal(sc, x);
 	mpc_imag(big_real(x), big_complex(p), GMP_RNDN);

Cmdist mailing list
James Hearon | 1 Mar 00:08 2015


> Date: Sat, 28 Feb 2015 11:51:43 -0800
> From: "Bill Schottstaedt" <bil <at> ccrma.Stanford.EDU>
> Subject: Re: [CM] analog-filter.scm
> To: James Hearon <>, "cmdist-Q5CBQdYaXkD3fQ9qLvQP4Q@public.gmane.orgnford.EDU"
> <>
> Message-ID: <>
> Content-Type: text/plain; charset=iso-8859-1
> They're in mus-config.h. SNDLIB_CONFIG_path is very obsolete --
> it has no effect on anything. I tried fc21 with all those settings
> and it worked fine. I don't know what the problem is.

Thanks Bill.  I tried this and it seems working now.

./configure  --with-s7 --with-gsl --with-motif --with-alsa CFLAGS=HAVE_COMPLEX_NUMBERS CFLAGS=HAVE_COMPLEX_TRIG CFLAGS="-I/usr/include/linux/param.h" SNDLIB_CONFIG_path=/opt/sndlib

(load "/opt/snd-15.4/analog-filter.scm")

(define (filter-sweep flt)
  (let ((phase 0.0)
    (freq 0.0)
    (incr (/ (* 2 pi) 144000.0))
        (samps (seconds->samples 0.5)))
    (do ((i 0 (+ i 1)))
    ((= i samps))
      (let ((sval (* .8 (sin phase))))
    (set! phase (+ phase freq))
    (set! freq (+ freq incr))
    (outa i (flt sval))
    (outb i (flt sval))  ))))

(with-sound (:output "test.wav" :srate 48000 :channels 2
                     :header-type  mus-riff)
  ;(filter-sweep (make-butterworth-lowpass 8 .1))
  (filter-sweep (make-bessel-lowpass 8 .2))
  ;(filter-sweep (make-chebyshev-lowpass 8 .1))
  ;(filter-sweep (make-inverse-chebyshev-lowpass 8 .1))
  ;(filter-sweep (make-elliptic-lowpass 8 .01))

Cmdist mailing list
James Hearon | 28 Feb 18:56 2015


> Message: 3
> Date: Fri, 27 Feb 2015 10:49:33 -0800
> From: "Bill Schottstaedt" <>
> Subject: Re: [CM] analog-filter.scm
> To: James Hearon <>, ""
> <>
> Message-ID: <>
> Content-Type: text/plain; charset=iso-8859-1
> in s7, which means it can't work in Windows, c++, or FreeBSD.
> If you aren't in that group, I need to know how you built Snd,
> and what those flags are. gsl-roots is used in the Bessel filter
> section, but is not related to the gsl Bessel function stuff.

Thanks for the info.  I've built Snd-15.4 on f21, and not seeing anything about HAVE_COMPLEX_NUMBERS or HAVE_COMPLEX_TRIG from the build output.  Is that something I need to add when running make or gcc?

[jhearon <at> localhost snd-15.4]$ ./configure --with-s7 --with-gsl --with-motif --with-alsa SNDLIB_CONFIG_path=/opt/sndlib
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for a BSD-compatible install... /usr/bin/install -c
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking whether byte ordering is bigendian... no
checking size of void *... 8
checking for pkg-config... /usr/bin/pkg-config
checking for fftw3... yes
checking for gsl... yes
checking for X... libraries , headers
checking for gethostbyname... yes
checking for connect... yes
checking for remove... yes
checking for shmat... yes
checking for IceConnectionNumber in -lICE... yes
checking for oggdec... /usr/bin/oggdec
checking for oggenc... /usr/bin/oggenc
checking for mpg123... no
checking for mpg321... no
checking for speexdec... no
checking for speexenc... no
checking for flac... no
checking for timidity... no
checking for ttaenc... no
checking for wavpack... /usr/bin/wavpack
checking for wvunpack... /usr/bin/wvunpack
checking for audio system... ALSA
configure: creating ./config.status
config.status: creating makefile
config.status: creating mus-config.h
config.status: mus-config.h is unchanged

  Options selected
  Snd version ...........: 15.4
  CFLAGS ................: -O2 -I. -g -O2
  LDFLAGS ...............: -Wl,-export-dynamic
  LIBS...................:  -lm -ldl
  prefix.................: /usr/local
  extension language.....: s7
  audio system...........: ALSA
  graphics toolkit.......: Motif
  optional libraries.....: fftw3 gsl
  random features........:
  environs...............: x86_64-unknown-linux-gnu gcc

[jhearon <at> localhost snd-15.4]$ make
gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\"   -O2 -I. -g -O2      s7.c
gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\"   -O2 -I. -g -O2      headers.c
gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\"   -O2 -I. -g -O2      audio.c
gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\"   -O2 -I. -g -O2      io.c
gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\"   -O2 -I. -g -O2      sound.c
gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\"   -O2 -I. -g -O2      clm.c
gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\"   -O2 -I. -g -O2      xen.c
gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\"   -O2 -I. -g -O2      vct.c
gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\"   -O2 -I. -g -O2      sndlib2xen.c
gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\"   -O2 -I. -g -O2      clm2xen.c
gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\"   -O2 -I. -g -O2      snd-io.c
gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\"   -O2 -I. -g -O2      snd-utils.c
gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\"   -O2 -I. -g -O2      snd-listener.c
gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\"   -O2 -I. -g -O2      snd-completion.c
gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\"   -O2 -I. -g -O2      snd-menu.c
gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\"   -O2 -I. -g -O2      snd-axis.c
gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\"   -O2 -I. -g -O2      snd-data.c
gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\"   -O2 -I. -g -O2      snd-fft.c
gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\"   -O2 -I. -g -O2      snd-marks.c
gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\"   -O2 -I. -g -O2      snd-file.c
gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\"   -O2 -I. -g -O2      snd-edits.c
gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\"   -O2 -I. -g -O2      snd-chn.c
gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\"   -O2 -I. -g -O2      snd-dac.c
gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\"   -O2 -I. -g -O2      snd-region.c
gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\"   -O2 -I. -g -O2      snd-select.c
gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\"   -O2 -I. -g -O2      snd-find.c
gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\"   -O2 -I. -g -O2      snd-snd.c
gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\"   -O2 -I. -g -O2      snd-help.c
gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\"   -O2 -I. -g -O2      snd-main.c
gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\"   -O2 -I. -g -O2      snd-print.c
gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\"   -O2 -I. -g -O2      snd-trans.c
gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\"   -O2 -I. -g -O2      snd-mix.c
gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\"   -O2 -I. -g -O2      snd.c
gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\"   -O2 -I. -g -O2      snd-env.c
gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\"   -O2 -I. -g -O2      snd-xen.c
gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\"   -O2 -I. -g -O2      snd-ladspa.c
gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\"   -O2 -I. -g -O2      snd-kbd.c
gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\"   -O2 -I. -g -O2      snd-sig.c
gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\"   -O2 -I. -g -O2      snd-draw.c
gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\"   -O2 -I. -g -O2      snd-gxbitmaps.c
gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\"   -O2 -I. -g -O2      snd-gxcolormaps.c
gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\"   -O2 -I. -g -O2      snd-motif.c
gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\"   -O2 -I. -g -O2      xm.c
gcc -Wl,-export-dynamic -O2 -I. -g -O2 s7.o headers.o audio.o io.o sound.o clm.o xen.o vct.o sndlib2xen.o clm2xen.o snd-io.o snd-utils.o snd-listener.o snd-completion.o snd-menu.o snd-axis.o snd-data.o snd-fft.o snd-marks.o snd-file.o snd-edits.o snd-chn.o snd-dac.o snd-region.o snd-select.o snd-find.o snd-snd.o snd-help.o snd-main.o snd-print.o snd-trans.o snd-mix.o snd.o snd-env.o snd-xen.o snd-ladspa.o snd-kbd.o snd-sig.o snd-draw.o snd-gxbitmaps.o snd-gxcolormaps.o snd-motif.o xm.o  -o snd   -lSM -lICE -lXm -lXt -lX11  -lXext -lSM -lICE -lXft -lXpm   -lasound -lfftw3  -lgsl -lgslcblas -lm   -lm -ldl

Cmdist mailing list