File: snd.html

package info (click to toggle)
snd 3.4-4
  • links: PTS
  • area: main
  • in suites: potato
  • size: 5,148 kB
  • ctags: 12,594
  • sloc: ansic: 86,516; lisp: 3,480; sh: 1,507; makefile: 119
file content (2299 lines) | stat: -rw-r--r-- 133,820 bytes parent folder | download
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
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
<html>
<head><title>Snd</title></head>
<body bgcolor="#ffffff">
<center>
<img src="s.gif" alt="S"><img src="n.gif" alt="n"><img src="d.gif" alt="d">
</center>
<br><br>
<center>Bill Schottstaedt (bil@ccrma.stanford.edu)</center>
<br><br>

<!-- indexing entries are of the form I(action):M|L|O|K|A(name)(optional href) -->
<!-- A=index name, M=menu, L=lisp, O=other, K=keyboard -->
<!-- these are then gathered into the reference table at the end by snd-index.cl -->

<center><img src="title.gif" alt="picture of Snd window"></center>


<br>
<hr>

<p><a name="overview"><b>Snd</b></a> is a sound editor modelled loosely after Emacs and an old,
sorely-missed PDP-10 sound editor named Dpysnd. It can accomodate any
number of sounds at once, each with any number of channels. Each
channel is normally displayed in its own window, with its own cursor,
edit history, and marks; each sound has a 'control panel' to try out
various changes quickly, and an expression parser, used mainly during
searches; there is an overall stack of 'regions' that can be browsed
and edited; channels and sounds can be grouped together during
editing; edits can be undone and redone without restriction; Snd can
be customized and extended using C plugins, or Gnu <a href="http://www.red-bean.com/guile">Guile</a>;
and it's free; the code is available via anonymous ftp
from ccrma-ftp.stanford.edu as pub/Lisp/snd.tar.gz.</p>

<br>
<hr>

<h2>Contents</h2>
<dl>
<dt><a href="#gettingstarted">Getting Started</a>

<dt><a href="#fileoperations">File Operations</a>
<dd><a href="#viewing">The Display</a>
<dd><a href="#options">Other Options</a>
<dt><a href="#editoperations">Editing</a>
<dd><a href="#thecursor">The Active Channel and The Cursor</a>
<dd><a href="#marks">Marks</a>
<dd><a href="#regions">Regions</a>
<dd><a href="#edithistory">The Edit List</a>
<dd><a href="#howtoedit">How to ...</a>
<dd><a href="#keyboardcommands">Keyboard Commands</a>
<dt><a href="#controls">The  Control Panel</a>
<dt><a href="extsnd.html#customization">Customization and Extension</a>
<dd><a href="extsnd.html#sndconstants">Constants</a>
<dd><a href="extsnd.html#sndvariables">Variables</a>
<dd><a href="extsnd.html#sndfunctions">Functions</a>
<dd><a href="extsnd.html#sndinitfile">The initialization file</a>
<dd><a href="extsnd.html#sndexamples">Examples</a>
<dt><a href="extsnd.html#sndresources">Snd Resources</a>
<dt><a href="extsnd.html#snddynamic">Runtime modules, plug-ins, external programs</a>
<dd><a href="extsnd.html#dynamic">Dynamically loaded modules</a>
<dd><a href="extsnd.html#plugins">Plug-ins</a>
<dd><a href="extsnd.html#programs">External Programs</a>
<dt><a href="extsnd.html#sndaswidget">Snd as a Widget</a>
<dt><a href="#index">Index</a>
</dl>
<hr>
        <!-- I(examine regions):A(regions) --><!-- I(control panel):A(controls) -->
        <!-- I(move cursor ahead):A(thecursor) --><!-- I(move cursor back):A(thecursor) -->
        <!-- I(define mark):A(marks) -->

<h2><a name="gettingstarted">Getting Started</a></h2>
<p>Once compiled and loaded (see README.Snd for instructions), fire Snd up with</p>
<pre>
  snd some.snd
</pre>
<p>where "some.snd" is any available sound file.  You should
get a window with the first .1 seconds of the sound displayed as a time
domain waveform. Click the file name at the lower left to get 
some information about the file.<a name="fw"></a> Click the "f" button, and an fft window
appears alongside the waveform.  Drag the upper scale at the
bottom of the graph and both graphs are updated as you move
through the file.  Drag the lower scale to zoom in or out.
Drag the outer scale (the wider one) on the left to zoom
the y axis in or out.  The inner scale 
moves the y axis up and down; its main use is to
move the waveform out of the way of a mix console.  
Click the "w" button (to unset the button) and
the time domain waveform goes away.  Click "play" to
play the file.  "sync" is more complicated -- it is used
to group sounds together for simultaneous editing.</p>

<p>Now return to the time domain form (click "w" and "f"),
and click on the graph itself.  A red cursor (a big "+")
appears at that point.  The cursor is exactly like an
Emacs cursor -- you can delete the sample at the cursor,
for example, by typing control D (abbreviated in this
document C-d), or move back one sample with C-b.
<a name="clickforhelp"></a>To see all the cursor-related
commands, go to the "Help" Menu, and choose "Click for
Help".  The cursor becomes a question mark.  Move the
cursor to the graph portion of the window and click,
and a help window pops up, telling all about it.  You
can use the same sequence to get help for anything in
the Snd window, even the vertical bar after the file name.</p>

Now click and drag the mouse through some portion of
the graph -- the portion dragged is highlighted in
some way.  When you release the mouse button, the
highlighted portion is 'selected' -- it becomes a
'region' that can be deleted, pasted elsewhere
(move the mouse and click the middle button), 
played, and operated on in many ways.  You'll
notice if you make some change to the data that
the file name gets an asterisk, as in Emacs, and
the various 'undo' and 'redo' menu options come
to life.  Just for laughs, cut the selection, then click the right mouse
button to get the popup menu, and try Undo followed
by Redo.  

<p>Next type C-m -- this sets a
mark at the current cursor location.  C-a goes
to the start of the window; C-j jumps forward to the
nearest mark.  Click and drag the upper horizontal
mark portion to move the mark; click the triangular
lower portion to play from the mark.  Drag the triangular
portion to play the data following the mouse.</p>

<p>Finally, go to the View menu and select 'Show controls'.
A new portion of the Snd window is opened, containing
a number of controls.  Try goofing around with them
while playing the sound.  For the more complex
cases, the button on the right side turns the
option on or off.  The sequence of changes you
make while playing can be remembered (the 'Record'
button), replayed ('Replay') or applied to the
data as a kind of giant editing operation ('Apply').</p>
        <!-- I(show freq domain):A(fw) --><!-- I(show time domain):A(fw) -->
        <!-- I(show freq domain):O('f' button)(fw) --><!-- I(show time domain):O('w' button)(fw) -->
<hr>

