File: README.Snd

package info (click to toggle)
snd 26.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 44,044 kB
  • sloc: ansic: 291,996; lisp: 260,569; ruby: 71,134; sh: 3,293; fortran: 2,342; csh: 1,067; cpp: 294; makefile: 294; python: 87; xml: 27; javascript: 1
file content (428 lines) | stat: -rw-r--r-- 13,632 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
Snd

Snd is a sound editor.  It currently runs on nearly all
Unix-based systems, including Mac OSX and Cygwin.
To build Snd, get the sources from

  ftp://ccrma-ftp.stanford.edu/pub/Lisp/snd-18.tar.gz

  gzip -d snd-18.tar.gz
  tar xf snd-18.tar
  cd snd-18
  ./configure
  make

and if you like, su root, then

  make install


The configure script has a bunch of arguments:

   Extension language:

     --with-s7         use s7 (the default, a version of Scheme).

     --with-ruby       use Ruby as the extension language.  If you build Ruby from the sources,
     			 remember to use the --enable-shared switch.  Otherwise ruby.pc is messed up.
                         If ruby.pc (or equivalent) is missing, tools/make-config-pc.rb can make one:
                         make-config-pc.rb > ruby.pc
                         mv ruby.pc /usr/local/lib/pkgconfig/ruby.pc
                         You may also have to set PKG_CONFIG_PATH:
			 PKG_CONFIG_PATH=.:/opt/X11/lib/pkgconfig/ ./configure --with-motif --with-ruby --with-portaudio 
			 (Debian: ruby-dev)
                       In Ruby 2.7, include -Wno-incompatible-pointer-types in CFLAGS.
  
     --with-forth      use Forth (Mike Scholz's FTH) as the extension language. (libfth or fth at sourceforge)
  
     --without-extension-language  build Snd without any extension language
  

   Graphics:

     --with-motif      use Motif.  If it's in some odd location, you can provide that info:
                         ./configure LDFLAGS="-L/usr/X11R6/lib" CFLAGS="-I/usr/X11R6/include" --with-motif

                         in Fedora, install the motif, motif-devel, and libXpm-devel packages.
                         in *BSD, pkg install open-motif, or perhaps use pkgin?
                         in Debian, apt-get install libmotif4, libmotif-dev, libxt-dev, libxpm-dev
			    in Ubuntu 21.04 the Motif libraries appear to be libmotif-common libxm4 libmotif-dev
			      and X11/extensions/shape.h is in libxext-dev
                         Also the X miscellaneous fonts package, Fedora: xorg-x11-fonts-misc, 
                           Fedora: xorg-x11-fonts-misc
                           Arch: https://archlinux.org/packages/extra/any/xorg-fonts-misc/

     --with-gui        make Snd with graphics support (actually intended for use as --without-gui)
  
     --with-gl         include support for OpenGL (default: no, Motif only) (debian: libgl-dev libglu-dev)
       --with-gl2ps    include gl2ps (postscript output from OpenGL graphics)
  

   Audio:

     --with-alsa       use ALSA if possible (the default in Linux) (Debian: libasound2-dev, Fedora: alsa-lib and alsa-lib-dev)

     --with-oss        use OSS (not tested in a long time)
  
     --with-jack       use the Jack library which needs libsamplerate

     --with-pulseaudio use PulseAudio (untested), libpulse-dev in debian, puleaudio-libs-devel in Fedora

     --without-audio   do not include audio support.  This also affects the
                         GUI (play buttons are omitted).


   Other options:

     --with-gmp        use gmp, mpfr, and mpc to implement multiprecision arithmetic
                       (Debian: libgmp-dev libmpfr-dev libmpc-dev)

     --with-ladspa     include LADSPA plugin support (default: yes in Linux)
                       (get ladaps.h and put it in /usr/local/include or some such directory)
  
     --with-temp-dir   directory to use for temp files (default: ".")
     --with-save-dir   directory to use for saved-state files (default: ".")
     --with-doc-dir    directory to search for documentation


If the configure/make process fails, please send me
(bil@ccrma.stanford.edu) the files mus-config.h, config.log, and makefile,
created (or updated) by configure.  In general, if some switch is ignored,
check that you have installed the "devel" package.  For example, --with-ruby
won't work unless you have installed the ruby-devel package.

Snd comes with s7, but if you insist on building Snd without any extension 
language, you'll find that it's severely limited in what it can do.  
Snd can also be built without any graphics toolkit.  Without either the GUI 
or an extension language, however, there's nothing it can do.

Here at CCRMA, we use this configure invocation:

  ./configure --with-jack --with-temp-dir=/zap


Version info:
  if Motif, then Motif 2.n but not Lesstif
  in Linux, if ALSA, then ALSA 1.0 or later
  if Ruby, Ruby 1.8.0 or later.  
  if Forth, any version
  if s7, version 3.0 or later (it comes with Snd).
  if GSL, version 1.0 or later


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

The customization/extension languages are either s7, Ruby, or Forth.

Much of Snd's functionality is loaded as needed from the Scheme, Ruby, or Forth
files found in the tarball (*.scm, *.rb, and *.fs).  You can run Snd without 
these files, but there's no reason to!  Just add the directory containing
those files to the "load-path".  In s7,

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

*load-path* is the list of directories that s7 looks at when trying
to find a file to load.  Here I've added "/home/bil/cl" so that Snd
can find its sources no matter what directory I run it in.  If you 
create a file named ~/.snd_s7 and put such a line in it, you'll
never have to think about it again.  In the other languages:

Ruby:   $LOAD_PATH.push("/home/bil/cl")
Forth:  "/home/bil/cl" add-load-path

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

The documentation is in snd.html, extsnd.html, grfsnd.html, sndscm.html,
sndlib.html, sndclm.html, fm.html, s7.html, s7-ffi.html, and s7-scm.html.

A brief change log is in HISTORY.Snd.


The mailing list for Snd is the same as that for Common Music:
cmdist@ccrma.stanford.edu.  To subscribe, visit

  http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist


To follow the Snd SVN repository, the first time you need to

  svn checkout svn://svn.code.sf.net/p/snd/svn1 snd

This creates a local snd directory with the files (in the trunk directory).

  svn update

updates any changed files.


----------------------------------------------------------------
This software is available to anyone who is interested, free gratis
for nothing, without warranties of any kind (see the file COPYING for
legalese).  Send bug reports or suggestions to bil@ccrma.stanford.edu.
----------------------------------------------------------------


Authors:

Bill Schottstaedt
Michael Scholz

Rick Taube, Andrew Burnson, Donny Ward, Greg Santucci: C++ and Windows wizardry.
Kjetil S. Matheussen:                   the Jack support and many other improvements.
Dave Phillips:                          the tutorial, new-effects.scm, and many other files.
Fernando Lopez-Lezcano:                 the current ALSA support.
Rick Taube and Anders Vinjar:           CM scheme files ported to Snd
Tito Latini:                            many bugfixes and new features.
Richard W.E. Furse:                     the original LADSPA support.
Nick Bailey:                            the ESD support.
Volker Kuhlmann and Seppo Ingalsuo:     the Solaris port.
Seppo Ingalsuo:                         the HPUX port.
Juan Reyes:                             the DEC Alpha port.
Guenter Geiger and Stefan Schwandter:   the Linux Alpha port.
Paul Davis:                             the original ALSA support.
Steven Schultz and Mike Scholz:         the *BSD ports.
Ludger Brummer and Charles Nichols:     the Mac-OSX port.
Thomas Klausner and Mike Scholz:        the NetBSD port.
Koen De Turck:                          the OpenBSD port.
Steve Beet:                             minGW

Plus many other contributions from
  Fernando Lopez-Lezcano, 
  Tom Roth,
  Fabio Furlanete,
  Rick Taube,
  Anders Vinjar,
  Olivier Doare,
  Ville Koskinen,
  Andrew Burnson.


In terms of number of lines, the languages used in Snd/Sndlib are:
C, Scheme, Ruby, Forth, Emacs Lisp, Fortran, and Lua (altogether about 850k lines).


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

If you hit a bug, don't just sit there weeping -- send me
(bil@ccrma.stanford.edu) a description of it!  If it's something like
a segfault, you have gdb, and you can build Snd from the sources, it
would help me a lot if you could build it with the -g switch, then

gdb snd
run
<here do whatever it takes to get the bug>
where

The 'where' command should print out the current stack trace which
is extremely helpful to me in tracking down the problem.  It can also
be helpful to move to the first Snd-related function in the stack
(via the 'up' command), then type

info locals

This will print out the value of the local variables.  In most cases,
that's all I need to fix the bug immediately.  If Snd
appears to be hung, you can 

gdb snd
run
<now get it to hang, then type control-C to exit>
where



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

TROUBLES:

---- wayland ----

Currently in wayland you need to run snd:

GDK_BACKEND=x11 snd

Thanks to Kenneth Flak for this tip!


---- audio (a can of worms) ----

If nothing plays in Linux (try aplay for example), and the sound preferences
have no effect, look for the pulseaudio daemon, and kill it.

In OpenBSD, use pulseaudio:
 ./configure --with-gmp --with-pulseaudio CFLAGS=-ftrampolines LDFLAGS=-pthread


---- ALSA: ----

Only versions from 1.0 of ALSA are supported.

An addendum: in my system, I have a wretched sound card in my machine,
and an EMI 2|6 connected to a USB connector.  So the EMI device is "hw:1"
in Alsa terms, and since I never want to use the internal sound card,
I have this line in my ~/.cshrc file:

setenv MUS_ALSA_DEVICE "hw:1"

But this number seems to be set randomly at boot time!  And sometimes, Alsa
in its infinite wisdom mutes the playback device. So, now I
have these lines executing at startup:

amixer sset PCM,0 80% unmute
amixer sset Mic,0 80%

If you use 100% (meaning, give me full amplitude output), it's the same
as 0!!  

On a different machine, I use:

setenv MUS_ALSA_DEVICE "plughw:0"



If you get some complaint like

  ;Invalid argument: cannot set hardware parameters for default

try setting:

    (set! (mus-alsa-device) "plughw:0")

or

    (set! (mus-alsa-device) "plughw:1")

then try playing again.  The "default" device is always completely
broken.  



---- Motif: ----

Only Motif 2.n is supported.  Be sure to get the Motif development
package if you want to build Snd (you need the Motif headers).

On 64-bit machines, use motif 2.3.2 or later.

I think some of the newer Motif packages (like post-2012)
need both /usr/include/X11/extensions/Print.h and
/usr/include/X11/bitmaps/gray -- in the latter case I
sometimes have to create the bitmaps directory.
I can send copies of these files if needed.


---- Mac OSX: ---- 

Daniel Hensel sends these instructions to get Snd running with Motif:

Download and install XQuartz:
http://www.xquartz.org

Download and install XCode
open terminal:
install Command Line Tools by typing
xcode-select --install
 
Install Homebrew

And then: 

brew install gcc 
brew install ruby
brew install openmotif
brew install poppler
brew install gsl
brew install timidity
brew install wavpack
brew install wvunpack
brew install mpg123
brew install mpg321
brew install vorbis-tools
brew install flac
brew install fftw

This is new: 

brew install libxft
brew install libiconv 
brew install libpng
brew install fontconfig 
brew install freetype

cd to the snd folder and configure with

CFLAGS="-I/opt/homebrew/include" LDFLAGS="-L/opt/homebrew/lib" ./configure  --with-motif 

make and sudo make install

after that, I make an Apple script to make a Snd.app.
Open Scripteditor, make a new script and type,

tell application "Terminal"
	do script "/usr/local/bin/snd; exit"
end tell

Save as an App. Go to your Applications folder to Snd and 
get app information via Cmd+i and drag your Snd.png File into it.

--------
Daniel Hensel's instructions for a Mac M1 MacBook

I built Snd on Monterey like this:

./configure -prefix=/opt/snd-s7 CFLAGS="-target arm64-apple-macos11"  --with-s7 --with-motif --with-gsl

make 
sudo make install
sudo ln -s /opt/snd-s7/bin/snd /usr/local/bin/snd

after that, I make an Apple script to make a Snd.app.
Open Scripteditor, make a new script and type,

tell application "Terminal"
	do script "/usr/local/bin/snd; exit"
end tell

Save as an App. Go to your Applications folder to Snd and 
get app information via Cmd+i and drag your Snd.png File into it.


-------- FreeBSD 9.n --------

If the Snd compilation fails with complaints about the complex trig functions (ccosh etc),
here are some suggestions from Mike Scholz:


FBSD has CFLAGS=-fno-strict-aliasing as a default for base and ports. With 
GCC you can use: 

  % ./configure CFLAGS=-fno-strict-aliasing 

Or at least set -fno-builtin: 

  % ./configure CFLAGS=-fno-builtin 

Or use clang without the aforementioned flags: 

  % ./configure CC=clang 

There is also a port in /usr/ports/audio/snd with version 13.0 from August 
2012. 


-------- Debian --------

The last time I installed Debian (25-Jan-17) I installed the following
Snd-related packages by hand:
   libfftw3-3 libgsl2 libmotif-dev libxpm-dev libxt-dev libmpfr-dev libmpc-dev
   libgsl-dev libfftw3-dev libgl-dev libglu-dev libjack-dev ruby-dev libasound2-dev


-------- Fedora --------

and for Fedora Core 22:
  yum install gcc tcsh rxvt emacs fftw3 fftw3-devel
              alsa-lib alsa-lib-devel gsl gsl-devel gmp gmp-devel 
              mpfr mpfr-devel libmpc libmpc-devel ruby ruby-devel motif 
              motif-devel libXpm-devel mesa-libGLU-devel