summaryrefslogtreecommitdiff
path: root/extsnd.html
diff options
context:
space:
mode:
authorAlessio Treglia <alessio@debian.org>2011-03-24 09:13:51 +0100
committerAlessio Treglia <alessio@debian.org>2011-03-24 09:13:51 +0100
commite5328e59987b90c4e98959510b810510e384650d (patch)
tree0f140b79d942c4654701d8fb4cfe2f1dd904f9f0 /extsnd.html
parent36cf8384e5699cda3f1ca607753fe4d4a8515b01 (diff)
Imported Upstream version 12.0
Diffstat (limited to 'extsnd.html')
-rw-r--r--extsnd.html964
1 files changed, 455 insertions, 509 deletions
diff --git a/extsnd.html b/extsnd.html
index bb97757..57fe4f5 100644
--- a/extsnd.html
+++ b/extsnd.html
@@ -26,7 +26,7 @@
<script language=JavaScript type="text/javascript" src="wz_tooltip.js"></script>
<script language=JavaScript type="text/javascript" src="wz_data.js"></script>
-<!-- I'm using A NAME (i.e caps) where the entity should be ignored by the indexer (index.cl) -->
+<!-- I'm using A NAME (i.e caps) where the entity should be ignored by the indexer (make-index.scm) -->
<A NAME="extsndcontents"></a>
<table border=0 bordercolor="lightgreen" width=100% cellpadding=2 cellspacing=0><tr><td bgcolor="lightgreen">
@@ -100,7 +100,6 @@
<ul>
<li><a href="grfsnd.html#sndswitches" onmouseout="UnTip()" onmouseover="Tip('startup switches such as -l and -p')">Snd invocation flags</a>
<li><a href="grfsnd.html#sndinitfile" onmouseout="UnTip()" onmouseover="Tip('~/.snd, ~/.snd_s7, ~/.snd_prefs_s7, etc')">The initialization file</a>
- <li><a href="grfsnd.html#sndresources" onmouseout="UnTip()" onmouseover="Tip('X resources: Xdefaults, gtkrc')">Snd resources</a>
<li><a href="grfsnd.html#sndconfigurationswitches" onmouseout="UnTip()" onmouseover="Tip('this refers to the configure script that prepares a makefile to build Snd from its sources')">Configuration choices</a>
<li><a href="grfsnd.html#sndenvvars" onmouseout="UnTip()" onmouseover="Tip('mostly related to audio hardware choices')">Environment variables</a>
</ul>
@@ -108,7 +107,6 @@
<ul>
<li><a href="grfsnd.html#emacssnd" onmouseout="UnTip()" onmouseover="Tip('Use Emacs as the listener')">Snd as an Emacs subjob</a>
<li><a href="grfsnd.html#dynamic" onmouseout="UnTip()" onmouseover="Tip('Load your own C code into Snd')">Dynamically loaded modules</a>
- <li><a href="grfsnd.html#programs" onmouseout="UnTip()" onmouseover="Tip('Use independent programs to perform editing operations')">External Programs</a>
<li><a href="grfsnd.html#sndaswidget" onmouseout="UnTip()" onmouseover="Tip('Embed Snd in some other program')">Snd as a Widget</a>
<li><a href="grfsnd.html#sndwithclm" onmouseout="UnTip()" onmouseover="Tip('CLM is built into Snd')">Snd and CLM</a>
<li><a href="grfsnd.html#sndwithcm" onmouseout="UnTip()" onmouseover="Tip('CM is Rick Taube\'s composition environment')">Snd and Common Music</a>
@@ -345,9 +343,8 @@ extension language, that initializes Snd to use whatever items you chose.
<p><small>If the listener is active, and some sound
is selected, any characters typed while in the sound
graph which it can't handle are passed to the
-listener; to exit the listener without using the
-mouse, type C-g. This is also the way to get back to
-the listener prompt if it appears to be hung; normally
+listener.
+If the listener appears to be hung, try C-g; normally
in this situation,
it's actually waiting for a close paren; if you put the
cursor just past the close paren you're interested in
@@ -508,65 +505,62 @@ Extensions to Snd can be found in:
<tr><td bgcolor="#f2f4ff"><a href="sndscm.html#polydoc">poly</a></td>
<td bgcolor="#f2f4ff" onmouseout="UnTip()" onmouseover="Tip(poly_doc_tip)">polynomial-related stuff</td></tr>
-<tr><td><a href="sndscm.html#popupdoc">popup, gtk-popup</a></td>
- <td onmouseout="UnTip()" onmouseover="Tip(popup_doc_tip)">Popup menu specializations</td></tr>
-
-<tr><td bgcolor="#f2f4ff"><a href="sndscm.html#prc95doc">prc95</a></td>
- <td bgcolor="#f2f4ff" onmouseout="UnTip()" onmouseover="Tip(prc95_doc_tip)">Perry Cook's physical model examples</td></tr>
+<tr><td><a href="sndscm.html#prc95doc">prc95</a></td>
+ <td onmouseout="UnTip()" onmouseover="Tip(prc95_doc_tip)">Perry Cook's physical model examples</td></tr>
-<tr><td><a href="sndscm.html#pvocdoc">pvoc</a></td>
- <td onmouseout="UnTip()" onmouseover="Tip(pvoc_doc_tip)">phase-vocoder</td></tr>
+<tr><td bgcolor="#f2f4ff"><a href="sndscm.html#pvocdoc">pvoc</a></td>
+ <td bgcolor="#f2f4ff" onmouseout="UnTip()" onmouseover="Tip(pvoc_doc_tip)">phase-vocoder</td></tr>
-<tr><td bgcolor="#f2f4ff"><a href="sndscm.html#rgbdoc">rgb</a></td>
- <td bgcolor="#f2f4ff" onmouseout="UnTip()" onmouseover="Tip(rgb_doc_tip)">color names</td></tr>
+<tr><td><a href="sndscm.html#rgbdoc">rgb</a></td>
+ <td onmouseout="UnTip()" onmouseover="Tip(rgb_doc_tip)">color names</td></tr>
-<tr><td><a href="sndscm.html#rtiodoc">rtio</a></td>
- <td onmouseout="UnTip()" onmouseover="Tip(rtio_doc_tip)">real-time stuff</td></tr>
+<tr><td bgcolor="#f2f4ff"><a href="sndscm.html#rtiodoc">rtio</a></td>
+ <td bgcolor="#f2f4ff" onmouseout="UnTip()" onmouseover="Tip(rtio_doc_tip)">real-time stuff</td></tr>
-<tr><td bgcolor="#f2f4ff"><a href="sndscm.html#rubberdoc">rubber</a></td>
- <td bgcolor="#f2f4ff" onmouseout="UnTip()" onmouseover="Tip(rubber_doc_tip)">rubber-sound</td></tr>
+<tr><td><a href="sndscm.html#rubberdoc">rubber</a></td>
+ <td onmouseout="UnTip()" onmouseover="Tip(rubber_doc_tip)">rubber-sound</td></tr>
-<tr><td><a href="sndscm.html#selectiondoc">selection</a></td>
- <td onmouseout="UnTip()" onmouseover="Tip(selection_doc_tip)">functions acting on the current selection</td></tr>
+<tr><td bgcolor="#f2f4ff"><a href="sndscm.html#selectiondoc">selection</a></td>
+ <td bgcolor="#f2f4ff" onmouseout="UnTip()" onmouseover="Tip(selection_doc_tip)">functions acting on the current selection</td></tr>
-<tr><td bgcolor="#f2f4ff"><a href="sndscm.html#singerdoc">singer</a></td>
- <td bgcolor="#f2f4ff" onmouseout="UnTip()" onmouseover="Tip(singer_doc_tip)">Perry Cook's vocal-tract physical model</td></tr>
+<tr><td><a href="sndscm.html#singerdoc">singer</a></td>
+ <td onmouseout="UnTip()" onmouseover="Tip(singer_doc_tip)">Perry Cook's vocal-tract physical model</td></tr>
-<tr><td><a href="sndscm.html#sndolddoc">snd6|7|8|9|10|11.scm</a></td>
- <td onmouseout="UnTip()" onmouseover="Tip(sndold_doc_tip)">Backwards compatibility</td></tr>
+<tr><td bgcolor="#f2f4ff"><a href="sndscm.html#sndolddoc">snd9|10|11.scm</a></td>
+ <td bgcolor="#f2f4ff" onmouseout="UnTip()" onmouseover="Tip(sndold_doc_tip)">Backwards compatibility</td></tr>
-<tr><td bgcolor="#f2f4ff"><a href="sndscm.html#snddiffdoc">snddiff</a></td>
- <td bgcolor="#f2f4ff" onmouseout="UnTip()" onmouseover="Tip(snddiff_doc_tip)">sound difference detection</td></tr>
+<tr><td><a href="sndscm.html#snddiffdoc">snddiff</a></td>
+ <td onmouseout="UnTip()" onmouseover="Tip(snddiff_doc_tip)">sound difference detection</td></tr>
-<tr><td><a href="sndscm.html#sndgldoc">snd-gl</a></td>
- <td onmouseout="UnTip()" onmouseover="Tip(snd_gl_doc_tip)">OpenGL examples (gl.c)</td></tr>
+<tr><td bgcolor="#f2f4ff"><a href="sndscm.html#sndgldoc">snd-gl</a></td>
+ <td bgcolor="#f2f4ff" onmouseout="UnTip()" onmouseover="Tip(snd_gl_doc_tip)">OpenGL examples (gl.c)</td></tr>
-<tr><td bgcolor="#f2f4ff"><a href="sndscm.html#sndmotifdoc">snd-motif, snd-gtk, snd-xm</a></td>
- <td bgcolor="#f2f4ff" onmouseout="UnTip()" onmouseover="Tip(snd_motif_doc_tip)">Motif/Gtk module (xm.c, xg.c)</td></tr>
+<tr><td><a href="sndscm.html#sndmotifdoc">snd-motif, snd-gtk, snd-xm</a></td>
+ <td onmouseout="UnTip()" onmouseover="Tip(snd_motif_doc_tip)">Motif/Gtk module (xm.c, xg.c)</td></tr>
-<tr><td><a href="sndscm.html#sndtestdoc">snd-test</a></td>
- <td onmouseout="UnTip()" onmouseover="Tip(snd_test_doc_tip)">Snd regression tests</td></tr>
+<tr><td bgcolor="#f2f4ff"><a href="sndscm.html#sndtestdoc">snd-test</a></td>
+ <td bgcolor="#f2f4ff" onmouseout="UnTip()" onmouseover="Tip(snd_test_doc_tip)">Snd regression tests</td></tr>
-<tr><td bgcolor="#f2f4ff"><a href="sndscm.html#sndwarpdoc">sndwarp</a></td>
- <td bgcolor="#f2f4ff" onmouseout="UnTip()" onmouseover="Tip(sndwarp_doc_tip)">Bret Battey's sndwarp instrument</td></tr>
+<tr><td><a href="sndscm.html#sndwarpdoc">sndwarp</a></td>
+ <td onmouseout="UnTip()" onmouseover="Tip(sndwarp_doc_tip)">Bret Battey's sndwarp instrument</td></tr>
-<tr><td><a href="sndscm.html#spectrdoc">spectr</a></td>
- <td>instrument steady state spectra</td></tr>
+<tr><td bgcolor="#f2f4ff"><a href="sndscm.html#spectrdoc">spectr</a></td>
+ <td bgcolor="#f2f4ff">instrument steady state spectra</td></tr>
-<tr><td bgcolor="#f2f4ff"><a href="sndscm.html#stochasticdoc">stochastic</a></td>
- <td bgcolor="#f2f4ff">Bill Sack's dynamic stochastic synthesis</td></tr>
+<tr><td><a href="sndscm.html#stochasticdoc">stochastic</a></td>
+ <td>Bill Sack's dynamic stochastic synthesis</td></tr>
-<tr><td><a href="sndscm.html#straddoc">strad</a></td>
- <td>string physical model (from CLM)</td></tr>
+<tr><td bgcolor="#f2f4ff"><a href="sndscm.html#straddoc">strad</a></td>
+ <td bgcolor="#f2f4ff">string physical model (from CLM)</td></tr>
-<tr><td bgcolor="#f2f4ff"><a href="sndscm.html#vdoc">v</a></td>
- <td bgcolor="#f2f4ff">fm-violin</td></tr>
+<tr><td><a href="sndscm.html#vdoc">v</a></td>
+ <td>fm-violin</td></tr>
-<tr><td><a href="sndscm.html#wsdoc">ws</a></td>
- <td onmouseout="UnTip()" onmouseover="Tip(ws_doc_tip)">with-sound</td></tr>
+<tr><td bgcolor="#f2f4ff"><a href="sndscm.html#wsdoc">ws</a></td>
+ <td bgcolor="#f2f4ff" onmouseout="UnTip()" onmouseover="Tip(ws_doc_tip)">with-sound</td></tr>
-<tr><td bgcolor="#f2f4ff"><a href="sndscm.html#zipdoc">zip</a></td>
- <td bgcolor="#f2f4ff" onmouseout="UnTip()" onmouseover="Tip(zip_doc_tip)">the zipper (the anti-cross-fader)</td></tr>
+<tr><td><a href="sndscm.html#zipdoc">zip</a></td>
+ <td onmouseout="UnTip()" onmouseover="Tip(zip_doc_tip)">the zipper (the anti-cross-fader)</td></tr>
</table>
</td></tr></table>
@@ -595,7 +589,7 @@ Snd does not exit.</p>
(unsaved-edits? (cdr lst)))
#f))
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>before-exit-hook</em> (lambda () (unsaved-edits? (<a class=quiet href="#sounds" onmouseout="UnTip()" onmouseover="Tip(extsnd_sounds_tip)">sounds</a>))))
+(hook-push <em class=red>before-exit-hook</em> (lambda () (unsaved-edits? (<a class=quiet href="#sounds" onmouseout="UnTip()" onmouseover="Tip(extsnd_sounds_tip)">sounds</a>))))
</pre></td></tr></table>
<p>Now when Snd is told to exit, it checks before-exit-hook, runs
@@ -644,9 +638,18 @@ function. </p>
<tr><td width=30></td><td width=220></td><td></td></tr>
+<!-- ask-about-unsaved-edits -->
+<tr><td colspan=2 bgcolor="#f2f4ff"><code><a class=def name="askaboutunsavededits">ask-about-unsaved-edits</a></code></td>
+<td bgcolor="#f2f4ff" onmouseout="UnTip()" onmouseover="Tip('in this table, the default value of the given variable is listed after the variable name,<br>so ask-about-unsaved-edits defaults to false')"><code>#f</code></td></tr><tr><td></td><td colspan=2>
+If ask-about-unsaved-edits is #t, Snd worries about unsaved edits when a sound is about to be closed.
+Otherwise Snd just closes the sound, flushing any unsaved edits.
+<code>(set! (ask-about-unsaved-edits) #t)</code>
+</td></tr><tr><td colspan=3 height=16></td></tr>
+
+
<!-- ask-before-overwrite -->
<tr><td colspan=2 bgcolor="#f2f4ff"><code><a class=def name="askbeforeoverwrite">ask-before-overwrite</a></code></td>
-<td bgcolor="#f2f4ff" onmouseout="UnTip()" onmouseover="Tip('in this table, the default value of the given variable is listed after the variable name,<br>so ask-before-overwrite defaults to false')"><code>#f</code></td></tr><tr><td></td><td colspan=2>
+<td bgcolor="#f2f4ff"><code>#f</code></td></tr><tr><td></td><td colspan=2>
ask-before-overwrite determines whether Snd asks before overwriting an existing file:
<code>(set! (ask-before-overwrite) #t)</code>
</td></tr><tr><td colspan=3 height=16></td></tr>
@@ -668,7 +671,7 @@ This is the audio output device for the play button.
<!-- auto-resize -->
<tr><td colspan=2 bgcolor="#f2f4ff"><code><a class=def name="autoresize">auto-resize</a></code></td>
-<td bgcolor="#f2f4ff"><code>#t</code></td></tr><tr><td></td><td colspan=2>
+<td bgcolor="#f2f4ff"><code>#t in Motif, #f in Gtk</code></td></tr><tr><td></td><td colspan=2>
auto-resize determines whether the Snd window should be resized
when a sound is opened or closed.
</td></tr><tr><td colspan=3 height=16></td></tr>
@@ -900,6 +903,7 @@ See the function html in index.scm.
</td></tr><tr><td colspan=3 height=16></td></tr>
+
<!-- html-program -->
<tr><td colspan=2 bgcolor="#f2f4ff"><code><a class=def name="htmlprogram">html-program</a></code></td>
<td bgcolor="#f2f4ff"><code>"firefox"</code></td></tr><tr><td></td><td colspan=2>
@@ -909,6 +913,20 @@ See the function html in index.scm.
</td></tr><tr><td colspan=3 height=16></td></tr>
+<!-- initial-beg -->
+<tr><td colspan=2 bgcolor="#f2f4ff"><code><a class=def name="initialbeg">initial-beg</a></code></td>
+<td bgcolor="#f2f4ff"><code>0.0</code></td></tr><tr><td></td><td colspan=2>
+initial-beg is the start point (in seconds) of the initial graph of a sound.
+</td></tr><tr><td colspan=3 height=16></td></tr>
+
+
+<!-- initial-dur -->
+<tr><td colspan=2 bgcolor="#f2f4ff"><code><a class=def name="initialdur">initial-dur</a></code></td>
+<td bgcolor="#f2f4ff"><code>0.1</code></td></tr><tr><td></td><td colspan=2>
+initial-dur is the duration (in seconds) of the initial graph of a sound.
+</td></tr><tr><td colspan=3 height=16></td></tr>
+
+
<!-- just-sounds -->
<tr><td colspan=2 bgcolor="#f2f4ff"><code><a class=def name="justsounds">just-sounds</a></code></td>
<td bgcolor="#f2f4ff"><code>#t</code></td></tr><tr><td></td><td colspan=2>
@@ -1007,7 +1025,7 @@ Currently, the optimizer is able to speed up Scheme code by factors between
If you set the optimization-hook to print out whatever its argument is, you can
find out what the optimizer found confusing:
<pre>
- (<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <a class=quiet href="#optimizationhook" onmouseout="UnTip()" onmouseover="Tip(extsnd_optimizationhook_tip)">optimization-hook</a> (lambda (n) (display (<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_format_tip)">format</a> #f "opt: ~A~%" n))))
+ (hook-push <a class=quiet href="#optimizationhook" onmouseout="UnTip()" onmouseover="Tip(extsnd_optimizationhook_tip)">optimization-hook</a> (lambda (n) (display (<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_format_tip)">format</a> #f "opt: ~A~%" n))))
</pre>
See also <a href="#maxvirtualptrees">max-virtual-ptrees</a>.
</td></tr><tr><td colspan=3 height=16></td></tr>
@@ -1022,6 +1040,13 @@ the initial graph display the next time you open that sound.
</td></tr><tr><td colspan=3 height=16></td></tr>
+<!-- play-arrow-size -->
+<tr><td colspan=2 bgcolor="#f2f4ff"><code><a class=def name="playarrowsize">play-arrow-size</a></code></td>
+<td bgcolor="#f2f4ff"><code>10</code></td></tr><tr><td></td><td colspan=2>
+This is the size of the triangular arrow that handles click-to-play duties for the cursor, marks, mixes, and the selection.
+</td></tr><tr><td colspan=3 height=16></td></tr>
+
+
<!-- print-length -->
<tr><td colspan=2 bgcolor="#f2f4ff"><code><a class=def name="printlength">print-length</a></code></td>
<td bgcolor="#f2f4ff"><code>12</code></td></tr><tr><td></td><td colspan=2>
@@ -1036,6 +1061,14 @@ In S7, this also sets *vector-print-length*.
</td></tr><tr><td colspan=3 height=16></td></tr>
+<!-- remember-sound-state -->
+<tr><td colspan=2 bgcolor="#f2f4ff"><code><a class=def name="remembersoundstate">remember-sound-state</a></code></td>
+<td bgcolor="#f2f4ff"><code>#f</code></td></tr><tr><td></td><td colspan=2>
+If remember-sound-state is #t, Snd saves most of a sound's display state when it is closed,
+and if that same sound is later re-opened, restores the previous state.
+</td></tr><tr><td colspan=3 height=16></td></tr>
+
+
<!-- save-dir -->
<tr><td colspan=2 bgcolor="#f2f4ff"><code><a class=def name="savedir">save-dir</a></code></td>
<td bgcolor="#f2f4ff"><code>#f</code></td></tr><tr><td></td><td colspan=2>
@@ -1067,6 +1100,13 @@ them); if you're not using regions anyway, this switch can turn them off.
</td></tr><tr><td colspan=3 height=16></td></tr>
+<!-- show-full-duration -->
+<tr><td colspan=2 bgcolor="#f2f4ff"><code><a class=def name="showfullduration">show-full-duration</a></code></td>
+<td bgcolor="#f2f4ff"><code>#f</code></td></tr><tr><td></td><td colspan=2>
+If show-full-duration is #t, Snd displays the entire sound when it is first opened.
+</td></tr><tr><td colspan=3 height=16></td></tr>
+
+
<!-- show-indices -->
<tr><td colspan=2 bgcolor="#f2f4ff"><code><a class=def name="showindices">show-indices</a></code></td>
<td bgcolor="#f2f4ff"><code>#f</code></td></tr><tr><td></td><td colspan=2>
@@ -1102,6 +1142,16 @@ This is a string giving the current Snd version.
</td></tr><tr><td colspan=3 height=16></td></tr>
+<!-- sync-style -->
+<tr><td colspan=2 bgcolor="#f2f4ff"><code><a class=def name="syncstyle">sync-style</a></code></td>
+<td bgcolor="#f2f4ff"><code>sync-by-sound</code></td></tr><tr><td></td><td colspan=2>
+sync-style determines how sounds and their channels are sync'd together when they are
+opened. <code>sync-none</code> means that no sounds, and no channels are tied together;
+<code>sync-all</code> causes everything to be tied together; <code>sync-by-sound</code>, the default, causes individual sounds to
+be separate, but if they have more than one channel, all the channels are tied together.
+</td></tr><tr><td colspan=3 height=16></td></tr>
+
+
<!-- temp-dir -->
<tr><td colspan=2 bgcolor="#f2f4ff"><code><a class=def name="tempdir">temp-dir</a></code></td>
<td bgcolor="#f2f4ff"><code>#f</code></td></tr><tr><td></td><td colspan=2>
@@ -1189,17 +1239,23 @@ the cursor is moved to the clicked point.
<img src="pix/uppergrf.png" alt="with-inset-graph" hspace=20 vspace=10>
<br>
+</td></tr><tr><td colspan=3 height=16></td></tr>
+
+<!-- with-menu-icons -->
+<tr><td colspan=2 bgcolor="#f2f4ff"><code><a class=def name="withmenuicons">with-menu-icons</a></code></td>
+<td bgcolor="#f2f4ff"><code>#f</code></td></tr><tr><td></td><td colspan=2>
+with-menu-icons determines whether some menus display icons beside the item labels (in Gtk only).
</td></tr><tr><td colspan=3 height=16></td></tr>
+
<!-- with-pointer-focus -->
-<tr><td colspan=2 bgcolor="#f2f4ff">
-<a class=def name="withpointerfocus">with-pointer-focus</a> <code>()</code>
-</td></tr><tr><td></td><td>
-If with-pointer-focus is #t (default is #f), whatever text or graph widget is underneath the mouse cursor is activated
+<tr><td colspan=2 bgcolor="#f2f4ff"><code><a class=def name="withpointerfocus">with-pointer-focus</a></code></td>
+<td bgcolor="#f2f4ff"><code>#f</code></td></tr><tr><td></td><td colspan=2>
+If with-pointer-focus is #t, whatever text or graph widget is underneath the mouse cursor is activated
(this is sometimes known as "point-to-focus" mode).
-</td></tr><tr><td colspan=2 height=16></td></tr>
+</td></tr><tr><td colspan=3 height=16></td></tr>
<!-- with-relative-panes -->
@@ -1212,6 +1268,94 @@ Mono sounds and the listener are not affected (perhaps they should be?).
</td></tr><tr><td colspan=3 height=16></td></tr>
+<!-- with-smpte-label -->
+<tr><td colspan=2 bgcolor="#f2f4ff"><code><a class=def name="withsmptelabel">with-smpte-label</a></code></td>
+<td bgcolor="#f2f4ff"><code>#f</code></td></tr><tr><td></td><td colspan=2>
+with-smpte-label shows the current SMPTE frame number in a box
+in the upper left corner of the graph (see the picture above under add-mark-pane).
+</td></tr><tr><td colspan=3 height=16></td></tr>
+
+
+<!-- with-toolbar -->
+<tr><td colspan=2 bgcolor="#f2f4ff"><code><a class=def name="withtoolbar">with-toolbar</a></code></td>
+<td bgcolor="#f2f4ff"><code>#t (gtk), #f (motif)</code></td></tr><tr><td></td><td colspan=2>
+with-toolbar places a toolbar at the top of the Snd window, just under the main menu.
+
+<img src="pix/toolbar.png" alt="with-toolbar picture" hspace=20 vspace=10 usemap="#toolbarmap" border=0>
+<map name="toolbarmap"
+ <area shape=rect coords="3, 42, 31, 76" alt="new sound icon" onmouseout="UnTip()" onmouseover="Tip('new sound')">
+ <area shape=rect coords="32, 42, 60, 76" alt="open sound icon" onmouseout="UnTip()" onmouseover="Tip('open sound')">
+ <area shape=rect coords="61, 42, 89, 76" alt="save icon" onmouseout="UnTip()" onmouseover="Tip('save edits')">
+ <area shape=rect coords="90, 42, 118, 76" alt="revert icon" onmouseout="UnTip()" onmouseover="Tip('revert to saved')">
+ <area shape=rect coords="119, 42, 149, 76" alt="undo icon" onmouseout="UnTip()" onmouseover="Tip('undo edit')">
+ <area shape=rect coords="148, 42, 176, 76" alt="redo icon" onmouseout="UnTip()" onmouseover="Tip('redo edit')">
+ <area shape=rect coords="177, 42, 205, 76" alt="close icon" onmouseout="UnTip()" onmouseover="Tip('close sound')">
+ <area shape=rect coords="206, 42, 234, 76" alt="play icon" onmouseout="UnTip()" onmouseover="Tip('play from the start')">
+ <area shape=rect coords="235, 42, 263, 76" alt="play from cursor icon" onmouseout="UnTip()" onmouseover="Tip('play from the cursor')">
+ <area shape=rect coords="264, 42, 292, 76" alt="stop playing icon" onmouseout="UnTip()" onmouseover="Tip('stop playing')">
+ <area shape=rect coords="293, 42, 321, 76" alt="full sound icon" onmouseout="UnTip()" onmouseover="Tip('show full sound')">
+ <area shape=rect coords="322, 42, 350, 76" alt="zoom out icon" onmouseout="UnTip()" onmouseover="Tip('zoom out')">
+ <area shape=rect coords="351, 42, 379, 76" alt="zoom in icon" onmouseout="UnTip()" onmouseover="Tip('zoom in')">
+ <area shape=rect coords="380, 42, 408, 76" alt="start icon" onmouseout="UnTip()" onmouseover="Tip('go to start of sound')">
+ <area shape=rect coords="409, 42, 437, 76" alt="back icon" onmouseout="UnTip()" onmouseover="Tip('go back a window')">
+ <area shape=rect coords="438, 42, 466, 76" alt="next icon" onmouseout="UnTip()" onmouseover="Tip('go forward a window')">
+ <area shape=rect coords="467, 42, 495, 76" alt="end icon" onmouseout="UnTip()" onmouseover="Tip('go to end of sound')">
+ <area shape=rect coords="496, 42, 524, 76" alt="select icon" onmouseout="UnTip()" onmouseover="Tip('select all of sound')">
+ <area shape=rect coords="525, 42, 553, 76" alt="unselect icon" onmouseout="UnTip()" onmouseover="Tip('unselect everything')">
+ <area shape=rect coords="554, 42, 582, 76" alt="cut icon" onmouseout="UnTip()" onmouseover="Tip('delete selection')">
+ <area shape=rect coords="583, 42, 611, 76" alt="paste icon" onmouseout="UnTip()" onmouseover="Tip('insert selection at cursor')">
+ <area shape=rect coords="612, 42, 640, 76" alt="prefs icon" onmouseout="UnTip()" onmouseover="Tip('start preferences dialog')">
+ <area shape=rect coords="641, 42, 669, 76" alt="quit icon" onmouseout="UnTip()" onmouseover="Tip('stop everything')">
+ <area shape=rect coords="670, 42, 700, 76" alt="exit icon" onmouseout="UnTip()" onmouseover="Tip('exit Snd')">
+</map>
+
+</td></tr><tr><td colspan=3 height=16></td></tr>
+
+
+<!-- with-tooltips -->
+<tr><td colspan=2 bgcolor="#f2f4ff"><code><a class=def name="withtooltips">with-tooltips</a></code></td>
+<td bgcolor="#f2f4ff"><code>#t</code></td></tr><tr><td></td><td colspan=2>
+Set with-tooltips to #f to turn off tooltips.
+</td></tr><tr><td colspan=3 height=16></td></tr>
+
+
+
+<!-- with-tracking-cursor -->
+<tr><td colspan=2 bgcolor="#f2f4ff">
+<code><a class=def name="withtrackingcursor">with-tracking-cursor</a></code></td>
+<td bgcolor="#f2f4ff"><code>#f</code></td></tr><tr><td></td><td colspan=2>
+<p>This is #t if the cursor always follows along in the sound during playback. If it is #f,
+you get the tracking cursor displayed only when you ask for it (via control-click of the
+play button, for example).
+</p>
+<p>
+The interval (in seconds) between cursor updates is set by <a href="#cursorupdateinterval">cursor-update-interval</a>
+which defaults to 0.05. The accuracy of the cursor in reflecting the sound coming out the speakers
+depends on the amount of buffering in your audio system. If Snd's displayed location is off,
+set <a href="#cursorlocationoffset">cursor-location-offset</a> to reflect the number of samples
+of buffering you think you probably have. A positive cursor-location-offset delays the cursor's
+apparent progress (if playing forwards).
+</p>
+
+<!-- INDEX trackingcursors:Tracking cursors -->
+<A NAME="trackingcursors"></a>
+
+<TABLE border=3 bordercolor="tan" hspace=20 vspace=10><tr><td>
+<blockquote><small>
+<br>
+play from the current cursor position with a tracking cursor: <a href="#pfc">pfc</a><br>
+display tracking cursor as a full height vertical line: <a href="#trackingcursorstyle">tracking-cursor-style</a><br>
+track play once: control-click 'play'. (You can add a mark at the current tracking cursor location during the play with C-m)<br>
+leave the cursor at the final position after tracking play: if-cursor-follows-play-it-stays-where-play-stopped in examp.scm<br>
+tracking cursor accuracy: <a href="#cursorlocationoffset">cursor-location-offset</a><br>
+tracking cursor updating: <a href="#cursorupdateinterval">cursor-update-interval</a><br>
+<br>
+</small></blockquote>
+</td></tr></TABLE>
+</td></tr><tr><td colspan=3 height=16></td></tr>
+
+
+
<!-- zoom-focus-style -->
<tr><td colspan=2 bgcolor="#f2f4ff"><code><a class=def name="zoomfocusstyle">zoom-focus-style</a></code></td>
<td bgcolor="#f2f4ff"><code>zoom-focus-active</code></td></tr><tr><td></td><td colspan=2>
@@ -1382,16 +1526,11 @@ and <a href="#sndsounds">sounds</a> (as objects or as integers).
<p>When some user-interface action takes place, code is called that responds to that action;
these functions are sometimes called callbacks; the variable that holds a list of such
callbacks is known as a hook.
-A hook provides
-a way to customize user-interface
-actions.
-The hook itself is list of functions. The function add-hook! adds a function to a hook's
-list, remove-hook! removes a function, and reset-hook! clears out the list.
For example, the hook that is checked when you click the sound's name in the minibuffer is
name-click-hook. We can cause that action to print "hi":</p>
<pre>
- Scheme: (add-hook! <a class=quiet href="#nameclickhook" onmouseout="UnTip()" onmouseover="Tip(extsnd_nameclickhook_tip)">name-click-hook</a> (lambda (snd) (<a class=quiet href="#sndprint" onmouseout="UnTip()" onmouseover="Tip(extsnd_sndprint_tip)">snd-print</a> "hi") #t))
+ Scheme: (hook-push <a class=quiet href="#nameclickhook" onmouseout="UnTip()" onmouseover="Tip(extsnd_nameclickhook_tip)">name-click-hook</a> (lambda (snd) (<a class=quiet href="#sndprint" onmouseout="UnTip()" onmouseover="Tip(extsnd_sndprint_tip)">snd-print</a> "hi") #t))
Ruby: $name_click_hook.add_hook!("print") do |snd| snd_print("hi"); true end
@@ -1467,14 +1606,14 @@ some of these sequences.
<p>
You can find out what's on a given hook with the following (which is mostly adding carriage returns to the
-printout from hook-&gt;list):
+printout from hook-functions):
</p>
<table border=0 cellpadding=5 hspace=20><tr><td><pre>
(define (describe-hook hook)
(for-each
(lambda (n)
(<a class=quiet href="#sndprint" onmouseout="UnTip()" onmouseover="Tip(extsnd_sndprint_tip)">snd-print</a> (<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_format_tip)">format</a> #f "~A~%" n)))
- (reverse (<em class=red>hook-&gt;list</em> hook))))
+ (reverse (<em class=red>hook-functions</em> hook))))
</pre></td></tr></table>
<p>Here's the Ruby version of some of the hook-related functions:
@@ -1538,9 +1677,8 @@ reset any added amplitude sliders to 1.0.
<tr><td colspan=3 bgcolor="#f2f4ff">
<code><a class=def name="aftergraphhook">after-graph-hook</a> (snd chn)</code>
</td></tr><tr><td></td><td colspan=2>
-This hook is called after a graph is updated or redisplayed; see <a href="#displaysampsinred">display-samps-in-red</a>,
-<a href="sndscm.html#showsmptelabel">draw-smpte-label</a> in snd-motif.scm, or <a href="#addcomment">add-comment</a>.
-This is the hook to use when adding your own finishing touches to the display; if added earlier they risk
+This hook is called after a graph is updated or redisplayed.
+Use it to add your own finishing touches to the display; if added earlier they risk
being erased by Snd as it redraws graphs.
</td></tr><tr><td colspan=3 height=16></td></tr>
@@ -1569,7 +1707,7 @@ together but are independent of any other sound), united channels (all chans in
and filled graphs (not line segments or dots, etc):
<table border=0 cellpadding=5 vspace=10><tr><td><pre>
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>after-open-hook</em>
+(hook-push <em class=red>after-open-hook</em>
(lambda (snd)
(if (&gt; (<a class=quiet href="#channels" onmouseout="UnTip()" onmouseover="Tip(extsnd_channels_tip)">channels</a> snd) 1)
(begin
@@ -1579,7 +1717,6 @@ and filled graphs (not line segments or dots, etc):
</pre></td></tr></table>
See also <a href="sndscm.html#xbopen">C-x b</a> support in examp.scm,
-<a href="sndscm.html#remembersoundstate">remember-sound-state</a> in extensions.scm,
enved.scm, and various examples in snd-motif.scm.
</td></tr><tr><td colspan=3 height=16></td></tr>
@@ -1588,8 +1725,7 @@ enved.scm, and various examples in snd-motif.scm.
<tr><td colspan=3 bgcolor="#f2f4ff">
<code><a class=def name="aftersaveashook">after-save-as-hook</a> (index filename from-dialog)</code>
</td></tr><tr><td></td><td colspan=2>
-This hook is called after File:Save as. See <a href="sndscm.html#emacsstylesaveas">emacs-style-save-as</a> in snd7.scm
-which closes the current sound and opens the newly created one to mimic Emacs.
+This hook is called after File:Save as.
</td></tr><tr><td colspan=3 height=16></td></tr>
@@ -1598,8 +1734,7 @@ which closes the current sound and opens the newly created one to mimic Emacs.
<code><a class=def name="aftersavestatehook">after-save-state-hook</a> (filename)</code>
</td></tr><tr><td></td><td colspan=2>
This hook is called after Snd has saved its state (<a href="#savestate">save-state</a>). 'filename' is the (otherwise complete) saved state
-program. See <a href="sndscm.html#wssavestate">ws-save-state</a> in ws.scm
-or <a href="sndscm.html#remembersoundstate">remember-sound-state</a> in extensions.scm. Both use this sequence:
+program. See <a href="sndscm.html#wssavestate">ws-save-state</a> in ws.scm. It uses this sequence:
<br>
<pre>
(lambda (filename)
@@ -1624,7 +1759,7 @@ This hook is called just after an FFT (or spectrum) is calculated.
(<a class=quiet href="#reportinminibuffer" onmouseout="UnTip()" onmouseover="Tip(extsnd_reportinminibuffer_tip)">report-in-minibuffer</a>
(number-&gt;string (/ (* 2 (<a class=quiet href="#vctpeak" onmouseout="UnTip()" onmouseover="Tip(extsnd_vctpeak_tip)">vct-peak</a> (<a class=quiet href="#transformtovct" onmouseout="UnTip()" onmouseover="Tip(extsnd_transformtovct_tip)">transform-&gt;vct</a> snd chn)))
(<a class=quiet href="#transformsize" onmouseout="UnTip()" onmouseover="Tip(extsnd_transformsize_tip)">transform-size</a> snd chn))))))
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>after-transform-hook</em> report-fft-peak)
+(hook-push <em class=red>after-transform-hook</em> report-fft-peak)
</pre></td></tr></table></td></tr><tr><td colspan=3 height=16></td></tr>
@@ -1636,7 +1771,7 @@ This hook is called if a file has a bogus-looking header (that is,
a header with what appear to be bad values such as a negative number of channels).
If a hook function returns #t, Snd does not try to open the file.
<pre>
- (<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> bad-header-hook (lambda (n) #t)) ; don't open bogus-looking files
+ (hook-push bad-header-hook (lambda (n) #t)) ; don't open bogus-looking files
</pre>
If no header is found, <a href="#openrawsoundhook">open-raw-sound-hook</a> is invoked instead ("raw" = "headerless").
</td></tr><tr><td colspan=3 height=16></td></tr>
@@ -1646,8 +1781,7 @@ If no header is found, <a href="#openrawsoundhook">open-raw-sound-hook</a> is in
<tr><td colspan=3 bgcolor="#f2f4ff">
<code><a class=def name="beforeclosehook">before-close-hook</a> (snd) </code> [<b>or</b>]
</td></tr><tr><td></td><td colspan=2>
-This hook is called when a file is about to be closed. If a hook function returns #t, the file is not closed (see
-<a href="sndscm.html#checkforunsavededits">check-for-unsaved-edits</a> in extensions.scm).
+This hook is called when a file is about to be closed. If a hook function returns #t, the file is not closed.
</td></tr><tr><td colspan=3 height=16></td></tr>
@@ -1656,8 +1790,7 @@ This hook is called when a file is about to be closed. If a hook function retur
<code><a class=def name="beforeexithook">before-exit-hook</a> ()</code> [<b>or</b>]
</td></tr><tr><td></td><td colspan=2>
This hook is called upon a request to exit Snd.
-If a hook function returns #t, Snd does not exit. This can be used to check
-for unsaved edits (see above or extensions.scm: <a href="#unsavededitsp">unsaved-edits?</a>).
+If a hook function returns #t, Snd does not exit.
</td></tr><tr><td colspan=3 height=16></td></tr>
@@ -1673,7 +1806,7 @@ just before a sound is saved. The arguments to the hook function describe the r
we're saving the selection.
<table border=0 cellpadding=5 vspace=10><tr><td><pre>
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>before-save-as-hook</em>
+(hook-push <em class=red>before-save-as-hook</em>
(lambda (index filename selection sr type format comment)
(if (not (= sr (<a class=quiet href="#srate" onmouseout="UnTip()" onmouseover="Tip(extsnd_srate_tip)">srate</a> index)))
(let ((chns (<a class=quiet href="#chans" onmouseout="UnTip()" onmouseover="Tip(extsnd_chans_tip)">channels</a> index)))
@@ -1699,7 +1832,7 @@ file. If the hook functions return #t, the save state file is opened in append
so you can write preliminary stuff via this hook, then instruct Snd not to clobber it during the save process.
<table border=0 cellpadding=5 vspace=10><tr><td><pre>
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>before-save-state-hook</em>
+(hook-push <em class=red>before-save-state-hook</em>
(lambda (name)
(<span onmouseout="UnTip()" onmouseover="Tip('io-open-write in Forth (see fs.fs); File.open in Ruby (I think &mdash; see extensions.rb)')">with-output-to-file name</span>
(lambda ()
@@ -1717,7 +1850,7 @@ an integer, that value is used as the starting point (sample number) of the fft.
the fft starts from the left window edge. To have it start at mid-window:
<table border=0 cellpadding=5 vspace=10><tr><td><pre>
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>before-transform-hook</em>
+(hook-push <em class=red>before-transform-hook</em>
(lambda (snd chn) ; 0.5 * (left + right) = midpoint
(round (* 0.5 (+ (<a class=quiet href="#rightsample" onmouseout="UnTip()" onmouseover="Tip(extsnd_rightsample_tip)">right-sample</a> snd chn) (<a class=quiet href="#leftsample" onmouseout="UnTip()" onmouseover="Tip(extsnd_leftsample_tip)">left-sample</a> snd chn))))))
</pre></td></tr></table>
@@ -1728,8 +1861,8 @@ of a moving mark:
<table border=0 cellpadding=5 vspace=10><tr><td><pre>
(define fft-position #f)
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>before-transform-hook</em> (lambda (snd chn) fft-position))
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <a class=quiet href="#markdraghook" onmouseout="UnTip()" onmouseover="Tip(extsnd_markdraghook_tip)">mark-drag-hook</a> (lambda (id)
+(hook-push <em class=red>before-transform-hook</em> (lambda (snd chn) fft-position))
+(hook-push <a class=quiet href="#markdraghook" onmouseout="UnTip()" onmouseover="Tip(extsnd_markdraghook_tip)">mark-drag-hook</a> (lambda (id)
(set! fft-position (<a class=quiet href="#marksample" onmouseout="UnTip()" onmouseover="Tip(extsnd_marksample_tip)">mark-sample</a> id))
(<a class=quiet href="#updatetransformgraph" onmouseout="UnTip()" onmouseover="Tip(extsnd_updatetransformgraph_tip)">update-transform-graph</a>)))
</pre></td></tr></table></td></tr><tr><td colspan=3 height=16></td></tr>
@@ -1752,7 +1885,7 @@ This hook is called when a file is closed (before the actual close, so the index
<table border=0><tr><td>
<table border=0 cellpadding=5 vspace=10><tr><td><pre>
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>close-hook</em>
+(hook-push <em class=red>close-hook</em>
(lambda (snd)
(system "sndplay wood16.wav")))
</pre></td></tr></table>
@@ -1768,7 +1901,6 @@ end
</td></tr></table>
close-hook is used in <a href="sndscm.html#autosavedoc">autosave.scm</a>,
the <a href="sndscm.html#xbopen">C-x b</a> support in examp.scm,
-<a href="sndscm.html#remembersoundstate">remember-sound-state</a> in extensions.scm,
and many other places.
</td></tr><tr><td colspan=3 height=16></td></tr>
@@ -1823,7 +1955,7 @@ Snd opens it as if you had called <a href="#opensound">open-sound</a>. If you d
Snd mixes it at the mouse location in that channel. To get Snd to
mix the dragged file even from the menubar:
<pre>
- (<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>drop-hook</em> (lambda (filename) (<a class=quiet href="#mix" onmouseout="UnTip()" onmouseover="Tip(extsnd_mix_tip)">mix</a> filename) #t)) ; return #t = we already dealt with the drop
+ (hook-push <em class=red>drop-hook</em> (lambda (filename) (<a class=quiet href="#mix" onmouseout="UnTip()" onmouseover="Tip(extsnd_mix_tip)">mix</a> filename) #t)) ; return #t = we already dealt with the drop
</pre>
snd-motif.scm has examples that add a drop callback to an arbitrary widget, or
change an existing callback (to pass the sound and channel number to the drop callback function, bypassing drop-hook).
@@ -1838,7 +1970,7 @@ This hook is called after file is opened, but before data has been read.
This provides an opportunity to set sndlib prescaling values:
<table border=0 cellpadding=5 vspace=10><tr><td><pre>
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>during-open-hook</em>
+(hook-push <em class=red>during-open-hook</em>
(lambda (fd name reason)
(if (= (<a class=quiet href="#mussoundheadertype" onmouseout="UnTip()" onmouseover="Tip(extsnd_mussoundheadertype_tip)">mus-sound-header-type</a> name) <a class=quiet href="#headertype" onmouseout="UnTip()" onmouseover="Tip(extsnd_musraw_tip)">mus-raw</a>)
(set! (<a href="#musfileprescaler" onmouseout="UnTip()" onmouseover="Tip(extsnd_musfileprescaler_tip)">mus-file-prescaler</a> fd) 500.0))))
@@ -1859,6 +1991,15 @@ check that 'reason' is 1, or perhaps 1, 3, or 6 (these read the external form of
</td></tr><tr><td colspan=3 height=16></td></tr>
+<!-- effects-hook -->
+<tr><td colspan=3 bgcolor="#f2f4ff">
+<code><a class=def name="effectshook">effects-hook</a> ()</code>
+</td></tr><tr><td></td><td colspan=2>
+effects-hook is a convenience hook for the effects dialogs.
+</td></tr><tr><td colspan=3 height=16></td></tr>
+
+
+
<!-- enved-hook -->
<tr><td colspan=3 bgcolor="#f2f4ff">
<code><a class=def name="envedhook">enved-hook</a> (env pt new-x new-y reason)</code> [<b>cascade</b>]
@@ -1873,7 +2014,7 @@ and decay portions in the envelope editor, or use functions such as
<a href="sndscm.html#stretchenvelope">stretch-envelope</a> from env.scm:
<table border=0 cellpadding=5 vspace=10><tr><td><pre>
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>enved-hook</em>
+(hook-push <em class=red>enved-hook</em>
(lambda (env pt x y reason)
(if (= reason enved-move-point)
(if (and (&gt; x 0.0) (&lt; x (<a class=quiet onmouseout="UnTip()" onmouseover="Tip(sndscm_envelopelastx_tip)">envelope-last-x</a> env))) ; from env.scm
@@ -1909,7 +2050,7 @@ If its hook functions return #t, the display is not updated.
See examp.scm for many examples. If you want to add your own graphics to the display, use <a href="#aftergraphhook">after-graph-hook</a>.
<table border=0 cellpadding=5 vspace=10><tr><td><pre>
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>graph-hook</em>
+(hook-push <em class=red>graph-hook</em>
(lambda (snd chn y0 y1)
"set the dot size depending on the number of samples being displayed"
(let ((dots (- (<a class=quiet href="#rightsample" onmouseout="UnTip()" onmouseover="Tip(extsnd_rightsample_tip)">right-sample</a> snd chn) (<a class=quiet href="#leftsample" onmouseout="UnTip()" onmouseover="Tip(extsnd_leftsample_tip)">left-sample</a> snd chn))))
@@ -1932,7 +2073,7 @@ This hook is called from <a href="#sndhelp">snd-help</a> with the current help s
Say we want the index.scm
procedure <a href="sndscm.html#html">html</a> called any time snd-help is called (from C-? for example):
<pre>
- (<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>help-hook</em> (lambda (subject help) (<a class=quiet href="sndscm.html#html" onmouseout="UnTip()" onmouseover="Tip(sndscm_html_function_tip)">html</a> subject) #f))
+ (hook-push <em class=red>help-hook</em> (lambda (subject help) (<a class=quiet href="sndscm.html#html" onmouseout="UnTip()" onmouseover="Tip(sndscm_html_function_tip)">html</a> subject) #f))
</pre>
If there is more than one hook function, each function's result is passed as input to the next function.
</td></tr><tr><td colspan=3 height=16></td></tr>
@@ -1951,19 +2092,19 @@ If the hook function returns a list, the list's contents are interpreted as:
initial x and y axis limits and the x axis label.
The default (an empty hook) is equivalent to:
<pre>
- (<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>initial-graph-hook</em> (lambda (snd chn dur) (list 0.0 0.1 -1.0 1.0 "time" -1.0 1.0)))
+ (hook-push <em class=red>initial-graph-hook</em> (lambda (snd chn dur) (list 0.0 0.1 -1.0 1.0 "time" -1.0 1.0)))
</pre>
The 'dur' argument is the total length in seconds of the displayed portion of the channel, so to cause the
entire sound to be displayed initially:
<pre>
- (<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>initial-graph-hook</em> (lambda (snd chn dur) (list 0.0 dur)))
+ (hook-push <em class=red>initial-graph-hook</em> (lambda (snd chn dur) (list 0.0 dur)))
</pre>
To get other the data limits (rather than the default y axis limits of -1.0 to 1.0), you can use <a href="#mussoundmaxamp">mus-sound-maxamp</a>,
but if that sound's maxamp isn't already known, it can require a long process of reading the file. The following hook procedure
uses the maxamp data if it is already available or the file is short:
<table border=0 cellpadding=5 vspace=10><tr><td><pre>
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>initial-graph-hook</em>
+(hook-push <em class=red>initial-graph-hook</em>
(lambda (snd chn dur)
(if (or (<a class=quiet href="#mussoundmaxampexists" onmouseout="UnTip()" onmouseover="Tip(extsnd_mussoundmaxampexists_tip)">mus-sound-maxamp-exists?</a> (<a class=quiet href="#filename" onmouseout="UnTip()" onmouseover="Tip(extsnd_filename_tip)">file-name</a> snd))
(&lt; (<a class=quiet href="#frames" onmouseout="UnTip()" onmouseover="Tip(extsnd_frames_tip)">frames</a> snd chn) 10000000))
@@ -1999,7 +2140,7 @@ If its function returns a list of pixels (xm style), these are used in order by
If it returns a function (of no arguments), that function is called rather than the standard graph routine:
<table border=0 cellpadding=5 vspace=10><tr><td><pre>
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>lisp-graph-hook</em>
+(hook-push <em class=red>lisp-graph-hook</em>
(lambda (snd chn)
(lambda ()
(<a class=quiet href="#drawstring" onmouseout="UnTip()" onmouseover="Tip(extsnd_drawstring_tip)">draw-string</a> "hi"
@@ -2018,7 +2159,6 @@ For a fancy example, see <a href="sndscm.html#displaybarkfft">display-bark-fft</
</td></tr><tr><td></td><td colspan=2>
This hook is called when a click occurs in the listener; the 'textpos' argument is the position in the text
(a character number) where the click occurred.
-See <a href="sndscm.html#clickforlistenerhelp">click-for-listener-help</a> in draw.scm.
</td></tr><tr><td colspan=3 height=16></td></tr>
@@ -2030,7 +2170,7 @@ This hook is called when a mark is clicked; return #t to squelch the default min
hook function is used in <a href="sndscm.html#withmarkedsound">with-marked-sound</a> in ws.scm to display arbitrary info about a mark.
<table border=0 cellpadding=5 vspace=10><tr><td><pre>
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>mark-click-hook</em>
+(hook-push <em class=red>mark-click-hook</em>
(lambda (n)
(if (not (defined? 'mark-properties)) (load "marks.scm"))
(<a class=quiet href="#infodialog" onmouseout="UnTip()" onmouseover="Tip(extsnd_infodialog_tip)">info-dialog</a> "Mark Help"
@@ -2073,29 +2213,7 @@ This hook is called when a mark is dragged.
(cadr sndchn)
(<a class=quiet href="#sample" onmouseout="UnTip()" onmouseover="Tip(extsnd_sample_tip)">sample</a> samp (car sndchn) (cadr sndchn))))))
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>mark-drag-hook</em> report-mark-location)
-</pre></td></tr></table></td></tr><tr><td colspan=3 height=16></td></tr>
-
-
-<!-- mark-drag-triangle-hook -->
-<tr><td colspan=3 bgcolor="#f2f4ff">
-<code><a class=def name="markdragtrianglehook">mark-drag-triangle-hook</a> (mark x time dragged-before)</code> [<b>progn</b>]
-</td></tr><tr><td></td><td colspan=2>
-This hook is called when a mark play triangle is dragged. The smoothness of the response to the drag motion is
-largely determined by <a href="#dacsize">dac-size</a>.
-'dragged-before' is #f when the drag starts and #t thereafter. 'x' is the mouse x location in the current
-graph. 'time' is the uninterpreted (graphics toolkit) time at which the drag event was reported. If the hook function returns #t,
-Snd takes no further action. To set up to play, then interpret the motion yourself, return #f on the first call,
-and #t thereafter:
-
-<table border=0 cellpadding=5 vspace=10><tr><td><pre>
-(let ((first-x 0))
- (<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>mark-drag-triangle-hook</em>
- (lambda (id x time dragged-before)
- (if (not dragged-before)
- (set! first-x x)
- (set! (<a class=quiet href="#speedcontrol" onmouseout="UnTip()" onmouseover="Tip(extsnd_speedcontrol_tip)">speed-control</a>) (/ (- x first-x) 16.0)))
- dragged-before)))
+(hook-push <em class=red>mark-drag-hook</em> report-mark-location)
</pre></td></tr></table></td></tr><tr><td colspan=3 height=16></td></tr>
@@ -2112,7 +2230,7 @@ and if the <a href="#marksync">mark-sync</a> is not 0, the hook is called on eac
(define (<A NAME="snpmark">snap-mark-to-beat</a>)
;; when a mark is dragged, its end position is always on a beat
(let ((mark-release 4))
- (<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>mark-hook</em>
+ (hook-push <em class=red>mark-hook</em>
(lambda (mrk snd chn reason)
(if (= reason mark-release)
(let* ((samp (<a class=quiet href="#marksample" onmouseout="UnTip()" onmouseover="Tip(extsnd_marksample_tip)">mark-sample</a> mrk))
@@ -2139,7 +2257,7 @@ Here's an example that sets a mix's amps to 0 if you click it (see <a href="snds
in mix.scm for a fancier version):
<table border=0 cellpadding=5 vspace=10><tr><td><pre>
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>mix-click-hook</em>
+(hook-push <em class=red>mix-click-hook</em>
(lambda (n)
(set! (<a class=quiet href="#mixamp" onmouseout="UnTip()" onmouseover="Tip(extsnd_mixamp_tip)">mix-amp</a> n) 0.0)
#t))
@@ -2153,7 +2271,7 @@ in mix.scm for a fancier version):
This hook is called when a mix is dragged.
<table border=0 cellpadding=5 vspace=10><tr><td><pre>
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>mix-drag-hook</em>
+(hook-push <em class=red>mix-drag-hook</em>
(lambda (n x y)
(<a class=quiet href="#reportinminibuffer" onmouseout="UnTip()" onmouseover="Tip(extsnd_reportinminibuffer_tip)">report-in-minibuffer</a>
(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_format_tip)">format</a> #f "mix ~A at ~D: ~,3F"
@@ -2164,7 +2282,7 @@ This hook is called when a mix is dragged.
A neat example is to set up an empty sound with a 1.0 in sample 0, mix in a vct containing one element of 0.5, then set
up this mix-drag-hook:
<pre>
- (<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> mix-drag-hook (lambda (id x y) (<a class=quiet href="#updatetransformgraph" onmouseout="UnTip()" onmouseover="Tip(extsnd_updatetransformgraph_tip)">update-transform-graph</a>)))
+ (hook-push mix-drag-hook (lambda (id x y) (<a class=quiet href="#updatetransformgraph" onmouseout="UnTip()" onmouseover="Tip(extsnd_updatetransformgraph_tip)">update-transform-graph</a>)))
</pre>
and turn on the FFT graph. As you drag the mix, you can see the spectral effect of that
moving value as a comb filter.
@@ -2199,10 +2317,10 @@ This hook is called upon a mouse button release or click (with various exception
(<a class=quiet href="#updatetimegraph" onmouseout="UnTip()" onmouseover="Tip(extsnd_updatetimegraph_tip)">update-time-graph</a>)
#t)
#f))
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>mouse-click-hook</em> click-to-center)
+(hook-push <em class=red>mouse-click-hook</em> click-to-center)
;;; this example disables button 2 -&gt; insert selection
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>mouse-click-hook</em>
+(hook-push <em class=red>mouse-click-hook</em>
(lambda (snd chn button state x y axis)
(and (= axis <a class=quiet onmouseout="UnTip()" onmouseover="Tip(extsnd_time_graph_tip)">time-graph</a>) (= button 2))))
</pre></td></tr></table>
@@ -2211,7 +2329,7 @@ The mouse scroll wheel is sometimes reported as buttons 4 and 5; in the next exa
turning the wheel zooms the graph in or out:
<table border=0 cellpadding=5 vspace=10><tr><td><pre>
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>mouse-click-hook</em>
+(hook-push <em class=red>mouse-click-hook</em>
(lambda (snd chn button state x y axis)
(if (and (= axis <a class=quiet onmouseout="UnTip()" onmouseover="Tip(extsnd_time_graph_tip)">time-graph</a>)
(or (= button 4) (= button 5))) ; mouse scroll wheel
@@ -2254,7 +2372,7 @@ This hook is called when the mouse is dragged within the lisp graph (see enved.s
This hook is called when the mouse enters a channel's drawing area (graph pane).
<table border=0 cellpadding=5 vspace=10><tr><td><pre>
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>mouse-enter-graph-hook</em>
+(hook-push <em class=red>mouse-enter-graph-hook</em>
(lambda (snd chn)
(<a class=quiet href="#sndprint" onmouseout="UnTip()" onmouseover="Tip(extsnd_sndprint_tip)">snd-print</a> (<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_format_tip)">format</a> #f "~A[~A]" (<a class=quiet href="#shortfilename" onmouseout="UnTip()" onmouseover="Tip(extsnd_shortfilename_tip)">short-file-name</a> snd) chn))))
</pre></td></tr></table></td></tr><tr><td colspan=3 height=16></td></tr>
@@ -2271,7 +2389,7 @@ The label itself is 'label'. We can use the <a href="sndscm.html#finfo">finfo</a
to popup file info as follows:
<table border=0 cellpadding=5 vspace=10><tr><td><pre>
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>mouse-enter-label-hook</em>
+(hook-push <em class=red>mouse-enter-label-hook</em>
(lambda (type position name)
(if (not (= type 2))
(<a class=quiet href="#infodialog" onmouseout="UnTip()" onmouseover="Tip(extsnd_infodialog_tip)">info-dialog</a> name (finfo name)))))
@@ -2291,11 +2409,11 @@ ensure that the pane under the mouse is the one that receives keyboard input, we
hook procedures:
<table border=0 cellpadding=5 vspace=10><tr><td><pre>
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>mouse-enter-graph-hook</em>
+(hook-push <em class=red>mouse-enter-graph-hook</em>
(lambda (snd chn)
(if (<a class=quiet href="#soundp" onmouseout="UnTip()" onmouseover="Tip(extsnd_soundp_tip)">sound?</a> snd) (<a class=quiet href="#focuswidget" onmouseout="UnTip()" onmouseover="Tip(extsnd_focuswidget_tip)">focus-widget</a> (car (<a class=quiet href="#channelwidgets" onmouseout="UnTip()" onmouseover="Tip(extsnd_channelwidgets_tip)">channel-widgets</a> snd chn))))))
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>mouse-enter-listener-hook</em>
+(hook-push <em class=red>mouse-enter-listener-hook</em>
(lambda (widget)
(<a class=quiet href="#focuswidget" onmouseout="UnTip()" onmouseover="Tip(extsnd_focuswidget_tip)">focus-widget</a> widget)))
</pre></td></tr></table>
@@ -2311,7 +2429,7 @@ I much prefer this style of operation.
This hook is called when the mouse enters a text widget (this is the third of the pointer focus hooks).
<table border=0 cellpadding=5 vspace=10><tr><td><pre>
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>mouse-enter-text-hook</em>
+(hook-push <em class=red>mouse-enter-text-hook</em>
(lambda (w)
(<a class=quiet href="#focuswidget" onmouseout="UnTip()" onmouseover="Tip(extsnd_focuswidget_tip)">focus-widget</a> w)))
</pre></td></tr></table></td></tr><tr><td colspan=3 height=16></td></tr>
@@ -2372,7 +2490,7 @@ Both mus_error and mus_print run this hook; in the mus_print case, the 'type' is
You can redirect mus_print output from stderr (the default) to stdout via:
<table border=0 cellpadding=5 vspace=10><tr><td><pre>
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>mus-error-hook</em>
+(hook-push <em class=red>mus-error-hook</em>
(lambda (typ msg)
(and (= typ 0) ; it's mus_print, not mus_error
(display msg)))) ; display returns some non-#f result, I assume
@@ -2390,7 +2508,7 @@ This hook is called when the sound name is clicked (in the label in the minibuff
If the function returns #t, the usual highly informative minibuffer babbling is squelched.
<table border=0 cellpadding=5 vspace=10><tr><td><pre>
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>name-click-hook</em>
+(hook-push <em class=red>name-click-hook</em>
(lambda (snd) ; toggle read-only
(set! (<a class=quiet href="#readonly" onmouseout="UnTip()" onmouseover="Tip(extsnd_readonly_tip)">read-only</a> snd) (not (<a class=quiet href="#readonly" onmouseout="UnTip()" onmouseover="Tip(extsnd_readonly_tip)">read-only</a> snd)))
#t))
@@ -2426,7 +2544,7 @@ and any corresponding <a href="#afteropenhook">after-open-hook</a> functions are
If it returns a string (a filename), that file is opened instead of the original one.
<table border=0 cellpadding=5 vspace=10><tr><td><pre>
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>open-hook</em>
+(hook-push <em class=red>open-hook</em>
(lambda (filename)
(if (= (<a class=quiet href="#mussoundheadertype" onmouseout="UnTip()" onmouseover="Tip(extsnd_mussoundheadertype_tip)">mus-sound-header-type</a> filename) <a class=quiet href="#headertype" onmouseout="UnTip()" onmouseover="Tip(extsnd_headertype_tip)">mus-raw</a>)
;; check for "OggS" first word, if found, translate to something Snd can read
@@ -2458,7 +2576,7 @@ be omitted ('data-location' defaults to 0, and 'data-length' defaults to the fil
If there is more than one function on the hook list, functions after the first get the
on-going list result (if any) as the 'current-choices' argument (the empty list is the default).
<pre>
- (<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>open-raw-sound-hook</em> (lambda (file choices) (list 1 44100 <a class=quiet href="#dataformat" onmouseout="UnTip()" onmouseover="Tip(extsnd_dataformat_tip)">mus-lshort</a>)))
+ (hook-push <em class=red>open-raw-sound-hook</em> (lambda (file choices) (list 1 44100 <a class=quiet href="#dataformat" onmouseout="UnTip()" onmouseover="Tip(extsnd_dataformat_tip)">mus-lshort</a>)))
</pre>
Return '() to accept all the current raw header defaults; return #f to fallback on the Raw File Dialog.
The raw header defaults are stereo, 44100 Hz, big endian short data; these values can be changed in the
@@ -2474,7 +2592,7 @@ If the hook function returns #t, the <a href="#opensound">open-sound</a> returns
</td></tr><tr><td></td><td colspan=2>
This hook is called each time the optimizer hits something it can't handle; 'message' tries to give some information about the situation.
<pre>
- (<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>optimization-hook</em> (lambda (n) (display (<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_format_tip)">format</a> #f "~A~%" n))))
+ (hook-push <em class=red>optimization-hook</em> (lambda (n) (display (<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_format_tip)">format</a> #f "~A~%" n))))
</pre>
Normally, if the optimizer fails for some reason, it falls back silently on the Scheme evaluator, so
the code runs slower. This hook gives you a way to find out why the optimizer gave up.
@@ -2499,7 +2617,7 @@ If there is more than one hook function, each function's result is passed as inp
<table border=0 cellpadding=5 vspace=10><tr><td>
<pre>
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>output-comment-hook</em>
+(hook-push <em class=red>output-comment-hook</em>
(lambda (str) ; append a time-stamp
(string-append str ": written " (strftime "%a %d-%b-%Y %H:%M %Z" (localtime (current-time))))))
@@ -2517,7 +2635,7 @@ making it slightly easier to set default output names.
<table border=0 cellpadding=5 vspace=10><tr><td><pre>
(let ((file-ctr -1))
- (<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>output-name-hook</em>
+ (hook-push <em class=red>output-name-hook</em>
(lambda (ignored-name)
(set! file-ctr (+ file-ctr 1))
(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_format_tip)">format</a> #f "~A-~D.snd" ; make new file name based on date and file-ctr: "Jun-01-23.snd"
@@ -2559,7 +2677,7 @@ distinguish Snd responses from user-typing, or add arbitrarily fancy prompts, bu
in some other way &mdash; I should rewrite this part of Snd.
<table border=0 cellpadding=5 vspace=10><tr><td><pre>
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>print-hook</em>
+(hook-push <em class=red>print-hook</em>
(lambda (msg)
(if (char=? (string-ref msg 0) #\newline)
(<a class=quiet href="#sndprint" onmouseout="UnTip()" onmouseover="Tip(extsnd_sndprint_tip)">snd-print</a> msg)
@@ -2632,7 +2750,7 @@ If it returns #t, Snd flushes the error (it assumes you've
dealt with it via the hook).
<table border=0 cellpadding=5 vspace=10><tr><td><pre>
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>snd-error-hook</em>
+(hook-push <em class=red>snd-error-hook</em>
(lambda (msg)
(<a class=quiet href="#play" onmouseout="UnTip()" onmouseover="Tip(extsnd_play_tip)">play</a> "bong.snd") ; or if xm is loaded, (XBell (XtDisplay (cadr (<a class=quiet href="#mainwidgets" onmouseout="UnTip()" onmouseover="Tip(extsnd_mainwidgets_tip)">main-widgets</a>))) 10)
#f))
@@ -2651,9 +2769,9 @@ reported it via the hook).
(define without-warnings
(lambda (thunk)
(define no-warning (lambda (msg) #t))
- (<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>snd-warning-hook</em> no-warning)
+ (hook-push <em class=red>snd-warning-hook</em> no-warning)
(thunk)
- (remove-hook! <em class=red>snd-warning-hook</em> no-warning)))
+ (hook-remove <em class=red>snd-warning-hook</em> no-warning)))
</pre></td></tr></table></td></tr><tr><td colspan=3 height=16></td></tr>
@@ -2668,7 +2786,7 @@ Snd to exit back to the shell if its file argument is not
found (this code has to be in the ~/.snd init file):
<table border=0 cellpadding=5 vspace=10><tr><td><pre>
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>start-hook</em>
+(hook-push <em class=red>start-hook</em>
(lambda (file)
(if (not (file-exists? file))
(begin
@@ -2687,7 +2805,7 @@ We can use this hook to replace "play" with "play selection" if the
selection is active:
<table border=0 cellpadding=5 vspace=10><tr><td><pre>
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>start-playing-hook</em>
+(hook-push <em class=red>start-playing-hook</em>
(lambda (snd)
(if (and (<a class=quiet href="#selectionok" onmouseout="UnTip()" onmouseover="Tip(extsnd_selectionok_tip)">selection?</a>)
(<a class=quiet href="#selectionmember" onmouseout="UnTip()" onmouseover="Tip(extsnd_selectionmember_tip)">selection-member?</a> snd))
@@ -2735,24 +2853,6 @@ This hook is called when the selection finishes playing.
</td></tr><tr><td colspan=3 height=16></td></tr>
-<!-- time-graph-hook -->
-<tr><td colspan=3 bgcolor="#f2f4ff">
-<code><a class=def name="timegraphhook">time-graph-hook</a> (snd chn)</code> [<b>progn</b>]
-</td></tr><tr><td></td><td colspan=2>
-This hook is called just before each channel's time domain graph is updated if <a href="#channelstyle">channel-style</a> is
-<code>channels-combined</code> (that is, when all the channels are superimposed in one graph).
-If its function returns a pixel, that color is used to draw that channel's data.
-
-<table border=0 cellpadding=5 vspace=10><tr><td><pre>
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>time-graph-hook</em>
- (lambda (snd chn)
- (lambda ()
- (apply <a class=quiet href="#makecolor">make-color</a> (<a class=quiet href="#colormapref">colormap-ref</a> (<a class=quiet href="#colormap">colormap</a>) (/ chn (<a class=quiet href="#channels">channels</a> snd)))))))
-</pre></td></tr></table>
-
-</td></tr><tr><td colspan=3 height=16></td></tr>
-
-
<!-- update-hook -->
<tr><td colspan=3 bgcolor="#f2f4ff">
<code><a class=def name="updatehook">update-hook</a> (snd)</code> [<b>or</b>]
@@ -2768,7 +2868,7 @@ the newly updated sound may have a different index. <a href="sndscm.html#addmar
the returned procedure to make sure the mark pane is reactivated right away when a sound is updated. The basic idea is:
<table border=0 cellpadding=5 vspace=10><tr><td><pre>
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>update-hook</em>
+(hook-push <em class=red>update-hook</em>
(lambda (snd-about-to-be-updated)
;; this function called just before update
(lambda (updated-snd)
@@ -2779,7 +2879,7 @@ the returned procedure to make sure the mark pane is reactivated right away when
I use update-hook to make sure the y axis bounds reflect the new maxamp, if it is greater than 1.0:
<table border=0 cellpadding=5 vspace=10><tr><td><pre>
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>update-hook</em>
+(hook-push <em class=red>update-hook</em>
(lambda (old-snd)
(lambda (snd)
(do ((i 0 (+ 1 i)))
@@ -2798,7 +2898,7 @@ then get the exploding bomb icon because their underlying data has changed):
<table border=0 cellpadding=5 vspace=10><tr><td><pre>
(let ((eds #f))
- (<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <em class=red>update-hook</em>
+ (hook-push <em class=red>update-hook</em>
(lambda (cursnd) ; called before actual update -- save our edits
(set! eds (<a href="#editlisttofunction">edit-list-&gt;function</a> cursnd 0))
(lambda (newsnd) ; called after update -- reapply our edits
@@ -2837,7 +2937,7 @@ edit-hook is called just before any attempt to edit the channel's data; if it re
the edit is cancelled. So,
</td></tr></table>
<pre>
- Scheme: (<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> (edit-hook snd chn) (lambda () #t))
+ Scheme: (hook-push (edit-hook snd chn) (lambda () #t))
Ruby: edit_hook(snd, chn).add_hook!(\"stop-edit\") do | | true end
Forth: snd chn edit-hook lambda: &lt;{ }&gt; #t ; add-hook!
</pre>
@@ -2857,7 +2957,7 @@ up protected portions of the edit history:
(let* ((edit-pos (<a class=quiet href="#editposition" onmouseout="UnTip()" onmouseover="Tip(extsnd_editposition_tip)">edit-position</a> snd chn))
(hook (<em class=red>edit-hook</em> snd chn)))
(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_reset_hook_tip)">reset-hook!</a> hook)
- (<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> hook
+ (hook-push hook
(lambda ()
(let ((val (&lt; (<a class=quiet href="#editposition" onmouseout="UnTip()" onmouseover="Tip(extsnd_editposition_tip)">edit-position</a> snd chn) edit-pos)))
(if val (<a class=quiet href="#reportinminibuffer" onmouseout="UnTip()" onmouseover="Tip(extsnd_reportinminibuffer_tip)">report-in-minibuffer</a> "protected"))
@@ -4683,7 +4783,7 @@ instead; you type <code>(start-sync)</code>, then click each of the marks that y
(define (start-sync) (set! mark-sync-number (+ (<a class=quiet href="#marksyncmax" onmouseout="UnTip()" onmouseover="Tip(extsnd_marksyncmax_tip)">mark-sync-max</a>) 1)))
(define (stop-sync) (set! mark-sync-number 0))
(define (click-to-sync id) (set! (<em class=red>mark-sync</em> id) mark-sync-number) #f)
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <a class=quiet href="#markclickhook" onmouseout="UnTip()" onmouseover="Tip(extsnd_markclickhook_tip)">mark-click-hook</a> click-to-sync)
+(hook-push <a class=quiet href="#markclickhook" onmouseout="UnTip()" onmouseover="Tip(extsnd_markclickhook_tip)">mark-click-hook</a> click-to-sync)
</pre></td></tr></table>
Now control-click and drag one of them, and all of them move together deleting data, or
@@ -5581,6 +5681,14 @@ delete-selection deletes the selection, equivalent to the Edit:Delete selection
<tr><td colspan=2 height=16></td></tr>
+<!-- delete-selection-and-smooth -->
+<tr><td colspan=2 bgcolor="#f2f4ff"><code><a class=def name="deleteselectionandsmooth">delete-selection-and-smooth</a></code>
+</td></tr><tr><td></td><td>
+delete-selection-and-smooth deletes the selection, then tries to make the splice smooth.
+</td></tr>
+<tr><td colspan=2 height=16></td></tr>
+
+
<!-- env-selection -->
<tr><td colspan=2 bgcolor="#f2f4ff"><code><a class=def name="envselection">env-selection</a> envelope <em class=narg>env-base</em></code>
</td></tr><tr><td></td><td>
@@ -5634,7 +5742,6 @@ reverse-selection reverses the selection.
<tr><td colspan=2 bgcolor="#f2f4ff"><code><a class=def name="saveselection">save-selection</a> <em class=narg>:file (:header-type mus-next) :data-format :srate :comment :channel</em></code>
</td></tr><tr><td></td><td>
save-selection saves the selection in 'file'. If 'channel' is given, it saves only that channel.
-See popup.scm for an example.
<table border=0 cellpadding=5 vspace=10><tr><td><pre>
(define (brksnd dur base)
@@ -5833,6 +5940,14 @@ If some 'obj' is passed, selection? returns #t is obj is a selection object, and
</td></tr><tr><td colspan=2 height=16></td></tr>
+<!-- show-selection -->
+<tr><td colspan=2 bgcolor="#f2f4ff"><code><a class=def name="showselection">show-selection</a></code>
+</td></tr><tr><td></td><td>
+show-selection finds the bounds of the current selection (in all channels), and
+sets the time domain view to show it.
+</td></tr><tr><td colspan=2 height=16></td></tr>
+
+
<!-- smooth-selection -->
<tr><td colspan=2 bgcolor="#f2f4ff"><code><a class=def name="smoothselection">smooth-selection</a></code>
</td></tr><tr><td></td><td>
@@ -5848,14 +5963,22 @@ then smooth it by typing that key.
</td></tr><tr><td></td><td>
src-selection applies sampling rate conversion to the selection;
this is the same as src-sound but as applied to the selection.
+</td></tr><tr><td colspan=2 height=16></td></tr>
+
+
+<!-- unselect-all -->
+<tr><td colspan=2 bgcolor="#f2f4ff"><code><a class=def name="unselectall">unselect-all</a></code>
+</td></tr><tr><td></td><td>
+If there is currently a selection, this deactivates (unselects) it.
</td></tr>
+
</table>
<br>
<!-- INDEX selectionstuff:Selections -->
<TABLE border=3 bordercolor="tan" hspace=20><tr><td>
<small><blockquote>
-show the current selection: <a href="sndscm.html#showselection">show-selection</a><br>
+show the current selection: <a href="#showselection">show-selection</a><br>
color of selected portion: <a href="#selectioncolor">selection-color</a><br>
set whether creating a selection creates a region: <a href="#selectioncreatesregion">selection-creates-region</a><br>
fft graph refers to the selection: <a href="#showselectiontransform">show-selection-transform</a><br>
@@ -5866,11 +5989,10 @@ select portion via function: <a href="sndscm.html#makeselection">make-selection<
evaluate func on each sample of selection: <a href="sndscm.html#evaloverselection">eval-over-selection</a> (map-selection in effect)<br>
selection members as list of lists of sounds and channels: <a href="sndscm.html#selectionmembers">selection-members</a><br>
rms of selection data: <a href="sndscm.html#selectionrms">selection-rms</a><br>
-delete selection and smooth the splice: <a href="sndscm.html#deleteselectionandsmooth">delete-selection-and-smooth</a><br>
+delete selection and smooth the splice: <a href="#deleteselectionandsmooth">delete-selection-and-smooth</a><br>
select portion between two marks: <a href="sndscm.html#defineselectionviamarks">define-selection-via-marks</a><br>
place marks at selection start and end: <a href="sndscm.html#snapmarks">snap-marks</a><br>
squeeze selection between marks: <a href="sndscm.html#fitselectionbetweenmarks">fit-selection-between-marks</a><br>
-add context-sensitive popup menu specific to selection: <a href="sndscm.html#popupdoc">add-selection-popup</a><br>
delete selection and write it to a file: <a href="sndscm.html#menusdoc">cut-selection-&gt;new</a><br>
append selection: <a href="sndscm.html#menusdoc">append-selection</a><br>
write selection to a file: <a href="sndscm.html#menusdoc">selection-&gt;new</a><br>
@@ -5878,6 +6000,7 @@ notch filter selection: <a href="sndscm.html#notchselection">notch-selection</a>
undo select-all.: <a href="sndscm.html#menusdoc">deselect-all</a><br>
filter the selection: <a href="#filterselection">filter-selection</a>, <a href="sndscm.html#filterselectionandsmooth">filter-selection-and-smooth</a><br>
turn the selection into a mix: <a href="#selectiontomix">selection-&gt;mix</a><br>
+unselect everything: <a href="#unselectall">unselect-all</a><br>
<br>
</blockquote></small>
</td></tr></TABLE>
@@ -6072,8 +6195,6 @@ then restore that state upon "Page Up":
(cddr lst)))))
last-page-state)))))))
</pre></td></tr></table>
-
-See also draw-smpte-label in snd-motif.scm.
</td></tr><tr><td colspan=2 height=18></td></tr>
@@ -6210,7 +6331,7 @@ Possible values are <code>channels-separate</code>, <code>channels-combined</cod
The following code sets the 'unite' button if the current sound has more than 4 channels:
<table border=0 cellpadding=5 vspace=10><tr><td><pre>
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <a class=quiet href="#afteropenhook" onmouseout="UnTip()" onmouseover="Tip(extsnd_afteropenhook_tip)">after-open-hook</a>
+(hook-push <a class=quiet href="#afteropenhook" onmouseout="UnTip()" onmouseover="Tip(extsnd_afteropenhook_tip)">after-open-hook</a>
(lambda (snd)
(if (&gt; (<a class=quiet href="#chans" onmouseout="UnTip()" onmouseover="Tip(extsnd_chans_tip)">channels</a> snd) 4)
(set! (<em class=red>channel-style</em> snd) <a class=quiet href="#channelstyle" onmouseout="UnTip()" onmouseover="Tip(extsnd_channelstyle_tip)">channels-combined</a>))))
@@ -6447,9 +6568,11 @@ replaces the normal "+" cursor with an "x":
(let* ((point (<em class=red>cursor-position</em>))
(x (car point))
(y (cadr point))
- (size (floor (/ (<em class=red>cursor-size</em>) 2))))
- (<a class=quiet href="#drawline" onmouseout="UnTip()" onmouseover="Tip(extsnd_drawline_tip)">draw-line</a> (- x size) (- y size) (+ x size) (+ y size) snd chn <em class=red>cursor-context</em>)
- (<a class=quiet href="#drawline" onmouseout="UnTip()" onmouseover="Tip(extsnd_drawline_tip)">draw-line</a> (- x size) (+ y size) (+ x size) (- y size) snd chn <em class=red>cursor-context</em>)))
+ (size (<em class=red>cursor-size</em>))
+ (cr (make-cairo (car (channel-widgets snd chn))))) ; needed in Gtk, ignored in Motif
+ (<a class=quiet href="#drawline" onmouseout="UnTip()" onmouseover="Tip(extsnd_drawline_tip)">draw-line</a> (- x size) (- y size) (+ x size) (+ y size) snd chn <em class=red>cursor-context</em> cr)
+ (<a class=quiet href="#drawline" onmouseout="UnTip()" onmouseover="Tip(extsnd_drawline_tip)">draw-line</a> (- x size) (+ y size) (+ x size) (- y size) snd chn <em class=red>cursor-context</em> cr)
+ (free-cairo cr)))
(set! (<em class=red>cursor-style</em>) x-cursor)
</pre></td></tr></table>
@@ -6503,7 +6626,7 @@ placement of the fixed point, but not to worry! Your data is ok:
these files automatically in Snd. Perhaps the simplest is to use one of the open hooks:
<table border=0 cellpadding=5 vspace=10><tr><td><pre>
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <a class=quiet href="#afteropenhook" onmouseout="UnTip()" onmouseover="Tip(extsnd_afteropenhook_tip)">after-open-hook</a>
+(hook-push <a class=quiet href="#afteropenhook" onmouseout="UnTip()" onmouseover="Tip(extsnd_afteropenhook_tip)">after-open-hook</a>
(lambda (snd)
;; this could also (alternatively) set the y-bounds as above
(if (= (<em class=red>data-format</em> snd) mus-lint)
@@ -6513,7 +6636,7 @@ these files automatically in Snd. Perhaps the simplest is to use one of the ope
or (an alternative that sets the underlying database entry, rather than the current in-Snd choice):
<table border=0 cellpadding=5 vspace=10><tr><td><pre>
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <a class=quiet href="#openhook" onmouseout="UnTip()" onmouseover="Tip(extsnd_openhook_tip)">open-hook</a>
+(hook-push <a class=quiet href="#openhook" onmouseout="UnTip()" onmouseover="Tip(extsnd_openhook_tip)">open-hook</a>
(lambda (name)
(if (= (<a class=quiet href="#mussounddataformat" onmouseout="UnTip()" onmouseover="Tip(extsnd_mussounddataformat_tip)">mus-sound-data-format</a> name) mus-lint)
(set! (<a class=quiet href="#mussounddataformat" onmouseout="UnTip()" onmouseover="Tip(extsnd_mussounddataformat_tip)">mus-sound-data-format</a> name) mus-lintn))
@@ -6569,10 +6692,11 @@ This deletes sample 'samp' in the given channel.
delete a file: use the Scheme function delete-file, Ruby's File.delete, or Forth's file-delete<br>
delete a region: <a href="#forgetregion">forget-region</a><br>
delete the currently selected samples: <a href="#deleteselection">delete-selection</a><br>
-delete the selection and smooth the splice: <a href="sndscm.html#deleteselectionandsmooth">delete-selection-and-smooth</a><br>
+delete the selection and smooth the splice: <a href="#deleteselectionandsmooth">delete-selection-and-smooth</a><br>
delete a mark or all marks: <a href="#deletemark">delete-mark</a><br>
delete a colormap: <a href="#deletecolormap">delete-colormap</a><br>
delete samples: <a href="#deletesamples">delete-samples</a><br>
+delete samples and smooth over the splice: <a href="#deletesamplesandsmooth">delete-samples-and-smooth</a><br>
remove a file from the sound cache: <a href="#mussoundforget">mus-sound-forget</a><br>
remove a menu item: <a href="#removefrommenu">remove-from-menu</a> or remove-main-menu in snd-motif.scm<br>
delete a mix or all mixes: <a href="sndscm.html#silenceallmixes">silence-mixes</a><br>
@@ -6589,7 +6713,14 @@ Scheme delete funcs: remove-if assoc-remove! hash-remove! delete-if! delete! str
<code><a class=def name="deletesamples">delete-samples</a> samp samps <em class=narg>snd chn edpos</em></code>
</td></tr><tr><td></td><td>
This deletes a block of samples. The deleted portion starts at sample 'samp' and runs for 'samps' samples.
-See delete-selection-and-smooth in extensions.scm.
+</td></tr><tr><td colspan=2 height=18></td></tr>
+
+
+<!-- delete-samples-and-smooth -->
+<tr><td colspan=2 bgcolor="#f2f4ff">
+<code><a class=def name="deletesamplesandsmooth">delete-samples-and-smooth</a> samp samps <em class=narg>snd chn edpos</em></code>
+</td></tr><tr><td></td><td>
+This deletes a block of samples, then tries to smooth over the splice. The deleted portion starts at sample 'samp' and runs for 'samps' samples.
</td></tr><tr><td colspan=2 height=18></td></tr>
@@ -6865,7 +6996,6 @@ Moog filter: <a href="sndscm.html#moogdoc">moog.scm</a><br>
Savitzky-Golay filter: <a href="sndscm.html#sgfilter">savitzky-golay-filter</a><br>
Click reduction: <a href="sndscm.html#removeclicks">remove-clicks</a>, <a href="sndscm.html#cleanchannel">clean-channel</a><br>
FIR filter as virtual edit: <a href="sndscm.html#virtualfilterchannel">virtual-filter-channel</a><br>
-LADSPA-based filter effects: see ladspa.scm<br>
Max Mathews resonator: <a href="sndclm.html#firmant">firmant</a>, <a href="sndscm.html#maxfdoc">maxf.scm, maxf.rb</a><br>
Spectral edit dialog: <a href="snd.html#editenvelope">Envelope Editor</a><br>
graphical equalizer filter bank: <a href="sndscm.html#clminsdoc">graphEq</a><br>
@@ -6959,7 +7089,7 @@ Leaving aside the 'nth' parameter, find-sound could be defined as:
#f)))
</pre></td></tr></table>
-See popup.scm, and files-popup-buffer, open-next-file-in-directory, and the "Buffer Menu" code in examp.scm.
+See files-popup-buffer, open-next-file-in-directory, and the "Buffer Menu" code in examp.scm.
</td></tr><tr><td colspan=2 height=18></td></tr>
@@ -7024,7 +7154,7 @@ the lisp-graph-hook, where the redisplay is automatic.
(<a class=quiet href="#vctmultiply" onmouseout="UnTip()" onmouseover="Tip(extsnd_vctmultiply_tip)">vct-multiply!</a> data data)
(<em class=red>graph</em> data "energy" (/ ls sr) (/ rs sr) 0.0 (* y-max y-max) snd chn #f))))
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <a href="#lispgraphhook">lisp-graph-hook</a> display-energy)
+(hook-push <a href="#lispgraphhook">lisp-graph-hook</a> display-energy)
</pre></td></tr></table>
<img src="pix/energy.png" alt="picture of examp.scm in action">
</td></tr><tr><td colspan=2 height=18></td></tr>
@@ -7661,7 +7791,7 @@ the information to that file, otherwise it posts the data in a help window
by <a href="#maxfftpeaks">max-transform-peaks</a>.
<pre>
-(add-hook! <a class=quiet href="#aftertransformhook" onmouseout="UnTip()" onmouseover="Tip(extsnd_aftertransformhook_tip)">after-transform-hook</a> (lambda (a b c)
+(hook-push <a class=quiet href="#aftertransformhook" onmouseout="UnTip()" onmouseover="Tip(extsnd_aftertransformhook_tip)">after-transform-hook</a> (lambda (a b c)
(<em class=red>peaks</em>))) ; post a detailed list of peaks after each FFT
</pre>
</td></tr><tr><td colspan=2 height=18></td></tr>
@@ -7738,7 +7868,7 @@ And here we play from the cursor with a moving ("tracking") cursor:
(define (<A NAME="pfc">pfc</a>)
(let ((old-tracking (<a class=quiet href="#withtrackingcursor" onmouseout="UnTip()" onmouseover="Tip(extsnd_withtrackingcursor_tip)">with-tracking-cursor</a>)))
(set! (<a class=quiet href="#withtrackingcursor" onmouseout="UnTip()" onmouseover="Tip(extsnd_withtrackingcursor_tip)">with-tracking-cursor</a>) #t)
- (<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <a class=quiet href="#stopplayinghook" onmouseout="UnTip()" onmouseover="Tip(extsnd_stopplayinghook_tip)">stop-playing-hook</a>
+ (hook-push <a class=quiet href="#stopplayinghook" onmouseout="UnTip()" onmouseover="Tip(extsnd_stopplayinghook_tip)">stop-playing-hook</a>
(lambda (snd)
(set! (<a class=quiet href="#withtrackingcursor" onmouseout="UnTip()" onmouseover="Tip(extsnd_withtrackingcursor_tip)">with-tracking-cursor</a>) old-tracking)))
(<em class=red>play</em> (selected-sound) (<a class=quiet href="#cursor" onmouseout="UnTip()" onmouseover="Tip(extsnd_cursor_tip)">cursor</a>))))
@@ -7817,7 +7947,7 @@ play the selection: (play (selection)), <a href="snd.html#cxp">C-x p</a><br>
play a region: (play region-object), <a href="snd.html#cxp">C-x p</a>, play button in Region dialog<br>
play a mix: (play mix-object), play button in Mix dialog<br>
play a sequence of mixes: <a href="sndscm.html#playmixes">play-mixes</a><br>
-play from mark: click or drag triangle (control-click for all chans)<br>
+play from mark: click triangle (control-click for all chans)<br>
play continuously between two marks: <a href="sndscm.html#loopbetweenmarks">loop-it</a><br>
stop playing: C-g, C-t, <a href="#stopplaying">stop-playing</a>, set <a href="#playing">playing</a> to #f<br>
pause or resume playback: space, set <a href="#pausing">pausing</a><br>
@@ -7938,7 +8068,6 @@ icons, so there's no point in calling this more often than that.
<a href="#startprogressreport">start-progress-report</a> posts the initial icon, and <a href="#finishprogressreport">finish-progress-report</a>
removes it. If the icons are not available, a message is posted in
the sound's minibuffer using 'name' to identify itself.
-See ladspa.scm.
</td></tr><tr><td colspan=2 height=18></td></tr>
@@ -7988,10 +8117,9 @@ more like Emacs (it prompts for confirmation first):
(<em class=red>prompt-in-minibuffer</em>
(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_format_tip)">format</a> #f "close ~S (cr=yes)?" (<a class=quiet href="#shortfilename" onmouseout="UnTip()" onmouseover="Tip(extsnd_shortfilename_tip)">short-file-name</a>))
(lambda (response)
- (if (and (not (<a class=quiet href="#cgp" onmouseout="UnTip()" onmouseover="Tip(extsnd_cgp_tip)">c-g?</a>)) ; C-g =&gt; no
- (or (not (string? response))
- (= (string-length response) 0)
- (char=? (string-ref response 0) #\y)))
+ (if (or (not (string? response))
+ (= (string-length response) 0)
+ (char=? (string-ref response 0) #\y))
(<a class=quiet href="#closesound" onmouseout="UnTip()" onmouseover="Tip(extsnd_closesound_tip)">close-sound</a>)))
#f ; selected sound
#t)) ; treat as string (i.e. don't require double quotes)
@@ -8574,7 +8702,7 @@ extract one channel from a sound: <a href="#extractchannel">extract-channel</a><
extract a set of channels from a sound: <a href="#extractchannels">extract-channels</a><br>
save a sound in a different format or header: <a href="#savesoundas">save-sound-as</a><br>
backup edits automatically: <a href="sndscm.html#autosave">autosave</a><br>
-check first for unsaved edits: <a href="sndscm.html#checkforunsavededits">check-for-unsaved-edits</a><br>
+check first for unsaved edits: <a href="#askaboutunsavededits">ask-about-unsaved-edits</a><br>
save Snd's complete state (unsaved edits and all): <a href="#savestate">save-state</a>, <a href="#savedir">save-dir</a>, <a href="#savestatehook">save-state-hook</a>, <a href="#savestatefile">save-state-file</a><br>
save the selection: <a href="#saveselection">save-selection</a><br>
save a region: <a href="#saveregion">save-region</a><br>
@@ -8584,13 +8712,12 @@ save currently defined envelopes (envelope editor): <a href="#saveenvelopes">sav
start the file save dialog: <a href="#savesounddialog">save-sound-dialog</a><br>
start the selection save dialog: <a href="#saveselectiondialog">save-selection-dialog</a><br>
start the region save dialog: <a href="#saveregiondialog">save-region-dialog</a><br>
-use Emacs-style save-as behavior: <a href="sndscm.html#emacsstylesaveas">emacs-style-save-as</a><br>
save the current listener text: <a href="#savelistener">save-listener</a><br>
save keyboard macros: <a href="#savemacros">save-macros</a><br>
save marks: <a href="#savemarks">save-marks</a><br>
save just the edit history: <a href="#saveedithistory">save-edit-history</a><br>
take some action upon a window manager save-yourself signal: <a href="sndscm.html#uponsaveyourself">upon-save-yourself</a><br>
-save the current sound setup for a later reopen: <a href="sndscm.html#remembersoundstate">remember-sound-state</a><br>
+save the current sound setup for a later reopen: <a href="#remembersoundstate">remember-sound-state</a><br>
save the current fft peak info: <a href="#peaks">peaks</a><br>
</blockquote></small>
</td></tr></TABLE>
@@ -8907,7 +9034,7 @@ it's probably simpler to use <a href="sndscm.html#withsound">with-sound</a> (see
(tempfile (<em class=red>with-sound</em> (:output (<a class=quiet href="#sndtempnam" onmouseout="UnTip()" onmouseover="Tip(extsnd_sndtempnam_tip)">snd-tempnam</a>) :srate (<a class=quiet href="#srate" onmouseout="UnTip()" onmouseover="Tip(extsnd_srate_tip)">srate</a>) :to-snd #f)
(<a class=quiet href="#run">run</a>
(do ((samp 0 (+ 1 samp)))
- ((or (c-g?) (<a class=quiet href="#sampleratendQ" onmouseout="UnTip()" onmouseover="Tip(extsnd_sampleratendQ_tip)">sampler-at-end?</a> rd)))
+ ((<a class=quiet href="#sampleratendQ" onmouseout="UnTip()" onmouseover="Tip(extsnd_sampleratendQ_tip)">sampler-at-end?</a> rd))
(<a class=quiet href="sndclm.html#out-any" onmouseout="UnTip()" onmouseover="Tip(sndclm_out_any_tip)">out-any</a> samp (<a class=quiet href="sndclm.html#src" onmouseout="UnTip()" onmouseover="Tip(sndclm_src_tip)">src</a> s incr (lambda (dir) (<a class=quiet href="#readsample" onmouseout="UnTip()" onmouseover="Tip(extsnd_readsample_tip)">read-sample</a> rd))) 0)
(if (= (modulo samp 2205) 0)
(set! incr (+ 2.0 (<a class=quiet href="sndclm.html#oscil" onmouseout="UnTip()" onmouseover="Tip(sndclm_oscil_tip)">oscil</a> o))))))))
@@ -9023,7 +9150,7 @@ smooth-channel-via-ptree in examp.scm is the virtual form.
<small><blockquote>
smooth all channels: <a href="#smoothsound">smooth-sound</a><br>
smooth selection: <a href="#smoothselection">smooth-selection</a><br>
-delete the selection and smooth the splice: <a href="sndscm.html#deleteselectionandsmooth">delete-selection-and-smooth</a><br>
+delete the selection and smooth the splice: <a href="#deleteselectionandsmooth">delete-selection-and-smooth</a><br>
smoothing as virtual op: smooth-channel-via-ptree in examp.scm<br>
smoothing via fft: <a href="sndscm.html#fftsmoother">fft-smoother</a><br>
smooth via low-pass <a href="#filtersinsnd">filter</a><br>
@@ -9450,7 +9577,7 @@ This removes 'player' from the current play-list (see <a href="#makeplayer">make
<code><a class=def name="stopplaying">stop-playing</a> <em class=narg>snd</em></code>
</td></tr><tr><td></td><td>
If 'snd' is playing, this stops it.
-If no argument is given, it stops all playback. See play.scm, popup.scm,
+If no argument is given, it stops all playback. See play.scm,
<a href="#stopplayinghook">stop-playing-hook</a>, or <a href="#stopplayingselectionhook">stop-playing-selection-hook</a>.
</td></tr><tr><td colspan=2 height=18></td></tr>
@@ -9560,7 +9687,7 @@ The default is <code>graph-once</code>. See also <a href="#wavohop">wavo-hop</a
<code><a class=def name="trackingcursorstyle">tracking-cursor-style</a> <em class=narg>snd chn</em></code>
</td></tr><tr><td></td><td>
This is the <a href="#cursorstyle">cursor-style</a> in effect when the cursor is tracking playback (<a href="#withtrackingcursor">with-tracking-cursor</a>).
-tracking-cursor-style can be <code>cursor-cross</code> or <code>cursor-line</code>. If you want some other shape,
+tracking-cursor-style can be <code>cursor-cross</code> or <code>cursor-line</code> (the default). If you want some other shape,
use the function choice for cursor-style (that function's third argument can tell you when you're tracking).
</td></tr><tr><td colspan=2 height=18></td></tr>
@@ -9799,42 +9926,6 @@ This sets the length (in samples) of each wavogram trace (the default is 64). S
</td></tr><tr><td colspan=2 height=18></td></tr>
-<!-- with-tracking-cursor -->
-<tr><td colspan=2 bgcolor="#f2f4ff">
-<code><a class=def name="withtrackingcursor">with-tracking-cursor</a> <em class=narg>snd</em></code>
-</td></tr><tr><td></td><td>
-This is #t if the cursor is following along in the sound during playback. To make this the default:
-<pre>
- (set! (with-tracking-cursor) #t)
-</pre>
-The interval (in seconds) between cursor updates is set by <a href="#cursorupdateinterval">cursor-update-interval</a>
-which defaults to 0.05. The accuracy of the cursor in reflecting the sound coming out the speakers
-depends on the amount of buffering in your audio system. If Snd's displayed location is off,
-set <a href="#cursorlocationoffset">cursor-location-offset</a> to reflect the number of samples
-of buffering you think you probably have. A positive cursor-location-offset delays the cursor's
-apparent progress (if playing forwards). In OSS, you can make a pretty good guess by setting
-it to the number of fragments times half the size of the fragments (since these are bytes, and
-cursor-location-offset is in terms of samples). If you have <code>(mus-oss-set-buffers 4 12)</code>,
-try <code>(set! (cursor-location-offset) (* 4 (expt 2 11)))</code>.
-
-<!-- INDEX trackingcursors:Tracking cursors -->
-<A NAME="trackingcursors"></a>
-
-<TABLE border=3 bordercolor="tan" hspace=20 vspace=10><tr><td>
-<blockquote><small>
-<br>
-play from the current cursor position with a tracking cursor: <a href="#pfc">pfc</a><br>
-display tracking cursor as a full height vertical line: <a href="#trackingcursorstyle">tracking-cursor-style</a><br>
-track play once: control-click 'play'. (You can add a mark at the current tracking cursor location during the play with C-m)<br>
-leave the cursor at the final position after tracking play: if-cursor-follows-play-it-stays-where-play-stopped in examp.scm<br>
-tracking cursor accuracy: <a href="#cursorlocationoffset">cursor-location-offset</a><br>
-tracking cursor updating: <a href="#cursorupdateinterval">cursor-update-interval</a><br>
-<br>
-</small></blockquote>
-</td></tr></TABLE>
-</td></tr><tr><td colspan=2 height=18></td></tr>
-
-
<!-- with-verbose-cursor -->
<tr><td colspan=2 bgcolor="#f2f4ff">
<code><a class=def name="withverbosecursor">with-verbose-cursor</a> <em class=narg>snd chn</em></code>
@@ -9895,7 +9986,7 @@ This returns <code>(list x0 x1)</code>, the current x axis bounds in seconds. T
</td></tr><tr><td></td><td>
This returns the graph (screen pixel) position that corresponds to the x axis value 'x'.
'axis' is one of <code>time-graph</code> (the default), <code>lisp-graph</code>, or <code>transform-graph</code>.
-See draw.scm or gtk-popup.scm for examples.
+See draw.scm for an example.
</td></tr><tr><td colspan=2 height=18></td></tr>
@@ -10441,8 +10532,8 @@ style (default: 12).
<p>
-<a href="sndscm.html#makehiddencontrolsdialog">make-hidden-controls-dialog</a> in
-snd-motif.scm sets up a dialog to handle the controls that aren't handled by
+The Options:Controls menu option
+starts a dialog to handle the controls that aren't handled by
the control panel (expand-control-hop, expand-control-length, expand-control-ramp,
contrast-control-amp, reverb-control-lowpass, and reverb-control-feedback).
The control panel itself is accessible as <code>(list-ref (<a href="#soundwidgets">sound-widgets</a>) 2)</code>.
@@ -10667,45 +10758,20 @@ no redo-able edits, <code>(edits)</code> returns <code>(list 2 0)</code>.
</td></tr><tr><td></td><td>
This returns a list of lists completely describing current edit list.
Each inner list has the form
+
<pre>
(list global-position data-number local-position local-end scaler ramp0 ramp1 type)
</pre>
+
If 'data-number' is -2, it marks the end of the list. In our example above (the scale-channel/pad-channel sequence):
+
<pre>
:<em class=typing>(edit-tree)</em>
<em class=listener>((0 0 0 99 2.0 0.0 0.0 0) (100 -1 0 199 0.0 0.0 0.0 1)
(300 0 100 50827 2.0 0.0 0.0 0) (51028 -2 0 0 0.0 0.0 0.0 0))</em>
</pre>
-The following function uses
-this information to highlight the changed portions of a given sound.
-
-<table border=0 cellpadding=5 vspace=10><tr><td><pre>
-(define (<A NAME="showoriginal">show-original</a> snd chn)
- ;; draw a bar above unchanged portions of a sound
- (define (check-fragment tree ls rs)
- (let* ((fragment (car tree)) ; current edit list fragment
- (pos (car fragment)) ; its position in sound
- (dat (cadr fragment))
- (scl (list-ref fragment 4)))
- (if (and (= dat 0) ; original sound
- (= scl 1.0)) ; unscaled
- (let ((nxtpos (car (cadr tree))))
- (if (and (&lt;= pos rs)
- (&gt;= nxtpos ls)) ; fragment is at least partially visible
- (let ((x0pos (<a class=quiet href="#xtoposition" onmouseout="UnTip()" onmouseover="Tip(extsnd_xtoposition_tip)">x-&gt;position</a> (/ (max ls pos) (<a class=quiet href="#srate" onmouseout="UnTip()" onmouseover="Tip(extsnd_srate_tip)">srate</a>))))
- (x1pos (<a class=quiet href="#xtoposition" onmouseout="UnTip()" onmouseover="Tip(extsnd_xtoposition_tip)">x-&gt;position</a> (/ (min rs nxtpos) (<a class=quiet href="#srate" onmouseout="UnTip()" onmouseover="Tip(extsnd_srate_tip)">srate</a>)))))
- (<a class=quiet href="#fillrectangle" onmouseout="UnTip()" onmouseover="Tip(extsnd_fillrectangle_tip)">fill-rectangle</a> x0pos 2 (- x1pos x0pos) 5)))))
- (if (and (cdr tree) ; go to next fragment
- (not (= (cadr (car tree)) -2)))
- (check-fragment (cdr tree) ls rs))))
- (check-fragment (<em class=red>edit-tree</em> snd chn)
- (<a class=quiet href="#leftsample" onmouseout="UnTip()" onmouseover="Tip(extsnd_leftsample_tip)">left-sample</a> snd chn)
- (<a class=quiet href="#rightsample" onmouseout="UnTip()" onmouseover="Tip(extsnd_rightsample_tip)">right-sample</a> snd chn)))
-
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <a class=quiet href="#aftergraphhook" onmouseout="UnTip()" onmouseover="Tip(extsnd_aftergraphhook_tip)">after-graph-hook</a> show-original)
-</pre>
-</td></tr></table></td></tr><tr><td></td><td></td></tr><tr><td colspan=2 height=16></td></tr>
+</td></tr><tr><td></td><td></td></tr><tr><td colspan=2 height=16></td></tr>
<!-- save-edit-history -->
@@ -10842,21 +10908,6 @@ Here's an example that displays a histogram of the current values in 16 bins:
(set! (v (+ j bin)) (+ step (v (+ j bin))))))))))
</pre></td></tr></table>
-This code ties the Hilbert transform in dsp.scm into the user-interface:
-
-<table border=0 cellpadding=5 vspace=10><tr><td><pre>
-(<em class=red>add-transform</em> "Hilbert" "Hilbert" 0.0 1.0
- (lambda (len fd)
- (let ((flt (<a class=quiet href="sndscm.html#makehilberttransform" onmouseout="UnTip()" onmouseover="Tip(sndscm_makehilberttransform_tip)">make-hilbert-transform</a> 40)))
- (do ((i 0 (+ 1 i))) ; preload first samples
- ((= i 40))
- (<a class=quiet href="sndclm.html#fir-filter" onmouseout="UnTip()" onmouseover="Tip(sndclm_fir_filter_tip)">fir-filter</a> flt (<a class=quiet href="#readsample" onmouseout="UnTip()" onmouseover="Tip(extsnd_readsample_tip)">read-sample</a> fd)))
- (<a class=quiet href="#vctmap" onmouseout="UnTip()" onmouseover="Tip(extsnd_vctmap_tip)">vct-map!</a>
- (<a class=quiet href="#makevct" onmouseout="UnTip()" onmouseover="Tip(extsnd_makevct_tip)">make-vct</a> len)
- (lambda ()
- (<a class=quiet href="sndclm.html#fir-filter" onmouseout="UnTip()" onmouseover="Tip(sndclm_fir_filter_tip)">fir-filter</a> flt (<a class=quiet href="#readsample" onmouseout="UnTip()" onmouseover="Tip(extsnd_readsample_tip)">read-sample</a> fd)))))))
-</pre></td></tr></table>
-
If GSL is included in Snd, the following code ties in the (slow) Hankel transform:
<table border=0 cellpadding=5 vspace=10><tr><td><pre>
@@ -11139,7 +11190,7 @@ called each time the menu is displayed.
This adds the menu 'menu-label' to the top-level menu whose index is
'top-menu' with the callback function 'callback', then returns the new menu label widget.
The built-in
-Snd menus are numbered from 0 ('File') to 5 ('Popup'); 'Help' is menu 4. If the label and callback are #f, a separator is added to the menu.
+Snd menus are numbered from 0 ('File') to 4 ('Help'). If the label and callback are #f, a separator is added to the menu.
'position' sets the position of the new menu option; it defaults to the end of the menu. See new-effects.scm for many examples.
<pre>
(<em class=red>add-to-menu</em> 1 "Stop Playing"
@@ -11254,6 +11305,7 @@ dialog-widgets returns a list of dialog widgets (or lists thereof, or #f if none
18: File: Recorder dialog
19: View: Regions dialog
20: info dialog (activated by info-dialog function)
+ 21: more controls dialog
22: Edit: Selection Save as dialog
23: File: Insert file dialog
24: region save as dialog (from regions dialog save button)
@@ -11510,9 +11562,6 @@ starts the help dialog with help related to the selection if "h" is typed in the
(if subject
(<a class=quiet href="#helpdialog" onmouseout="UnTip()" onmouseover="Tip(extsnd_helpdialog_tip)">help-dialog</a> subject (<a class=quiet href="#sndhelp" onmouseout="UnTip()" onmouseover="Tip(extsnd_sndhelp_tip)">snd-help</a> subject))))))
</pre>
-<p>But it's probably more convenient to use the <a href="#listenerclickhook">listener-click-hook</a>
-and click-for-listener-help (draw.scm).
-</p>
</td></tr><tr><td colspan=2 height=16></td></tr>
@@ -11538,7 +11587,6 @@ associated with its integer argument:
2: View menu
3: Options menu
4: Help menu
- 5: built-in popup menu
and others as added by add-main-menu
</pre>
</td></tr><tr><td colspan=2 height=16></td></tr>
@@ -11577,8 +11625,7 @@ as a list:
2: edit-menu
3: view-menu
4: options-menu
- 5: help-menu,
- 6: default popup menu
+ 5: help-menu
</pre>
See snd-motif.scm, snd-gtk.scm, kmenu.scm, and new-effects.scm for various examples.
Manipulating menus can be tricky in both Motif and Gtk; if I were to try to explain
@@ -11671,6 +11718,24 @@ This resets the listener cursor to the default pointer shape.
</td></tr><tr><td colspan=2 height=16></td></tr>
+<!-- save-as-dialog-auto-comment -->
+<tr><td colspan=2 bgcolor="#f2f4ff">
+<code><a class=def name="saveasdialogautocomment">save-as-dialog-auto-comment</a></code>
+</td></tr><tr><td></td><td>
+This is the 'auto' button in the Save-as dialogs. If set, a comment is automatically
+generated for the new file.
+</td></tr><tr><td colspan=2 height=16></td></tr>
+
+
+<!-- save-as-dialog-src -->
+<tr><td colspan=2 bgcolor="#f2f4ff">
+<code><a class=def name="saveasdialogsrc">save-as-dialog-src</a></code>
+</td></tr><tr><td></td><td>
+This is the 'src' button in the Save-as dialogs. If set, sampling rate conversion
+is performed if the output srate does not match the original srate.
+</td></tr><tr><td colspan=2 height=16></td></tr>
+
+
<!-- save-envelopes -->
<tr><td colspan=2 bgcolor="#f2f4ff">
<code><a class=def name="saveenvelopes">save-envelopes</a> filename</code>
@@ -11963,27 +12028,6 @@ add-source-file-extension adds 'ext' to the list of source file extensions.
</td></tr><tr><td colspan=2 height=16></td></tr>
-<!-- add-watcher -->
-<tr><td colspan=2 bgcolor="#f2f4ff">
-<code><a class=def name="addwatcher">add-watcher</a> func</code>
-</td></tr><tr><td><br></td><td>
-add-watcher adds 'func' (a function of no arguments) to the watcher list, and
-returns its id (an integer, used by <a href="#deletewatcher">delete-watcher</a>). Each watcher function is called whenever the current selection
-changes, a sound is opened or closed or set read-only, a sound is selected, or a mark is changed.
-effects-utils.scm (and the gtk version in gtk-effects-utils.scm) use this to make sure the
-"DoIt" button is sensitive only when it can actually do something. In the simplest case, this
-is:
-<pre>
- Motif: (add-watcher (lambda ()
- (XtSetSensitive
- (XmMessageBoxGetChild new-dialog XmDIALOG_OK_BUTTON)
- (not (null? (<a class=quiet href="#soundp" onmouseout="UnTip()" onmouseover="Tip(extsnd_soundp_tip)">sounds</a>))))))
- Gtk: (add-watcher (lambda ()
- (gtk_widget_set_sensitive ok-button (not (null? (<a class=quiet href="#soundp" onmouseout="UnTip()" onmouseover="Tip(extsnd_soundp_tip)">sounds</a>))))))
-</pre>
-</td></tr><tr><td colspan=2 height=16></td></tr>
-
-
<!-- bes-* -->
<tr><td colspan=2 bgcolor="#f2f4ff">
<code><A class=def NAME="besj0">bes-j0</A> x</code><br>
@@ -12159,7 +12203,6 @@ A similar set rebinds the arrow keys to give much more precise window position a
(zoom-one-pixel (<a class=quiet href="#selectedsound" onmouseout="UnTip()" onmouseover="Tip(extsnd_selectedsound_tip)">selected-sound</a>) (<a class=quiet href="#selectedchannel" onmouseout="UnTip()" onmouseover="Tip(extsnd_selectedchannel_tip)">selected-channel</a>) #t)))
</pre></td></tr></table>
-Most of the predefined key definitions are given in <a href="snd.html#builtinkeys">Keyboard Commands</a>.
The key bindings set by bind-key are active only when the active widget is a graph; when the listener is receiving
key strokes, the underlying text widget interprets them itself (using Emacs as a vague guide). You can change the listener's interpretation
in the following manner (this assumes you're using Motif and have the xm module loaded):
@@ -12204,7 +12247,7 @@ in either Motif or Gtk:
(let ((listener (list-ref (<a class=quiet href="#mainwidgets" onmouseout="UnTip()" onmouseover="Tip(extsnd_mainwidgets_tip)">main-widgets</a>) 4)))
(g_signal_connect_closure_by_id
(GPOINTER listener)
- (g_signal_lookup "key_press_event" (G_OBJECT_TYPE (GTK_OBJECT listener)))
+ (g_signal_lookup "key_press_event" (G_OBJECT_TYPE (G_OBJECT listener)))
0
(g_cclosure_new (lambda (w event data)
(let ((bits (.state (GDK_EVENT_KEY event)))
@@ -12281,68 +12324,8 @@ exit back to the top level, (break-exit):
<tr><td colspan=2 bgcolor="#f2f4ff">
<code><a class=def name="cgp">c-g?</a></code>
</td></tr><tr><td></td><td>
-This checks for C-g to interrupt an on-going computation, and let other UI
-events through. c-g? is especially useful in loops; we can define our own safe 'while' loop as follows:
-
-<table border=0 cellpadding=5 vspace=10><tr><td><pre>
-(defmacro safe-while (cond . body)
- `(letrec ((break (lambda val (apply throw 'break val)))
- (continue (lambda () (if (<em class=red>c-g?</em>)
- (break 'interrupted)
- (or (not ,cond)
- (begin (begin ,@ body)
- (continue)))))))
- (catch 'break
- (lambda () (continue))
- (lambda v (cadr v)))))
-</pre></td></tr></table>
-
-Here's a version of "do" that is interruptible and continuable. c-g? provides
-the interrupt, and call-with-current-continuation provides the continuation.
-To continue running an interrupted do?, <code>(do-go-on)</code>.
-
-<table border=0 cellpadding=5 vspace=10><tr><td><pre>
-(define do-go-on-continuation #f)
-(define (do-go-on)
- (if (continuation? do-go-on-continuation) ; a Snd function &mdash; should be provided by Scheme!
- (do-go-on-continuation #f)
- ";sorry! can't continue"))
-
-(defmacro do? (inits ends . body)
- `(do ,inits
- ((or (and ,(car ends)
- (begin
- (set! do-go-on-continuation #f) ; clear obsolete continuation
- #t))
- (and (<em class=red>c-g?</em>) ; got C-g &mdash; set continuation
- (call-with-current-continuation
- (lambda (go-on)
- (set! do-go-on-continuation go-on)))))
- ,(and (not (null? (cdr ends)))
- (cadr ends)))
- ,@body))
-</pre></td></tr></table>
-
-See examp.scm and play.scm for other examples.
-</td></tr><tr><td colspan=2 height=16></td></tr>
-
-
-<!-- c-g! -->
-<tr><td colspan=2 bgcolor="#f2f4ff">
-<code><a class=def name="cgx">c-g!</a></code>
-</td></tr><tr><td></td><td>
-This simulates typing C-g. It is intended for use with <a href="#bindkey">bind-key</a> to remap C-g.
-If you use it in some other situation (a hook for example), there are annoying problems with clearing
-the "I've been interrupted" flags. Probably the safest thing is to call (c-g?) after the interruption
-has taken effect.
-</td></tr><tr><td colspan=2 height=16></td></tr>
-
-
-<!-- delete-watcher -->
-<tr><td colspan=2 bgcolor="#f2f4ff">
-<code><a class=def name="deletewatcher">delete-watcher</a> id</code>
-</td></tr><tr><td width=30><br></td><td>
-delete-watcher removes from the watcher list the function associated with id.
+This checks for C-g to interrupt an on-going computation, and lets other UI
+events through. It is obsolete in s7.
</td></tr><tr><td colspan=2 height=16></td></tr>
@@ -12378,6 +12361,7 @@ fmod is mod with float arguments:
&gt;<em class=typing>(fmod 2.5 1.4)</em>
<em class=listener>1.1</em>
</pre>
+In Scheme, it is a synonym for modulo.
</td></tr><tr><td colspan=2 height=16></td></tr>
@@ -12553,9 +12537,7 @@ To go to the
HTML documentation for a given object, load <a href="sndscm.html#indexdoc">index.scm</a> and use the html function.
<br><br>
Normally snd-help adds carriage-returns to fit the current size of the listener; to
-get the raw string instead, set the argument 'formatted' to #f (or use s7's help function). click-for-listener-help
-in draw.scm uses this to put off formatting the help string until the help dialog (rather than
-the listener) gets it.
+get the raw string instead, set the argument 'formatted' to #f (or use s7's help function).
</td></tr><tr><td colspan=2 height=16></td></tr>
@@ -12574,7 +12556,6 @@ refer to it directly, not as a procedure call. Say we have a sound file "now.sn
and we want it to use the grid-graph whenever it is viewed. We make "now.snd.scm"
and put in it: <code>(set! (show-grid *snd-opened-sound*) #t)</code>. When "now.snd" is
opened, "now.snd.scm" is loaded automatically with *snd-opened-sound* holding the sound object of "now.snd".
-There are other fancier ways to do this (e.g. <a href="sndscm.html#remembersoundstate">remember-sound-state</a>).
</td></tr><tr><td colspan=2 height=16></td></tr>
@@ -12834,10 +12815,6 @@ throws the error 'no-such-file:</p>
debuggers to exit the current context, returning up a level in the
stack of listeners. Normally that means you jump out of a breakpoint
or whatever and find yourself back at the top level. <code>(throw 'snd-top-level)</code>.
-This catch is also the target of the SIGUSR1 signal, so if you're caught in an infinite
-loop and Snd won't respond to C-g or anything else, go to a shell, get the Snd
-process number ("PID" in the 'ps au' printout), then: kill -10 6141. SIGUSR1 is
-signal 10, and we're using the kill program to send that signal to Snd (process 6141 in our example).
</p>
<br>
@@ -12931,63 +12908,87 @@ are:</p>
<table border=2 bordercolor="#f2f4ff" cellpadding=6 hspace=10><tr><td>
<table border=0 cellpadding=0 cellspacing=0 hspace=20>
-<tr><td><code><a class=def name="axiscolor">axis-color</a></code></td><td width=20></td>
- <td><code>defaults to current data color</code></td><td width=20></td>
- <td>color of axes</td></tr>
-<tr><td><code><a class=def name="basiccolor">basic-color</a></code></td><td width=20></td>
- <td><code>ivory2</code></td><td width=20></td>
+
+<tr><td bgcolor="#f2f4ff"><code><a class=def name="axiscolor">axis-color</a></code></td><td width=20 bgcolor="#f2f4ff"></td>
+ <td bgcolor="#f2f4ff"><code>defaults to current data color</code></td><td width=20 bgcolor="#f2f4ff"></td>
+ <td bgcolor="#f2f4ff">color of axes</td></tr>
+
+<tr><td><code><a class=def name="basiccolor">basic-color</a></code></td><td></td>
+ <td><code>ivory2</code></td><td></td>
<td>main Snd color.</td></tr>
-<tr><td bgcolor="#f2f4ff"><code><a class=def name="cursorcolor">cursor-color</a></code></td><td bgcolor="#f2f4ff"></td>
- <td bgcolor="#f2f4ff"><code>red</code></td><td bgcolor="#f2f4ff"></td>
- <td bgcolor="#f2f4ff">graph cursor color.</td></tr>
-<tr><td><code><a class=def name="datacolor">data-color</a></code></td><td></td>
- <td><code>black</code></td><td></td>
- <td>color of data in unselected graph.</td></tr>
-<tr><td bgcolor="#f2f4ff"><code><em class=emdef>enved-waveform-color</em></code></td><td bgcolor="#f2f4ff"></td>
- <td bgcolor="#f2f4ff"><code>blue</code></td><td bgcolor="#f2f4ff"></td>
- <td bgcolor="#f2f4ff">color of waveform displayed in envelope editor.</td></tr>
-<tr><td><code><em class=emdef>filter-control-waveform-color</em></code></td><td></td>
+
+<tr><td bgcolor="#f2f4ff"><code><a class=def name="combineddatacolor">combined-data-color</a></code></td><td bgcolor="#f2f4ff"></td>
+ <td bgcolor="#f2f4ff"><code>depends on channel number</code></td><td bgcolor="#f2f4ff"></td>
+ <td bgcolor="#f2f4ff">color of channel data if channels-combined</td></tr>
+
+<tr><td><code><a class=def name="cursorcolor">cursor-color</a></code></td><td></td>
+ <td><code>red</code></td><td></td>
+ <td>graph cursor color.</td></tr>
+
+<tr><td bgcolor="#f2f4ff"><code><a class=def name="datacolor">data-color</a></code></td><td bgcolor="#f2f4ff"></td>
+ <td bgcolor="#f2f4ff"><code>black</code></td><td bgcolor="#f2f4ff"></td>
+ <td bgcolor="#f2f4ff">color of data in unselected graph.</td></tr>
+
+<tr><td><code><em class=emdef>enved-waveform-color</em></code></td><td></td>
<td><code>blue</code></td><td></td>
- <td>color of control panel filter waveform.</td></tr>
-<tr><td bgcolor="#f2f4ff"><code><a class=def name="graphcolor">graph-color</a></code></td><td bgcolor="#f2f4ff"></td>
- <td bgcolor="#f2f4ff"><code>white</code></td><td bgcolor="#f2f4ff"></td>
- <td bgcolor="#f2f4ff">background color of unselected graph.</td></tr>
+ <td>color of waveform displayed in envelope editor.</td></tr>
+
+<tr><td bgcolor="#f2f4ff"><code><em class=emdef>filter-control-waveform-color</em></code></td><td bgcolor="#f2f4ff"></td>
+ <td bgcolor="#f2f4ff"><code>blue</code></td><td bgcolor="#f2f4ff"></td>
+ <td bgcolor="#f2f4ff">color of control panel filter waveform.</td></tr>
+
+<tr><td><code><a class=def name="graphcolor">graph-color</a></code></td><td></td>
+ <td><code>white</code></td><td></td>
+ <td>background color of unselected graph.</td></tr>
+
<tr><td bgcolor="#f2f4ff"><code><a class=def name="highlightcolor">highlight-color</a></code></td><td bgcolor="#f2f4ff"></td>
<td bgcolor="#f2f4ff"><code>ivory1</code></td><td bgcolor="#f2f4ff"></td>
<td bgcolor="#f2f4ff">highlighting color.</td></tr>
+
<tr><td><code><em class=emdef>listener-color</em></code></td><td></td>
<td><code>aliceblue</code></td><td></td>
<td>background color of listener.</td></tr>
+
<tr><td bgcolor="#f2f4ff"><code><em class=emdef>listener-text-color</em></code></td><td bgcolor="#f2f4ff"></td>
<td bgcolor="#f2f4ff"><code>black</code></td><td bgcolor="#f2f4ff"></td>
<td bgcolor="#f2f4ff">text color in listener.</td></tr>
+
<tr><td><code><a class=def name="markcolor">mark-color</a></code></td><td></td>
<td><code>red</code></td><td></td>
<td>color of mark indicator.</td></tr>
+
<tr><td bgcolor="#f2f4ff"><code><em class=emdef>mix-color</em></code></td><td bgcolor="#f2f4ff"></td>
<td bgcolor="#f2f4ff"><code>darkgray</code></td><td bgcolor="#f2f4ff"></td>
<td bgcolor="#f2f4ff">color of mix waveforms.</td></tr>
+
<tr><td><code><a class=def name="positioncolor">position-color</a></code></td><td></td>
<td><code>ivory3</code></td><td></td>
<td>position slider color</td></tr>
-<tr><td><code><a class=def name="sashcolor">sash-color</a></code></td><td></td>
- <td><code>lightgreen</code></td><td></td>
- <td>color of paned window sashes.</td></tr>
-<tr><td bgcolor="#f2f4ff"><code><a class=def name="selecteddatacolor">selected-data-color</a></code></td><td bgcolor="#f2f4ff"></td>
- <td bgcolor="#f2f4ff"><code>black</code></td><td bgcolor="#f2f4ff"></td>
- <td bgcolor="#f2f4ff">color of data in currently selected graph.</td></tr>
-<tr><td><code><a class=def name="selectedgraphcolor">selected-graph-color</a></code></td><td></td>
- <td><code>white</code></td><td></td>
- <td>background color of currently selected graph.</td></tr>
-<tr><td bgcolor="#f2f4ff"><code><a class=def name="selectioncolor">selection-color</a></code></td><td bgcolor="#f2f4ff"></td>
- <td bgcolor="#f2f4ff"><code>lightsteelblue1</code></td><td bgcolor="#f2f4ff"></td>
- <td bgcolor="#f2f4ff">color of selected portion of graph.</td></tr>
-<tr><td><code><a class=def name="textfocuscolor">text-focus-color</a></code></td><td></td>
- <td><code>white</code></td><td></td>
- <td>color of text field when it has focus.</td></tr>
-<tr><td bgcolor="#f2f4ff"><code><a class=def name="zoomcolor">zoom-color</a></code></td><td bgcolor="#f2f4ff"></td>
- <td bgcolor="#f2f4ff"><code>ivory4</code></td><td bgcolor="#f2f4ff"></td>
- <td bgcolor="#f2f4ff">zoom slider color.</td></tr>
+
+<tr><td bgcolor="#f2f4ff"><code><a class=def name="sashcolor">sash-color</a></code></td><td bgcolor="#f2f4ff"></td>
+ <td bgcolor="#f2f4ff"><code>lightgreen</code></td><td bgcolor="#f2f4ff"></td>
+ <td bgcolor="#f2f4ff">color of paned window sashes.</td></tr>
+
+<tr><td><code><a class=def name="selecteddatacolor">selected-data-color</a></code></td><td></td>
+ <td><code>black</code></td><td></td>
+ <td>color of data in currently selected graph.</td></tr>
+
+<tr><td bgcolor="#f2f4ff"><code><a class=def name="selectedgraphcolor">selected-graph-color</a></code></td><td bgcolor="#f2f4ff"></td>
+ <td bgcolor="#f2f4ff"><code>white</code></td><td bgcolor="#f2f4ff"></td>
+ <td bgcolor="#f2f4ff">background color of currently selected graph.</td></tr>
+
+<tr><td><code><a class=def name="selectioncolor">selection-color</a></code></td><td></td>
+ <td><code>lightsteelblue1</code></td><td></td>
+ <td>color of selected portion of graph.</td></tr>
+
+<tr><td bgcolor="#f2f4ff"><code><a class=def name="textfocuscolor">text-focus-color</a></code></td><td bgcolor="#f2f4ff"></td>
+ <td bgcolor="#f2f4ff"><code>white</code></td><td bgcolor="#f2f4ff"></td>
+ <td bgcolor="#f2f4ff">color of text field when it has focus.</td></tr>
+
+<tr><td><code><a class=def name="zoomcolor">zoom-color</a></code></td><td></td>
+ <td><code>ivory4</code></td><td></td>
+ <td>zoom slider color.</td></tr>
+
</table>
</td></tr></table>
@@ -13014,11 +13015,15 @@ are:</p>
set_selected_data_color blue
</pre>
+<p>combined-data-color is slightly special. It takes two arguments, the sound and channel number, and applies to the
+channel's data only if the graphs are superimposed, when <a href="#channelstyle">channel-style</a> is <code>channels-combined</code>.
+</p>
+
+
<!-- INDEX colors:Colors -->
<TABLE border=3 bordercolor="tan" hspace=40 vspace=10><tr><td>
<blockquote><small><br>
Other color-related stuff:<br>
-X/Motif color resources: <a href="grfsnd.html#sndresources">Snd Resources</a><br>
Color names: <a href="sndscm.html#rgbdoc">rgb.scm, rgb.rb</a><br>
colors in the file dialogs: install-searcher-with-colors in snd-motif.scm<br>
color-orientation-dialog: <a href="#colororientationdialog">color-orientation-dialog</a><br>
@@ -13076,11 +13081,6 @@ If the requested font can't be loaded, the set! statement returns the old (uncha
<table width="60%" border=0><tr><td bgcolor="lightgreen" valign="middle"><h4><A NAME="graphics">Graphics</a></h4></td></tr></table>
-<p>It is possible to draw directly on any of the channel graphs. Examples include the
-<a href="#showoriginal">show-original</a> after-graph-hook function, and the
-<a href="#xcursor">x-cursor</a> function that draws an "x" shaped cursor.
-</p>
-
<!-- -------------------------------- GRAPHICS -------------------------------- -->
<table border=0 cellspacing=4 cellpadding=6 hspace=10>
@@ -13197,25 +13197,6 @@ If the colormap is inverted, the order of colors is reversed.
color-scale reflects the darkness setting in the View:<a href="snd.html#colorbrowser">Color/Orientation</a> dialog.
The mapping between the slider in the dialog and the color-scale value is not linear, and is
currently different in Gtk and Motif.
-The color chooser function in <a href="#timegraphhook">time-graph-hook</a> can use
-<a href="#colorinverted">color-inverted</a>
-and color-scale to drive colormap choices:
-
-<pre>
- (add-hook! <a class=quiet href="#timegraphhook">time-graph-hook</a>
- (lambda (snd chn)
- (apply <a class=quiet href="#makecolor">make-color</a> (<a class=quiet href="#colormapref">colormap-ref</a>
- (<a class=quiet href="#colormap">colormap</a>)
- (let ((x (if (<em class=red>color-inverted</em>)
- (/ chn n) ; n = total chans in this case
- (/ (- n chn) n)))
- (base (<em class=red>color-scale</em>)))
- (if (= base 1.0)
- x
- (/ (- (expt base x) 1.0)
- (- base 1.0))))))))
-</pre>
-
</td></tr><tr><td colspan=2 height=16></td></tr>
@@ -13287,7 +13268,6 @@ This is the graphics mode (an integer in Snd, not a function) to use to draw ove
The "contexts" refer to graphics contexts used throughout Snd; the <code>copy-context</code>
copies into the current graph, whereas the <code>cursor-context</code> uses XOR.
The error thrown for an unimplemented context is 'no-such-graphics-context.
-See draw.scm or <a href="#displaysampsinred">display-samps-in-red</a>.
</td></tr><tr><td colspan=2 height=16></td></tr>
@@ -13319,12 +13299,13 @@ delete-colormap deletes the memory associated with the given colormap.
<!-- draw-axes -->
<tr><td colspan=2 bgcolor="#f2f4ff">
-<code><a class=def name="drawaxes">draw-axes</a> <em class=narg>wid gc label x0 x1 y0 y1 style axes</em></code>
+<code><a class=def name="drawaxes">draw-axes</a> wid gc label x0 x1 y0 y1 style axes cr</code>
</td></tr><tr><td width=30></td><td>
This draws axes in the widget 'wid', using the graphics context 'gc', with the x-axis label 'label'
going from 'x0' to 'x1' (floats) along the x axis, 'y0' to 'y1' along the y axis, with x-axis-style
'style' (<code>x-axis-in-seconds</code> etc). Whether axes are actually displayed or just implied
-depends on 'axes', which defaults to <code>show-all-axes</code>.
+depends on 'axes', which defaults to <code>show-all-axes</code>. In Gtk, the cairo_t 'cr' argument is not optional;
+it is ignored in Motif.
draw-axes returns a list of the actual (pixel) axis bounds.
See the scanned-synthesis display code in snd-motif.scm,
or the local envelope editor code in xm-enved.scm.
@@ -13333,7 +13314,7 @@ or the local envelope editor code in xm-enved.scm.
<!-- draw-dot -->
<tr><td colspan=2 bgcolor="#f2f4ff">
-<code><a class=def name="drawdot">draw-dot</a> x0 y0 <em class=narg>dot-size snd chn context</em></code>
+<code><a class=def name="drawdot">draw-dot</a> x0 y0 dot-size snd chn context cr</code>
</td></tr><tr><td width=30></td><td>
This draws a dot at ('x0 y0') of diameter 'dot-size' pixels in the specified context. See musglyphs.scm.
</td></tr><tr><td colspan=2 height=16></td></tr>
@@ -13341,7 +13322,7 @@ This draws a dot at ('x0 y0') of diameter 'dot-size' pixels in the specified con
<!-- draw-dots -->
<tr><td colspan=2 bgcolor="#f2f4ff">
-<code><a class=def name="drawdots">draw-dots</a> positions <em class=narg>dot-size snd chn context</em></code>
+<code><a class=def name="drawdots">draw-dots</a> positions dot-size snd chn context cr</code>
</td></tr><tr><td></td><td>
This draws dots of size 'dot-size' from the (x y) pairs in the vector 'positions' in the specified context.
draw-dots, draw-lines, and fill-polygon take vectors, rather than vcts (which would be more consistent
@@ -13351,7 +13332,7 @@ with the rest of Snd) because the values passed are supposed to be short ints.
<!-- draw-line -->
<tr><td colspan=2 bgcolor="#f2f4ff">
-<code><a class=def name="drawline">draw-line</a> x0 y0 x1 y1 <em class=narg>snd chn context</em></code>
+<code><a class=def name="drawline">draw-line</a> x0 y0 x1 y1 snd chn context cr</code>
</td></tr><tr><td></td><td>
This draws a line from ('x0 y0') to ('x1 y1') in the specified context.
</td></tr><tr><td colspan=2 height=16></td></tr>
@@ -13359,7 +13340,7 @@ This draws a line from ('x0 y0') to ('x1 y1') in the specified context.
<!-- draw-lines -->
<tr><td colspan=2 bgcolor="#f2f4ff">
-<code><a class=def name="drawlines">draw-lines</a> lines <em class=narg>snd chn context</em></code>
+<code><a class=def name="drawlines">draw-lines</a> lines snd chn context cr</code>
</td></tr><tr><td></td><td>
This draws lines following the (x y) pairs in the vector 'lines' in the specified context.
make-bezier-1 in <a href="sndscm.html#musglyphs">musglyphs.scm</a> can be used to draw Bezier curves.
@@ -13368,7 +13349,7 @@ make-bezier-1 in <a href="sndscm.html#musglyphs">musglyphs.scm</a> can be used t
<!-- draw-string -->
<tr><td colspan=2 bgcolor="#f2f4ff">
-<code><a class=def name="drawstring">draw-string</a> text x0 y0 <em class=narg>snd chn context</em></code>
+<code><a class=def name="drawstring">draw-string</a> text x0 y0 snd chn context cr</code>
</td></tr><tr><td></td><td>
This draws a string ('text') in the current font and foreground color starting at ('x0 y0') in the specified context.
The next procedures use the channel-property list to maintain a list
@@ -13396,34 +13377,36 @@ currently in the time-domain graph:
(if (and (&lt; ls samp)
(&gt; rs samp))
(let ((xpos (<a class=quiet href="#xtoposition" onmouseout="UnTip()" onmouseover="Tip(extsnd_xtoposition_tip)">x-&gt;position</a> (/ samp (<a class=quiet href="#srate" onmouseout="UnTip()" onmouseover="Tip(extsnd_srate_tip)">srate</a>))))
- (ypos (<a class=quiet href="#ytoposition" onmouseout="UnTip()" onmouseover="Tip(extsnd_ytoposition_tip)">y-&gt;position</a> (<a class=quiet href="#sample" onmouseout="UnTip()" onmouseover="Tip(extsnd_sample_tip)">sample</a> samp))))
- (<a class=quiet href="#drawline" onmouseout="UnTip()" onmouseover="Tip(extsnd_drawline_tip)">draw-line</a> xpos 20 xpos (- ypos 4))
- (<em class=red>draw-string</em> text (- xpos (/ text-width 2)) 18)))))
+ (ypos (<a class=quiet href="#ytoposition" onmouseout="UnTip()" onmouseover="Tip(extsnd_ytoposition_tip)">y-&gt;position</a> (<a class=quiet href="#sample" onmouseout="UnTip()" onmouseover="Tip(extsnd_sample_tip)">sample</a> samp)))
+ (cr (make-cairo (car (channel-widgets snd chn)))))
+ (<a class=quiet href="#drawline" onmouseout="UnTip()" onmouseover="Tip(extsnd_drawline_tip)">draw-line</a> xpos 20 xpos (- ypos 4) snd chn time-graph cr)
+ (<em class=red>draw-string</em> text (- xpos (/ text-width 2)) 18 snd chn time-graph cr)
+ (free-cairo cr)))))
comments)))
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <a class=quiet href="#aftergraphhook" onmouseout="UnTip()" onmouseover="Tip(extsnd_aftergraphhook_tip)">after-graph-hook</a> show-comments)
+(hook-push <a class=quiet href="#aftergraphhook" onmouseout="UnTip()" onmouseover="Tip(extsnd_aftergraphhook_tip)">after-graph-hook</a> show-comments)
</pre></td></tr></table>
</td></tr><tr><td colspan=2 height=16></td></tr>
<!-- fill-rectangle -->
<tr><td colspan=2 bgcolor="#f2f4ff">
-<code><a class=def name="fillrectangle">fill-rectangle</a> x0 y0 width height <em class=narg>snd chn context erase</em></code>
+<code><a class=def name="fillrectangle">fill-rectangle</a> x0 y0 width height snd chn context erase cr</code>
</td></tr><tr><td></td><td>
This draws a filled rectangle in the current foreground color from ('x0 y0') of size ('width height').
If 'erase' is #t, this function erases the rectangular area.
-See draw.scm, snd-motif.scm, or <a href="#showoriginal">show-original</a>.
+See draw.scm and snd-motif.scm.
</td></tr><tr><td colspan=2 height=16></td></tr>
<!-- fill-polygon -->
<tr><td colspan=2 bgcolor="#f2f4ff">
-<code><a class=def name="fillpolygon">fill-polygon</a> points <em class=narg>snd chn context</em></code>
+<code><a class=def name="fillpolygon">fill-polygon</a> points snd chn context cr</code>
</td></tr><tr><td></td><td>
This draws a filled polygon whose vertices are in the vector 'points'.
<table border=0 cellpadding=5 vspace=10><tr><td><pre>
-(define (-&gt; x0 y0 size snd chn)
+(define (-&gt; x0 y0 size snd chn cr)
"draw an arrow pointing (from the left) at the point (x0 y0)"
(let ((points (make-vector 8)))
(define (point i x y)
@@ -13434,13 +13417,13 @@ This draws a filled polygon whose vertices are in the vector 'points'.
(point 1 (- x (* 2 size)) (- y size))
(point 2 (- x (* 2 size)) (+ y size))
(point 3 x y)
- (<em class=red>fill-polygon</em> points snd chn))
+ (<em class=red>fill-polygon</em> points snd chn time-graph cr))
(arrow-head x0 y0)
(<a class=quiet href="#fillrectangle" onmouseout="UnTip()" onmouseover="Tip(extsnd_fillrectangle_tip)">fill-rectangle</a> (- x0 (* 4 size))
(floor (- y0 (* .4 size)))
(* 2 size)
(floor (* .8 size))
- snd chn)))
+ snd chn time-graph #f cr)))
</pre></td></tr></table>
musglyphs.scm has some elaborate examples that use fill-polygon to draw music notation symbols.
@@ -13470,55 +13453,17 @@ The <a href="sndscm.html#startwaterfall">waterfall</a> function in snd-gl.scm us
<!-- graph-data -->
<tr><td colspan=2 bgcolor="#f2f4ff">
-<code><a class=def name="graphdata">graph-data</a> data <em class=narg>snd chn context low high graphics-style</em></code>
+<code><a class=def name="graphdata">graph-data</a> data snd chn context low high graphics-style cr</code>
</td></tr><tr><td></td><td>
+<p>
graph-data displays 'data' in the time domain graph of the sound's channel
'chn' using the graphics context 'context' (normally <code>copy-context</code>), placing the
data in the recipient's graph between points 'low' and 'high'
in the drawing mode 'graphics-style'.
With this function and make-graph-data, we can overlay sounds,
overlay different versions of the same sound, place a portion of a
-sound over another at an arbitrary point, and so on (see draw.scm):
-
-<table border=0 cellpadding=5 vspace=10><tr><td><pre>
-(define (<A NAME="displaysampsinred">display-samps-in-red</A> snd chn)
- "display samples 1000 to 2000 in red whenever they're in the current view"
- (let ((left (<a class=quiet href="#leftsample" onmouseout="UnTip()" onmouseover="Tip(extsnd_leftsample_tip)">left-sample</a> snd chn))
- (right (<a class=quiet href="#rightsample" onmouseout="UnTip()" onmouseover="Tip(extsnd_rightsample_tip)">right-sample</a> snd chn))
- (old-color (<a class=quiet href="#foregroundcolor" onmouseout="UnTip()" onmouseover="Tip(extsnd_foregroundcolor_tip)">foreground-color</a> snd chn))
- (red (<a class=quiet href="#makecolor" onmouseout="UnTip()" onmouseover="Tip(extsnd_makecolor_tip)">make-color</a> 1 0 0)))
- (if (and (&lt; left 2000)
- (&gt; right 1000))
- (let* ((data (<em class=red>make-graph-data</em> snd chn)))
- (if (<a class=quiet href="#vctp" onmouseout="UnTip()" onmouseover="Tip(extsnd_vctp_tip)">vct?</a> data) ;the simple, one-sided graph case
- (let* ((samps (- (min right 2000)
- (max left 1000)))
- (offset (max 0 (- 1000 left)))
- (new-data (<a class=quiet href="#vctsubseq" onmouseout="UnTip()" onmouseover="Tip(extsnd_vctsubseq_tip)">vct-subseq</a> data offset (+ offset samps))))
- (set! (<a class=quiet href="#foregroundcolor" onmouseout="UnTip()" onmouseover="Tip(extsnd_foregroundcolor_tip)">foreground-color</a> snd chn) red)
- (<em class=red>graph-data</em> new-data snd chn <a class=quiet href="#copycontext" onmouseout="UnTip()" onmouseover="Tip(extsnd_copycontext_tip)">copy-context</a> (max 1000 left) (min 2000 right))
- (set! (<a class=quiet href="#foregroundcolor" onmouseout="UnTip()" onmouseover="Tip(extsnd_foregroundcolor_tip)">foreground-color</a> snd chn) old-color))
- (let* ((low-data (car data)) ;the two-sided envelope graph case
- (high-data (cadr data))
- ;; we need to place the red portion correctly in the current graph
- ;; so the following is getting the "bin" numbers associated with
- ;; samples 1000 and 2000
- (size (length low-data))
- (samps (- right left))
- (left-offset (max 0 (- 1000 left)))
- (left-bin (round (/ (* size left-offset) samps)))
- (right-offset (- (min 2000 right) left))
- (right-bin (round (/ (* size right-offset) samps)))
- (new-low-data (<a class=quiet href="#vctsubseq" onmouseout="UnTip()" onmouseover="Tip(extsnd_vctsubseq_tip)">vct-subseq</a> low-data left-bin right-bin))
- (new-high-data (<a class=quiet href="#vctsubseq" onmouseout="UnTip()" onmouseover="Tip(extsnd_vctsubseq_tip)">vct-subseq</a> high-data left-bin right-bin)))
- (set! (<a class=quiet href="#foregroundcolor" onmouseout="UnTip()" onmouseover="Tip(extsnd_foregroundcolor_tip)">foreground-color</a> snd chn) red)
- (<em class=red>graph-data</em>
- (list new-low-data new-high-data) snd chn <a class=quiet href="#copycontext" onmouseout="UnTip()" onmouseover="Tip(extsnd_copycontext_tip)">copy-context</a> left-bin right-bin)
- (set! (<a class=quiet href="#foregroundcolor" onmouseout="UnTip()" onmouseover="Tip(extsnd_foregroundcolor_tip)">foreground-color</a> snd chn) old-color)))))))
-
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <a class=quiet href="#aftergraphhook" onmouseout="UnTip()" onmouseover="Tip(extsnd_aftergraphhook_tip)">after-graph-hook</a> display-samps-in-red)
-</pre></td></tr></table></td></tr>
-<tr><td></td><td>
+sound over another at an arbitrary point, and so on (see draw.scm).
+</p>
<img src="pix/redsamps.png" alt="red samples" hspace=20>
@@ -13534,7 +13479,7 @@ This function returns the colormap corresponding to a given integer.
<!-- make-color -->
<tr><td colspan=2 bgcolor="#f2f4ff">
-<code><a class=def name="makecolor">make-color</a> red green blue</code>
+<code><a class=def name="makecolor">make-color</a> red green blue (alpha 1.0)</code>
</td></tr><tr><td></td><td>
make-color returns a color object using the rgb values 'red', 'green', and 'blue'. Each argument
is a float between 0.0 (none of that color) and 1.0 (full value for that color). So,
@@ -13543,6 +13488,7 @@ is a float between 0.0 (none of that color) and 1.0 (full value for that color).
</pre>
returns a red color object.
Two colors are equal (i.e. equal? returns #t) if their rgb values are the same.
+The 'alpha' argument only matters in Gtk.
</td></tr><tr><td colspan=2 height=16></td></tr>
@@ -13582,7 +13528,7 @@ The result can be used in the lisp graph:
0.0 60.0
snd chn))))))
-(<a class=quiet onmouseout="UnTip()" onmouseover="Tip(scheme_add_hook_tip)">add-hook!</a> <a class=quiet href="#lispgraphhook" onmouseout="UnTip()" onmouseover="Tip(extsnd_lispgraphhook_tip)">lisp-graph-hook</a> display-db)
+(hook-push <a class=quiet href="#lispgraphhook" onmouseout="UnTip()" onmouseover="Tip(extsnd_lispgraphhook_tip)">lisp-graph-hook</a> display-db)
</pre>
</td></tr></table>
@@ -13684,7 +13630,7 @@ snd-gcs returns a list of Snd's graphics contexts:
14: bg=basic-color, fg=filter-waveform-color
</pre>
These graphics-contexts make it easier to fit in with whatever color scheme is currently in use. For example,
-in snd-motif.xm's SMPTE time display, we make sure the font color reflects whether we're in the selected channel:
+in to make sure the font color reflects whether we're in the selected channel:
<pre>
(XSetFont dpy
(if (= chn (<a class=quiet href="#selectedsound" onmouseout="UnTip()" onmouseover="Tip(extsnd_selectedsound_tip)">selected-channel</a> snd))