<h2><a name="fileoperations">File Operations</a></h2>
<pre>
  File Menu

    <a href="#openfile">Open</a>:    open a new file                                   (C-x C-f) 
    <a href="#closefile">Close</a>:   close a file, flush any unsaved edits             (C-x k)  
    <a href="#savefile">Save</a>:    save current edits, overwriting previous version  (C-x C-s) 
    <a href="#savefileas">Save as</a>: save current edits under a new name, stay in current file
    <a href="#revertfile">Revert</a>:  flush edits
    <a href="#updatefile">Update</a>:  re-read file (data changed behind Snd's back)
    <a href="#viewfile">View</a>:    open file read-only
    <a href="#mixingfiles">Mix</a>:     mix file
    <a href="#newfile">New</a>:     create a new, empty file
    <a href="#recordfile">Record</a>:  record sound producing a new file
    <a href="#printfile">Print</a>:   produce a Postscript version of current display
    <a href="#exitfile">Exit</a>:    leave Snd, flushing all pending edits
</pre>

        <!-- I(open file):M(File: Open)(openfile) --><!-- I(close file):M(File: Close)(closefile) -->
        <!-- I(save file):M(File: Save)(savefile) --><!-- I(save file):O(Popup: Save) -->
        <!-- I(save file as):M(File: Save as)(savefileas) --><!-- I(save file as):O(see also overwriteCheck)(overwrite) -->
        <!-- I(revert file):M(File: Revert)(revertfile) --><!-- I(open file read-only):M(File: View)(viewfile) -->
        <!-- I(create new file):M(File: New)(newfile) --><!-- I(create new file):A(newfile) -->
        <!-- I(print file):M(File: Print)(printfile) --><!-- I(exit Snd):M(File: Exit)(exitfile) -->
        <!-- I(file formats):M(File: Save as)(savefileas) --><!-- I(exit Snd):O(window menu: close or exit) -->
        <!-- I(update file):M(File: Update)(updatefile) --><!-- I(update file):K([Home]) --><!-- I(update file):A(updatefile) -->
	<!-- I(update file):O(corruption-time, auto-update)(corruptiontime) -->
        <!-- I(mix file):M(File: Mix)(mixingfiles) --> <!-- I(mix file):A(mixingfiles) -->
        <!-- I(record sound):M(File: Record)(recordfile) --> <!-- I(record sound):A(recordfile) -->
        <!-- I(change format):M(File: Save as)(savefileas) -->

<p>Snd operates on sound files.  When invoked, Snd scans
its arguments for file names, and opens any it finds.</p>
<pre>
  snd oboe.snd fyow.snd
</pre>
<p>If there are no arguments, Snd comes up as a bare menu bar.
If a name is preceded by <a name="minusp">"-p"</a> or "-preload", it is treated as a directory
name and all sound files found in that directory are preloaded
into the <a href="#prevfiles">previous files</a> list.  To
load arbitrary Snd customizations (scheme code, or a <a href="#savedstate">saved state</a> file for example)
precede the file name with <a name="minusl">"-l"</a> or "-load". </p>
<pre>
  snd oboe.snd -l examp.scm
</pre>
<p>opens the sound file oboe.snd and loads the Guile/Scheme code in examp.scm.</p>

        <!-- I(preload directory):O(-p switch to Snd)(minusp) --><!-- I(preload directory):A(minusp) -->
        <!-- I(continue session):O(-l switch to Snd)(minusl) -->

<blockquote><blockquote>
<p><font size="2">
Each sound file in the argument list can include start up
information about the size and location of the
initial waveform display:  <code>snd oboe.snd -s "0.0,0.25,0.75,0.3"</code>.
The flag <a name="minuss">"-s"</a> introduces the size information,
followed by a string containing the values of
the x position, y position, x zoom, and y zoom
scrollbars.  </font></p>
</blockquote></blockquote>
        <!-- I(axis bounds):O(-s switch to Snd)(minuss) -->

<p>Normally Snd adds each new sound below those currently being
displayed.
<a name="verticalpane"></a>
To position sounds horizontally (adding on the right), use the "-h" (or "-horizontal") flag,
or the <a href="extsnd.html#horizontalpanes">horizontalPanes</a> resource.
(This only works on systems with Motif 2.0 or later).  Other overall layout
choices include the Notebook widget (horizontalPanes: 2, -notebook), an outer scroller
widget (horizontalPanes: 3, or -scroller), and separate windows for each sound (-separate).  
These special choices need to be set either
in the resource file, or in the invocation line.
</p>
<!-- I(horizontal panes):O(-h switch to Snd)(verticalpane) --><!-- I(horizontal panes):A(verticalpane) -->

<a name="openfile"></a>
<p>A file can be opened from the File menu via Open
or View.  <a name="viewfile">View</a> opens the file read-only, whereas Open
<!-- I(open file read-only):A(viewfile) -->
will allow it to be changed.  The equivalent keyboard
command is C-x C-f.  You can also drag a sound file's
icon and drop it on top of the Snd icon or the Snd menubar.
If a file cannot be written (either it was opened read-only
or you don't have write permission on it), a lock appears
next to the file name.  <a name="updatefile"></a>Similarly, if Snd notices that
the file on the disk no longer matches the original,
a bomb appears (this can happen if some other program
writes a sound while you are editing an earlier version
of it; see also <a href="#overwrite">overwrite-check</a> and <a href="extsnd.html#corruptiontime">corruption-time</a>).
If the variable <a href="extsnd.html#autoupdate">auto-update</a> is 1 (default is 0), Snd
automatically updates any such file (this is also useful if
you're editing the same file in two separate panes).
</p>

<a name="soundsonlybutton"></a><p>In the file selection dialog, there's a button marked
'Sound files only'.  This can be set by default (see
<a href="#customization">Customization</a>).  If it is set, only files that appear
to be sound files are included in the directory listing.
Currently Snd uses the file extension to decide whether
it is a sound file -- the initial extensions are
snd, wav, aiff, aif, au, aifc, voc, and wve. To add
an extension to this list, use <a href="extsnd.html#addsoundfileextension">add-sound-file-extension</a>.
</p>
<a name="formats"></a>
<p>Snd can handle the following file and data types:</p>
<dl>
<dt>read/write (many data formats):       
<dd>NeXT/Sun/DEC/AFsp
<dd>AIFF/AIFC
<dd>RIFF (Microsoft wave)
<dd>IRCAM (old style)
<dd>NIST-sphere
<dd>no header
<dd> ----
<dt>read-only (in selected data formats):
<dd>8SVX (IFF), IRCAM Vax float, EBICSF, INRS, ESPS, 
<dd>SPPACK, ADC (OGI), AVR, VOC,
<dd>Sound Tools, Turtle Beach SMP, SoundFont 2.0, 
<dd>Sound Designer I and II, PSION, MAUD, Kurzweil 2000,
<dd>Tandy DeskMate, Gravis Ultrasound, ASF,
<dd>Comdisco SPW, Goldwave sample, omf, quicktime
<dd>Sonic Foundry, SBStudio II, Delusion digital, 
<dd>Digiplayer ST3, Farandole Composer WaveSample,
<dd>Ultratracker WaveSample, Sample Dump exchange, 
<dd>Yamaha SY85, SY99, and TX16, Covox v8, SPL, AVI, 
<dd> ----
<dt>automatically translated to Sun 16-bit, then read/write:
<dd>IEEE text, Mus10 SAM 16-bit (modes 1 and 4), IBM CVSD, AVI
<dd>NIST shortpack, HCOM, Intel and Oki (Dialogic) ADPCM, MIDI sample dump
<dd>G721, G723_24, G723_40, IFF Fibonacci and Exponential
</dl>
        <!-- I(file formats):A(formats) --><!-- I(file formats):O(defaultOutputType)(Xdefaultoutputtype) -->

<p>'Linear' here means 2's complement integer.
The files can have any number of channels.
Data can be either big or little endian.
The default
output type is settable as the <a name="Xdefaultoutputtype">defaultOutputType</a>
resource.  A raw data file gets its srate, chans,
and data format information either from the variables
<a href="extsnd.html#rawsrate">raw-srate</a> and friends (if raw-defaults == 1), or
from a dialog window that pops up when such a file
is opened. The files listed as "automatically translated" are
decoded upon being opened, rewritten in Sun 16-bit format
to a new file with an added (possibly redundant) extension .snd,
and that form is the one the editor sees from then on.
</p>

<p><a name="panelayout"></a>Each file has its own
'pane', a horizontal section of the overall Snd
screen space; within that section, each channel
has a pane, and below the channels is the 'control
pane', normally hidden except for the file name
and 'minibuffer'.  At the very bottom (or far right)
of the Snd window is the lisp listener, if any (see
the View menu "Open listener" option).
The panes can all be independently
raised and lowered by dragging the pane buttons on
the right.  The channel that is currently active
(receiving keyboard commands) has a thin black border
around the display portion. Each channel has the 
four scrollbars setting what portion of the data
is displayed; the 'w' button (normally set) which
causes the time domain waveform to be displayed;
and the 'f' button (normally unset) which includes
the frequency domain (FFT) display.
There is a third display settable by user-provided
functions; if both the 'w' and 'f' buttons are
off and there is no active user-display function,
you get an empty display.  <a name="panecontrol">For</a> each sound there is
a control panel containing the file name, in parentheses if
the file is actually a link, with an
asterisk if there are unsaved edits, a 'minibuffer'
for various kinds of text-based interactions,
a 'sync' button for grouped display and edit
operations, a 'unite' button (if the sound has more than one channel),
and a 'play' button to play the
current (edited) state of the file.  Any number
of files can be played at the same time.  The 
rest of the control panel modifies how the file
is played.
</p>
        <!-- I(control panel):O(drag pane sash)(panecontrol) -->

<a name="newfile"></a><p>To open a new, empty file, use the New option.</p>

<a name="closefile"></a><p>To close a file (flushing any unsaved edits), use
the File menu Close option, or C-x k.  This command
applies to the file that contains the active channel,
or the top file in the display.</p>

<a name="savefile"></a><p>To save the current edited state of a file, use the
Save option (to overwrite the old version of the
file), or <a name="savefileas">Save as</a> (to write to a new file, leaving
the old file unchanged).  The equivalent keyboard
command is C-x C-s (save).  Other related keyboard
commands are C-x w (save selection as file), and
<a name="cxcw">C-x C-w</a> (extract and save the current channel as a file).
Normally, if the new file already exists, and it is
not currently being edited in Snd, it is silently
overwritten.  If you try to overwrite a file, and
that file has active edits in a different Snd window, you'll be asked
for confirmation.
If you want Snd to ask before overwriting
a file in any case, set the resource <a name="overwrite">overwriteCheck</a> to 1,
or include the expression (<a href="extsnd.html#askbeforeoverwrite">set-ask-before-overwrite</a> 1) in your Snd initialization file.
        <!-- I(overwrite check):L(ask-before-overwrite)(overwrite) -->
If you edit a write-protected file and try to save the edits, Snd will
try to save the edits in a temporary file and will post a warning
that the current file could not be edited.  A similar sequence can
occur when opening a file on a write-protected directory where the sound file uses some compression
scheme that Snd wants to translate before editing.
</p>

<a name="revertfile"></a><p>To undo all edits and return to the last saved state
of a file, use the Revert option.  The edit history
is still available, so you can redo all the edits
in order simply by calling <a href="#undoredo">Redo</a> repeatedly.</p>

<a name="printfile"></a><p>The Print option fires up the Print
dialog.  You can send the currently active graph directly to
a printer, or save it as an "encapsulated Postscript"
file.  The default name
of this file is "snd.eps"; the resource that overrides
this default is named 'epsFile'.
</p>

<p>To mix files, see <a href="#mixingfiles">"Mix Files"</a>.
To record a file, see <a href="#recordfile">"Record Files"</a>.</p>

<a name="exitfile"></a><p>Finally, to exit Snd cleanly (that is, removing any
temporary files, and cleaning up some system stuff),
use the Exit option.  Unsaved edits are silently
flushed.</p>
        <!-- I(close file):K(C-x k)(cxk) --><!-- I(close file):A(closefile) --><!-- I(save file):A(savefile) --><!-- I(exit Snd):A(exitfile) -->
        <!-- I(save file):K(C-x C-s)(cxcs) --><!-- I(save selection):K(C-x w)(cxw) --><!-- I(save channel):K(C-x C-w)(cxcw) -->
	<!-- I(extract channel):K(C-x C-w)(cxcw) --><!-- I(extract channel):A(cxcw) -->
        <!-- I(save channel):A(cxcw) --><!-- I(overwrite check):O(overwriteCheck)(overwrite) -->
        <!-- I(overwrite check):A(overwrite) --><!-- I(revert file):A(revertfile) --><!-- I(print file):A(printfile) -->
<hr>

<h3><a name="viewing">The Display</a></h3>
<pre>
  View Menu

    <a href="#controls">Show controls</a>:    show/hide the control panel    (C-x C-o, C-x C-c)
    <a href="#viewnormalize">Normalize</a>:        cleanup current Snd display
    <a href="extsnd.html#lisplistener">Open listener</a>:    show/hide lisp listener
    <a href="#unitebutton">Channel style</a>:    separate, combined or superimposed channels
    <a href="#viewdots">Graph style</a>:      use dots, lines, or filled polygons in the data displays
    <a href="extsnd.html#verbosecursor">Verbose cursor</a>:   describe the current sample every time the cursor moves
    <a href="#regionbrowser">Regions</a>:          a browser to examine the region stack
    <a href="#prevfiles">Files</a>:            a browser of currently and previously loaded files
    <a href="#colorbrowser">Color</a>:            a browser that chooses color maps
    <a href="#orientationbrowser">Orientation</a>:      a browser that sets spectrogram and wavogram orientation
    <a href="#groups">Groups</a>:           group editor (tracks for mixing)
    <a href="#marks">Show marks</a>:       show or hide current marks
    <a href="extsnd.html#showaxes">Hide axes</a>:        show or hide the x and y axes
    <a href="#viewy0">Show y=0</a>:         show or hide the y=0 line
    <a href="extsnd.html#xaxisstyle">X axis units</a>:     x axis labelled in seconds, samples, percent of total
    <a href="#errorhistory">Error History</a>:    saved error messages
</pre>
        <!-- I(control panel):M(View: Show controls)(controls) --><!-- I(control panel):K(C-x C-o, C-x C-c)(cxco) -->
        <!-- I(normalize display):M(View: Normalize)(viewnormalize) --><!-- I(normalize display):A(viewnormalize) -->
        <!-- I(normalize display):O(Popup: Normalize) --><!-- I(combine channels):M(View: Channel style)(unitebutton) -->
        <!-- I(combine channels):A(unitebutton) --><!-- I(describe file):M(Popup: Info)(viewinfo) -->
        <!-- I(describe file):A(viewinfo) --><!-- I(describe file):O(Edit: Edit Header)(viewinfo) -->
        <!-- I(dots or lines):M(View: Dots)(viewdots) --><!-- I(dots or lines):O(dot-size: numberpad '.', '0')(dotsize) -->
        <!-- I(show marks):M(View: Show marks)(marks) --><!-- I(show marks):A(marks) -->
        <!-- I(y=0 line):M(View: Show y=0)(viewy0) --><!-- I(describe sample):M(View: Verbose cursor)(verbosecursor) -->
        <!-- I(describe sample):L(set-verbose-cursor)(verbosecursor) --><!-- I(describe sample):A(verbosecursor) -->
        <!-- I(examine regions):M(View: Regions)(regionbrowser) --><!-- I(color):M(View: Color)(colorbrowser) -->
        <!-- I(orientation):M(View: Orientation)(orientationbrowser) -->
        <!-- I(file lists):M(View: Files)(prevfiles) -->
        <!-- I(X axis units):M(View: X axis units)(xaxisstyle) --><!-- I(X axis units):A(xaxisstyle) -->

<p>The file display can be modified in various ways.  <a name="viewdots"></a>To use
dots rather than connected lines, use the Dots option in
the View menu's Graph style option (see also <a href="extsnd.html#dotsize">set-dot-size</a>).  <a name="viewy0"></a>Similarly, to show (or hide) the line
Y = 0, use the y=0 option.  The Region browser is described under
<a href="#regions">Regions</a>.  To open the control panel, use Show Controls.
Similarly, to open or close the lisp listener panel, use Open listener.
You can also drag the associated pane button.  When
many files are displayed, and the pane buttons have
been in use, the overall display can become a bit of
a mess.  <a name="viewnormalize"></a>To return to a state where each file and channel
has a 'normal' amount of space, use the Normalize option.
</p>
        <!-- I(dots or lines):A(viewdots) --><!-- I(y=0 line):A(viewy0) -->

<p>The <a name="colorbrowser">Color</a> and 
<a name="orientationbrowser">Orientation</a>
options activate windows that set various aspects of the sonogram, spectrogram,
and wavogram displays.  There are eight or nine colormaps available along with
ways to invert the maps, and scale (darken) them differently according to screen or
printer characteristics.  And the graphs themselves can be rotated and resized.
The color variable default settings produce good output on the SGI but
looks cluttered on some Linuces -- you may have to play around with the
lightness scaler and so on to find reasonable values for your system.
</p>
        <!-- I(color):A(colorbrowser) --><!-- I(orientation):A(colorbrowser) -->

<p>The <a name="viewinfo">Popup menu's Info</a> dialog can be left in view and updated with M-v i
to reflect the currently active sound.  Except for the header comment, the same information is displayed in the
minibuffer when you click the file name.</p>

<p>The <a href="#prevfiles">Files</a> option fires up the file browser:</p>
<img src="files.gif" alt="picture of file browser"><br><br>
<p>The file browser window shown above provides two lists, one of
the currently active files in Snd, and
the other of <a name="prevfiles">previously active files</a>.  The currently selected
sound is highlighted.
The save button saves current edits, if any; the
play button plays the file; and the
unlist button removes a file from the
previous files list. 
Click a current file name, and
that sound becomes the selected sound in the main
Snd window.  <a name="Oopen">Click</a> a previous file name, and 
that file is opened in Snd.
The 'update' button runs through the previous files
list checking for files that have been deleted or moved behind Snd's back.
'Clear' clears the previous files list. The previous
files list can be preloaded via the -p switch to Snd, and the extended commands <a name="preload">preload</a>
and <a name="preload-file-browser">preload-file-browser</a>.
By preloading your "working set" of sounds, you can save
the bother of picking them up one by one from the
clumsy file selection box.
</p>
<p>The <a name="errorhistory">Error History</a> option displays whatever errors have been
posted during the current run of Snd.  If some error gets erased too quickly from the
'minibuffer', you can recover it in this dialog.</p>
        <!-- I(file lists):A(prevfiles) --><!-- I(play file):M(Popup: Play) -->
        <!-- I(play file):O(File or main window: 'play') --><!-- I(select sound):O(File dialog: click file) -->
        <!-- I(select sound):A(prevfiles) --><!-- I(open file):O(Files dialog: click file) -->

<p>The <a href="#regionbrowser">Regions</a> option is described below.</p>
<hr>

<h3><a name="options">Other Options</a></h3>
<pre>
  Options Menu

    <a href="#viewfft">Transform options</a>: various transform choices
    <a href="extsnd.html#lspeedstyle">Speed style</a>:       control panel speed scrollbar interpretation
    <a href="#zoomoption">Zoom style</a>:        where to focus during zooms
    <a href="#saveoptions">Save options</a>:      save current state of options
    <a href="#savedstate">Save state</a>:        save current state
    <a href="extsnd.html#showusagestats">Show stats</a>:        show disk and memory usage 
</pre>
        <!-- I(fft size):M(Options: Transform)(fftsize) --><!-- I(fft size):O(fft-size: numberpad: '*', '/')(lfftsize) -->
        <!-- I(fft size):A(fftsize) --><!-- I(fft peaks):M(Options: Transform)(showpeaks) -->
	<!-- I(fft normalization):M(Options: Transform)(normalizefft) -->
        <!-- I(fft peaks):A(showpeaks) --><!-- I(fft log freq):M(Options: Transform)(logfreq) -->
        <!-- I(fft log freq):A(logfreq) --><!-- I(fft in dB):M(Options: Transform)(fftindb) -->
        <!-- I(fft in dB):A(fftindb) --><!-- I(fft/sono/spectrogram):M(Options: Transform)(lfftstyle) -->
        <!-- I(sonogram):M(Options: Transform)(fftstyle) --><!-- I(sonogram):O(colormap)(colormap) -->
        <!-- I(spectrogram):M(Options: Transform)(fftstyle) --><!-- I(spectrogram):O(orientation, scaling)(spectrocutoff) -->
        <!-- I(fft/sono/spectrogram):A(fftstyle) --><!-- I(sonogram):A(fftstyle) -->
        <!-- I(spectrogram):A(fftstyle) --><!-- I(fft window):M(Options: Transform)(fftwindow) -->
        <!-- I(fft window):A(fftwindow) --><!-- I(fft window parameter):M(Options: Transform)(Xfftbeta) -->
        <!-- I(fft window parameter):A(Xfftbeta) --><!-- I(zoom focus):M(Options: Zoom style)(zoomoption) -->
	<!-- I(save options):M(Options: Save options)(saveoptions) -->
        <!-- I(save state):M(Options: Save State)(savedstate) --><!-- I(speed units):M(Options: Speed style)(lspeedstyle) -->
        <!-- I(speed units):A(lspeedstyle) -->
	<!-- I(wavelets):A(transformtype) --><!-- I(wavelets):M(Options: Transform)(transformtype) -->

<a name="viewfft"></a><p>The Options menu sets various preferences.
The Transform Options menu applies mainly to the FFT display triggered
by setting the 'f' button in the channel window.  The dialog that is
launched by this menu item has six sections: on the upper left
is a list of available transform types; next on the right is a
list of fft sizes; next is a panel of buttons that sets various
display-oriented choices; the lower left panel sets the current
wavelet, when relevant; <a name="fftwindow">next</a> is the fft data window choice; and
next to it is a graph of the current fft window; <a name="Xfftbeta">when</a> the window
has an associated parameter (sometimes known as "alpha" or "beta"),
the slider beneath the window list is highlighted and can be used
to choose the desired member of that family of windows.</p>

<p>The FFT is taken from the start (the left edge) of the
current window and is updated as the window bounds change.
If you'd like the fft size to reflect the current time domain
window size:<p>
<pre>
(add-hook! <a href="extsnd.html#graphhook">graph-hook</a>
	   (lambda (snd chn y0 y1)
	     (if (and (ffting) (= (fft-style) normal-fft))
		 (<a href="extsnd.html#lfftsize">set-fft-size</a>
		  (expt 2 (ceiling (/ (log (- (right-sample) (left-sample))) 
				      (log 2.0))))))))
</pre>
<p>
The fft data is scaled to fit between 0.0 and 1.0 unless
the fft normalization is off. 
The full frequency axis is normally displayed, but the
axis is "dragable" -- put the mouse on the axis and
drag it either way to change the range (this is equivalent
to changing the variable spectro-cutoff).  You can also click
on any point in the fft to get the associated fft data
displayed; if verbose-cursor is on, you can
drag the mouse through the fft display and the
description in the minibuffer will be constantly
updated.
</p>

<a name="transformtype"></a><p>The harmonic analysis function is
normally the Fourier Transform, but others are available, including
about 20 wavelet choices, and <a name="autocorrelation">autocorrelation</a>.</p>

	<!-- I(autocorrelation):A(autocorrelation) --><!-- I(autocorrelation):M(Options: Transform)(viewfft) -->
	<!-- I(autocorrelation):O(examp.scm) -->

<a name="fftstyle"></a><p>The top three buttons in the transform dialog choose between a normal
fft, a sonogram, or a spectrogram.  The <a name="showpeaks">"peaks"</a>
button affects whether peak info is displayed alongside the graph
of the spectrum.  The <a name="fftindb">"dB"</a> button selects between
a linear and logarithmic Y (magnitude) axis.  The <a name="logfreq">"log freq"</a>
button makes a similar choice along the frequency axis.
</p>

<p>The easiest way to change the colormap and graph orientation
of the spectrogram, wavogram, and sonogram, is to use the Color and Orientation 
dialogs from the View menu.
You can also use the numeric keypad, or Lisp expressions.
The keypad keys are mapped to various variables as follows:</p>
<pre>
    variable         increase           decrease
  spectro-cutoff    PageUp (9)          PageDown (3)
  spectro-hop       Add (+)             Subtract (-)
  spectro-z-angle   RightArrow (6)      LeftArrow (4)
  spectro-x-angle   Ctrl-UpArrow (8)    Ctrl-DownArrow (2)
  spectro-y-angle   Ctrl-RightArrow (6) Ctrl-LeftArrow (4)
  spectro-z-scale   UpArrow (8)         DownArrow (2)
  fft-size          Multiply (*)        Divide (/)
  dot-size          Delete (.)          Insert (0)
</pre>
<p>You can rotate the spectrogram around the various axes
by holding down the keypad and control keys.  You can get
arbitrarily small or large ffts with the Multiply and
Divide keys.  The x and y axis scalers are named
spectro-x-scale and spectro-y-scale.
The keypad Enter key resets all the
spectrogram variables to their default values.
(In Linux, use the corresponding numbered keys --
add shift to the key sequences given above).
See also the Color and Orientation menu options
in the View menu.
</p>
<img src="hfft.gif" alt="picture of sonogram">
<br><br>

<a name="fftsize"></a><p>If the choice of sizes in the fft size list
doesn't include the one you want, you can get
arbitrarily small or large ffts with the Multiply and
Divide keys.  
The keypad Enter key resets all the
spectrogram variables to their default values.
See also the <a href="extsnd.html#lfftsize">fft-size</a> variable.
To interrupt a long transform-related computation,
deactivate the 'f' button.
</p>

<p>A somewhat frivolous feature, known to Snd as the
<a name="wavogram">"wavogram"</a>, mimics the spectrogram in the time domain.
The same rotation commands apply to this display,
with the additional variable <a href="extsnd.html#wavohop">wavo-hop</a> which sets the
density of the traces.  To get this display <code>M-x (set-wavo 1)</code>.  It is
important in this case to get the length of each trace
correct so successive peaks more or less line up.  The
trace length in samples is set by the variable wavo-trace,
or the numeric keypad + and - keys.
</p>
        <!-- I(wavogram):A(wavogram) --><!-- I(wavogram):L(wavo)(wavogram) --><!-- I(wavogram):O(wavo-trace, wavo-hop)(wavohop) -->

<a name="saveoptions"></a><p>The Save options menu option is best explained as a part
of the <a href="#customization">customization</a> process described below.  It basically
sets up (or adds to) an <a href="extsnd.html#sndinitfile">initialization file</a> for Snd that sets all
the options to their current settings; 
this is intended to be similar to a .emacs file (its default name is .snd).
</p>

<a name="zoomoption"></a><p>The Zoom style option determines the graph point that tries to
remain stable in the display during an x-axis zoom.
The default is to zoom onto the cursor or the beginning of the current
selection if either is visible.  You can also have
zoom focus on the left edge, right edge, or
midpoint of the current window.</p>
        <!-- I(save options):A(saveoptions) --><!-- I(zoom focus):A(zoomoption) -->
<hr>

<h2><a name="editoperations">Edit Operations</a></h2>
<pre>
  Edit Menu
    <a href="#undoredo">Undo</a>:              Undo last edit                  (C-x C-u or C-_)
    <a href="#undoredo">Redo</a>:              Redo last edit                  (C-x C-r)
    <a href="#find">Find</a>:              Global search via find dialog   (C-s, C-r)
    <a href="#editcut">Cut</a>:               Cut (delete) selected portion
    <a href="#editcut">Paste</a>:             Paste (insert) selected portion (C-y, C-x i)
    <a href="#editcut">Mix selection</a>:     Mix (add) selected portion      (C-x q)
    <a href="#cxp">Play selection</a>:    Play selected portion           (C-x p)
    <a href="#cxw">Save selection</a>:    Save selected portion as file   (C-x w)
    <a href="#selectall">Select all</a>:        select entire file (following sync state)
    <a href="#editenvelope">Edit Envelope</a>:     Edit or view envelopes
    <a href="#editheader">Edit Header</a>:       Edit or view file header
</pre>
        <!-- I(undo edit):M(Edit: Undo)(undoredo) --><!-- I(undo edit):K(C-_ or C-x C-u)(cxcu) --><!-- I(undo edit):O(Popup: Undo) -->
        <!-- I(redo edit):M(Edit: Redo)(undoredo) --><!-- I(redo edit):K(C-x C-r)(cxcr) --><!-- I(redo edit):O(Popup: Redo) -->
        <!-- I(find):M(Edit: Find)(find) --><!-- I(find):K(C-s or C-r)(cs) --><!-- I(cut selection):M(Edit: Cut)(editcut) -->
	<!-- I(find):L(find)(lfind) --><!-- I(find):O(count-matches)(lcountmatches) -->
        <!-- I(cut selection):A(editoperations) --><!-- I(delete samples):M(Edit: Cut)(editcut) --><!-- I(delete samples):A(editoperations) -->
        <!-- I(insert selection):M(Edit: Paste)(editcut) --><!-- I(insert selection):K(C-y or C-x i)(cxi) --><!-- I(insert selection):A(editcut) -->
        <!-- I(mix selection):M(Edit: Mix)(editcut) --><!-- I(mix selection):K(C-x q)(cxq) --><!-- I(mix selection):A(editcut) -->
        <!-- I(play selection):M(Edit: Play)(cxp) --><!-- I(play selection):K(C-x p)(cxp) --><!-- I(play selection):A(cxp) -->
        <!-- I(save selection):M(Edit: Save selection)(cxw) --><!-- I(save selection):A(cxw) -->
	<!-- I(edit header):M(Edit: Edit Header)(editheader) --><!-- I(edit header):A(editheader) -->

<p>Editing in Snd is modelled after Emacs in many regards.  Each
channel has a cursor (a big "+"), a set of marks, and a list of
edits that have not yet been saved.  Most operations take place
at the cursor.  Operations can be applied simultaneously to
any other channels or sounds by using the 'sync' button.  And
as in Emacs, there is a notion of a region ('selection'), and
a list of saved regions.  Operations can be applied
either to a sample, a region, a channel, a file, or any number of
files at the same time.  Where an operation has an obvious
analog in text editing, I've tried to use the associated Emacs command.
To delete the sample at the cursor, for example, use C-d.</p>

<p>The following sections describe how to move the cursor and
the window; how to change which channel is active; 
how to use marks and regions; how to perform various 
common editing operations. It ends with a description of
all the mouse and keyboard editing commands.  The 'control
panel' provides more complex editing operations, but
has a chapter to itself.</p>

<h3><a name="thecursor">The Active Channel and The Cursor</a></h3>

<h4>The Active Channel</h4>

<p>The cursor (and its associated channel) is activated by clicking on the time domain waveform.
The active channel normally has a dark
edge around the graphics portion, as a sort of highlight.
It is the window that receives keyboard commands.  You can
also move between windows with <a name="cxo">C-x o</a> (forwards or backwards).</p>
        <!-- I(select sound):K(C-x o)(cxo) -->

<h4>Moving the Cursor</h4>

<a name="movecursor"></a>
<p>Any mouse click on the waveform causes the cursor to move to that point.
To move the cursor from the keyboard, use:</p>
<pre>
  &lt;      move cursor to sample 0
  &gt;      move cursor to last sample
  C-&lt;    move cursor to sample 0
  C-&gt;    move cursor to last sample

  <a name="ca">C-a</a>    move cursor to window start
  <a name="ce">C-e</a>    move cursor to window end
  <a name="cb">C-b</a>    move cursor back one sample
  <a name="cf">C-f</a>    move cursor ahead one sample

  <a name="cn">C-n</a>    move cursor ahead one 'line'
  <a name="cp">C-p</a>    move cursor back one 'line'
  <a name="cv">C-v</a>    move cursor to mid-window

  <a name="ci">C-i</a>    display cursor info
  C-j    go to mark
  C-x j  go to named mark
</pre>
<a name="cu"></a>
<p>All keyboard commands accept numerical arguments, as in Emacs.
If the argument is a float, it is multiplied by the sampling
rate before being applied to the command, so C-u 2.1 C-f moves
the cursor forward 2.1 seconds in the data.</p>
        <!-- I(move cursor ahead):K(C-f, C-n, C-e)(ce)(movecursor) --><!-- I(move cursor back):K(C-b, C-p, C-a)(ca)(movecursor) -->
        <!-- I(move cursor ahead):O(also &gt;) --><!-- I(move cursor back):O(also &lt;) --><!-- I(describe sample):K(C-i)(ci) -->
        <!-- I(move to mark):K(C-j, C-x j)(cj) --><!-- I(move to mark):O(C-x j -&gt; named mark)(cxj) -->
        <!-- I(move to mark):A(cj) --><!-- I(numeric arguments):A(cu) -->

<h4>Moving the Window</h4>

<a name="movingwindow"></a>
<p>The simplest way to move the window (the portion of the data in the current graph) is to drag the
scrollbars with the mouse.  The darker scrollbars zoom in and
out; the lighter bars move the window along the x or y axis.
Because sound files can be enormous, the x axis placement
needs some special handling to make it useful in
all cases.  To move by a single windowful, click the
arrows on the scrollbar.  To move by smaller amounts,
use the left and right arrow keys (or zoom with the up and
down arrow keys);  the control, shift, and meta keys
are multipliers on this movement -- each key adds a factor
of .5 to the multiple, so to move by .25 windows, 
press control, meta, left (or right) arrow.  A similar
mechanism can be used to zoom quickly onto a particular
point; hold the keys and click the mouse in the waveform
and you'll zoom an increasing amount into the data at that
point.  
</p>

<a name="movewindow"></a>
<p>Various keyboard commands provide
much more precise control of the window bounds and placement:</p>
<pre>
  <a name="cl">C-l</a>      position window so cursor is in the middle
  <a name="cxb">C-x b</a>    position window so cursor is on left margin
  <a name="cxf">C-x f</a>    position window so cursor is on right margin
  [Down]   zoom out, amount depends on shift, control, and meta
  [Up]     zoom in
  [Left]   move window left
  [Right]  move window right
  <a name="cxl">C-x l</a>    position selection in mid-view
  <a name="cxv">C-x v</a>    position window over current selection
  <a name="cxcb">C-x C-b</a>  set x window bounds (preceded by number of leftmost sample)
  <a name="cxcp">C-x C-p</a>  set window size (preceded by size as numeric argument)
</pre>
<p>As in most other cases, the sample numbers (or sizes) can be floats;
if the argument is not an integer, it is multiplied by the sampling
rate before being applied to the command.  So, C-u .1 C-x C-p makes
the window display .1 seconds of data.</p>
        <!-- I(zoom window):O(control keys intensify)(movingwindow) -->
        <!-- I(zoom window):A(movingwindow) --><!-- I(move window back):A(movingwindow) -->
        <!-- I(move window ahead):A(movingwindow) --><!-- I(move window back):O(scroll bars) -->
        <!-- I(move window ahead):O(scroll bars) --><!-- I(center cursor):A(movewindow) -->
        <!-- I(center cursor):K(C-l, C-v)(cv) --><!-- I(move window ahead):K([Left], C-x f)(cxf)(movewindow) -->
        <!-- I(move window back):K([Right], C-x b)(movewindow) --><!-- I(zoom window):K([Up],[Down]) -->
        <!-- I(center selection):K(C-x l)(cxl) --><!-- I(center selection):A(cxl) -->
        <!-- I(axis bounds):K(C-x C-b, C-x C-p)(cxcb) --><!-- I(axis bounds):A(cxcb) -->
<hr>
<h3><a name="marks">Marks</a></h3>

<p>A mark marks a particular sample in a sound file (not a
position in that file).
If we mark a sample, then delete 100 samples before it,
the mark follows the sample, changing its current position 
in the data.  If we delete the sample, the mark is also
deleted; a subsequent undo that returns the sample also
returns its associated mark.  I'm not sure this is the
right thing, but it's a lot less stupid than marking
a position.
</p>

<p>Once set, a mark can be moved (redefined) by dragging the
horizontal tab at the top. Click on the triangle at the
bottom to play (or stop playing) from the mark; drag the
triangle to play following the mouse.</p>

<p>A mark can be named or unnamed -- the name is displayed
above the horizontal tab at the top of the window.  The
following keyboard commands relate to marks:</p>
<pre>
  <a name="cm">C-m</a>       place (or remove if argument negative) mark at cursor
  C-x /     place named mark at cursor
  <a name="cxcm">C-x C-m</a>   add named mark

  <a name="cj">C-j</a>       go to mark
  <a name="cxj">C-x j</a>     go to named mark
</pre>
<p>The distance from the cursor to a mark can be used as a numeric
argument for other commands by following C-u with C-m.  Any
number in-between is the number of marks to jump forward before
getting the distance.</p>

<a name="savemarks"></a>
<p>The current marks assoicated with a sound can be saved in a
file that Snd will load automatically later via
<code>(save-marks)</code>.</p>
        <!-- I(save marks):A(savemarks) -->

<hr>
<h3><a name="regions">Regions</a></h3>

<p>A region is a (saved) portion of the sound
data.  Although I'm not completely consistent in this document, 
the word "selection" is used to refer to the currently selected
(and highlighted) portion of the data; an operation such as
filter-selection affects the underlying data.  A "region" on
the other hand, refers to the saved (copied) version of that
data that can be inserted or mixed elsewhere.
<a name="mousedefsect">Regions</a> can be defined by dragging the mouse
through a portion of the data.  If the mouse drags off
the end of the graph, the x axis moves, in a sense dragging
the data along to try to keep up with the mouse; the further
away the mouse is from the display, the faster the axis
moves.  (One minor caveat: if you drag the mouse too quickly off the end
of the graph, making a grand sweeping gesture, the last portion
of the graph may be missed because the mouse updates are
coalesced to some extent; move deliberately as you near the end
of the sound).
A region can also be defined with keyboard
commands, much as in Emacs. C-[space] starts the
region definition and the various cursor moving
commands continue the definition.</p>
        <!-- I(define selection):O(mouse drag)(mousedefsect) --><!-- I(define selection):A(mousedefsect) -->
	<!-- I(define selection):M(Edit: Select All)(selectall) -->

<a name="regionbrowser"></a><p>Once defined, the copied selection
is added to a stack of currently
available regions (the stack size is normally 16 -- see <a href="extsnd.html#maxregions">max-regions</a>).
In many cases, the numeric argument to the command below
chooses which region in that stack to use in the command.
Since it can be hard to remember which region is which,
especially since they are constantly on the move as the
stack changes, there is a region browser, similar to the File browser, invoked from
the View menu's Regions option:</p>
<img src="regions.gif" alt="picture of region browser"><br><br>
<p>The 'save' button here protects the region from deletion
as the region stack grows.  'Print' produces a Postscript
rendition of the current graph contents, using the default
eps output name. 'play' plays the region.  The graphical
display 
shows the waveform with arrows to move around in the
channels of multi-channel regions.  The 'edit' button
loads the region into the main editor as a temporary
file.  It can be edited or renamed, etc.  If you save
the file, the region is updated to reflect any edits
you made.
</p>

<p><a name="selectall"></a>The Select all menu option (in the
Edit menu) uses the region mechanism as a way to save
the entire current sync'd state.  Besides making it easier to
select an entire file (mouse event handling can make it tiresome to
pick up the last few samples sometimes), this option provides a
quick way to save in a temporary place the current edits applied
to some file, channel, or group thereof.  You can then quickly
return to this state later via the region browser.
</p>

<p>The keyboard commands that apply to regions are:</p>
<pre>
  <a name="cy">C-y</a>         paste in current selection at cursor
  C-[space]   start keyboard-based region definition
  C-x a       apply amplitude envelope to selection
  <a name="cxc">C-x c</a>       define selection from cursor to nth mark
  <a name="cxi">C-x i</a>       insert selection
  <a name="cxn">C-x n</a>       re-evaluate expression over selection
  C-x p       play selection or region (numeric arg selects region)
  <a name="cxq">C-x q</a>       mix in region (float arg = scaler)
  <a name="cxw">C-x w</a>       save selection as file 
  <a name="cxx">C-x x</a>       evaluate expression over selection

  C-x l       position selection in mid-view
  C-x v       position window over current selection
</pre>

<p>If the current selection is active (displayed somewhere in the
current time domain displays), there are several functions that
can edit that portion of the current sounds (that is, the edit
applies to the underlying sound, not to the selection as a separate entity).
</p>
<pre>
  <a href="extsnd.html#sndscaleselectionby">scale-selection-by</a> args
  <a href="extsnd.html#sndscaleselectionto">scale-selection-to</a> args
  <a href="extsnd.html#sndsrcselection">src-selection</a> num-or-env
  <a href="extsnd.html#sndfilterselection">filter-selection</a> coeffs order
  <a href="extsnd.html#callplugselection">call-plug-selection</a> plug
  <a href="extsnd.html#sndreverseselection">reverse-selection</a>
  <a href="extsnd.html#sndenvselection">env-selection</a> env
  <a href="extsnd.html#sndsaveselection">save-selection</a> name type format srate comment
  <a href="extsnd.html#sndconvolveselectionwith">convolve-selection-with</a> filename amp
  <a href="extsnd.html#sndsmoothselection">smooth-selection</a>
</pre>
<p>Also if the 'selection' button is set in the transform options dialog,
(or equivalently, <a href="extsnd.html#lshowselectiontransform">show-selection-transform</a>
is #t or 1), the fft display, if any, displays the transform of the selected portion.
Save-selection is not always the same as save-region with the region argument
set to 0; a few functions, such as reverse-selection, reverse the selected
data, but leave the region copy alone, so save-selection saves the reversed
form, but save-region saves the original version.  This can be confusing if
you use C-x p to play the selection; it will actually play the original region,
not the reversed form.  
</p>
<hr>

<h3><a name="edithistory">The Edit List</a></h3>

<p>The current state of the undo/redo list can be viewed
as a scrolled list of strings in the pane on the left of the 
graph (in Motif 1, there's a 'Show Edit History' menu option).
If there are no
current edits, it just lists the associated file name
(i.e. the zero-edits state).  As you edit the sound,
the operations appear in the edit list window.  Click
on a member of the list to move to that point in the
edit list (equivalent to some number of undo's or
redo's).  To move to a given edit point and follow
the sync chain (if any), use control-click.</p>

<p>If Guile is loaded,
the function <a href="extsnd.html#sndsaveedithistory">save-edit-history</a> saves the current
edit list as a loadable program (assuming the base sounds haven't changed in the
meantime).  The file can be edited (it's just a text file with comments).
<font size="2">(more to come...)</font></p>

<hr>
<h3><a name="howtoedit">How to...</a></h3>

<dl>
<dt><a href="#saveopen">Save, open, close, print</a>
<dt><a href="#deleteinsert">Delete, insert, mix</a>
<dt><a href="#multichannel">Multi-channel operations</a>
<dt><a href="#ampenvs">Amplitude envelopes and scaling</a>
<dt><a href="#find">Find</a>
<dt><a href="#changesamples">Change samples</a>
<dt><a href="#undoredo">Undo, redo, revert</a>
<dt><a href="#play">Play</a>
<dt><a href="#mixingfiles">Mix Files</a>
<dt><a href="#kbdmacros">Keyboard macros</a>
<dt><a href="#changeformat">Change file format</a>
<dt><a href="#extendfile">Extend a file</a>
<dt><a href="#recordfile">Record a file</a>
<dt><a href="#editenvelope">Edit or view an envelope</a>
<dt><a href="#editheader">Edit, add, or remove the header</a>
<dt><a href="#centeryaxis">Center a tiny signal with DC</a>
<dt><a href="#savedstate">Save state for later restart</a>
<dt><a href="#misccommands">Miscellaneous commands</a>
<dt>
</dl>
        <!-- I(amp env):A(ampenvs) --><!-- I(undo edit):A(undoredo) --><!-- I(redo edit):A(undoredo) -->
        <!-- I(find):A(find) --><!-- I(play file):A(play) --><!-- I(keyboard macros):A(kbdmacros) -->
        <!-- I(amp env):M(Edit: Edit Env)(editenvelope) -->

<h4><a name="saveopen">Save, open, close, print</a></h4>

<p>Most of these kinds of operations are accessible from the File menu.
They can also
be invoked from the keyboard:</p>
<pre>
  <a name="cxk">C-x k</a>     close currently selected file
  C-x w     save selection as file 
  <a name="cxcd">C-x C-d</a>   print
  <a name="cxcf">C-x C-f</a>   open file 
  <a name="cxcs">C-x C-s</a>   save file
  C-x C-w   save currently selected channel as file
</pre>
<p>The Print command produces a PostScript
file which can be sent to directly a printer or saved for later use.</p>
        <!-- I(open file):K(C-x C-f)(cxcf) --><!-- I(open file):A(saveopen) -->

<h4><a name="deleteinsert">Delete, insert, mix</a></h4>

<a name="editcut"></a><p>The fastest way to delete a section is to drag the mouse through it and
call the Edit menu's Cut option.  Any active region
can be pasted or mixed in using C-x q and C-x i with a
numeric argument (the region number); the current selection
(region 0) can be pasted in
by clicking the middle mouse button.  The
associated keyboard commands are:</p>
<pre>
  <a name="cd">C-d</a>      delete sample at cursor
  <a name="ch">C-h</a>      delete previous sample
  <a name="ck">C-k</a>      delete a 'line' -- line-size (128) samples
  <a name="cw">C-w</a>      delete current selected portion

  <a name="co">C-o</a>      insert a zero sample at cursor
  C-x i    insert region at cursor (arg = region number)
  <a name="cxci">C-x C-i</a>  insert file 

  C-y      paste in current selection at cursor

  C-x q    mix in region (float arg scales mix, int arg = region number)
  <a name="cxcq">C-x C-q</a>  mix in file
</pre>
<p>Insertion takes place just ahead of the cursor; to insert after the
cursor, define a command something like:</p>
<pre>
  (bind-key (char-&gt;integer #\i) 0 "(insert-region (1+ (cursor)))")
</pre>

<h4><a name="multichannel">Multi-channel operations</a></h4>

<a name="syncbutton"></a><p>Normally each operation applies only to the currently
active channel.  If, however, the sound's 'sync' button is set,
the operations apply to every sound or channel that also
has the sync button set to the same value.  If you click
the 'sync' button, its value is 1 and its color is blue;
C-click gives 2 and green, C-M-click gives 3 and yellow;
C-M-Shift-click gives 4 and red; any other value (set via
the set-syncing function) shows as a black button.  The point
of all this is that only those sounds that share the sync value
of the current sound are considered to be sync'd to it; for example,
to make a stereo selection in one file, then paste it into some
other stereo file, set the sync buttons in each sound, but use
different values; that way, the channels within each sound are
sync'd together (giving stereo operations), but the sounds themselves
are separate.</p>

<a name="unitebutton"></a><p>A multichannel sound also
has a 'unite' button to the left of the 'sync' button.
If this button is set, all channels are displayed in
one graph; the x and y-axis scrollbars apply to all the
channels at once, as do the 'f' and 'w' buttons;
two new scrollbars appear on the right of the window;
the furthest right
scrollbar affects the placement of the window within
the overall set of graphs, and the scrollbar on its left
zooms in and out of the overall graph.  For stereo files,
this is user-interface overkill, but the hope is to
accomodate sounds with many channels, making it easy
to focus on particular portions and so on.
The View menu Channel style
option has the same effect but applies to all active
multichannel sounds.  Control-click the unite button
to get superimposed channels.
If the channels are not combined (the default), control-click the 'f' or 'w' button in one
channel to affect all channels at once.
</p>
        <!-- I(multichannel ops):A(multichannel) --><!-- I(multichannel ops):O(sync button)(syncbutton) -->

<p>To get multi-channel selections, set the sync
button, then define the selection (by dragging
the mouse) in one channel, and the parallel
portions of the other channels will also be
selected.</p>


<h4><a name="ampenvs">Amplitude envelopes and scaling</a></h4>

<p>An envelope in Snd is a list of x y break-point pairs.
The x axis range is arbitrary. For example,
to define a triangle curve: '(0 0 1 1 2 0).
There is no (obvious) limit on the number of
breakpoints.  Envelopes can be defined with
defvar and referred to thereafter by name.  This
can save much typing.  Use the <a href="#editenvelope">envelope editor</a>
to draw envelopes with the mouse.
</p>

<p>To apply an envelope to a sound, use the extended
command C-x C-a.  If this command gets a numeric
argument, the envelope is applied from the cursor
for that many samples. Otherwise, the envelope is
applied to the entire file.</p>
<pre>
  <a name="cxa">C-x a</a>     apply amplitude envelope to selection
  <a name="cxca">C-x C-a</a>   apply amplitude envelope to channel
</pre>
<p>You can also specify an envelope name to the C-x C-a prompt.
</p>

<a name="scaling"></a><p>To scale a file or selection by or to some
amplitude, use the lisp functions:</p>
<pre>
  <a href="extsnd.html#sndscaleby">scale-by</a> args
  <a href="extsnd.html#sndscaleto">scale-to</a> args
  <a href="extsnd.html#sndscaleselectionby">scale-selection-by</a> args
  <a href="extsnd.html#sndscaleselectionto">scale-selection-to</a> args
</pre>
<p><i>scale-by</i> scales the current sync'd channels by its arguments,
and <i>scale-to</i> scales them to its arguments (a "normalization").
The arguments in each case are either a list of floats
corresponding to each successsive member of the current
set of sync'd channels, or just one argument. In the
latter case, scale-by uses that scaler for all its
channels, and scale-to normalizes all the channels
together so that the loudest reaches that amplitude
(that is, (scale-to .5) when applied to a stereo file
means that both channels are scaled by the same amount so
that the loudest point in the file becomes .5).</p>
        <!-- I(amp env):O(scale-to, scale-by)(sndscaleto) -->

<h4><a name="find">Find</a></h4>

<p>Searches in Snd refer to the sound data, and are,
in general, patterned after Emacs.  When you type
C-s or C-r, the minibuffer below the graph is
activated and you are asked for the search expression.
The expression is either a piece of C-like code that describes
which sample satisfies the search, or the corresponding
Scheme procedure.  For example,
to look for the next sample that is greater than
.1, we could type: y &gt; .1.  The cursor then moves
to the next such sample, if any.  Alternatively,
we could use Scheme: (lambda (y) (> y .1)).  The
Scheme procedure should be a function of one argument,
the current sample value; it should return #t when
it reaches a sample that satisfies the search criterion.
Successive C-s's
or C-r's repeat the search.  C-x C-s can redefine the
search pattern, which is also cleared by various other
commands, much as in Emacs. 
</p>

<a name="cexpression"></a>
<p>The search (and C-x C-x) expression
C-syntax includes most of C's operators, the
standard math library, as well as a few variables
internal to Snd.  To get at the current sample's
value (the sample that the cursor is sitting on), use 'y'.  'y(n)' refers to the sample
n samples from the current one. 
Similiarly, each of the other channels
besides the current one is accessible as y1..8(n)
(where the offset argument is optional); the channels
are assigned to these yn functions in the order they
occur in the Snd display (sounds from top to bottom,
channels in order within a sound).  As an example,
say you want to find where two channels differ:</p>
<pre>
  C-s y != y1
</pre>
<p>Or you want to find where the current channel has
three consecutive zeros:</p>
<pre>
  C-s (y == 0.0) &amp;&amp; (y(1) == 0.0) &amp;&amp; (y(2) == 0.0)
</pre>

<p>Normally, the search applies only to the current channel.
To search
all active files at once, use the Edit menu's
find option.
</p>

<p>The available C operators are:</p>
<pre>
+ - * / &gt; &gt;= &lt; &lt;= == != 
( ) { } += *= /= -= = || &amp;&amp; ? : !
</pre>
<p>The available functions are:</p>
<pre>

log log10 exp cos sin abs (i.e. fabs) pow sqrt 
atan acos asin cosh sinh tanh fmod ceil floor

  y:             value at cursor (y(n) also)
  y1..8:         value ar cursor (y1(n)) in channel n (counting sounds from top)
</pre>

<p>The search commands are:</p>
<pre>
  <a name="cr">C-r</a>   find backwards
  <a name="cs">C-s</a>   find forwards
</pre>
<p>See also the functions <a href="extsnd.html#lfind">find</a> and <a href="extsnd.html#lcountmatches">count-matches</a>,
and the scanning and mapping functions (<a href="extsnd.html#scanning">Scanning Data</a>).</p>

        <!-- I(evaluate expression):A(cexpression) -->    


<h4><a name="changesamples">Change samples</a></h4>

<p>The simplest changes are:</p>
<pre>
  <a name="cz">C-z</a>       set current sample to zero
  <a name="cxcz">C-x C-z</a>   smooth data using cosine (<a href="extsnd.html#sndsmooth">smooth</a>)
</pre>

<p><a name="cxcxy">C-x C-x y</a> = .1 sets the sample
at the cursor to .1.  To set several samples to zero, define a selection over the
desired samples, then
C-x x y=0. Or use C-u preceding the C-x C-x command.
As with the 'find' commands, you can use Scheme syntax here: the
argument to C-x C-x should be a function of one argument, the
current sample value, and should return either #f (to leave the
value unchanged), or the new value.  The example given above could
also be expressed as: C-x C-x (lambda (y) .1).  To maintain local
state across function calls, you can use constructs such as:</p>
<pre>
(define filt 
  (let ((y0 0.0)) 
    (lambda (x) 
      (set! y0 (+ x (* .9 y0))) 
      y0)))
</pre>
<p>Then C-u 1000 C-x C-x filt.  But this can only be used once.  A better
version might be:</p>
<pre>
(define filt 
  (lambda () 
    (let ((y0 0.0)) 
      (lambda (x) 
        (set! y0 (+ x (* .9 y0)))
	y0))))
</pre>
<p>C-u 1000 C-x C-x (filt). Now a subsequent (filt) call creates a new
closure (i.e. y0 starts again at 0.0).</p>

<a name="comparefiles"></a>
<p>Another way to use expressions is to make new sounds from existing
ones.  Say we want to make a new sound that is the difference of
two others: make a new file (via the File menu New option, or
<code>M-x (new)</code>), make room in it (via C-u 1.0 C-o or whatever), then:</p>
<pre>
  C-u 1.0 C-x C-x y = y1 - y2
</pre>
<p>In this particular case, a simpler way would be to scale the first by -1, then mix in the second.</p>

        <!-- I(change samples):A(changesamples) --><!-- I(change samples):K(C-z, C-x C-z)(cz) --><!-- I(change samples):O(C-x C-x y=val)(cxcxy) -->
        <!-- I(compare files):A(comparefiles) -->


<h4><a name="undoredo">Undo, redo, revert</a></h4>

<p>Snd supports 'unlimited undo' in the sense that you can
move back and forth in the list of edits without any obvious
limit on how long that list can get.  The data displayed is
always the edited form thereof.  Each editing operation
extends the current edit list; each undo backs up in that
list, and each redo moves forward in the list of previously
un-done edits.  Besides the Edit and Popup menu options, there
are these keyboard commands:</p>
<pre>
  <a name="cxr">C-x r</a>     redo last edit
  <a name="cxu">C-x u</a>     undo last edit
  <a name="cxcr">C-x C-r</a>   redo last edit
  <a name="cxcu">C-x C-u</a>   undo last edit
  C-_       undo last edit
</pre>
<p>Revert is the same as undoing all edits.</p>

<h4><a name="play">Play</a></h4>

<p>To play a sound, click the 'play' button.  If the sound has more
channels than your DAC(s), Snd will try to mix the extra channels
into the available DAC outputs.
While it is playing,
you can click the button again to stop it, or click some other
file's 'play' button to mix it into the current set of sounds
being played. To play from a particular point, set a mark
there, then click its 'play triangle' (the triangular portion
below the x axis).  To 'rock the reels', that is to play
while dragging the mouse back and forth, drag the mark's
play triangle.  The Edit menu 'Play' option plays the current
selection, if any.  The Popup menu's 'Play' option plays the
currently selected sound.  And the region and file browsers provide
play buttons for each of the listed regions or files.  <a name="trackingcursor"></a>If you
hold down the control key when you click 'play', the cursor
follows along as the sound is played.  If 'verbose cursor' is
on, the time is also displayed in the minibuffer.
If you stop the play
in progress, the cursor remains where you stopped it, but
otherwise returns to its original position.  Type space
(without control) to pause and continue during playback.
</p>
<p>In Linux, the soundcard input lines are sometimes left active
by default, causing an amazing amount of hum and whatnot.  To
try to turn these off, call the function clear-audio-inputs.
</p>
<p>The color of the play button corresponds to the state of
the playback: normal: not playing, blue: playing,
green: playing and tracking with the cursor (if any),
red: playback paused.</p>

<p><font size="2">
If you're getting
interruptions while playing a sound (stereo 44.1 kHz sounds can be problematic),
try using a very large dac buffer.  The function that sets the
dac buffer size is <a href="extsnd.html#dacsize">set-dac-size</a>: M-x (set-dac-size 65536).
If you're getting clicks in Linux despite a large dac-size, try setting the OSS fragment sizes by hand: 
<a href="extsnd.html#setossbuffers">set-oss-buffers</a>(<i>fragments</i>,<i>fragment-size</i>). OSS's
defaults are 16 and 12; Snd's defaults are probably 4 and 12; the larger these numbers, the more sluggish the control panel controls.
</font></p>


	<!-- I(tracking cursor):O(control click 'play')(trackingcursor) -->
	<!-- I(tracking cursor):L(cursor-follows-play)(sndcursorfollowsplay) -->
	<!-- I(tracking cursor):A(trackingcursor) -->

<a name="cq"></a><p>The keyboard commands for playing are:</p>
<pre>
  C-q    play current channel starting at the cursor
  <a name="ct">C-t</a>    stop playing
  <a name="cxp">C-x p</a>  play region (numeric arg selects region)
</pre>
        <!-- I(play channel):K(C-q, C-t)(cq) --><!-- I(play channel):A(cq) -->
<p>In a multi-channel file, C-q plays all channels from the current channel's
cursor if the sync button is on, and otherwise plays only the current channel.
Except in the browsers, what is actually
played depends on the <a href="#controls">control panel</a>.
Both C-q and C-x p allow overlapped plays; that is, if you
type C-q several times in succession, you'll hear several
simultaneous renditions of the sound.  The various 'play'
buttons scattered around Snd on the other hand, interrupt
the current play if you click them during a run.  C-g stops
any current playing.
</p>


<h4><a name="mixingfiles">Mix Files</a></h4>

<p>Since mixing is the most common and most useful
editing operation performed on sounds, there is relatively
elaborate support for it in Snd.  To mix in a file, use either the File Mix menu option
or the command C-x C-q.  Currently the only difference
between these two is that the Mix menu option tries
to take the current sync state into account, whereas
the C-x C-q command does not. To mix a selection, use
C-x q.
The mix
starts at the current cursor location.</p>

<p>Each individual mix
portion has a "<a name="consoles">mix console</a>", a small box displayed
above the waveform containing various controls.  These
consoles follow the sync buttons where relevant.  More
importantly, consoles can be edited together by collecting
related mix portions into a group, then firing up the
Group Editor (via the View menu Groups option).  In a sense,
a group can be viewed as Snd's way of implementing a
more normal mixer's "tracks".
</p>

<h5>The Mix Console</h5>
<p>When a section or file is mixed into the current file
a mix console is associated with it, each output channel
getting its own console.  The console is displayed at first
as a row of widgets giving the input file name, the begin and
end times of the mixed-in portion (click to change from
seconds to samples), then three icons:</p>
<pre>
  a speaker:   while pushed, the input is played
  an 'x':      click to remove the console permanently
  a box:       click to open (or close) the console
</pre>
<br>
<img src="mixer.gif" alt="picture of mix console">
<br><br>
<a name="movemixedfile"></a>
<!-- I(move mixed file):O(see mix doc)(movemixedfile) --><!-- I(move mixed file):A(movemixedfile) -->
<p>You can drag the widgets to change the position of the mix.
Once opened, each console presents a pane with an amplitude
slider for each input channel, and a speed control (srate
change on the input).  The initial state of the console
sets the speed to 1.0, and all the input amplitudes 0.0
except the channel that matches the current output channel,
which is set to 1.0 (a straight mix).  To return to this
state at any time, click the 'amp:' label.  To turn the
mix off ('mute' it, set all amps to 0.0), double click
the label; to return to the last settings you made, click
it with control or meta down.  Similarly, click the 'speed:'
label to reset it to 1.0, and click it with control or meta
to return to your last settings.  Each time you release the
mouse button (or click the amp label) counts as another 'edit'
of the file, so it is usually better to use 'undo' and 'redo'
in this context, rather than repeated clicks and shift-clicks.
The srate scale is interpreted in the same way as the sound
pane speed control -- as a float normally, but also, if
you like, quantized to semitones or integer ratios.
</p>

<p>To change the scale interpretation, set the variables
<a name="mix-amp-scaler">mix-amp-scaler</a>, 
<a name="mix-speed-scaler">mix-speed-scaler</a>, and in the group editor
<a name="mix-tempo-scaler">mix-tempo-scaler</a>; 
all default to 1.0
which gives a scaling range from 0 to around 12.
These numbers actually
scale an exponent, so (for example) if mix-amp-scaler is
set to 0.5, the scale goes from 0.0 to around 3.5; similarly
if mix-tempo-scaler is 0.025, its scale goes from around .95
to 1.05.</p>

<p>To reduce the mix console to a single letter, double
click the file name.  Double click the label to return to the
original row of icons.  Since screen space is at a premium,
this minimal form of the console can reduce clutter.  You can
still drag the label to reposition the mix.</p>

<p>When any edit is performed that changes the file within the
mixed portion, the affected mix consoles are removed from
the display, and the only way to return to them is to undo
the offending edit.  That is, if you mix a portion, then
cut some part of that portion, the mix will be locked in
place from then on, as if you had clicked the 'x' button on
the mix console.</p>

<p>To turn off the constant graphics updates (which can slow down
old machines like mine, and which can also be annoying when you
know what you're doing), set the variable
movies to 0 (it is also accessible in the Group Editor).</p>

<p>When a sound is mixed into a file that has its sync
button on, the separate channels are tied together so that
as long as the sync button is on, if you move one mix console
the other sync'd consoles move with it.  Similarly, any
speed change is reflected automatically in the other consoles;
amplitude changes however, are not copied. To make the sync'd
consoles independent, turn off the sync button.  Once unsync'd,
the consoles remain independent unless you 'undo' enough edits
to return to the sync'd state.</p>

<p>Normally the console is lined up with its left edge at the
beginning of the mixed segment.  You can move the console
anywhere within the segment by setting its "<a name="consoleleft">anchor</a>" to 
the position (sample) within the mix that should correspond
to the console's left edge.  See 
<a href="extsnd.html#sndmixanchor">mix-anchor</a>.
</p>

<p>To see the waveform of the sound being mixed,
set the group editor "show mix waveforms" button,
or set the Snd variable <a href="extsnd.html#showmixwaveforms">show-mix-waveforms</a> to 1.
The height of these graphs is set by <a href="extsnd.html#mixwaveformheight">mix-waveform-height</a>.
The mix waveform color is set by the resource mixWaveColor.
</p>

<h5><a name="groups">Grouped Mixes</a></h5>
<p>To tie together an arbitrary collection of mix consoles, use
the 'group' buttons in the upper right corner of the mixer.
Any mixers that share a button can be changed in parallel using
the Group Editor (the Groups option under the View menu).
The group editor gives amplitude control over each output
channel that has a mix that is a member of the group.
The speed control affects the sampling rate, and the tempo control
affects the spacing of the individual members of the group.
The play button plays just the
group members.</p>

<p>The group editor envelope fields use the same syntax as other
Snd envelopes: '(0 0 1 1) is a ramp, for example, and '(0 0 1 1 2 0)
is a sort of pyramid. The
envelope data in a given field only takes effect after
the field has been "activated" (normally by
a carriage return). The tempo envelope is interpreted in terms
of the current group times using the placement of the given mix
within the group to find the parallel place on the (arbitrary)
tempo envelope x axis.  The value of the envelope at that point
becomes another tempo multiplier; that is, these envelopes are
not time maps (perhaps someday!).  Since a tempo value of 2
makes things happen twice as slowly (it essentially multiplies begin times),
the tempo envelope causes things to go faster as it gets closer to
zero -- weird!  The speed envelope changes the overall speed
of a given segment, but doesn't change within that segment.
</p>

<p>The underlying mix consoles have 
independent envelopes, but my original plan to
include envelope text fields in the consoles made
them too big, cluttered, and unwieldy; an attempt
to make each console a scrollable (or paned) window
failed due to unfortunate limitations in Motif.
These could be overcome, but would require much
more programming than I think the issue is worth.
I'm interested in better ideas, if anyone has any.
One idea I'm goofing around with makes the mix matrix
entries visicalc-like expressions.
</p>
<a name="gotomix"></a>
<p>To move the cursor from one mix to the next, in the same
manner as C-j moves through marks, use <a name="cxcj">C-x C-j</a>.
</p>
        <!-- I(move to mix):K(C-x C-j)(cxcj) -->
        <!-- I(move to mix):A(gotomix) -->


<h5>Group Changes and Undo</h5>
<p>Since
a mix is viewed in Snd as just another edit which you can undo
and redo, and since one mix console can be participating in any
number of groups, and since any number of files can have
these grouped mixes active at once, and since you can
ungroup a mix, then undo the related edit, it becomes a bit of a pain
to describe what each sequence of actions will do.  In general,
think of a group as simply another kind of 'sync' button.
The Group Editor itself does not follow the undo/redo chains
(edits in Snd are considered to be local to each channel, but the
group editor affects all mixes together, possibly across many channels).  Each change
to a group control immediately affects all mixes associated
with that group, in each case as a single edit of each participating
channel.  Each change to the mix console takes into account the
state of the groups that it is a member of.  Undo of any edit
simply undoes the edit -- the mix console will back up one
state, but if the group controls have changed in the meantime,
the two are now out of sync.  Similarly, if you remove a mix
from a group, the group's effect upon the mix is removed as
well.  If it joins a group with current state, that causes
an immediate change in the mixed portion's state.  The tempo
control, however, only affects mixes that are under its control
when it is changed (does that make sense? -- the idea is that
you might want to leave a group briefly to fix a local mix
position or speed, then rejoin the group, but in that process
you don't want the tempo control to cause the mix to jump
about randomly in time).
Similar
complications affect the group envelopes.  You can choose
whether the envelope is applied over the entire output
duration, or just the group duration; in the latter case,
you need to be aware that adding or removing mixes can change
that duration, changing the effect of the envelope.  Group
state changes by themselves are not edits (i.e. if a group
has no members, undo and redo will not notice that you've
been fiddling with its amp scalers).  If a mix is participating
in several groups, all associated groups affect the mix together (group states are multiplied, and
envelopes are "melded" into something resembling a gathering
of the various envelopes).  If a mix is synced to others, and
joins or leaves a group, all the synced mixes follow its lead.
All of this can be summarized: groups act like the sync buttons.
And if it's confusing, consider the alternatives; or better,
decide once and for all which mixes are grouped together,
and use only one group per mix.  Then everything
should be "intuitive".</p>


<h4><a name="kbdmacros">Keyboard macros</a></h4>

<p><a name="kce"></a>As in Emacs, C-x ( begins keyboard macro definition, C-x )
ends it, and C-x e executes the last keyboard macro.  Unlike
Emacs, C-x C-e prompts for a name for the last defined
macro; M-x name invokes the macro "name", the
function save-macros saves all current named macros, and
save-macro saves one (named) macro
in the <a href="extsnd.html#sndinitfile">initialization file</a> (normally
.snd). See the <a href="extsnd.html#lisplistener">lisp</a> section for
more details.</p>

        <!-- I(keyboard macros):K(C-(, C-x e)(kce) -->
        <!-- I(save macros):A(kbdmacros) -->

<h4><a name="changeformat">Change file format</a></h4>

<p>To change the sound file's header or data format, use the File or Edit menu Save as option.
Choose the header type you want, then the data format,
(the data format list will change depending on the header
choice).  The File version saves the current selected file.
The Edit version saves the currently selected region.</p>
        <!-- I(save file as):A(changeformat) -->
        <!-- I(change format):A(changeformat) -->

<h4><a name="extendfile">Extend a File</a></h4>

<p>Normally Snd keeps the current cursor, and therefore most
actions you can perform on the current channel, within the
current channel's bounds.  The easiest way to extend the
file is to pad it with zeros.  Go to the end of the file,
via the C-&gt; command, then use the C-u command with a float
argument, giving the number of seconds to add to the end
of the file, followed by C-o (insert zeros): for example,
to add a second, C-&gt; C-u 1.0 C-o.  The same sequence
can be used to add silence to the start of a file.
	<!-- I(extend file):A(extendfile) --><!-- I(extend file):K(C-o)(co) -->
</p>

<h4><a name="recordfile">Record a File</a></h4>

<p>To make a recording, choose "Record" from the File menu.
A window opens with the various recording controls (SGI and Linux shown below):</p>

<img src="rec.gif" alt="picture of SGI Record window" vspace=5><img src="reclin.gif" alt="picture of Linux Record window" hspace=10>
<br><br>

<p>The top three panes display the status of the input and output lines.
If a channel is active, its meter will glow yellow.
If some signal clips during recording, the meter will
flash red.  The numbers below the channel buttons indicate the signal
maximum since it was last reset.  The sliders underneath the meters scale the
audio data in various ways before it is mixed into the output.  The
vertical sliders on the right scale the in-coming signals
before the meter, and the output signal before it gets to the speaker
(these are needed to avoid clipping on input, and to set the 'monitor'
volume of the output independent of the output file volume).</p>

<p>The fourth pane has information about the current output file (its
name and so on), and the layout of the window.  The buttons on the
right can be used to open and close panes painlessly.  If the
button is not square (a diamond on the SGI), the underlying audio
hardware can't handle input from that device at the same time as
it reads other "radio" button devices.  So, in that case, opening
the panel via the button also turns off the other incompatible
device.  The '<a name="Xautoload">autoload</a>' button, if set,
causes the recorded file to be loaded automatically into Snd.</p>

<p>The fifth
pane contains a history of whatever the recorder thought worth
reporting.  The duration field gives the current output file's
duration.  The bottom row of buttons dismiss the window, start
recording, cancel the current take, and provide some help.  There's
also a slider on the far right that controls the speaker output volume
(independent of the output file volume).  </p>

<p>To make a recording, choose the inputs and outputs you want; for
example, to record channel A from the microphone to channel A
of the output file, click the Microphone panel's A button and
the Output panel's A button.  Then when you're ready to go,
click the Record button.  Click it again to finish the recording.
The default is to provide up to two channels of output; if you
want to write output files with more channels, set the recorder-out-chans
variable before invoking the recorder.
</p>

<p>If the record window's VU meters are too big (or too small) for
your screen, you can fool around with the variable vu-size which
defaults to 1.0.  Similarly the variable vu-font-size tries to
change the size of the numbers on the label, and vu-font chooses
the family name of the font used (normally "courier").
</p>

<p>
The description above is aimed at the SGI Indy; in other systems,
the layout may be different.  In general, each separate pane
reflects an independent digital data stream; the vertical sliders on
the right reflect various hardware gains or tone controls that are applied
before the signal gets to the ADC, or in the case of output, after 
it has been read in, scaled, and mixed into the output; in Linux
the actual meaning of some of these sliders is an industry secret,
so some experimentation may be needed.  The basic signal flow 
can be viewed as coming in on the right of the input panels,
scaled in the sound card hardware by the vertical sliders,
passed through the ADC (if any), reflected in the VU meters,
then scaled by the horizontal sliders of the input panel,
mixed into the output signal, scaled by its horizontal sliders,
reflected in its VU meters, then written to the output file,
while another copy passes out the right side of the output panel
to the speakers scaled by the output (vertical) sliders. The bizarre icon next to
the microphone in Linux is supposed to mean "line-in".
</p>

<p>Sometimes it is more convenient to have the recorder start writing
the output file data only after some threshold amplitude has been
reached.  The scale bar in the lower right marked "trigger:" sets
this value.  If it is 0.0 (the default), the recording begins
as soon as you push the "Record" button.  Otherwise, the recording
begins after you push "Record" and after the triggered value is
noticed in the output (modulo buffer crossings -- sometimes you'll
get up to a buffer's worth of whatever preceded that value).  In
this case, the button is labelled "Triggered Record".
</p>

<blockquote><blockquote>
<p><font size="2">If there are so many input and output channels active that
more than eight sliders would be needed in a given pane, the
recorder tries to conserve tight screen space by showing only the direct cases,
chan0 to chan0, chan1 to chan1, and so on.  It also posts a box
of buttons to the left of the meters, each button representing
a slider.  If the button is on (green), the corresponding slider
is displayed.
Press one of the buttons to toggle whether its slider is displayed or
hidden.
It is also possible to drag the mouse through
the box of buttons, setting (button 1) or unsetting (button 2)
buttons as you go.  Click in the corner (the '/' label) to
set all (button 1) or unset all (button 2). Similarly, click
above a column or to the left of a row to set (button 1) or
unset (button 2) the entire column or row.  Control-click in
the corner to return to the default settings.
</font></p></blockquote></blockquote>


<h4><a name="editenvelope">Edit or View an Envelope</a></h4>

<p>The Edit Envelope dialog (under the Edit menu) fires up a window
for viewing and editing envelopes.  
The dialog
has a display showing either the envelope currently being edited or
a panorama of all currently loaded envelopes.  The current
envelope can be edited with the mouse: click at some spot in the graph to place a
new breakpoint, drag an existing breakpoint to change
its position, and click an existing breakpoint to delete it.
The Undo and Redo buttons can be used to move around
in the list of envelope edits;
the current state
of the envelope can be saved with the 'save' button, or
printed with 'print'.</p>
<img src="env.gif" alt="picture of envelope editor"><br><br>

<p>Envelopes can be defined
using defvar, and loaded from a separate file of envelope
definitions via <a href="extsnd.html#lload">load</a>.  For example,
the file:</p>
<pre>
  (defvar ramp '(0 0 1 1))
  (defvar pyramid '(0 0 1 1 2 0))
</pre>
<p>defines two envelopes that can be used in Snd wherever an
envelope is needed (e.g. C-x C-a).  You can also define
a new envelope in the dialog's text field;
'(0 0 1 1) followed by return fires up a ramp as a new envelope.</p>

<p>In the overall view of envelopes,
click an envelope, or click its name in the scrolled
list on the left to select it; click the selected envelope
to load it into the editor portion, clearing out whatever
was previously there.  To load an exisiting envelope into the editor, you can
also type its name in the text field; to give a name to
the envelope as it is currently defined in the
graph viewer, type its name in this field, then
either push return or the 'save' button.
</p>

<p>Once you have an envelope in the
editor, it can be applied to the currently active sounds
via the 'Apply' or 'Undo&amp;Apply' buttons; the latter
first tries to undo the previous edit, then applies
the envelope.
The envelope can be applied to
the amplitude, the spectrum, or the sampling rate. The
choice is made via the three buttons marked 'amp',
'flt', and 'src'.
The filter order is the variable filter-env-order
which defaults to 40. 
To interrupt the application of the envelope, click the
'Stop' button.  To apply the changes to the current
selection, rather than the current sound, set the 'selection' button.
</p>

<p>The
two toggle buttons at the lower right choose whether
to show a light-colored version of
the currently active sound (the 'wave' button), and whether
to clip mouse movement at the current y axis bounds (the
'clip' button).  The 'linear' and 'exp' buttons choose
the type of connecting lines, and the 'exp base' slider at
the bottom sets the 'base' of the exponential curves, just as
in CLM.  If the envelope is being treated as a spectrum ('flt'
is selected), the 'wave' button shows the actual frequency
response of the filter that will be applied to the waveform
by the 'apply' buttons.  Increase the filter-env-order to
improve the fit.  In this case, the X axis goes from 0 Hz to half the sampling rate, labelled as "1.0".
</p>



	<!-- I(edit env):A(editenvelope) --><!-- I(edit env):M(Edit: Edit Env)(editenvelope) -->
	<!-- I(view envs):A(editenvelope) --><!-- I(view envs):M(Edit: Edit Env)(editenvelope) -->

<h4><a name="editheader">Edit, add, or remove the header</a></h4>

<p>The Edit menu's Edit Header option fires up a dialog to edit, add, or
remove the sound's header.  No change is made to the actual sound
data; the new header is blindly written out; any unsaved edits are
ignored. If you specify 'raw' as the type, any existing header is
removed.  This dialog is aimed at adding or removing an entire header,
or editing the header comments; anything else is obviously dangerous.
If you don't mess with the data location, it will be updated to
reflect any header changes; that is, unless you intervene, the
resultant header will be syntactically correct. 
After writing the new header, you should either close or update the
associated sound.
</p>

<h4><a name="savedstate">Save state</a></h4>

<p>At any time you can save the current
state of Snd by calling <code>(save-state name)</code> where <i>name</i>
is a file name.  You can start in this state by calling Snd
with this file name and the "-l" switch: snd -l name.
This file is in exactly the same format as the <a href="extsnd.html#sndinitfile">initialization
file</a>, and can be edited, renamed, or
whatever. To load such a file after startup, <code>(load name)</code> (C-x C-l). 
Currently, mix consoles are not saved,
but the associated edits are. 
</p> 
        <!-- I(continue session):A(savedstate) -->
        <!-- I(save state):A(savedstate) -->
        <!-- I(save state):L(save-state)(sndsavestate) -->
        <!-- I(save state):O(save-state-on-exit)(savestateonexit) -->

<h4><a name="centeryaxis">Center a tiny signal with DC</a></h4>

<p>Due to the quantized nature of the y-axis position scroller, a tiny
signal that is not centered on 0 can be a pain to position in the
window.  Use the <a href="extsnd.html#sndsetybounds">set-y-bounds</a> function to set the y axis bounds to some
small number, then use the position scroller to find the signal.
For example, if your signal is a very soft recording setting only the lowest two bits
of a 16 bit signal but with DC offset due to the recording conditions,
M-x (set-y-axis -.01 .01) and try the scroller.</p>

	<!-- I(center tiny signal):A(centeryaxis) --><!-- I(center tiny signal):L(set-y-bounds)(sndsetybounds) -->

<h4><a name="misccommands">Miscellaneous commands</a></h4>

<p><a name="kgc">C-g</a> at any point aborts the current keyboard command
sequence, as does any mouse click.  C-g can also interrupt some long
computations (search, eval expression, and the various envelope applications).</p>
<!-- I(interrupt Snd):A(kgc) --><!-- I(interrupt Snd):O(edit env)(editenvelope) -->
<!-- I(interrupt Snd):K(C-g)(kgc) -->

<p><a name="kcu">C-u</a> introduces a numeric argument. Besides the integer and
float cases mentioned several times above, you can also
use marks to set the argument.  If the (optional) number
after C-u is followed by C-m, the resultant number passed
to the command is the distance (in samples) from the cursor
to the n-th successive mark.  That is C-u C-m C-f is the
same as C-j.</p>

<p>C-x introduces an 'extended command'.  It can be preceded
by a numeric argument or aborted with C-g.  C-x halts any
on-going region definition.</p>

<p><a name="ktempdir">C-x d</a> prompts for the temporary directory name.  Snd
saves some editing operations in temporary files, rather
than in-core buffers.  If the temporary directory has
been set (in various ways), it is used; otherwise
Snd looks for the TMPDIR environment variable; if it
is not found, or is null, the directory /var/tmp is
used.</p>

<p><a name="cxcc">C-x C-c</a> closes the control panel. 
<a name="cxco">C-x C-o</a> opens the
panel.</p>

<p>C-x C-x evaluates an expression; <a name="cxcn">C-x C-n</a> re-evaluates it.</p>

<p>To change a key binding, use <a href="extsnd.html#sndbindkey">bind-key</a>.</p>

<p>As in Emacs or Tcsh, the Tab key in a text field invokes a context-sensitive completion function
that tries to figure out what the rest of the text probably should be.  If it finds no matches,
the text flashes red; if it finds multiple matches and can't extend the current text, it flashes green,
and (eventually) a list of possible completions appears in the help window.
If there is no completion routine active, Tab is a no-op (i.e. it doesn't activate the "next" widget,
as in the normal Motif program). 
</p>

        <!-- I(abort command):K(C-g)(kgc) --><!-- I(abort command):O(mouse click) --><!-- I(abort command):A(kgc) -->
        <!-- I(numeric arguments):K(C-u)(kcu) --><!-- I(numeric arguments):O(see marks as args)(kcu) -->
        <!-- I(temp directory):K(C-x d)(ktempdir) --><!-- I(temp directory):A(ktempdir) -->
        <!-- I(temp directory):O(TMPDIR or /var/tmp) -->
	<!-- I(change key binding):A(sndbindkey) --><!-- I(change key binding):L(bind-key)(sndbindkey) -->
<hr>
<h3><a name="keyboardcommands">Keyboard Commands</a></h3>

<p>There are two types of keyboard commands in Snd: 
those associated with the Meta ('Alt') key, used as 
mouse equivalents for various menu options,
and all the rest.  The menu-related commands
are shown underlined in the menubar.  You type
the underlined letter with Meta, then just the
letter (no Meta) of the option you want.  The
menu-related commands are:</p>
<hr>  
<pre>
<font size="2">
<a name="menus"></a>
 <a href="#fileoperations">File</a> Menu        <a href="#editoperations">Edit</a> Menu             <a href="#viewing">View</a> Menu             <a href="#options">Options</a> Menu               Help Menu

M-f o: <a href="#openfile">Open</a>     M-e u: <a href="#undoredo">Undo</a>            M-v s: <a href="#controls">Show controls</a>  M-o t: <a href="#viewfft">Transform Options</a>  <a href="#clickforhelp">Click for help</a>
M-f c: <a href="#closefile">Close</a>    M-e r: <a href="#undoredo">Redo</a>            M-v n: <a href="#viewnormalize">Normalize</a>             <a href="extsnd.html#lspeedstyle">Speed style</a>        <a href="#overview">Overview</a>
M-f s: <a href="#savefile">Save</a>     M-e f: <a href="#find">Find</a>                   <a href="extsnd.html#lisplistener">Open listener</a>         <a href="#zoomoption">Focus style</a>        <a href="#viewfft">FFT</a>
M-f a: <a href="#savefile">Save as</a>  M-e c: <a href="#editcut">Cut</a>             M-v c: <a href="#unitebutton">Channel style</a>  M-o a: <a href="#saveoptions">Save options</a>       <a href="#find">Find</a>
M-f r: <a href="#revertfile">Revert</a>   M-e p: <a href="#editcut">Paste</a>           M-v d: <a href="#viewdots">Graph style</a>           <a href="#savedstate">Save State</a>         <a href="#undoredo">Undo and Redo</a>
M-f m: <a href="#mixingfiles">Mix</a>      M-e m: <a href="#editcut">Mix Selection</a>          <a href="extsnd.html#verbosecursor">Verbose cursor</a>        <a href="extsnd.html#showusagestats">Show stats</a>         <a href="#syncbutton">Sync</a>
M-f u: <a href="#updatefile">Update</a>   M-e p: <a href="#cxp">Play Selection</a>  M-v r: <a href="#regionbrowser">Regions</a>                                  <a href="#speed">Speed</a>
M-f n: <a href="#newfile">New</a>      M-e s: <a href="#cxw">Save Selection</a>  M-v b: <a href="#prevfiles">Files</a>                                    <a href="#expand">Expand</a>
       <a href="#recordfile">Record</a>          <a href="#selectall">Select all</a>             <a href="#colorbrowser">Color</a>                                    <a href="#reverb">Reverb</a>
M-f v: <a href="#openfile">View</a>            <a href="#editenvelope">Edit Envelope</a>   M-v o: <a href="#orientationbrowser">Orientation</a>                              <a href="#contrast">Contrast</a>
M-f p: <a href="#printfile">Print</a>           <a href="#editheader">Edit Header</a>            <a href="#groups">Groups</a>                                   <a href="#ampenvs">Envelope</a>
M-f x: <a href="#exitfile">Exit</a>	                       M-v m: <a href="#marks">Show marks</a>                               <a href="#marks">Marks</a>
                                              <a href="extsnd.html#showaxes">Hide axes</a>                                <a href="#mixingfiles">Mixing</a>
                                       M-v y: <a href="#viewy0">Show y=0</a>                                 <a href="#formats">Formats</a>
                                              <a href="#consoles">Hide consoles</a>                            <a href="#customization">Customization</a>
                                              <a href="extsnd.html#xaxisstyle">X axis units</a>                             <a href="#recordfile">Recording</a>
                                              <a href="#errorhistory">Error History</a>                            News
</font></pre>
<hr>
<p>The rest of the keyboard commands refer to the currently
active graph, and any graphs that are currently sync'd
to it.  In general, commands are analogous to Emacs
where such an analogy exists; in other cases, an 
extended command followed by a key with control 
affects the current channel whereas the same key
without control affects the selection.
Case is not significant.</p>

<p>Most of the commands accept a numeric
argument which can be either an integer or
a float; an integer causes the command to be repeated
that many times; the float is usually multiplied by the
sound's sampling rate, then applied that many times.
So, for example, C-u 1.0 C-f causes the cursor to move
ahead one second in the sound.  The argument can
be negative to reverse the sense of the command,
as in Emacs.  It is often useful to use the distance
to a mark as a count.  If the C-u n command is
followed by C-m, the 'n' determines how many
marks to move to, then the count returned is
the distance from the cursor to that mark.  
For example, C-u C-m returns the number of samples between
the cursor and the next mark, so C-u C-m C-z zeros
all the samples between the cursor and the next mark.</p>

<p>The commands are:</p>
<pre>
  [Down]  zoom out
  [Up]    zoom in
  [Left]  move window left
  [Right] move window right
  [Home]  update current file (re-read data from disk)
  [Space] cancel and deselect selection, return to pre-select position
          if playing, pause or continue playback
  &lt;:      move cursor to sample 0
  &gt;:      move cursor to last sample
  C-&lt;:    move cursor to sample 0
  C-&gt;:    move cursor to last sample
  C-a:    move cursor to window start
  C-b:    move cursor back one sample
  C-d:    delete sample at cursor
  C-e:    move cursor to window end
  C-f:    move cursor ahead one sample
  C-g:    abort current command
  C-h:    delete previous sample
  C-i:    display cursor info
  C-j:    go to mark
  C-k:    delete one line's worth of samples
  C-l:    position window so cursor is in the middle
  C-m:    place (or remove) mark at cursor location
  C-n:    move cursor ahead one 'line'
  C-o:    insert one zero sample at cursor
  C-p:    move cursor back one 'line'
  C-q:    play current channel(s) starting at cursor
  C-r:    repeat last search backwards
  C-s:    search according to an expression
  C-t:    stop playing
  C-u:    start count (numerical argument) specification
  C-v:    move cursor to mid-window
  C-w:    delete current region
  C-x:    start extended command (see below)
  C-y:    paste in region
  C-z:    set current sample to 0.0
  C-_:    undo last edit
  C-[Space]: start region definition (arg&lt;0 =&gt; cancel and deselect)
</pre>
        <!-- I(delete samples):K(C-d, C-h, C-k)(ck) --><!-- I(insert zeros):K(C-o, C-z)(cz) --><!-- I(insert zeros):A(co) -->
        <!-- I(cut selection):K(C-w)(cw) --><!-- I(define selection):K(C-[space], C-x c)(cxc) -->

<p>The extended commands (preceded by C-x) are:</p>
<pre>
  a:    apply envelope to selection
  b:    position window so cursor is on left margin
  c:    define selection from cursor to nth mark
  d:    get temp dir name
  e:    execute keyboard macro
  f:    position window so cursor is on right margin
  i:    insert region
  j:    go to named mark
  k:    close file
  l:    position selection in mid-view
  n:    re-evaluate expression over selection
  o:    move to next or previous graph
  p:    play selection or region n
  q:    mix in region
  r:    redo last undone edit
  u:    undo last edit
  v:    position window over current selection
  w:    save selection as file
  x:    evaluate expression over selection
  <a name="cxz">z</a>:    smooth selection
  /:    place named mark
  (:    begin keyboard macro definition
  ):    end keyboard macro definition
        <!-- I(smooth selection):K(C-x z)(cxz) --><!-- I(smooth selection):A(cxz) --><!-- I(define mark):K(C-x /, C-x C-m)(cxcm) -->
        <!-- I(define mark):O(also C-m)(cm) --><!-- I(delete mark):K(- C-m)(cm) --><!-- I(delete mark):A(marks) -->
        <!-- I(smooth selection):L(smooth-selection)(sndsmoothselection) -->

  C-a:  apply amplitude envelope
  C-b:  set x window bounds (preceded by first sample number)
  C-c:  hide ("close") controls
  C-d:  print
  C-f:  open file
  C-g:  abort command
  C-i:  insert file
  C-j:  go to mix console
  <a name="cxcl">C-l</a>:  load scm file
  C-m:  add named mark
  C-n:  re-evaluate expression
  C-o:  show ("open") controls
  C-p:  set (time domain display) window size (preceded by size)
  C-q:  mix in file
  C-r:  redo last undone edit
  C-s:  save file
  C-u:  undo last edit
  C-v:  set (time domain display) window size as percentage of total
  C-w:  save current channel in file
  <a name="cxcx">C-x</a>:  evaluate expression
  C-z:  smooth using cosine
</pre>
        <!-- I(amp env):K(C-x C-a, C-x a)(cxca) --><!-- I(print file):K(C-x C-d)(cxcd) --><!-- I(insert file):K(C-x C-i)(cxci) -->
        <!-- I(insert file):A(cxci) --><!-- I(mix file):K(C-x C-q)(cxcq) -->
        <!-- I(smooth samples):K(C-x C-z)(cxcz) --><!-- I(smooth samples):A(cxcz) -->
        <!-- I(evaluate expression):K(C-x C-x, C-x C-n)(cxcx) --><!-- I(evaluate expression):O(over region: C-x x, C-x n)(cxcn) -->
	<!-- I(continue session):K(C-x C-l)(cxcl) -->
	<!-- I(smooth samples):L(smooth)(sndsmooth) -->
<hr>
<h2><a name="controls">The Control Panel</a></h2>

<p>The control panel is the portion of each sound's display
beneath the channel graphs.  It is normally hidden, except
for the upper portion that shows the file name, the
sync and play buttons, and the minibuffer (the portion
in between that opens into a text window when activated).
</p>
<br>
<center><img src="controls.gif" alt="picture of Snd control panel"></center>
<br>
<br>
<p>The controls are: amp, speed, expand, contrast,
reverb, and filter.</p>

<p><a name="speed"></a>'Speed' here refers to the rate at which the
sound data is consumed during playback.
Another term might be 'srate'.  Snd normally uses
linear interpolation to perform the speed
change; to use sinc interpolation instead, use <a href="extsnd.html#sndsrc">src</a> or the envelope editor.
The arrow button on the right determines
the direction we move through the data.
The scroll bar position is normally interpreted
as a float between .05 and 20.  The Options
Speed Style menu (or the speed-style variable)
can change this to use semitones (actually microtones)
or just-intonation ratios.  The number of equal
divisions to the octave in the semitone case is
set by the variable speed-tones (normally 12).
        <!-- I(change pitch):O(see 'speed' control)(speed) --><!-- I(change pitch):A(speed) -->
        <!-- I(change srate):O(see 'speed' control)(speed) --><!-- I(change srate):A(speed) -->
        <!-- I(change srate):M(Edit: Edit Env)(editenvelope) --><!-- I(change pitch):M(Edit: Edit Env)(editenvelope) -->
</p>

<p><a name="expand"></a>'Expand' refers to a kind of granular
synthesis used to change the tempo of events
in the sound without changing pitch.  Successive
short slices of the file are overlapped with
the difference in size between the input and
output hops (between successive slices) giving
the change in tempo.  This doesn't work in all
files -- it sometimes sounds like execrable reverb
or is too buzzy -- but it certainly is more
robust than the phase vocoder approach to the
same problem. The expander is on only if the expand
button is set.
        <!-- I(change tempo):O(see 'expand' control)(expand) --><!-- I(change tempo):A(expand) -->
	<!-- I(change tempo):M(View: Groups)(groups) -->
</p>

<p><a name="reverb"></a>The reverberator is a version of Michael
McNabb's Nrev.  In addition to the controls
in the control pane, you can set the reverb
<a href="extsnd.html#sndsetreverbfeedback">feedback</a> gain and the coefficient of the <a href="extsnd.html#sndsetreverblowpass">lowpass</a>
filter in the allpass bank (see below).
The reverb is on only
if the reverb button is set.  The reverb length
field takes effect only when the reverb is
set up (when the DAC is started by clicking
'play' when nothing else is being played).
        <!-- I(reverberate file):O(see 'reverb' controls)(reverb) --><!-- I(reverberate file):A(reverb) -->
</p>

<p><a name="contrast"></a>'Contrast enhancement' is my name for a
somewhat weird waveshaper or compander.  It
phase-modulates a sound, which can in some
cases make it sound sharper or brighter.
For softer sounds, it causes only an amplitude
change.  To scale a soft sound up before
being 'contrasted', use the variable
contrast-amp.  The function maxamp
returns the channel's maximum amplitude, so the
inverse of that is a good first guess for
contrast-amp. Contrast is on only if the contrast
button is set.
        <!-- I(brighten file):O(see 'contrast' control)(contrast) --><!-- I(brighten file):A(contrast) -->	
</p>

<p>The <a name="filter">filter</a> is an arbitrary (even) order FIR filter
specified by giving the frequency response 
envelope (the envelope is assumed to go from 0 to half the sampling rate)
and filter order in the text windows provided.
If you raise the control pane from its default height, 
a graph is revealed beneath the filter text field;
this is an envelope editor like the envelope editor dialog
but specialized for filtering.  The actual frequency response
is displayed in blue.
The filter is on only if the filter button is set.
        <!-- I(filter):O(see filter controls)(filter) --><!-- I(filter):A(filter) -->
</p>
<p>There are many variables that reflect or control
the panel's various sliders; each also has a default or
initial value.  The reverb and expand functions also have
several aspects that aren't brought out to sliders or
buttons on the panel, but that can be accessed through
these variables.  See the <a href="extsnd.html#lisplistener">lisp</a> section for details.</p>

<a name="savcontrols"></a>
<p>The 's' (for 'Save') button saves the current control
panel state for a subsequent 'Restore'.
The 'r' (for 'Restore') button returns the control
panel to the state at the time of the
last save, or the initial state if there
has been no save.</p>
        <!-- I(save control state):O('save' button)(savcontrols) --><!-- I(save control state):A(savcontrols) -->

<p>Except for the the reverb length
setting, the controls can be changed as the sound
plays.  You can record the (non-filter-related) changes you make by
setting the 'Record' button, and replay the new
version later with 'Replay'.  The latter actually
takes effect only when play is set in motion.
'Replay' and 'Record' can be set at the same time,
allowing you to add more changes or override previous
ones.  To take all the current recorded changes
and turn them into a giant 'edit' of the
file, click the 'Apply' button.  Apply may change
the length of the file; for example, if reverb is
on, the reverb decay length is added onto
the end.  Once Apply has taken effect, the
controls section is reset to its clean state (so
a subsequent 'play' plays the unmodified newly
edited version).  It is possible to use 'Apply'
over the current selection, or over the current
channel (rather than the entire sound); use C-x p
(for the selection)
or C-q (for the entire channel), then 'Apply'.  In the selection
case, this
only works if the selection does not span several sounds;
the new data is truncated at the bounds of the current selection.
(This may be changed soon).
</p>

<p>Snd's control panel
is not intended to replace mixers or CLM -- I view
it as a quick-and-dirty 'cartooning' facility.  After finding 
useful settings, 
you'll want to save the recorded changes
and run them through CLM or some other hi-fi 
signal processing system.</p>

<p>The keyboard commands associated with the control
panel are:</p>
<pre>
  C-x C-o   show ("open") control panel
  C-x C-c   hide ("close") control panel
</pre>
<p>See also <a href="extsnd.html#callapply">call-apply</a>.</p>
<hr>

<h2><a name="customization">Customization and Extension</a></h2>

<p>See <a href="extsnd.html#extsndcontents">extsnd.html</a>.</p>
<hr>

<h2><a name="index">Index</a></h2>

<table border>
  <caption>Index</caption>
  <!-- created Fri 22-Oct-99 12:27 PDT -->
  <tr><th>Action<th>Menu<th>Keyboard<th>Lisp<th>Other
  <tr><td><a href="#kgc">abort command</a><td><td><a href="#kgc"><font size="2">Cg</font></a><td><a href="extsnd.html#sndabort"><font size="2">abort?</font></a><td><font size="2">mouse click</font>
  <tr><td><a href="#ampenvs">amp env</a><td><font size="2">Edit: <a href="#editenvelope">Edit Env</a></font><td><a href="#cxca"><font size="2">Cx Ca, Cx a</font></a><td><a href="extsnd.html#sndenv"><font size="2">env-sound</font></a><td><a href="extsnd.html#sndscaleto"><font size="2">scale-to, scale-by</font></a>
  <tr><td><a href="extsnd.html#autosave">auto-save</a><td><td><td><td><font size="2">examp.scm</font>
  <tr><td><a href="#autocorrelation">autocorrelation</a><td><font size="2">Options: <a href="#viewfft">Transform</a></font><td><td><td><font size="2">examp.scm</font>
  <tr><td><a href="#cxcb">axis bounds</a><td><td><a href="#cxcb"><font size="2">Cx Cb, Cx Cp</font></a><td><a href="extsnd.html#sndxbounds"><font size="2">[xy]-bounds</font></a><td><a href="#minuss"><font size="2">-s switch to Snd</font></a>
  <tr><td><a href="extsnd.html#fitdataonopen">axis fits data</a><td><td><td><a href="extsnd.html#fitdataonopen"><font size="2">fit-data-on-open</font></a><td><a href="extsnd.html#sndsetybounds"><font size="2">set-y-bounds</font></a>
  <tr><td><a href="#contrast">brighten file</a><td><td><td><td><a href="#contrast"><font size="2">see 'contrast' control</font></a>
  <tr><td><a href="#movewindow">center cursor</a><td><td><a href="#cv"><font size="2">Cl, Cv</font></a><td><td>
  <tr><td><a href="#cxl">center selection</a><td><td><a href="#cxl"><font size="2">Cx l</font></a><td><td>
  <tr><td><a href="#centeryaxis">center tiny signal</a><td><td><td><a href="extsnd.html#sndsetybounds"><font size="2">set-y-bounds</font></a><td>
  <tr><td><a href="extsnd.html#aboutcolors">change colors</a><td><td><td><a href="extsnd.html#aboutcolors"><font size="2">make-color</font></a><td><a href="extsnd.html#sndresources"><font size="2">resources</font></a>
  <tr><td><a href="#changeformat">change format</a><td><font size="2">File: <a href="#savefileas">Save as</a></font><td><td><a href="extsnd.html#sndsaveas"><font size="2">save-sound-as</font></a><td>
  <tr><td><a href="extsnd.html#sndbindkey">change key binding</a><td><td><td><a href="extsnd.html#sndbindkey"><font size="2">bind-key</font></a><td>
  <tr><td><a href="#speed">change pitch</a><td><font size="2">Edit: <a href="#editenvelope">Edit Env</a></font><td><td><a href="extsnd.html#sndsrc"><font size="2">src-sound</font></a><td><a href="#speed"><font size="2">see 'speed' control</font></a>
  <tr><td><a href="#changesamples">change samples</a><td><td><a href="#cz"><font size="2">Cz, Cx Cz</font></a><td><a href="extsnd.html#sndsetsamples"><font size="2">set-samples</font></a><td><a href="#cxcxy"><font size="2">Cx Cx y=val</font></a>
  <tr><td><a href="#speed">change srate</a><td><font size="2">Edit: <a href="#editenvelope">Edit Env</a></font><td><td><a href="extsnd.html#sndsrc"><font size="2">src-sound</font></a><td><a href="#speed"><font size="2">see 'speed' control</font></a>
  <tr><td><a href="#expand">change tempo</a><td><font size="2">View: <a href="#groups">Groups</a></font><td><td><a href="extsnd.html#sndsetexpand"><font size="2">set-expand</font></a><td><a href="#expand"><font size="2">see 'expand' control</font></a>
  <tr><td><a href="#closefile">close file</a><td><font size="2">File: <a href="#closefile">Close</a></font><td><a href="#cxk"><font size="2">Cx k</font></a><td><a href="extsnd.html#sndclose"><font size="2">close-sound</font></a><td>
  <tr><td><a href="#colorbrowser">color</a><td><font size="2">View: <a href="#colorbrowser">Color</a></font><td><td><a href="extsnd.html#sndcolordialog"><font size="2">color-dialog</font></a><td><a href="extsnd.html#colorscale"><font size="2">color-scale,color-cutoff</font></a>
  <tr><td><a href="#unitebutton">combine channels</a><td><font size="2">View: <a href="#unitebutton">Channel style</a></font><td><td><a href="extsnd.html#channelstyle"><font size="2">channel-style</font></a><td>
  <tr><td><a href="#comparefiles">compare files</a><td><td><td><td>
  <tr><td><a href="#savedstate">continue session</a><td><td><a href="#cxcl"><font size="2">Cx Cl</font></a><td><a href="extsnd.html#lload"><font size="2">load</font></a><td><a href="#minusl"><font size="2">-l switch to Snd</font></a>
  <tr><td><a href="#controls">control panel</a><td><font size="2">View: <a href="#controls">Show controls</a></font><td><a href="#cxco"><font size="2">Cx Co, Cx Cc</font></a><td><a href="extsnd.html#sndsetshowingcontrols"><font size="2">set-showing-controls</font></a><td><a href="#panecontrol"><font size="2">drag pane sash</font></a>
  <tr><td><a href="extsnd.html#sndconvolve">convolution</a><td><td><td><a href="extsnd.html#sndconvolve"><font size="2">convolve</font></a><td><a href="extsnd.html#sndconvolvewith"><font size="2">convolve-with</font></a>
  <tr><td><a href="extsnd.html#lcountmatches">count matches</a><td><td><td><a href="extsnd.html#lcountmatches"><font size="2">count-matches</font></a><td>
  <tr><td><a href="#newfile">create new file</a><td><font size="2">File: <a href="#newfile">New</a></font><td><td><a href="extsnd.html#sndnew"><font size="2">new-sound</font></a><td>
  <tr><td><a href="#editoperations">cut selection</a><td><font size="2">Edit: <a href="#editcut">Cut</a></font><td><a href="#cw"><font size="2">Cw</font></a><td><a href="extsnd.html#sndcut"><font size="2">cut</font></a><td>
  <tr><td><a href="#marks">define mark</a><td><td><a href="#cxcm"><font size="2">Cx /, Cx Cm</font></a><td><a href="extsnd.html#sndaddmark"><font size="2">add-mark</font></a><td><a href="#cm"><font size="2">also Cm</font></a>
  <tr><td><a href="#mousedefsect">define selection</a><td><font size="2">Edit: <a href="#selectall">Select All</a></font><td><a href="#cxc"><font size="2">C[space], Cx c</font></a><td><a href="extsnd.html#sndmakeregion"><font size="2">make-region</font></a><td><a href="#mousedefsect"><font size="2">mouse drag</font></a>
  <tr><td><a href="#marks">delete mark</a><td><td><a href="#cm"><font size="2">- Cm</font></a><td><a href="extsnd.html#snddeletemark"><font size="2">delete-mark</font></a><td><a href="extsnd.html#snddeletemarks"><font size="2">delete-marks</font></a>
  <tr><td><a href="#editoperations">delete samples</a><td><font size="2">Edit: <a href="#editcut">Cut</a></font><td><a href="#ck"><font size="2">Cd, Ch, Ck</font></a><td><a href="extsnd.html#snddeletesamples"><font size="2">delete-samples</font></a><td>
  <tr><td><a href="extsnd.html#describeaudiostate">describe audio</a><td><td><td><a href="extsnd.html#describeaudiostate"><font size="2">describe-audio</font></a><td>
  <tr><td><a href="#viewinfo">describe file</a><td><font size="2">Popup: <a href="#viewinfo">Info</a></font><td><td><a href="extsnd.html#sndinfo"><font size="2">info</font></a><td><a href="#viewinfo"><font size="2">Edit: Edit Header</font></a>
  <tr><td><a href="extsnd.html#verbosecursor">describe sample</a><td><font size="2">View: <a href="extsnd.html#verbosecursor">Verbose cursor</a></font><td><a href="#ci"><font size="2">Ci</font></a><td><a href="extsnd.html#verbosecursor"><font size="2">set-verbose-cursor</font></a><td>
  <tr><td><a href="#viewdots">dots or lines</a><td><font size="2">View: <a href="#viewdots">Dots</a></font><td><td><a href="extsnd.html#graphstyle"><font size="2">graph-style</font></a><td><a href="extsnd.html#dotsize"><font size="2">dot-size: numberpad '.', '0'</font></a>
  <tr><td><a href="#editenvelope">edit env</a><td><font size="2">Edit: <a href="#editenvelope">Edit Env</a></font><td><td><a href="extsnd.html#sndenveddialog"><font size="2">enved-dialog</font></a><td>
  <tr><td><a href="#editheader">edit header</a><td><font size="2">Edit: <a href="#editheader">Edit Header</a></font><td><td><a href="extsnd.html#sndeditheaderdialog"><font size="2">edit-header-dialog</font></a><td>
  <tr><td><a href="#cexpression">evaluate expression</a><td><td><a href="#cxcx"><font size="2">Cx Cx, Cx Cn</font></a><td><td><a href="#cxcn"><font size="2">over region: Cx x, Cx n</font></a>
  <tr><td><a href="#regions">examine regions</a><td><font size="2">View: <a href="#regionbrowser">Regions</a></font><td><td><a href="extsnd.html#sndregiondialog"><font size="2">region-dialog</font></a><td>
  <tr><td><a href="#exitfile">exit Snd</a><td><font size="2">File: <a href="#exitfile">Exit</a></font><td><td><a href="extsnd.html#sndexit"><font size="2">exit</font></a><td><font size="2">window menu: close or exit</font>
  <tr><td><a href="#extendfile">extend file</a><td><td><a href="#co"><font size="2">Co</font></a><td><td>
  <tr><td><a href="#cxcw">extract channel</a><td><td><a href="#cxcw"><font size="2">Cx Cw</font></a><td><td>
  <tr><td><a href="#fftindb">fft in dB</a><td><font size="2">Options: <a href="#fftindb">Transform</a></font><td><td><a href="extsnd.html#fftlogmagnitude"><font size="2">fft-log-magnitude</font></a><td>
  <tr><td><a href="#logfreq">fft log freq</a><td><font size="2">Options: <a href="#logfreq">Transform</a></font><td><td><a href="extsnd.html#fftlogfrequency"><font size="2">fft-log-frequency</font></a><td>
  <tr><td><a href="extsnd.html#normalizefft">fft normalization</a><td><font size="2">Options: <a href="extsnd.html#normalizefft">Transform</a></font><td><td><a href="extsnd.html#normalizefft"><font size="2">normalize-fft</font></a><td>
  <tr><td><a href="#showpeaks">fft peaks</a><td><font size="2">Options: <a href="#showpeaks">Transform</a></font><td><td><a href="extsnd.html#showfftpeaks"><font size="2">show-fft-peaks</font></a><td><a href="extsnd.html#sndpeaks"><font size="2">peaks</font></a>
  <tr><td><a href="#fftsize">fft size</a><td><font size="2">Options: <a href="#fftsize">Transform</a></font><td><td><a href="extsnd.html#lfftsize"><font size="2">fft-size</font></a><td><a href="extsnd.html#lfftsize"><font size="2">fft-size: numberpad: '*', '/'</font></a>
  <tr><td><a href="#fftwindow">fft window</a><td><font size="2">Options: <a href="#fftwindow">Transform</a></font><td><td><a href="extsnd.html#lfftwindow"><font size="2">fft-window</font></a><td>
  <tr><td><a href="#Xfftbeta">fft window parameter</a><td><font size="2">Options: <a href="#Xfftbeta">Transform</a></font><td><td><a href="extsnd.html#fftbeta"><font size="2">fft-beta</font></a><td>
  <tr><td><a href="#fftstyle">fft/sono/spectrogram</a><td><font size="2">Options: <a href="extsnd.html#lfftstyle">Transform</a></font><td><td><a href="extsnd.html#lfftstyle"><font size="2">fft-style</font></a><td>
  <tr><td><a href="#formats">file formats</a><td><font size="2">File: <a href="#savefileas">Save as</a></font><td><td><a href="extsnd.html#rawformat"><font size="2">raw-format</font></a><td><a href="#Xdefaultoutputtype"><font size="2">defaultOutputType</font></a>
  <tr><td><a href="#prevfiles">file lists</a><td><font size="2">View: <a href="#prevfiles">Files</a></font><td><td><a href="extsnd.html#sndfiledialog"><font size="2">file-dialog</font></a><td>
  <tr><td><a href="#filter">filter</a><td><font size="2">Edit: <a href="#editenvelope">Edit Env</a></font><td><td><a href="extsnd.html#sndfilterenv"><font size="2">filter-env</font></a><td><a href="#filter"><font size="2">see filter controls</font></a>
  <tr><td><a href="extsnd.html#sndfilter">filter samples</a><td><font size="2">Edit: <a href="#editenvelope">Edit Env</a></font><td><td><a href="extsnd.html#sndfilter"><font size="2">filter-sound</font></a><td><a href="extsnd.html#sndfilterselection"><font size="2">filter-selection</font></a>
  <tr><td><a href="#find">find</a><td><font size="2">Edit: <a href="#find">Find</a></font><td><a href="#cs"><font size="2">Cs or Cr</font></a><td><a href="extsnd.html#lfind"><font size="2">find</font></a><td><a href="extsnd.html#lcountmatches"><font size="2">count-matches</font></a>
  <tr><td><a href="#verticalpane">horizontal panes</a><td><td><td><td><a href="#verticalpane"><font size="2">-h switch to Snd</font></a>
  <tr><td><a href="#cxci">insert file</a><td><td><a href="#cxci"><font size="2">Cx Ci</font></a><td><a href="extsnd.html#sndinsertfile"><font size="2">insert-sound</font></a><td>
  <tr><td><a href="#editcut">insert selection</a><td><font size="2">Edit: <a href="#editcut">Paste</a></font><td><a href="#cxi"><font size="2">Cy or Cx i</font></a><td><a href="extsnd.html#sndinsertregion"><font size="2">insert-region</font></a><td>
  <tr><td><a href="#co">insert zeros</a><td><td><a href="#cz"><font size="2">Co, Cz</font></a><td><a href="extsnd.html#sndinsertsamples"><font size="2">insert-samples</font></a><td>
  <tr><td><a href="#kgc">interrupt Snd</a><td><td><a href="#kgc"><font size="2">Cg</font></a><td><a href="extsnd.html#sndstop"><font size="2">stop</font></a><td><a href="#editenvelope"><font size="2">edit env</font></a>
  <tr><td><a href="#kbdmacros">keyboard macros</a><td><td><a href="#kce"><font size="2">C(, Cx e</font></a><td><a href="extsnd.html#sndkey"><font size="2">key</font></a><td>
  <tr><td><a href="extsnd.html#sndmaxamp">max amp</a><td><td><td><a href="extsnd.html#sndmaxamp"><font size="2">maxamp</font></a><td>
  <tr><td><a href="#mixingfiles">mix file</a><td><font size="2">File: <a href="#mixingfiles">Mix</a></font><td><a href="#cxcq"><font size="2">Cx Cq</font></a><td><a href="extsnd.html#sndmix"><font size="2">mix</font></a><td>
  <tr><td><a href="#editcut">mix selection</a><td><font size="2">Edit: <a href="#editcut">Mix</a></font><td><a href="#cxq"><font size="2">Cx q</font></a><td><a href="extsnd.html#sndmixregion"><font size="2">mix-region</font></a><td>
  <tr><td><a href="#thecursor">move cursor ahead</a><td><td><a href="#ce"><font size="2">Cf, Cn, Ce</font></a><td><a href="extsnd.html#sndforwardsample"><font size="2">forward-sample</font></a><td><font size="2">also &gt;</font>
  <tr><td><a href="#thecursor">move cursor back</a><td><td><a href="#ca"><font size="2">Cb, Cp, Ca</font></a><td><a href="extsnd.html#sndbackwardsample"><font size="2">backward-sample</font></a><td><font size="2">also &lt;</font>
  <tr><td><a href="#movemixedfile">move mixed file</a><td><td><td><a href="extsnd.html#sndsetmixposition"><font size="2">set-mix-position</font></a><td><a href="#movemixedfile"><font size="2">see mix doc</font></a>
  <tr><td><a href="#cj">move to mark</a><td><td><a href="#cj"><font size="2">Cj, Cx j</font></a><td><a href="extsnd.html#sndforwardmark"><font size="2">forward-mark</font></a><td><a href="#cxj"><font size="2">Cx j -&gt; named mark</font></a>
  <tr><td><a href="#gotomix">move to mix</a><td><td><a href="#cxcj"><font size="2">Cx Cj</font></a><td><a href="extsnd.html#sndforwardmix"><font size="2">forward-mix</font></a><td>
  <tr><td><a href="#movingwindow">move window ahead</a><td><td><a href="#cxf"><font size="2">[Left], Cx f</font></a><td><a href="extsnd.html#sndsetrightsample"><font size="2">set-right-sample</font></a><td><font size="2">scroll bars</font>
  <tr><td><a href="#movingwindow">move window back</a><td><td><a href="#movewindow"><font size="2">[Right], Cx b</font></a><td><a href="extsnd.html#sndsetleftsample"><font size="2">set-left-sample</font></a><td><font size="2">scroll bars</font>
  <tr><td><a href="#multichannel">multichannel ops</a><td><td><td><a href="extsnd.html#sndsyncing"><font size="2">syncing</font></a><td><a href="#syncbutton"><font size="2">sync button</font></a>
  <tr><td><a href="#viewnormalize">normalize display</a><td><font size="2">View: <a href="#viewnormalize">Normalize</a></font><td><td><a href="extsnd.html#sndnormalizeview"><font size="2">normalize-view</font></a><td><font size="2">Popup: Normalize</font>
  <tr><td><a href="#cu">numeric arguments</a><td><td><a href="#kcu"><font size="2">Cu</font></a><td><a href="extsnd.html#prefixarg"><font size="2">prefix-arg</font></a><td><a href="#kcu"><font size="2">see marks as args</font></a>
  <tr><td><a href="#saveopen">open file</a><td><font size="2">File: <a href="#openfile">Open</a></font><td><a href="#cxcf"><font size="2">Cx Cf</font></a><td><a href="extsnd.html#sndopen"><font size="2">open-sound</font></a><td><font size="2">Files dialog: click file</font>
  <tr><td><a href="#viewfile">open file read-only</a><td><font size="2">File: <a href="#viewfile">View</a></font><td><td><a href="extsnd.html#sndview"><font size="2">view-sound</font></a><td>
  <tr><td><a href="#colorbrowser">orientation</a><td><font size="2">View: <a href="#orientationbrowser">Orientation</a></font><td><td><a href="extsnd.html#sndorientationdialog"><font size="2">orientation-dialog</font></a><td>
  <tr><td><a href="#overwrite">overwrite check</a><td><td><td><a href="#overwrite"><font size="2">ask-before-overwrite</font></a><td><a href="#overwrite"><font size="2">overwriteCheck</font></a>
  <tr><td><a href="#cq">play channel</a><td><td><a href="#cq"><font size="2">Cq, Ct</font></a><td><a href="extsnd.html#sndplay"><font size="2">play</font></a><td>
  <tr><td><a href="#play">play file</a><td><font size="2">Popup: Play</font><td><td><a href="extsnd.html#sndplay"><font size="2">play, stop</font></a><td><font size="2">File or main window: 'play'</font>
  <tr><td><a href="#cxp">play selection</a><td><font size="2">Edit: <a href="#cxp">Play</a></font><td><a href="#cxp"><font size="2">Cx p</font></a><td><a href="extsnd.html#sndplayregion"><font size="2">play-region</font></a><td>
  <tr><td><a href="extsnd.html#snddynamic">plug-ins</a><td><td><td><a href="extsnd.html#callplug"><font size="2">call-plug</font></a><td><a href="extsnd.html#callplugselection"><font size="2">call-plug-selection</font></a>
  <tr><td><a href="#minusp">preload directory</a><td><td><td><a href="extsnd.html#sndpreloaddirectory"><font size="2">preload-directory</font></a><td><a href="#minusp"><font size="2">-p switch to Snd</font></a>
  <tr><td><a href="#printfile">print file</a><td><font size="2">File: <a href="#printfile">Print</a></font><td><a href="#cxcd"><font size="2">Cx Cd</font></a><td><a href="extsnd.html#sndgraph2ps"><font size="2">graph->ps</font></a><td><a href="extsnd.html#epsresource"><font size="2">epsFile resource</font></a>
  <tr><td><a href="#recordfile">record sound</a><td><font size="2">File: <a href="#recordfile">Record</a></font><td><td><a href="extsnd.html#sndrecorderdialog"><font size="2">recorder-dialog</font></a><td>
  <tr><td><a href="#undoredo">redo edit</a><td><font size="2">Edit: <a href="#undoredo">Redo</a></font><td><a href="#cxcr"><font size="2">Cx Cr</font></a><td><a href="extsnd.html#sndredo"><font size="2">redo</font></a><td><font size="2">Popup: Redo</font>
  <tr><td><a href="extsnd.html#sndsrc">resample</a><td><font size="2">Edit: <a href="#editenvelope">Edit Env</a></font><td><td><a href="extsnd.html#sndsrc"><font size="2">src-sound</font></a><td><a href="extsnd.html#sndsrcselection"><font size="2">src-selection</font></a>
  <tr><td><a href="#reverb">reverberate file</a><td><td><td><a href="extsnd.html#sndconvolvewith"><font size="2">convolve-with</font></a><td><a href="#reverb"><font size="2">see 'reverb' controls</font></a>
  <tr><td><a href="extsnd.html#sndreverse">reverse samples</a><td><td><td><a href="extsnd.html#sndreverse"><font size="2">reverse-sound</font></a><td><a href="extsnd.html#sndreverseselection"><font size="2">reverse-selection</font></a>
  <tr><td><a href="#revertfile">revert file</a><td><font size="2">File: <a href="#revertfile">Revert</a></font><td><td><a href="extsnd.html#sndrevert"><font size="2">revert-sound</font></a><td>
  <tr><td><a href="#cxcw">save channel</a><td><td><a href="#cxcw"><font size="2">Cx Cw</font></a><td><td>
  <tr><td><a href="#savcontrols">save control state</a><td><td><td><a href="extsnd.html#sndcontrolpanelsave"><font size="2">control-panel-save</font></a><td><a href="#savcontrols"><font size="2">'save' button</font></a>
  <tr><td><a href="#savefile">save file</a><td><font size="2">File: <a href="#savefile">Save</a></font><td><a href="#cxcs"><font size="2">Cx Cs</font></a><td><a href="extsnd.html#sndsave"><font size="2">save-sound</font></a><td><font size="2">Popup: Save</font>
  <tr><td><a href="#changeformat">save file as</a><td><font size="2">File: <a href="#savefileas">Save as</a></font><td><td><a href="extsnd.html#sndsaveas"><font size="2">save-sound-as</font></a><td><a href="#overwrite"><font size="2">see also overwriteCheck</font></a>
  <tr><td><a href="#kbdmacros">save macros</a><td><td><td><a href="extsnd.html#sndsavemacros"><font size="2">save-macros</font></a><td>
  <tr><td><a href="#savemarks">save marks</a><td><td><td><a href="extsnd.html#sndsavemarks"><font size="2">save-marks</font></a><td>
  <tr><td><a href="#saveoptions">save options</a><td><font size="2">Options: <a href="#saveoptions">Save options</a></font><td><td><a href="extsnd.html#sndsaveoptions"><font size="2">save-options</font></a><td>
  <tr><td><a href="#cxw">save selection</a><td><font size="2">Edit: <a href="#cxw">Save selection</a></font><td><a href="#cxw"><font size="2">Cx w</font></a><td><a href="extsnd.html#sndsaveregion"><font size="2">save-region</font></a><td><a href="extsnd.html#sndsaveselection"><font size="2">save-selection</font></a>
  <tr><td><a href="#savedstate">save state</a><td><font size="2">Options: <a href="#savedstate">Save State</a></font><td><td><a href="extsnd.html#sndsavestate"><font size="2">save-state</font></a><td><a href="extsnd.html#savestateonexit"><font size="2">save-state-on-exit</font></a>
  <tr><td><a href="#prevfiles">select sound</a><td><td><a href="#cxo"><font size="2">Cx o</font></a><td><a href="extsnd.html#sndselectsound"><font size="2">select-sound</font></a><td><font size="2">File dialog: click file</font>
  <tr><td><a href="#edithistory">show edit list</a><td><font size="2">Edit: <a href="#edithistory">Show edit history</a></font><td><td><a href="extsnd.html#showedithistory"><font size="2">show-edit-history</font></a><td>
  <tr><td><a href="#fw">show freq domain</a><td><td><td><a href="extsnd.html#sndffting"><font size="2">ffting</font></a><td><a href="#fw"><font size="2">'f' button</font></a>
  <tr><td><a href="#marks">show marks</a><td><font size="2">View: <a href="#marks">Show marks</a></font><td><td><a href="extsnd.html#setshowmarks"><font size="2">set-show-marks</font></a><td>
  <tr><td><a href="#fw">show time domain</a><td><td><td><a href="extsnd.html#sndwaving"><font size="2">waving</font></a><td><a href="#fw"><font size="2">'w' button</font></a>
  <tr><td><a href="#cxcz">smooth samples</a><td><td><a href="#cxcz"><font size="2">Cx Cz</font></a><td><a href="extsnd.html#sndsmooth"><font size="2">smooth</font></a><td>
  <tr><td><a href="#cxz">smooth selection</a><td><td><a href="#cxz"><font size="2">Cx z</font></a><td><a href="extsnd.html#sndsmoothselection"><font size="2">smooth-selection</font></a><td>
  <tr><td><a href="#fftstyle">sonogram</a><td><font size="2">Options: <a href="#fftstyle">Transform</a></font><td><td><a href="extsnd.html#lfftstyle"><font size="2">fft-style</font></a><td><a href="extsnd.html#colormap"><font size="2">colormap</font></a>
  <tr><td><a href="#fftstyle">spectrogram</a><td><font size="2">Options: <a href="#fftstyle">Transform</a></font><td><td><a href="extsnd.html#lfftstyle"><font size="2">fft-style</font></a><td><a href="extsnd.html#spectrocutoff"><font size="2">orientation, scaling</font></a>
  <tr><td><a href="extsnd.html#lspeedstyle">speed units</a><td><font size="2">Options: <a href="extsnd.html#lspeedstyle">Speed style</a></font><td><td><a href="extsnd.html#lspeedstyle"><font size="2">speed-style</font></a><td><a href="extsnd.html#speedtones"><font size="2">speed-tones</font></a>
  <tr><td><a href="extsnd.html#sndsrc">srate conversion</a><td><font size="2">Edit: <a href="#editenvelope">Edit Env</a></font><td><td><a href="extsnd.html#sndsrc"><font size="2">src-sound</font></a><td><a href="extsnd.html#sndsrcselection"><font size="2">src-selection</font></a>
  <tr><td><a href="#ktempdir">temp directory</a><td><td><a href="#ktempdir"><font size="2">Cx d</font></a><td><a href="extsnd.html#tempdir"><font size="2">temp-dir</font></a><td><font size="2">TMPDIR or /var/tmp</font>
  <tr><td><a href="#trackingcursor">tracking cursor</a><td><td><td><a href="extsnd.html#sndcursorfollowsplay"><font size="2">cursor-follows-play</font></a><td><a href="#trackingcursor"><font size="2">control click 'play'</font></a>
  <tr><td><a href="#undoredo">undo edit</a><td><font size="2">Edit: <a href="#undoredo">Undo</a></font><td><a href="#cxcu"><font size="2">C_ or Cx Cu</font></a><td><a href="extsnd.html#sndundo"><font size="2">undo</font></a><td><font size="2">Popup: Undo</font>
  <tr><td><a href="#updatefile">update file</a><td><font size="2">File: <a href="#updatefile">Update</a></font><td><font size="2">[Home]</font><td><a href="extsnd.html#sndupdate"><font size="2">update</font></a><td><a href="extsnd.html#corruptiontime"><font size="2">corruption-time, auto-update</font></a>
  <tr><td><a href="#editenvelope">view envs</a><td><font size="2">Edit: <a href="#editenvelope">Edit Env</a></font><td><td><a href="extsnd.html#sndenveddialog"><font size="2">enved-dialog</font></a><td>
  <tr><td><a href="#transformtype">wavelets</a><td><font size="2">Options: <a href="#transformtype">Transform</a></font><td><td><a href="extsnd.html#wavelettype"><font size="2">wavelet-type</font></a><td>
  <tr><td><a href="#wavogram">wavogram</a><td><td><td><a href="#wavogram"><font size="2">wavo</font></a><td><a href="extsnd.html#wavohop"><font size="2">wavo-trace, wavo-hop</font></a>
  <tr><td><a href="extsnd.html#xaxisstyle">X axis units</a><td><font size="2">View: <a href="extsnd.html#xaxisstyle">X axis units</a></font><td><td><a href="extsnd.html#xaxisstyle"><font size="2">x-axis-style</font></a><td>
  <tr><td><a href="#viewy0">y=0 line</a><td><font size="2">View: <a href="#viewy0">Show y=0</a></font><td><td><a href="extsnd.html#setshowyzero"><font size="2">set-show-y-zero</font></a><td>
  <tr><td><a href="#zoomoption">zoom focus</a><td><font size="2">Options: <a href="#zoomoption">Zoom style</a></font><td><td><a href="extsnd.html#setzoomfocusstyle"><font size="2">set-zoom-focus-style</font></a><td>
  <tr><td><a href="#movingwindow">zoom window</a><td><td><font size="2">[Up],[Down]</font><td><a href="extsnd.html#sndsetxbounds"><font size="2">set-x-bounds</font></a><td><a href="#movingwindow"><font size="2">control keys intensify</font></a>
</table>

</body></html>