Nearly everything in Snd can be set in an initialization file, loaded at any time from a saved state file, specified via inter-process communciation from any other program, invoked via M-x in the minibuffer, imbedded in a keyboard macro, or dealt with from the lisp listener panel. The syntax used is lisp; if the Guile library is loaded, the underlying language is actually Scheme, these entities are fully incorporated into lisp, and all of them can be used in arbitrarily complicated functions. I've tried to bring out to lisp nearly every portion of Snd, both the signal-processing functions, and much of the user interface. You can, for example, add your own menu choices, editing operations, or graphing alternatives. These extensions can be loaded at any time. If the listener is active (whether its pane is open or not) any forms typed to the M-X prompt will be copied to the listener, providing a history of the interactions. To activate the listener without opening it (to conserve screen space or whatever), use the function activate-listener.
Currently, 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.
In Guile versions 1.3.4 or later, remember to
(use-modules (ice-9 debug)) if you
want to get backtrace information from the error handler.
In the following, optional arguments are in italics, functions available only if Guile is loaded are bold face. Channels are numbered from 0. If a channel argument is omitted, the currently active channel is used, if any; otherwise channel 0. Each sound has an associated "index" used to refer to it in all the functions. This somewhat arbitrary number is more or less related to the sound's position in the display of sounds. If the index is omitted, the currently active sound is used; if none, the top sound (or leftmost if you're using the horizontal panes).
Sndlib (see sndlib.html for a complete list): next-sound-file aiff-sound-file riff-sound-file nist-sound-file raw-sound-file ircam-sound-file snd-16-linear snd-8-mulaw snd-8-linear snd-32-linear-little-endian snd-32-linear snd-8-alaw snd-8-unsigned snd-32-float-little-endian snd-64-double snd-24-linear snd-32-float snd-16-linear-little-endian FFT style (the Transform Options Display choice): normal-fft sonogram spectrogram Transform type: fourier-transform wavelet-transform hankel-transform chebyshev-transform legendre-transform autocorrelation walsh-transform hadamard-transform FFT Window type: rectangular-window hanning-window welch-window parzen-window bartlett-window hamming-window blackman2-window blackman3-window blackman4-window exponential-window riemann-window kaiser-window cauchy-window poisson-window gaussian-window tukey-window Zoom Focus style: focus-left focus-right focus-active focus-middle X-axis Label: x-in-seconds x-in-samples x-to-one Speed Control style: speed-as-float speed-as-ratio speed-as-semitone Channel Combination style; channels-separate channels-combined channels-superimposed Envelope Editor target: amplitude-env spectrum-env srate-env Graph Line style: graph-lines graph-dots graph-filled graph-lollipops graph-dots-and-lines Keyboard action choices: cursor-in-view cursor-on-left cursor-on-right cursor-in-middle cursor-update-display cursor-no-action cursor-claim-selection keyboard-no-action
These variables are accessed as though each were a function of no arguments, and set using a function with "set-" prepended to the variable name. For example, auto-resize's current value can be accessed via (auto-resize), and set to a new value via (set-auto-resize #t). (I can't use normal Scheme variables here because set! would not affect the user-interface that reflects the variable; I need the "set-" forms anyway, so making everything a function makes for less confusion, I hope). Many of the variables are switches that can take either the C-style boolean values 0 and 1, or the Scheme-style #f and #t (the variables reside in C, but Scheme values are translated to C values automatically).
ask-before-overwrite #f (Save-as): ask before overwriting an existing file
audio-output-device sndlib-default-device Audio output device (for the play button)
auto-resize #t should Snd window resize upon open/close (see AutoResize)
auto-update #f should Snd update a file automatically.
basic-color ivory2 main Snd color.
channel-style channels-separate
The default state of the 'unite' button in multi-channel files.
Other values are channels-combined and channels-superimposed.
color-cutoff 0.003 In spectra, sets the lowest data value that will be colored.
color-inverted #t The 'invert' button in the color dialog, negated (hunh?!).
color-scale 0.5 The darkness setting in the color dialog, divided by 100.
colormap 0 Colormap choice for various displays (see the Color Editor).
This should be an integer between -1 and 15. The maps (from 0 to 15) are:
gray, hsv, hot, cool, bone, copper, pink, jet, prism, autumn, winter, spring,
summer, colorcube, flag, and lines. -1 means black and white.
corruption-time 60 Time (seconds) between background checks for changed file on disk (see auto-update).
If less than 0.0, this background process is turned off.
cursor-color red cursor color.
dac-size 256 Audio output buffer size (not always meaningful).
data-color black color of data in unselected graph.
default-amp 1.0 These 'default' settings refer to the value given the control
panel widgets when a sound is opened. default-amp is the
amplitude setting. See amp).
default-contrast 0.0 Initial contrast value.
default-contrast-amp 1.0 Initial contrast scaler (see contrast-amp).
default-contrasting #f Initial contrast button value (contrasting).
default-expand 1.0 Initial expand value (expand).
default-expand-hop 0.05 Initial expand hop value (expand-hop).
default-expand-length 0.15 Initial expand segment length (expand-length).
default-expand-ramp 0.4 Initial expand ramp length (expand-ramp).
default-expanding #f Initial value of expand button (expanding).
default-filter-order 20 Initial control panel filter order (filter-order).
default-filtering #f Initial filter button value (filtering).
default-output-type next-sound-file
The default header type when a new or temporary file is created (defaultOutputType resource).
default-reverb-feedback 1.09 Initial reverb feedback coefficient (reverb-feedback).
default-reverb-length 1.0 Initial reverb delay length scaler (reverb-length).
This scales the length of all the delay lines used in the reverberator,
so higher numbers give longer initial delays and a more cavernous
effect. In the control panel it is the scaler labelled "len:".
default-reverb-lowpass 0.7 Initial reverb lowpass coefficient (reverb-lowpass).
default-reverb-scale 0.0 Initial value of the reverb volume scaler (reverb-scale).
default-reverbing #f Initial reverb button value (reverbing).
default-speed 1.0 Initial speed (srate) scaler value (speed).
dot-size 1 Size in pixels of dots when graphing with dots (see also examp.scm auto-dot function).
edit-history-width 1 width (pixels) of edit history portion of channel pane.
enved-base 1.0 Envelope editor exponential base value
enved-clipping #f Envelope editor 'clip' button
If clipping, the motion of the mouse is restricted to the current graph bounds.
enved-dBing #f Envelope editor 'dB' button
enved-exping #f Envelope editor 'exp' and 'lin' buttons
If exping, the connecting segments use exponential curves rather than straight lines.
enved-power 3.0 Envelope editor base scale range (9.0^power).
enved-target amplitude-env
Determines how the envelope is applied to the current data
This chooses one of the 'amp', 'flt', and 'src' buttons in the Envelope editor.
The other (named constant) choices are srate-env and spectrum-env.
enved-waveform-color blue color of waveform displayed in envelope editor.
enved-waving #f Envelope editor 'wave' button
The wave shown is the time domain display, even when filtering.
eps-file "snd.eps" Name of the Postscript file produced by the File Print option.
See also the epsFile resource.
fft-beta 0.0 The fft data window parameter, if relevant. If any of the FFT
variables is set to a new value, call update-ffts to see the effect.
fft-log-frequency #f If #t, the spectrum frequency axis is logarithmic, not linear.
fft-log-magnitude #f If #t, the spectrum magnitude axis is in decibels.
fft-size 256 FFT size.
fft-style normal-fft
The other choices are sonogram and spectrogram.
fft-window blackman2-window
FFT data window. See the long list above for other choices.
filter-env-order 40 The order of the Envelope editor's FIR filter.
filter-waveform-color blue color of control panel filter waveform.
fit-data-on-open #f If #t, the initial time-domain display of a sound shows
its entire duration, with the Y-axis set to show its maxamp.
graph-color white background color of unselected graph.
graph-cursor XC_crosshair (34) cursor displayed following mouse in graph
The cursors are declared in /usr/X11R6/include/X11/cursorfont.h or some such file.
graph-style graph-lines
The other choices are graph-dots, graph-filled etc.
highlight-color ivory1 highlighting color.
initial-x0 0.0 Initial time domain window left bound (seconds).
initial-x1 0.1 Same, but on the right; actual x1 is the lesser of this and the sound's duration
initial-y0 -1.0 Initial window y axis minimum.
initial-y1 1.0 Same, but maximum.
line-size 128 Number of samples considered to be a 'line' (C-n and C-p commands).
listener-color aliceblue background color of lisp listener.
listener-prompt ">" lisp listener prompt (a one-character string).
mark-color red color of mark indicator.
max-fft-peaks 100 Max number of fft peaks reported.
max-fft-size 0 In convolve-with, max size of in-memory fft (0 = limited only by malloc).
max-regions 16 Size of region stack.
memo-sound #f When a sound file is opened, Snd looks for a file with the same name but with an appended
".scm" extension. If such a file is found, it is loaded automatically. The variable
memo-sound is set to the newly opened sound's index. This supports the "snd-memo"
feature in CLM, but can be used independently of CLM to store marks, selections, or whatever
that you want associated with a particular sound.
min-dB -60.0 Sets the minimum dB value displayed in various graphs.
mix-amp-scaler 1.0 Multiplier on amp scales in mix consoles (see mix consoles).
mix-color lightgreen color of mixer consoles.
mix-focus-color green color of selected mix consoles.
mix-speed-scaler 1.0 Multiplier on speed scales in mix consoles (mix consoles).
mix-tempo-scaler 1.0 Multiplier on tempo scales in group consoles.
mix-waveform-color darkgray color of mix waveform.
mix-waveform-height 20 Max height (pixels) of mix waveforms (see show-mix-waveforms).
mixer-group-max-out-chans 4 Maximum number of output scalers in mix console.
mixer-groups 6 Number of mixer groups available.
mixer-save-state-file ".snd-mixer" Name of file for save mixer state.
movies #t If #t, the mix graphs are updated constantly as the mouse drags the mix console.
normalize-fft #t If #t, spectral data is normalized to 1.0 before display.
If #f, you get the raw data values, which can reflect amplitude changes. Snd tries
to choose a y axis limit that makes successive displays move smoothly.
normalize-on-open #t When a new sound is added to the Snd window, the resultant
set of graphs can start to dangle off the bottom or end of the screen.
If normalize-on-open is #t, Snd tries to do something reasonable in this case.
position-color ivory3 position slider color
prefix-arg 0 This is the keyboard C-u style argument (named current-prefix-arg in Emacs).
previous-files-sort 0 Sort choice in files dialog (0=unsorted, 1=name, etc).
print-length 12 In the listener, print-out of lists and vectors that are longer
than print-length is truncated.
pushed-button-color lightsteelblue1 color of pushed button.
raw-chans 1 The "raw-" variables refer to sound data interpretation choices made
when a sound is opened that appears to be headerless.
raw-chans sets the default number of channels.
raw-format 16-linear
The default data format in a headerless sound. Other possibilities
are given above, or you can use the Sndlib macros directly.
raw-srate 44100 The default headerless sound sampling rate.
raw-type next-sound-file
The default headerless file header type (for subsequent saves and so on).
Snd only writes NeXT/Sun, AIFF, RIFF ('wave'), IRCAM, or raw files; the
corresponding Sndlib macros are given above.
recorder-autoload #f The 'autoload' button in the recorder dialog.
recorder-buffer-size 4096 The size of the recorder input buffer (there's a trade-off
between responsiveness and clicks in some cases).
recorder-file nil Default recorder output file name.
recorder-in-format 16-bit linear
Incoming data format for the recorder. It's not currently safe to mess with this.
It defaults to the host byte order.
recorder-max-duration 1000000.0 Recorder max output file length.
recorder-out-chans 2 Recorder output file channels.
recorder-out-format same as recorder-in-format
recorder-srate 22050 Recorder sampling rate.
recorder-trigger 0.0 Recorder auto-trigger value.
reverb-decay 1.0 The length (seconds) of the reverberation after the sound has finished.
The sound-local (control panel) version of this is reverb-length.
save-state-on-exit #f If #t, Snd saves its current state in save-state-file.
save-state-file "saved-snd.scm" The default saved state file name.
selected-data-color black color of data in currently selected graph.
selected-graph-color white background color of currently selected graph.
selection-color lightsteelblue1 color of selected portion of graph.
show-axes #t If #t, display x and y axes. This is the 'Show axes' View menu option.
show-edit-history #f (Motif 1 only) If #t, include edit history window in channel pane.
show-fft-peaks #f If #t, fft peak information is included in the fft display.
(This is the 'peaks' button in the Transform options dialog).
show-marks #t If #t, marks are displayed. This is the 'Show marks' View menu option.
show-mix-consoles #t If #t, mix consoles are displayed. This is the 'Show consoles' View menu option.
show-mix-waveforms #t If #t, mixer console displays the waveform of the sound being mixed.
show-selection-transform #f If #t, display the transform of the current active selection, if any.
show-usage-stats #f If #t, show approximate memory and disk space usage of current edit trees.
show-y-zero #f If #t, the y=0 axis is displayed. This is the 'Show Y=0' View menu option.
sinc-width 10 Width (in samples) of the sampling rate conversion sinc interpolation.
The higher this number, the better the src low-pass filter, but the slower src runs.
If you use too low a setting, you can sometimes hear high frequency "whistles" leaking through.
To hear these on purpose, make a sine wave at (say) 55 Hz, then (src-sound '(0 3 1 1)) with sinc-width at 4.
spectro-cutoff 1.0 The amount of the frequency domain to include in the spectrum display.
This number changes as you drag the frequency axis, for example. This is the
slider labelled '% of spectrum' in the View Orientation dialog.
spectro-hop 4 The distance (samples) moved between successive spectrogram traces.
This is the slider labelled 'hop' in the Orientation dialog.
spectro-x-angle 90.0 Default spectrogram x-axis viewing angle.
spectro-x-scale 1.0 Default scaler (stretch) along the spectrogram x axis.
spectro-y-angle 0.0 Same for y-axis.
spectro-y-scale 1.0 Same for y-axis.
spectro-z-angle -2.0 Same for z-axis
spectro-z-scale 0.1 Same for z-axis. For all of these variables, the easiest way to
see what they refer to is to run the Orientation dialog with a spectrogram displayed.
speed-style speed-as-float
In the control panel, the 'speed' control can be interpreted as a continuum
(speed-as-float), as a just-intonation ratio of relatively small integers
(speed-as-ratio) or as a step in a microtonal scale (speed-as-semitone).
The default is 12 tones to the octave. See the Speed style Options menu option.
speed-tones 12 The number of tones per octave in the speed-as-semitone speed style.
temp-dir nil Name of directory for temporary files. nil usually means "/var/tmp".
text-focus-color white color of text field when it has focus.
transform-type fourier-transform
The spectrum transform type. Other types are given above.
trap-segfault #t If #t, try to catch segfaults and continue anyway.
use-raw-defaults #f If #t, the "raw-" variables' values are used automatically
when a headerless file is encountered. If #f, Snd fires up the
raw file dialog to find out how to interpret the data.
verbose-cursor #f If #t, the cursor's position and other information is
constantly displayed in the minibuffer. This is the View menu's Verbose cursor option.
vu-font nil The "vu-" variables refer to the VU meters in the recorder.
vu-font is the font used to label the meters. It is normally "courier".
vu-font-size 1.0 This sets the recorder VU meter label font size.
vu-size 1.0 This sets the overall size of the recorder VU meters.
wavelet-type 0 If transform-type is wavelet-transform, wavelet-type selects which
wavelet is used. The list of available wavelets is in the Transform Dialog.
There are currently 20 choices, so this variable goes from 0 to 19.
wavo #f If #t, the time domain waveform is displayed as a 'wavogram'.
wavo-hop 3 This sets the distance upward between wavogram traces; that is,
the smaller this number, the more traces can be displayed.
wavo-trace 64 This sets the length (samples) of each wavogram trace.
window-height 0 The current Snd window height in pixels.
window-width 0 The current Snd window width in pixels.
window-x -1 The current Snd window left side in pixels.
window-y -1 The current Snd window upper side in pixels (X numbering starts at 0 at the top).
x-axis-style x-in-seconds
The x axis labelling of the time domain waveform can be in seconds
(x-in-seconds), in samples (x-in-samples), or expressed
as a percentage of the overall duration (useful in envelope definitions).
The latter is x-to-one. This is the View menu 'X-axis units' option.
xmax 0.0 Sets the x axis maximum (truncates the display if the sound is longer).
That is, you can display anything below xmax normally, but
Snd refuses to go past that point. Not sure why you'd want this...
The default of 0.0 turns off this feature.
xmin 0.0 Sets the x axis minimum.
ymax 1.0 Sets the y axis maximum (useful to narrow the range of slider action).
ymin 1.0 Sets the y axis minimum.
zero-pad 0 fft zero pad size as a multiple of the fft size; (set-zero-pad 1) gives you
half data, half zeros.
zoom-color ivory4 zoom slider color.
zoom-focus-style focus-active
This determines what a zoom action focuses (centers) on. See Zoom options.
These functions give lisp access to most of Snd's data structures and functions. In the argument lists below, snd as an argument refers to the sound's index, and defaults to the currently selected sound. Similarly, chn is the channel number, starting from 0, and defaults to the currently selected channel. So if there's only one sound active, and it has only one channel, (cursor) (cursor 0), and (cursor 0 0) all refer to the same thing.
abort () drop into gdb
abort? () check for C-g to interrupt on-going computation (and let other UI events through).
activate-listener () make listener active, even if not open.
active-sounds () return number of currently active (displayed) sounds.
add-mark (sample snd chn) add mark at sample, returning mark id.
add-sound-file-extension (ext) add ext to the list of sound file extensions.
add-to-main-menu (menu-label) add new top-level menu named menu-label, return menu index.
(add-to-main-menu "Tools") -> 5
see examples in examp.scm.
add-to-menu (top-menu menu-label callback)
add menu menu-label to top-level menu whose index is
top-menu with the lisp callback string callback. The built-in
Snd menus are numbered from 0 ('File') to 4 ('Help'). see also remove-from-menu.
(add-to-menu 5 "Denoise" "(report-in-minibuffer \"denoise\")")
amp (snd) return current amp (control panel slider) value.
append-to-minibuffer (msg snd) append msg to whatever is in snd's minibuffer.
audio-outputs (speakers headphones line-out) (Sun only) set which output devices are active.
autocorrelate (data) return (in place) autocorrelation of data
backward-graph (count) move back (up or left) count graphs (C-x C-o).
backward-mark (count) move back count marks (C-j).
backward-mix (count) move back count mix consoles (C-x C-j).
backward-sample (count) move back count samples (C-b), return new cursor position.
bind-key (key state code ignore-prefix)
Cause key (an integer) with modifiers state to evaluate code.
as in the hook functions: (bind-key (char->integer #\a) 4 "(snd-print \"hi\"))")
The modifier state is a combination of shift: 1, control: 4, meta: 8, so this call
causes C-a to print "hi" in the lisp listener. The value returned should
be one of the cursor choices telling Snd what action (if any) to take after
evaluating code. If ignore-prefix is #t, Snd does not repeat the key based
on the prefix argument (C-u) -- in this case, the code can examine prefix-arg if desired.
See examp.scm for several examples. (code can be a scheme function if Guile is loaded).
bomb (snd on) display bomb icon in snd's minibuffer. If on (default #t) is #f, the bomb is erased.
call-apply (snd) equivalent to pushing snd's 'apply' button.
This can be used in conjunction with the various control panel variables:
(define expnd (lambda (amt) (set-expanding #t) (set-expand amt) (call-apply))).
call-plug (plug) invoke the plug as an editing operation.
call-plug-selection (plug) invoke the plug as an editing operation over current selection.
change-menu-label (top-menu old-label new-label)
channels (snd) return number of channels in snd.
chans (snd) same as channels (the forgetful programmer's friend).
clear-audio-inputs() in Linux/OSS, try to reduce soundcard background racket.
clm? () return 1 if clm is loaded.
close-sound (snd) close snd (same as File menu Close).
close-sound-file (fd bytes) close file updating header to report bytes bytes of data. (See open-sound-file).
color? (obj) return #t if obj is a color object (see make-color).
color-dialog () fire up the Color dialog.
comment (snd) return snd's comment, if any.
contrast (snd) return current contrast (control panel slider) value.
contrast-amp (snd) return snd's contrast-amp (control panel variable).
contrasting (snd) return #t if snd has contrast turned on (control panel)
convolve-arrays (rl1 rl2) convolve vectors rl1 with rl2. Result returned in rl1.
rl1 should be large enough to hold the full convolution result.
As a special dispensation for forgetful users, if rl1 is a file
name and rl2 is not a vector, convolve-with is called instead.
convolve-with (file amp snd chn)
convolve snd's channel chn (or the currently sync'd data)
with the data in the sound file file. If your machine is short on memory,
set max-fft-size first. amp is the resultant peak amplitude
(leave amp unset, or set it to #f to get the unnormalized result).
Convolve-with in conjunction with mix can provide high-quality reverb:
(define conrev
(lambda (impulse amp)
(convolve-with impulse amp)
(save-sound-as "reverb.snd") ;this extra step so mix console scalers set reverb amount
(revert-sound)
(mix "reverb.snd")))
convolve-selection-with (file amp)
convolve the current selection with file.
count-matches (expr sample snd chn)
return how many samples satisfy the expression expr. expr
can be either a C expression (a string), or a Scheme function of one argument.
For example, (count-matches "y>.1") returns the number of samples
greater than .1. sample determines where to start the search.
The same thing in Scheme is: (count-matches (lambda (y) (> (or y 0.0) .1)))
cursor (snd chn) return cursor location (samples) of channel chn of snd.
cursor-follows-play (snd) return #t if cursor is following along in the sound as it plays.
cut () cut the current selection (a no-op if no active selection).
data-format (snd) return snd's data format (sndlib).
data-location (snd) return snd's data location (bytes).
delete-mark (id snd chn) delete mark id in snd's channel chn (- C-m).
delete-marks (snd chn) delete all marks in snd's channel chn
delete-region (reg) delete region number reg (which defaults to 0). This removes the
region from the region stack; it doesn't edit the corresponding file(s).
delete-sample (samp snd chn) delete sample samp in snd's channel chn.
delete-samples (samp samps snd chn) delete samps samples starting at sample samp.
describe-plug (plug) describe plug
dismiss-all-dialogs () deactivate all dialogs.
edit-header-dialog() fire up Edit Header dialog.
edits (snd chn) return a vector with number of undo-able edits and redo-able edits.
env-sound (envelope samp samps env-base snd chn)
apply (in amplitude) envelope to snd's channel chn starting
at sample samp for samps samples with connecting segments
based on env-base. env-base defaults to 1.0 (line segments).
samp defaults to 0. samps defaults to the full duration.
envelope is a list or vector containing the breakpoint values (as in CLM).
(env-sound '(0 0 1 1 2 0))
env-selection (envelope env-base snd chn)
apply envelope to the currently selected portion of snd's channel chn.
enved-dialog () fire up the Envelope editor dialog.
exit () exit Snd.
expand (snd) return current expansion amount (control panel).
expand-hop (snd) return snd's expansion hop amount (seconds).
expand-length (snd) return snd's expansion segment length (seconds).
expand-ramp (snd) return snd's expansion ramp amount (between 0 and .5).
This affects the smoothness of the grain overlaps -- .001 is a rattling effect.
expanding (snd) return #t if snd's expand button is on.
fft (rl im sgn) perform an FFT on rl and im (the real and imaginary parts
of the input data. sgn is 1 for an FFT, -1 for an inverse FFT; it defaults to 1.
ffting (snd chn) return #t if snd's channel chn is displaying a spectrum (the 'f' button).
file-dialog () fire up the list of current and previous files (not the file browser).
file-name (snd) snd's complete file name.
filter-env (snd) snd's filter envelope (control panel).
filter-dBing (snd) snd's filter dB button state (control panel).
filter-order (snd) snd's filter order (control panel).
filter-sound (env order snd chn)
apply an FIR filter of order order and frequency response env
to snd's channel chn.
filtering (snd) return #t if snd is filtering (control panel filter button).
filter-selection (env order) apply an FIR filter of order order and frequency response env
to the current selection.
find (c-expr sample snd chn)
find the sample that satisfies the C expression (a string) c-expr.
For example, (find "y>.1") looks for a sample greater than .1,
returning the sample number if one is found. sample
determines where to start the search. c-expr can also be a Scheme function.
find-mark (samp snd chn) return identifier of mark at sample samp or #f if none found.
This identifier is used in calls such as mark-sample. Since marks
can move around during editing, a unique 'tag' is needed to refer to a particular mark.
samp can also be a string; in this case find-mark looks for a mark of that name.
find-sound (filename) returns the index of filename (used as snd throughout).
return #f if no sound is found that matches filename.
finish-progress-report (snd) see progress-report.
forward-graph (count) move forward (down or right) count graphs (C-x C-o).
forward-mark (count) move forward count marks (C-j).
forward-mix (count) move forward count mix consoles (C-x C-j).
forward-sample (count) move forward count samples (C-f), return new cursor position.
frames (snd chn) return chn's current length in samples.
graph (data xlabel x0 x1 y0 y1 snd chn)
Display a graph of data in a separate display per channel. The x axis
is labelled xlabel, the x axis units go from x0 to x1 (default 0 to 1.0),
the y axis goes from y0 to y1 (default fits the data), and the display is
associated with channel chn in snd. data should be a vector.
(graph #(0 .1 .2 .3 .4 .3 .2 .1 0) "roof")
graphing (snd chn) return #t if graph data is being displayed.
graph->ps () create Postscript description of current display (see eps-file).
group-amp (group chan) return group's chan-th output amplitude.
group-beg (group) return group's begin time.
group-dialog () fire up the Groups browser.
group-end (group) return group's end time.
group-ok? (group) return #t if group is active (i.e. has a member mix).
group-speed (group) return group's speed.
group-tempo (group) return group's tempo.
groups () return how many groups are currently active.
guile? () return 1 if guile is loaded. If you're running on a system where
several Snd's are running, some without Guile, and you want to include Guile-isms in
your initialization file, precede such code with (if (guile?)...)
header-type (snd) return (type . name)
help-dialog (subject help) fire up the help dialog with title subject and body help.
(help-dialog "xyzzy" "are we having fun?")
hide-listener () close the lisp listener pane.
in (ms code) ms milliseconds from now, evaluate code, a string containing Scheme code, or a Scheme function (see examp.scm).
The auto-save implementation in examp.scm uses in.
insert-sound (file in_chan snd chn)
insert channel in_chan of file at the cursor in snd's channel chn.
insert-region (beg reg snd chn) insert region reg at sample beg in snd's channel chn.
insert-sample (samp value snd chn)
insert sample value at sample samp in snd's channel chn.
insert-samples (samp samps data snd chn)
insert samps samples of data starting at sample samp in snd's channel chn.
data can be a filename; Snd assumes any such file is temporary; it will be
deleted when no longer needed.
key (key state) execute the keyboard command key with modifier keys state.
shift: 1, control: 4, meta: 8 (see /usr/include/X11/X.h ControlMask et al).
left-sample (snd chn) return the position in samples of the left edge of the time domain
waveform for snd's channel chn.
list->vct (lst) return vct object with elements of list lst
load-colormap (colors) use colors in colors (a vector) as current colormap.
This is still kludgey, but the following shows how to use it:
(load "rgb.scm")
(define hi (make-vector 512)) ;use 64 if not using big colormaps
(do ((i 0 (+ i 4))) ((>= i 512))
(vector-set! hi i red) (vector-set! hi (+ i 1) blue)
(vector-set! hi (+ i 2) green) (vector-set! hi (+ i 3) black))
(load-colormap hi)
make-color (r g b) return a color value using the red/green/blue values r/g/b -- each of these
is a float running from 0.0 to 1.0. (make-color 1.0 0.0 0.0) returns red.
make-region (beg end snd chn)
create a new region spanning samples beg to end in snd's channel chn.
make-vct (len) create vct struct of size len.
map-across-all-chans (func start end edname) apply func to all open channels in parallel (see Scanning Data).
map-across-chans (func start end edname) apply func to currently syncd channels in parallel
map-across-sound-chans (func start end edname snd) apply func to sound's channels in parallel
map-all-chans (func start end edname) apply func to all open channels
map-chan (func start end edname snd chn) apply func to samples in current channel (see Scanning Data).
map-chans (func start end edname) apply func to currently syncd channels
map-sound-chans (func start end edname snd) apply func to current sound's channels
mark-name (id snd chn) return name of mark id.
mark-sample (id snd chn) return position of mark id.
marks (snd chn) return number of marks in snd's channel chn.
max-sounds () return current size of sound array (grows as required, may contain holes).
maxamp (snd chn) return max amp of snd's channel chn.
mix (file samp in_chan snd chn)
mix file's channel in_chan starting at samp in snd's channel chn.
if only the file argument is given, this is equivalent to the File menu's Mix option.
mix-amp (mix chan) return amplitude of mix's channel chan.
mix-anchor (mix) return anchor position (within the mix) of mix.
mix-groups (mix) return a bit-wise indication of the groups mix is participating in.
That is, group 0 is bit 0, etc. If mix is in groups 3 and 4, this returns 24.
mix-length (mix) return length in samples of mix.
mix-position (mix) return position (sample number) of mix.
mix-region (samp scaler reg snd chn)
Mix in region reg at sample samp (defaulting to the cursor sample),
scaled by scaler (defaults to 1.0) in snd's channel chn.
mix-speed (mix) return speed of mix.
mix-state (mix) return console state of mix (0=open, 1=title bar, 2=name[0]).
new-sound (name header-type data-format srate chans)
create a new (empty) sound named name. If the type and other
arguments are not specified, the raw file dialog is posted to get the
needed values which default to the current raw-type and related settings.
normalize-view () normalize Snd display as in View menu Normalize option.
ok? (snd) return #t if snd (an index) is active.
open-raw-sound (name chans srate format) open name as a raw (no header) sound in the layout specified.
open-sound (name) open name as in File menu Open option.
open-sound-file (name chans srate comment)
Open (create) a sound file name (defaults to "test.snd" or "test.wav"). It is assumed
that the data will be floats in the native format (written by the caller interleaving channels),
and that the file will be closed by close-sound-file.
One simple way to write the data is to call vct->sound-file.
open-alternate-sound(name) close the currently selected file, if any, and open name.
orientation-dialog() fire up the Orientation dialog.
override-data-format(format snd)force data format (ignore header)
override-data-location(loc snd) force data location (ignore header)
override-data-size(samps snd) force data size (ignore header)
peaks (file snd chn) display fft peak information. If file is not null, write the information
to that file, else post it in a help window (where it can be selected and
pasted elsewhere). This function follows the state of the various 'sync'
buttons, given snd and chn.
play (samp snd chn) play snd's channel chn starting from sample samp.
play-and-wait (samp snd chn) play snd's channel chn starting from sample samp and wait for it to finish.
play-region (reg) play region reg.
preload-directory (dir) preload sound files from directory dir (see -p).
preload-file (file) preload file (see View menu's View Files option).
progress-report (pct name current-channel channels snd)
The functions start-progress-report, progress-report, and finish-progress-report
handle the animated hour-glass icon used to amuse the idle user while some long
computation is allegedly in progress. The pct argument is a float between
0.0 and 1.0 which indicates how far along we are in the computation (there are
actually only 15 or 20 separate icons, so there's no point in calling this more
often than that). start-progress-report posts the initial icon, and finish-progress-report
removes it. If the icons are not available, a message is posted in snd's minibuffer
using name and so on to identify itself.
protect-region (reg protect) protect/unprotect region reg from deletion in the region browser.
read-only (snd) return #t if snd is read-only, #f otherwise.
recorder-dialog () fire up recorder window.
recorder-gain (gain) return recorder input (soundcard-audio) gain gain.
recorder-in-amp (in out) return recorder input channel in to output channel out amplitude.
recorder-out-amp (out) return recorder file output channel out amplitude.
redo (edits snd chn) redo edits edits (default is 1) in snd's channel chn.
region-chans (reg) return number of channels in region reg.
region-dialog () fire up region browser (a no-op if no regions).
region-length (reg) return number of samples (per channel) in region reg.
region-maxamp (reg) return maximum amplitude of region reg.
region-sample (samp reg chn) return value of sample samp in region reg in snd's channel chn.
region-samples (samp samps reg chn)
return vector of samps samples starting at samp in region reg's channel chn.
region-samples->vct (samp samps reg chn)
return vct struct of samps samples starting at samp in region reg's channel chn.
region-srate (reg) return original (nominal) sampling rate of region reg.
regions () return number of regions in the region stack.
remove-from-menu (top-menu menu-label)
remove menu menu-label from the top top-level menu whose index is top-menu.
report-in-minibuffer (msg snd) post msg in snd's minibuffer.
restore-control-panel (snd) same as pushing the control panel 'r' button.
reverb-feedback (snd) return snd's reverb feedback coefficient.
reverb-length (snd) return reverb delay line length scaler (control panel).
reverb-lowpass (snd) return reverb low pass filter coefficient.
reverb-scale (snd) return reverb amount (control panel).
reverbing (snd) return #t if snd's reverb button is on.
reverse-selection () reverse data delineated by current selection.
reverse-sound (snd chn) reverse data.
revert-sound (snd) revert snd to saved state (undo all edits).
right-sample (snd chn) return position (samples) of right edge of time domain waveform.
sample (samp snd chn) return value of sample samp in snd's channel chn.
samples (samp samps snd chn)
return vector of samps samples starting at samp in snd's channel chn.
samp defaults to 0. samps defaults to frames - samp.
samples->vct (samp samps snd chn)
return vct struct with same data as in samples call above.
save-control-panel(snd) same as pushing the control panel 's' button.
save-edit-history (filename snd chn) save current edit list(s) in filename.
If chn is omitted, all snd's channels are saved; if snd is omitted,
all edit list are saved. If the underlying files are not subsequently
changed, you can load this file to restore the current edit list state.
Returns #t if successful (file opened ok); #f is something went wrong.
save-envelopes (filename) save envelope editor contents in filename.
save-macros () save keyboard macros in Snd's init file (.snd).
save-marks (snd) save snd's marks, writing a file <name>.marks.
save-options (filename) save options in filename.
save-region (reg filename format)
save region reg in filename in data format format (default snd-16-linear).
save-selection (file header-type data-format srate comment)
save the currently selected data in file.
save-sound (snd) save snd; same as File menu's Save option.
save-sound-as (filename snd header-type data-format srate)
save snd as filename (same as File Save as option).
save-state (filename) save current state of Snd in filename.
scale-by (scalers snd chn)
scale amplitude of snd by scalers. Unlike most of these functions,
scale-by follows the 'sync' buttons and affects all currently sync'd channels.
scalers can be either a float or a vector of floats. In the latter case,
the values are used one by one, applying each as scale-by moves through the channels.
If control: 4, meta: 8 (see /usr/include/X11/X.h ControlMask et al).
left-sample (snd chn) return the position in samples of the left edge of the time domain
waveform for snd's channel chn.
list->vct (lst) return vct object with elements of list lst
load-colormap (colors) use colors in colors (a vector) as current colormap.
This is still kludgey, but the following shows how to use it:
(load "rgb.scm")
(define hi (make-vector 512)) ;use 64 if not using big colormaps
(do ((i 0 (+ i 4))) ((>= i 512))
(vector-set! hi i red) (vector-set! hi (+ i 1) blue)
(vector-set! hi (+ i 2) green) (vector-set! hi (+ i 3) black))
(load-colormap hi)
make-color (r g b) return a color value using the red/green/blue values r/g/b -- each of these
is a float running from 0.0 to 1.0. (make-color 1.0 0.0 0.0) returns red.
make-region (beg end snd chn)
create a new region spanning samples beg to end in snd's channel chn.
make-vct (len) create vct struct of size len.
map-across-all-chans (func start end edname) apply func to all open channels in parallel (see Scanning Data).
map-across-chans (func start end edname) apply func to currently syncd channels in parallel
map-across-sound-chans (func start end edname snd) apply func to sound's channels in parallel
map-all-chans (func start end edname) apply func to all open channels
map-chan (func start end edname snd chn) apply func to samples in current channel (see Scanning Data).
map-chans (func start end edname) apply func to currently syncd channels
map-sound-chans (func start end edname snd) apply func to current sound's channels
mark-name (id snd chn) return name of mark id.
mark-sample (id snd chn) return position of mark id.
marks (snd chn) return number of marks in snd's channel chn.
max-sounds () return current size of sound array (grows as required, may contain holes).
maxamp (snd chn) return max amp of snd's channel chn.
mix (file samp in_chan snd chn)
mix file's channel in_chan starting at samp in snd's channel chn.
if only the file argument is given, this is equivalent to the File menu's Mix option.
mix-amp (mix chan) return amplitude of mix's channel chan.
mix-anchor (mix) return anchor position (within the mix) of mix.
mix-groups (mix) return a bit-wise indication of the groups mix is participating in.
That is, group 0 is bit 0, etc. If mix is in groups 3 and 4, this returns 24.
mix-length (mix) return length in samples of mix.
mix-position (mix) return position (sample number) of mix.
mix-region (samp scaler reg snd chn)
Mix in region reg at sample samp (defaulting to the cursor sample),
scaled by scaler (defaults to 1.0) in snd's channel chn.
mix-speed (mix) return speed of mix.
mix-state (mix) return console state of mix (0=open, 1=title bar, 2=name[0]).
new-sound (name header-type data-format srate chans)
create a new (empty) sound named name. If the type and other
arguments are not specified, the raw file dialog is posted to get the
needed values which default to the current raw-type and related settings.
normalize-view () normalize Snd display as in View menu Normalize option.
ok? (snd) return #t if snd (an index) is active.
open-raw-sound (name chans srate format) open name as a raw (no header) sound in the layout specified.
open-sound (name) open name as in File menu Open option.
open-sound-file (name chans srate comment)
Open (create) a sound file name (defaults to "test.snd" or "test.wav"). It is assumed
that the data will be floats in the native format (written by the caller interleaving channels),
and that the file will be closed by close-sound-file.
One simple way to write the data is to call vct->sound-file.
open-alternate-sound(name) close the currently selected file, if any, and open name.
orientation-dialog() fire up the Orientation dialog.
override-data-format(format snd)force data format (ignore header)
override-data-location(loc snd) force data location (ignore header)
override-data-size(samps snd) force data size (ignore header)
peaks (file snd chn) display fft peak information. If file is not null, write the information
to that file, else post it in a help window (where it can be selected and
pasted elsewhere). This function follows the state of the various 'sync'
buttons, given snd and chn.
play (samp snd chn) play snd's channel chn starting from sample samp.
play-and-wait (samp snd chn) play snd's channel chn starting from sample samp and wait for it to finish.
play-region (reg) play region reg.
preload-directory (dir) preload sound files from directory dir (see -p).
preload-file (file) preload file (see View menu's View Files option).
progress-report (pct name current-channel channels snd)
The functions start-progress-report, progress-report, and finish-progress-report
handle the animated hour-glass icon used to amuse the idle user while some long
computation is allegedly in progress. The pct argument is a float between
0.0 and 1.0 which indicates how far along we are in the computation (there are
actually only 15 or 20 separate icons, so there's no point in calling this more
often than that). start-progress-report posts the initial icon, and finish-progress-report
removes it. If the icons are not available, a message is posted in snd's minibuffer
using name and so on to identify itself.
protect-region (reg protect) protect/unprotect region reg from deletion in the region browser.
read-only (snd) return #t if snd is read-only, #f otherwise.
recorder-dialog () fire up recorder window.
recorder-gain (gain) return recorder input (soundcard-audio) gain gain.
recorder-in-amp (in out) return recorder input channel in to output channel out amplitude.
recorder-out-amp (out) return recorder file output channel out amplitude.
redo (edits snd chn) redo edits edits (default is 1) in snd's channel chn.
region-chans (reg) return number of channels in region reg.
region-dialog () fire up region browser (a no-op if no regions).
region-length (reg) return number of samples (per channel) in region reg.
region-maxamp (reg) return maximum amplitude of region reg.
region-sample (samp reg chn) return value of sample samp in region reg in snd's channel chn.
region-samples (samp samps reg chn)
return vector of samps samples starting at samp in region reg's channel chn.
region-samples->vct (samp samps reg chn)
return vct struct of samps samples starting at samp in region reg's channel chn.
region-srate (reg) return original (nominal) sampling rate of region reg.
regions () return number of regions in the region stack.
remove-from-menu (top-menu menu-label)
remove menu menu-label from the top top-level menu whose index is top-menu.
report-in-minibuffer (msg snd) post msg in snd's minibuffer.
restore-control-panel (snd) same as pushing the control panel 'r' button.
reverb-feedback (snd) return snd's reverb feedback coefficient.
reverb-length (snd) return reverb delay line length scaler (control panel).
reverb-lowpass (snd) return reverb low pass filter coefficient.
reverb-scale (snd) return reverb amount (control panel).
reverbing (snd) return #t if snd's reverb button is on.
reverse-selection () reverse data delineated by current selection.
reverse-sound (snd chn) reverse data.
revert-sound (snd) revert snd to saved state (undo all edits).
right-sample (snd chn) return position (samples) of right edge of time domain waveform.
sample (samp snd chn) return value of sample samp in snd's channel chn.
samples (samp samps snd chn)
return vector of samps samples starting at samp in snd's channel chn.
samp defaults to 0. samps defaults to frames - samp.
samples->vct (samp samps snd chn)
return vct struct with same data as in samples call above.
save-control-panel(snd) same as pushing the control panel 's' button.
save-edit-history (filename snd chn) save current edit list(s) in filename.
If chn is omitted, all snd's channels are saved; if snd is omitted,
all edit list are saved. If the underlying files are not subsequently
changed, you can load this file to restore the current edit list state.
Returns #t if successful (file opened ok); #f is something went wrong.
save-envelopes (filename) save envelope editor contents in filename.
save-macros () save keyboard macros in Snd's init file (.snd).
save-marks (snd) save snd's marks, writing a file <name>.marks.
save-options (filename) save options in filename.
save-region (reg filename format)
save region reg in filename in data format format (default snd-16-linear).
save-selection (file header-type data-format srate comment)
save the currently selected data in file.
save-sound (snd) save snd; same as File menu's Save option.
save-sound-as (filename snd header-type data-format srate)
save snd as filename (same as File Save as option).
save-state (filename) save current state of Snd in filename.
scale-by (scalers snd chn)
scale amplitude of snd by scalers. Unlike most of these functions,
scale-by follows the 'sync' buttons and affects all currently sync'd channels.
scalers can be either a float or a vector of floats. In the latter case,
the values are used one by one, applying each as scale-by moves through the channels.
If control: 4, meta: 8 (see /usr/include/X11/X.h ControlMask et al).
left-sample (snd chn) return the position in samples of the left edge of the time domain
waveform for snd's channel chn.
list->vct (lst) return vct object with elements of list lst
load-colormap (colors) use colors in colors (a vector) as current colormap.
This is still kludgey, but the following shows how to use it:
(load "rgb.scm")
(define hi (make-vector 512)) ;use 64 if not using big colormaps
(do ((i 0 (+ i 4))) ((>= i 512))
(vector-set! hi i red) (vector-set! hi (+ i 1) blue)
(vector-set! hi (+ i 2) green) (vector-set! hi (+ i 3) black))
(load-colormap hi)
make-color (r g b) return a color value using the red/green/blue values r/g/b -- each of these
is a float running from 0.0 to 1.0. (make-color 1.0 0.0 0.0) returns red.
make-region (beg end snd chn)
create a new region spanning samples beg to end in snd's channel chn.
make-vct (len) create vct struct of size len.
map-across-all-chans (func start end edname) apply func to all open channels in parallel (see Scanning Data).
map-across-chans (func start end edname) apply func to currently syncd channels in parallel
map-across-sound-chans (func start end edname snd) apply func to sound's channels in parallel
map-all-chans (func start end edname) apply func to all open channels
map-chan (func start end edname snd chn) apply func to samples in current channel (see Scanning Data).
map-chans (func start end edname) apply func to currently syncd channels
map-sound-chans (func start end edname snd) apply func to current sound's channels
mark-name (id snd chn) return name of mark id.
mark-sample (id snd chn) return position of mark id.
marks (snd chn) return number of marks in snd's channel chn.
max-sounds () return current size of sound array (grows as required, may contain holes).
maxamp (snd chn) return max amp of snd's channel chn.
mix (file samp in_chan snd chn)
mix file's channel in_chan starting at samp in snd's channel chn.
if only the file argument is given, this is equivalent to the File menu's Mix option.
mix-amp (mix chan) return amplitude of mix's channel chan.
mix-anchor (mix) return anchor position (within the mix) of mix.
mix-groups (mix) return a bit-wise indication of the groups mix is participating in.
That is, group 0 is bit 0, etc. If mix is in groups 3 and 4, this returns 24.
mix-length (mix) return length in samples of mix.
mix-position (mix) return position (sample number) of mix.
mix-region (samp scaler reg snd chn)
Mix in region reg at sample samp (defaulting to the cursor sample),
scaled by scaler (defaults to 1.0) in snd's channel chn.
mix-speed (mix) return speed of mix.
mix-state (mix) return console state of mix (0=open, 1=title bar, 2=name[0]).
new-sound (name header-type data-format srate chans)
create a new (empty) sound named name. If the type and other
arguments are not specified, the raw file dialog is posted to get the
needed values which default to the current raw-type and related settings.
normalize-view () normalize Snd display as in View menu Normalize option.
ok? (snd) return #t if snd (an index) is active.
open-raw-sound (name chans srate format) open name as a raw (no header) sound in the layout specified.
open-sound (name) open name as in File menu Open option.
open-sound-file (name chans srate comment)
Open (create) a sound file name (defaults to "test.snd" or "test.wav"). It is assumed
that the data will be floats in the native format (written by the caller interleaving channels),
and that the file will be closed by close-sound-file.
One simple way to write the data is to call vct->sound-file.
open-alternate-sound(name) close the currently selected file, if any, and open name.
orientation-dialog() fire up the Orientation dialog.
override-data-format(format snd)force data format (ignore header)
override-data-location(loc snd) force data location (ignore header)
override-data-size(samps snd) force data size (ignore header)
peaks (file snd chn) display fft peak information. If file is not null, write the information
to that file, else post it in a help window (where it can be selected and
pasted elsewhere). This function follows the state of the various 'sync'
buttons, given snd and chn.
play (samp snd chn) play snd's channel chn starting from sample samp.
play-and-wait (samp snd chn) play snd's channel chn starting from sample samp and wait for it to finish.
play-region (reg) play region reg.
preload-directory (dir) preload sound files from directory dir (see -p).
preload-file (file) preload file (see View menu's View Files option).
progress-report (pct name current-channel channels snd)
The functions start-progress-report, progress-report, and finish-progress-report
handle the animated hour-glass icon used to amuse the idle user while some long
computation is allegedly in progress. The pct argument is a float between
0.0 and 1.0 which indicates how far along we are in the computation (there are
actually only 15 or 20 separate icons, so there's no point in calling this more
often than that). start-progress-report posts the initial icon, and finish-progress-report
removes it. If the icons are not available, a message is posted in snd's minibuffer
using name and so on to identify itself.
protect-region (reg protect) protect/unprotect region reg from deletion in the region browser.
read-only (snd) return #t if snd is read-only, #f otherwise.
recorder-dialog () fire up recorder window.
recorder-gain (gain) return recorder input (soundcard-audio) gain gain.
recorder-in-amp (in out) return recorder input channel in to output channel out amplitude.
recorder-out-amp (out) return recorder file output channel out amplitude.
redo (edits snd chn) redo edits edits (default is 1) in snd's channel chn.
region-chans (reg) return number of channels in region reg.
region-dialog () fire up region browser (a no-op if no regions).
region-length (reg) return number of samples (per channel) in region reg.
region-maxamp (reg) return maximum amplitude of region reg.
region-sample (samp reg chn) return value of sample samp in region reg in snd's channel chn.
region-samples (samp samps reg chn)
return vector of samps samples starting at samp in region reg's channel chn.
region-samples->vct (samp samps reg chn)
return vct struct of samps samples starting at samp in region reg's channel chn.
region-srate (reg) return original (nominal) sampling rate of region reg.
regions () return number of regions in the region stack.
remove-from-menu (top-menu menu-label)
remove menu menu-label from the top top-level menu whose index is top-menu.
report-in-minibuffer (msg snd) post msg in snd's minibuffer.
restore-control-panel (snd) same as pushing the control panel 'r' button.
reverb-feedback (snd) return snd's reverb feedback coefficient.
reverb-length (snd) return reverb delay line length scaler (control panel).
reverb-lowpass (snd) return reverb low pass filter coefficient.
reverb-scale (snd) return reverb amount (control panel).
reverbing (snd) return #t if snd's reverb button is on.
reverse-selection () reverse data delineated by current selection.
reverse-sound (snd chn) reverse data.
revert-sound (snd) revert snd to saved state (undo all edits).
right-sample (snd chn) return position (samples) of right edge of time domain waveform.
sample (samp snd chn) return value of sample samp in snd's channel chn.
samples (samp samps snd chn)
return vector of samps samples starting at samp in snd's channel chn.
samp defaults to 0. samps defaults to frames - samp.
samples->vct (samp samps snd chn)
return vct struct with same data as in samples call above.
save-control-panel(snd) same as pushing the control panel 's' button.
save-edit-history (filename snd chn) save current edit list(s) in filename.
If chn is omitted, all snd's channels are saved; if snd is omitted,
all edit list are saved. If the underlying files are not subsequently
changed, you can load this file to restore the current edit list state.
Returns #t if successful (file opened ok); #f is something went wrong.
save-envelopes (filename) save envelope editor contents in filename.
save-macros () save keyboard macros in Snd's init file (.snd).
save-marks (snd) save snd's marks, writing a file <name>.marks.
save-options (filename) save options in filename.
save-region (reg filename format)
save region reg in filename in data format format (default snd-16-linear).
save-selection (file header-type data-format srate comment)
save the currently selected data in file.
save-sound (snd) save snd; same as File menu's Save option.
save-sound-as (filename snd header-type data-format srate)
save snd as filename (same as File Save as option).
save-state (filename) save current state of Snd in filename.
scale-by (scalers snd chn)
scale amplitude of snd by scalers. Unlike most of these functions,
scale-by follows the 'sync' buttons and affects all currently sync'd channels.
scalers can be either a float or a vector of floats. In the latter case,
the values are used one by one, applying each as scale-by moves through the channels.
If control: 4, meta: 8 (see /usr/include/X11/X.h ControlMask et al).
left-sample (snd chn) return the position in samples of the left edge of the time domain
waveform for snd's channel chn.
list->vct (lst) return vct object with elements of list lst
load-colormap (colors) use colors in colors (a vector) as current colormap.
This is still kludgey, but the following shows how to use it:
(load "rgb.scm")
(define hi (make-vector 512)) ;use 64 if not using big colormaps
(do ((i 0 (+ i 4))) ((>= i 512))
(vector-set! hi i red) (vector-set! hi (+ i 1) blue)
(vector-set! hi (+ i 2) green) (vector-set! hi (+ i 3) black))
(load-colormap hi)
make-color (r g b) return a color value using the red/green/blue values r/g/b -- each of these
is a float running from 0.0 to 1.0. (make-color 1.0 0.0 0.0) returns red.
make-region (beg end snd chn)
create a new region spanning samples beg to end in snd's channel chn.
make-vct (len) create vct struct of size len.
map-across-all-chans (func start end edname) apply func to all open channels in parallel (see Scanning Data).
map-across-chans (func start end edname) apply func to currently syncd channels in parallel
map-across-sound-chans (func start end edname snd) apply func to sound's channels in parallel
map-all-chans (func start end edname) apply func to all open channels
map-chan (func start end edname snd chn) apply func to samples in current channel (see Scanning Data).
map-chans (func start end edname) apply func to currently syncd channels
map-sound-chans (func start end edname snd) apply func to current sound's channels
mark-name (id snd chn) return name of mark id.
mark-sample (id snd chn) return position of mark id.
marks (snd chn) return number of marks in snd's channel chn.
max-sounds () return current size of sound array (grows as required, may contain holes).
maxamp (snd chn) return max amp of snd's channel chn.
mix (file samp in_chan snd chn)
mix file's channel in_chan starting at samp in snd's channel chn.
if only the file argument is given, this is equivalent to the File menu's Mix option.
mix-amp (mix chan) return amplitude of mix's channel chan.
mix-anchor (mix) return anchor position (within the mix) of mix.
mix-groups (mix) return a bit-wise indication of the groups mix is participating in.
That is, group 0 is bit 0, etc. If mix is in groups 3 and 4, this returns 24.
mix-length (mix) return length in samples of mix.
mix-position (mix) return position (sample number) of mix.
mix-region (samp scaler reg snd chn)
Mix in region reg at sample samp (defaulting to the cursor sample),
scaled by scaler (defaults to 1.0) in snd's channel chn.
mix-speed (mix) return speed of mix.
mix-state (mix) return console state of mix (0=open, 1=title bar, 2=name[0]).
new-sound (name header-type data-format srate chans)
create a new (empty) sound named name. If the type and other
arguments are not specified, the raw file dialog is posted to get the
needed values which default to the current raw-type and related settings.
normalize-view () normalize Snd display as in View menu Normalize option.
ok? (snd) return #t if snd (an index) is active.
open-raw-sound (name chans srate format) open name as a raw (no header) sound in the layout specified.
open-sound (name) open name as in File menu Open option.
open-sound-file (name chans srate comment)
Open (create) a sound file name (defaults to "test.snd" or "test.wav"). It is assumed
that the data will be floats in the native format (written by the caller interleaving channels),
and that the file will be closed by close-sound-file.
One simple way to write the data is to call vct->sound-file.
open-alternate-sound(name) close the currently selected file, if any, and open name.
orientation-dialog() fire up the Orientation dialog.
override-data-format(format snd)force data format (ignore header)
override-data-location(loc snd) force data location (ignore header)
override-data-size(samps snd) force data size (ignore header)
peaks (file snd chn) display fft peak information. If file is not null, write the information
to that file, else post it in a help window (where it can be selected and
pasted elsewhere). This function follows the state of the various 'sync'
buttons, given snd and chn.
play (samp snd chn) play snd's channel chn starting from sample samp.
play-and-wait (samp snd chn) play snd's channel chn starting from sample samp and wait for it to finish.
play-region (reg) play region reg.
preload-directory (dir) preload sound files from directory dir (see -p).
preload-file (file) preload file (see View menu's View Files option).
progress-report (pct name current-channel channels snd)
The functions start-progress-report, progress-report, and finish-progress-report
handle the animated hour-glass icon used to amuse the idle user while some long
computation is allegedly in progress. The pct argument is a float between
0.0 and 1.0 which indicates how far along we are in the computation (there are
actually only 15 or 20 separate icons, so there's no point in calling this more
often than that). start-progress-report posts the initial icon, and finish-progress-report
removes it. If the icons are not available, a message is posted in snd's minibuffer
using name and so on to identify itself.
protect-region (reg protect) protect/unprotect region reg from deletion in the region browser.
read-only (snd) return #t if snd is read-only, #f otherwise.
recorder-dialog () fire up recorder window.
recorder-gain (gain) return recorder input (soundcard-audio) gain gain.
recorder-in-amp (in out) return recorder input channel in to output channel out amplitude.
recorder-out-amp (out) return recorder file output channel out amplitude.
redo (edits snd chn) redo edits edits (default is 1) in snd's channel chn.
region-chans (reg) return number of channels in region reg.
region-dialog () fire up region browser (a no-op if no regions).
region-length (reg) return number of samples (per channel) in region reg.
region-maxamp (reg) return maximum amplitude of region reg.
region-sample (samp reg chn) return value of sample samp in region reg in snd's channel chn.
region-samples (samp samps reg chn)
return vector of samps samples starting at samp in region reg's channel chn.
region-samples->vct (samp samps reg chn)
return vct struct of samps samples starting at samp in region reg's channel chn.
region-srate (reg) return original (nominal) sampling rate of region reg.
regions () return number of regions in the region stack.
remove-from-menu (top-menu menu-label)
remove menu menu-label from the top top-level menu whose index is top-menu.
report-in-minibuffer (msg snd) post msg in snd's minibuffer.
restore-control-panel (snd) same as pushing the control panel 'r' button.
reverb-feedback (snd) return snd's reverb feedback coefficient.
reverb-length (snd) return reverb delay line length scaler (control panel).
reverb-lowpass (snd) return reverb low pass filter coefficient.
reverb-scale (snd) return reverb amount (control panel).
reverbing (snd) return #t if snd's reverb button is on.
reverse-selection () reverse data delineated by current selection.
reverse-sound (snd chn) reverse data.
revert-sound (snd) revert snd to saved state (undo all edits).
right-sample (snd chn) return position (samples) of right edge of time domain waveform.
sample (samp snd chn) return value of sample samp in snd's channel chn.
samples (samp samps snd chn)
return vector of samps samples starting at samp in snd's channel chn.
samp defaults to 0. samps defaults to frames - samp.
samples->vct (samp samps snd chn)
return vct struct with same data as in samples call above.
save-control-panel(snd) same as pushing the control panel 's' button.
save-edit-history (filename snd chn) save current edit list(s) in filename.
If chn is omitted, all snd's channels are saved; if snd is omitted,
all edit list are saved. If the underlying files are not subsequently
changed, you can load this file to restore the current edit list state.
Returns #t if successful (file opened ok); #f is something went wrong.
save-envelopes (filename) save envelope editor contents in filename.
save-macros () save keyboard macros in Snd's init file (.snd).
save-marks (snd) save snd's marks, writing a file <name>.marks.
save-options (filename) save options in filename.
save-region (reg filename format)
save region reg in filename in data format format (default snd-16-linear).
save-selection (file header-type data-format srate comment)
save the currently selected data in file.
save-sound (snd) save snd; same as File menu's Save option.
save-sound-as (filename snd header-type data-format srate)
save snd as filename (same as File Save as option).
save-state (filename) save current state of Snd in filename.
scale-by (scalers snd chn)
scale amplitude of snd by scalers. Unlike most of these functions,
scale-by follows the 'sync' buttons and affects all currently sync'd channels.
scalers can be either a float or a vector of floats. In the latter case,
the values are used one by one, applying each as scale-by moves through the channels.
If control: 4, meta: 8 (see /usr/include/X11/X.h ControlMask et al).
left-sample (snd chn) return the position in samples of the left edge of the time domain
waveform for snd's channel chn.
list->vct (lst) return vct object with elements of list lst
load-colormap (colors) use colors in colors (a vector) as current colormap.
This is still kludgey, but the following shows how to use it:
(load "rgb.scm")
(define hi (make-vector 512)) ;use 64 if not using big colormaps
(do ((i 0 (+ i 4))) ((>= i 512))
(vector-set! hi i red) (vector-set! hi (+ i 1) blue)
(vector-set! hi (+ i 2) green) (vector-set! hi (+ i 3) black))
(load-colormap hi)
make-color (r g b) return a color value using the red/green/blue values r/g/b -- each of these
is a float running from 0.0 to 1.0. (make-color 1.0 0.0 0.0) returns red.
make-region (beg end snd chn)
create a new region spanning samples beg to end in snd's channel chn.
make-vct (len) create vct struct of size len.
map-across-all-chans (func start end edname) apply func to all open channels in parallel (see Scanning Data).
map-across-chans (func start end edname) apply func to currently syncd channels in parallel
map-across-sound-chans (func start end edname snd) apply func to sound's channels in parallel
map-all-chans (func start end edname) apply func to all open channels
map-chan (func start end edname snd chn) apply func to samples in current channel (see Scanning Data).
map-chans (func start end edname) apply func to currently syncd channels
map-sound-chans (func start end edname snd) apply func to current sound's channels
mark-name (id snd chn) return name of mark id.
mark-sample (id snd chn) return position of mark id.
marks (snd chn) return number of marks in snd's channel chn.
max-sounds () return current size of sound array (grows as required, may contain holes).
maxamp (snd chn) return max amp of snd's channel chn.
mix (file samp in_chan snd chn)
mix file's channel in_chan starting at samp in snd's channel chn.
if only the file argument is given, this is equivalent to the File menu's Mix option.
mix-amp (mix chan) return amplitude of mix's channel chan.
mix-anchor (mix) return anchor position (within the mix) of mix.
mix-groups (mix) return a bit-wise indication of the groups mix is participating in.
That is, group 0 is bit 0, etc. If mix is in groups 3 and 4, this returns 24.
mix-length (mix) return length in samples of mix.
mix-position (mix) return position (sample number) of mix.
mix-region (samp scaler reg snd chn)
Mix in region reg at sample samp (defaulting to the cursor sample),
scaled by scaler (defaults to 1.0) in snd's channel chn.
mix-speed (mix) return speed of mix.
mix-state (mix) return console state of mix (0=open, 1=title bar, 2=name[0]).
new-sound (name header-type data-format srate chans)
create a new (empty) sound named name. If the type and other
arguments are not specified, the raw file dialog is posted to get the
needed values which default to the current raw-type and related settings.
normalize-view () normalize Snd display as in View menu Normalize option.
ok? (snd) return #t if snd (an index) is active.
open-raw-sound (name chans srate format) open name as a raw (no header) sound in the layout specified.
open-sound (name) open name as in File menu Open option.
open-sound-file (name chans srate comment)
Open (create) a sound file name (defaults to "test.snd" or "test.wav"). It is assumed
that the data will be floats in the native format (written by the caller interleaving channels),
and that the file will be closed by close-sound-file.
One simple way to write the data is to call vct->sound-file.
open-alternate-sound(name) close the currently selected file, if any, and open name.
orientation-dialog() fire up the Orientation dialog.
override-data-format(format snd)force data format (ignore header)
override-data-location(loc snd) force data location (ignore header)
override-data-size(samps snd) force data size (ignore header)
peaks (file snd chn) display fft peak information. If file is not null, write the information
to that file, else post it in a help window (where it can be selected and
pasted elsewhere). This function follows the state of the various 'sync'
buttons, given snd and chn.
play (samp snd chn) play snd's channel chn starting from sample samp.
play-and-wait (samp snd chn) play snd's channel chn starting from sample samp and wait for it to finish.
play-region (reg) play region reg.
preload-directory (dir) preload sound files from directory dir (see -p).
preload-file (file) preload file (see View menu's View Files option).
progress-report (pct name current-channel channels snd)
The functions start-progress-report, progress-report, and finish-progress-report
handle the animated hour-glass icon used to amuse the idle user while some long
computation is allegedly in progress. The pct argument is a float between
0.0 and 1.0 which indicates how far along we are in the computation (there are
actually only 15 or 20 separate icons, so there's no point in calling this more
often than that). start-progress-report posts the initial icon, and finish-progress-report
removes it. If the icons are not available, a message is posted in snd's minibuffer
using name and so on to identify itself.
protect-region (reg protect) protect/unprotect region reg from deletion in the region browser.
read-only (snd) return #t if snd is read-only, #f otherwise.
recorder-dialog () fire up recorder window.
recorder-gain (gain) return recorder input (soundcard-audio) gain gain.
recorder-in-amp (in out) return recorder input channel in to output channel out amplitude.
recorder-out-amp (out) return recorder file output channel out amplitude.
redo (edits snd chn) redo edits edits (default is 1) in snd's channel chn.
region-chans (reg) return number of channels in region reg.
region-dialog () fire up region browser (a no-op if no regions).
region-length (reg) return number of samples (per channel) in region reg.
region-maxamp (reg) return maximum amplitude of region reg.
region-sample (samp reg chn) return value of sample samp in region reg in snd's channel chn.
region-samples (samp samps reg chn)
return vector of samps samples starting at samp in region reg's channel chn.
region-samples->vct (samp samps reg chn)
return vct struct of samps samples starting at samp in region reg's channel chn.
region-srate (reg) return original (nominal) sampling rate of region reg.
regions () return number of regions in the region stack.
remove-from-menu (top-menu menu-label)
remove menu menu-label from the top top-level menu whose index is top-menu.
report-in-minibuffer (msg snd) post msg in snd's minibuffer.
restore-control-panel (snd) same as pushing the control panel 'r' button.
reverb-feedback (snd) return snd's reverb feedback coefficient.
reverb-length (snd) return reverb delay line length scaler (control panel).
reverb-lowpass (snd) return reverb low pass filter coefficient.
reverb-scale (snd) return reverb amount (control panel).
reverbing (snd) return #t if snd's reverb button is on.
reverse-selection () reverse data delineated by current selection.
reverse-sound (snd chn) reverse data.
revert-sound (snd) revert snd to saved state (undo all edits).
right-sample (snd chn) return position (samples) of right edge of time domain waveform.
sample (samp snd chn) return value of sample samp in snd's channel chn.
samples (samp samps snd chn)
return vector of samps samples starting at samp in snd's channel chn.
samp defaults to 0. samps defaults to frames - samp.
samples->vct (samp samps snd chn)
return vct struct with same data as in samples call above.
save-control-panel(snd) same as pushing the control panel 's' button.
save-edit-history (filename snd chn) save current edit list(s) in filename.
If chn is omitted, all snd's channels are saved; if snd is omitted,
all edit list are saved. If the underlying files are not subsequently
changed, you can load this file to restore the current edit list state.
Returns #t if successful (file opened ok); #f is something went wrong.
save-envelopes (filename) save envelope editor contents in filename.
save-macros () save keyboard macros in Snd's init file (.snd).
save-marks (snd) save snd's marks, writing a file <name>.marks.
save-options (filename) save options in filename.
save-region (reg filename format)
save region reg in filename in data format format (default snd-16-linear).
save-selection (file header-type data-format srate comment)
save the currently selected data in file.
save-sound (snd) save snd; same as File menu's Save option.
save-sound-as (filename snd header-type data-format srate)
save snd as filename (same as File Save as option).
save-state (filename) save current state of Snd in filename.
scale-by (scalers snd chn)
scale amplitude of snd by scalers. Unlike most of these functions,
scale-by follows the 'sync' buttons and affects all currently sync'd channels.
scalers can be either a float or a vector of floats. In the latter case,
the values are used one by one, applying each as scale-by moves through the channels.
If control: 4, meta: 8 (see /usr/include/X11/X.h ControlMask et al).
left-sample (snd chn) return the position in samples of the left edge of the time domain
waveform for snd's channel chn.
list->vct (lst) return vct object with elements of list lst
load-colormap (colors) use colors in colors (a vector) as current colormap.
This is still kludgey, but the following shows how to use it:
(load "rgb.scm")
(define hi (make-vector 512)) ;use 64 if not using big colormaps
(do ((i 0 (+ i 4))) ((>= i 512))
(vector-set! hi i red) (vector-set! hi (+ i 1) blue)
(vector-set! hi (+ i 2) green) (vector-set! hi (+ i 3) black))
(load-colormap hi)
make-color (r g b) return a color value using the red/green/blue values r/g/b -- each of these
is a float running from 0.0 to 1.0. (make-color 1.0 0.0 0.0) returns red.
make-region (beg end snd chn)
create a new region spanning samples beg to end in snd's channel chn.
make-vct (len) create vct struct of size len.
map-across-all-chans (func start end edname) apply func to all open channels in parallel (see Scanning Data).
map-across-chans (func start end edname) apply func to currently syncd channels in parallel
map-across-sound-chans (func start end edname snd) apply func to sound's channels in parallel
map-all-chans (func start end edname) apply func to all open channels
map-chan (func start end edname snd chn) apply func to samples in current channel (see Scanning Data).
map-chans (func start end edname) apply func to currently syncd channels
map-sound-chans (func start end edname snd) apply func to current sound's channels
mark-name (id snd chn) return name of mark id.
mark-sample (id snd chn) return position of mark id.
marks (snd chn) return number of marks in snd's channel chn.
max-sounds () return current size of sound array (grows as required, may contain holes).
maxamp (snd chn) return max amp of snd's channel chn.
mix (file samp in_chan snd chn)
mix file's channel in_chan starting at samp in snd's channel chn.
if only the file argument is given, this is equivalent to the File menu's Mix option.
mix-amp (mix chan) return amplitude of mix's channel chan.
mix-anchor (mix) return anchor position (within the mix) of mix.
mix-groups (mix) return a bit-wise indication of the groups mix is participating in.
That is, group 0 is bit 0, etc. If mix is in groups 3 and 4, this returns 24.
mix-length (mix) return length in samples of mix.
mix-position (mix) return position (sample number) of mix.
mix-region (samp scaler reg snd chn)
Mix in region reg at sample samp (defaulting to the cursor sample),
scaled by scaler (defaults to 1.0) in snd's channel chn.
mix-speed (mix) return speed of mix.
mix-state (mix) return console state of mix (0=open, 1=title bar, 2=name[0]).
new-sound (name header-type data-format srate chans)
create a new (empty) sound named name. If the type and other
arguments are not specified, the raw file dialog is posted to get the
needed values which default to the current raw-type and related settings.
normalize-view () normalize Snd display as in View menu Normalize option.
ok? (snd) return #t if snd (an index) is active.
open-raw-sound (name chans srate format) open name as a raw (no header) sound in the layout specified.
open-sound (name) open name as in File menu Open option.
open-sound-file (name chans srate comment)
Open (create) a sound file name (defaults to "test.snd" or "test.wav"). It is assumed
that the data will be floats in the native format (written by the caller interleaving channels),
and that the file will be closed by close-sound-file.
One simple way to write the data is to call vct->sound-file.
open-alternate-sound(name) close the currently selected file, if any, and open name.
orientation-dialog() fire up the Orientation dialog.
override-data-format(format snd)force data format (ignore header)
override-data-location(loc snd) force data location (ignore header)
override-data-size(samps snd) force data size (ignore header)
peaks (file snd chn) display fft peak information. If file is not null, write the information
to that file, else post it in a help window (where it can be selected and
pasted elsewhere). This function follows the state of the various 'sync'
buttons, given snd and chn.
play (samp snd chn) play snd's channel chn starting from sample samp.
play-and-wait (samp snd chn) play snd's channel chn starting from sample samp and wait for it to finish.
play-region (reg) play region reg.
preload-directory (dir) preload sound files from directory dir (see -p).
preload-file (file) preload file (see View menu's View Files option).
progress-report (pct name current-channel channels snd)
The functions start-progress-report, progress-report, and finish-progress-report
handle the animated hour-glass icon used to amuse the idle user while some long
computation is allegedly in progress. The pct argument is a float between
0.0 and 1.0 which indicates how far along we are in the computation (there are
actually only 15 or 20 separate icons, so there's no point in calling this more
often than that). start-progress-report posts the initial icon, and finish-progress-report
removes it. If the icons are not available, a message is posted in snd's minibuffer
using name and so on to identify itself.
protect-region (reg protect) protect/unprotect region reg from deletion in the region browser.
read-only (snd) return #t if snd is read-only, #f otherwise.
recorder-dialog () fire up recorder window.
recorder-gain (gain) return recorder input (soundcard-audio) gain gain.
recorder-in-amp (in out) return recorder input channel in to output channel out amplitude.
recorder-out-amp (out) return recorder file output channel out amplitude.
redo (edits snd chn) redo edits edits (default is 1) in snd's channel chn.
region-chans (reg) return number of channels in region reg.
region-dialog () fire up region browser (a no-op if no regions).
region-length (reg) return number of samples (per channel) in region reg.
region-maxamp (reg) return maximum amplitude of region reg.
region-sample (samp reg chn) return value of sample samp in region reg in snd's channel chn.
region-samples (samp samps reg chn)
return vector of samps samples starting at samp in region reg's channel chn.
region-samples->vct (samp samps reg chn)
return vct struct of samps samples starting at samp in region reg's channel chn.
region-srate (reg) return original (nominal) sampling rate of region reg.
regions () return number of regions in the region stack.
remove-from-menu (top-menu menu-label)
remove menu menu-label from the top top-level menu whose index is top-menu.
report-in-minibuffer (msg snd) post msg in snd's minibuffer.
restore-control-panel (snd) same as pushing the control panel 'r' button.
reverb-feedback (snd) return snd's reverb feedback coefficient.
reverb-length (snd) return reverb delay line length scaler (control panel).
reverb-lowpass (snd) return reverb low pass filter coefficient.
reverb-scale (snd) return reverb amount (control panel).
reverbing (snd) return #t if snd's reverb button is on.
reverse-selection () reverse data delineated by current selection.
reverse-sound (snd chn) reverse data.
revert-sound (snd) revert snd to saved state (undo all edits).
right-sample (snd chn) return position (samples) of right edge of time domain waveform.
sample (samp snd chn) return value of sample samp in snd's channel chn.
samples (samp samps snd chn)
return vector of samps samples starting at samp in snd's channel chn.
samp defaults to 0. samps defaults to frames - samp.
samples->vct (samp samps snd chn)
return vct struct with same data as in samples call above.
save-control-panel(snd) same as pushing the control panel 's' button.
save-edit-history (filename snd chn) save current edit list(s) in filename.
If chn is omitted, all snd's channels are saved; if snd is omitted,
all edit list are saved. If the underlying files are not subsequently
changed, you can load this file to restore the current edit list state.
Returns #t if successful (file opened ok); #f is something went wrong.
save-envelopes (filename) save envelope editor contents in filename.
save-macros () save keyboard macros in Snd's init file (.snd).
save-marks (snd) save snd's marks, writing a file <name>.marks.
save-options (filename) save options in filename.
save-region (reg filename format)
save region reg in filename in data format format (default snd-16-linear).
save-selection (file header-type data-format srate comment)
save the currently selected data in file.
save-sound (snd) save snd; same as File menu's Save option.
save-sound-as (filename snd header-type data-format srate)
save snd as filename (same as File Save as option).
save-state (filename) save current state of Snd in filename.
scale-by (scalers snd chn)
scale amplitude of snd by scalers. Unlike most of these functions,
scale-by follows the 'sync' buttons and affects all currently sync'd channels.
scalers can be either a float or a vector of floats. In the latter case,
the values are used one by one, applying each as scale-by moves through the channels.
If control: 4, meta: 8 (see /usr/include/X11/X.h ControlMask et al).
left-sample (snd chn) return the position in samples of the left edge of the time domain
waveform for snd's channel chn.
list->vct (lst) return vct object with elements of list lst
load-colormap (colors) use colors in colors (a vector) as current colormap.
This is still kludgey, but the following shows how to use it:
(load "rgb.scm")
(define hi (make-vector 512)) ;use 64 if not using big colormaps
(do ((i 0 (+ i 4))) ((>= i 512))
(vector-set! hi i red) (vector-set! hi (+ i 1) blue)
(vector-set! hi (+ i 2) green) (vector-set! hi (+ i 3) black))
(load-colormap hi)
make-color (r g b) return a color value using the red/green/blue values r/g/b -- each of these
is a float running from 0.0 to 1.0. (make-color 1.0 0.0 0.0) returns red.
make-region (beg end snd chn)
create a new region spanning samples beg to end in snd's channel chn.
make-vct (len) create vct struct of size len.
map-across-all-chans (func start end edname) apply func to all open channels in parallel (see Scanning Data).
map-across-chans (func start end edname) apply func to currently syncd channels in parallel
map-across-sound-chans (func start end edname snd) apply func to sound's channels in parallel
map-all-chans (func start end edname) apply func to all open channels
map-chan (func start end edname snd chn) apply func to samples in current channel (see Scanning Data).
map-chans (func start end edname) apply func to currently syncd channels
map-sound-chans (func start end edname snd) apply func to current sound's channels
mark-name (id snd chn) return name of mark id.
mark-sample (id snd chn) return position of mark id.
marks (snd chn) return number of marks in snd's channel chn.
max-sounds () return current size of sound array (grows as required, may contain holes).
maxamp (snd chn) return max amp of snd's channel chn.
mix (file samp in_chan snd chn)
mix file's channel in_chan starting at samp in snd's channel chn.
if only the file argument is given, this is equivalent to the File menu's Mix option.
mix-amp (mix chan) return amplitude of mix's channel chan.
mix-anchor (mix) return anchor position (within the mix) of mix.
mix-groups (mix) return a bit-wise indication of the groups mix is participating in.
That is, group 0 is bit 0, etc. If mix is in groups 3 and 4, this returns 24.
mix-length (mix) return length in samples of mix.
mix-position (mix) return position (sample number) of mix.
mix-region (samp scaler reg snd chn)
Mix in region reg at sample samp (defaulting to the cursor sample),
scaled by scaler (defaults to 1.0) in snd's channel chn.
mix-speed (mix) return speed of mix.
mix-state (mix) return console state of mix (0=open, 1=title bar, 2=name[0]).
new-sound (name header-type data-format srate chans)
create a new (empty) sound named name. If the type and other
arguments are not specified, the raw file dialog is posted to get the
needed values which default to the current raw-type and related settings.
normalize-view () normalize Snd display as in View menu Normalize option.
ok? (snd) return #t if snd (an index) is active.
open-raw-sound (name chans srate format) open name as a raw (no header) sound in the layout specified.
open-sound (name) open name as in File menu Open option.
open-sound-file (name chans srate comment)
Open (create) a sound file name (defaults to "test.snd" or "test.wav"). It is assumed
that the data will be floats in the native format (written by the caller interleaving channels),
and that the file will be closed by close-sound-file.
One simple way to write the data is to call vct->sound-file.
open-alternate-sound(name) close the currently selected file, if any, and open name.
orientation-dialog() fire up the Orientation dialog.
override-data-format(format snd)force data format (ignore header)
override-data-location(loc snd) force data location (ignore header)
override-data-size(samps snd) force data size (ignore header)
peaks (file snd chn) display fft peak information. If file is not null, write the information
to that file, else post it in a help window (where it can be selected and
pasted elsewhere). This function follows the state of the various 'sync'
buttons, given snd and chn.
play (samp snd chn) play snd's channel chn starting from sample samp.
play-and-wait (samp snd chn) play snd's channel chn starting from sample samp and wait for it to finish.
play-region (reg) play region reg.
preload-directory (dir) preload sound files from directory dir (see -p).
preload-file (file) preload file (see View menu's View Files option).
progress-report (pct name current-channel channels snd)
The functions start-progress-report, progress-report, and finish-progress-report
handle the animated hour-glass icon used to amuse the idle user while some long
computation is allegedly in progress. The pct argument is a float between
0.0 and 1.0 which indicates how far along we are in the computation (there are
actually only 15 or 20 separate icons, so there's no point in calling this more
often than that). start-progress-report posts the initial icon, and finish-progress-report
removes it. If the icons are not available, a message is posted in snd's minibuffer
using name and so on to identify itself.
protect-region (reg protect) protect/unprotect region reg from deletion in the region browser.
read-only (snd) return #t if snd is read-only, #f otherwise.
recorder-dialog () fire up recorder window.
recorder-gain (gain) return recorder input (soundcard-audio) gain gain.
recorder-in-amp (in out) return recorder input channel in to output channel out amplitude.
recorder-out-amp (out) return recorder file output channel out amplitude.
redo (edits snd chn) redo edits edits (default is 1) in snd's channel chn.
region-chans (reg) return number of channels in region reg.
region-dialog () fire up region browser (a no-op if no regions).
region-length (reg) return number of samples (per channel) in region reg.
region-maxamp (reg) return maximum amplitude of region reg.
region-sample (samp reg chn) return value of sample samp in region reg in snd's channel chn.
region-samples (samp samps reg chn)
return vector of samps samples starting at samp in region reg's channel chn.
region-samples->vct (samp samps reg chn)
return vct struct of samps samples starting at samp in region reg's channel chn.
region-srate (reg) return original (nominal) sampling rate of region reg.
regions () return number of regions in the region stack.
remove-from-menu (top-menu menu-label)
remove menu menu-label from the top top-level menu whose index is top-menu.
report-in-minibuffer (msg snd) post msg in snd's minibuffer.
restore-control-panel (snd) same as pushing the control panel 'r' button.
reverb-feedback (snd) return snd's reverb feedback coefficient.
reverb-length (snd) return reverb delay line length scaler (control panel).
reverb-lowpass (snd) return reverb low pass filter coefficient.
reverb-scale (snd) return reverb amount (control panel).
reverbing (snd) return #t if snd's reverb button is on.
reverse-selection () reverse data delineated by current selection.
reverse-sound (snd chn) reverse data.
revert-sound (snd) revert snd to saved state (undo all edits).
right-sample (snd chn) return position (samples) of right edge of time domain waveform.
sample (samp snd chn) return value of sample samp in snd's channel chn.
samples (samp samps snd chn)
return vector of samps samples starting at samp in snd's channel chn.
samp defaults to 0. samps defaults to frames - samp.
samples->vct (samp samps snd chn)
return vct struct with same data as in samples call above.
save-control-panel(snd) same as pushing the control panel 's' button.
save-edit-history (filename snd chn) save current edit list(s) in filename.
If chn is omitted, all snd's channels are saved; if snd is omitted,
all edit list are saved. If the underlying files are not subsequently
changed, you can load this file to restore the current edit list state.
Returns #t if successful (file opened ok); #f is something went wrong.
save-envelopes (filename) save envelope editor contents in filename.
save-macros () save keyboard macros in Snd's init file (.snd).
save-marks (snd) save snd's marks, writing a file <name>.marks.
save-options (filename) save options in filename.
save-region (reg filename format)
save region reg in filename in data format format (default snd-16-linear).
save-selection (file header-type data-format srate comment)
save the currently selected data in file.
save-sound (snd) save snd; same as File menu's Save option.
save-sound-as (filename snd header-type data-format srate)
save snd as filename (same as File Save as option).
save-state (filename) save current state of Snd in filename.
scale-by (scalers snd chn)
scale amplitude of snd by scalers. Unlike most of these functions,
scale-by follows the 'sync' buttons and affects all currently sync'd channels.
scalers can be either a float or a vector of floats. In the latter case,
the values are used one by one, applying each as scale-by moves through the channels.
If control: 4, meta: 8 (see /usr/include/X11/X.h ControlMask et al).
left-sample (snd chn) return the position in samples of the left edge of the time domain
waveform for snd's channel chn.
list->vct (lst) return vct object with elements of list lst
load-colormap (colors) use colors in colors (a vector) as current colormap.
This is still kludgey, but the following shows how to use it:
(load "rgb.scm")
(define hi (make-vector 512)) ;use 64 if not using big colormaps
(do ((i 0 (+ i 4))) ((>= i 512))
(vector-set! hi i red) (vector-set! hi (+ i 1) blue)
(vector-set! hi (+ i 2) green) (vector-set! hi (+ i 3) black))
(load-colormap hi)
make-color (r g b) return a color value using the red/green/blue values r/g/b -- each of these
is a float running from 0.0 to 1.0. (make-color 1.0 0.0 0.0) returns red.
make-region (beg end snd chn)
create a new region spanning samples beg to end in snd's channel chn.
make-vct (len) create vct struct of size len.
map-across-all-chans (func start end edname) apply func to all open channels in parallel (see Scanning Data).
map-across-chans (func start end edname) apply func to currently syncd channels in parallel
map-across-sound-chans (func start end edname snd) apply func to sound's channels in parallel
map-all-chans (func start end edname) apply func to all open channels
map-chan (func start end edname snd chn) apply func to samples in current channel (see Scanning Data).
map-chans (func start end edname) apply func to currently syncd channels
map-sound-chans (func start end edname snd) apply func to current sound's channels
mark-name (id snd chn) return name of mark id.
mark-sample (id snd chn) return position of mark id.
marks (snd chn) return number of marks in snd's channel chn.
max-sounds () return current size of sound array (grows as required, may contain holes).
maxamp (snd chn) return max amp of snd's channel chn.
mix (file samp in_chan snd chn)
mix file's channel in_chan starting at samp in snd's channel chn.
if only the file argument is given, this is equivalent to the File menu's Mix option.
mix-amp (mix chan) return amplitude of mix's channel chan.
mix-anchor (mix) return anchor position (within the mix) of mix.
mix-groups (mix) return a bit-wise indication of the groups mix is participating in.
That is, group 0 is bit 0, etc. If mix is in groups 3 and 4, this returns 24.
mix-length (mix) return length in samples of mix.
mix-position (mix) return position (sample number) of mix.
mix-region (samp scaler reg snd chn)
Mix in region reg at sample samp (defaulting to the cursor sample),
scaled by scaler (defaults to 1.0) in snd's channel chn.
mix-speed (mix) return speed of mix.
mix-state (mix) return console state of mix (0=open, 1=title bar, 2=name[0]).
new-sound (name header-type data-format srate chans)
create a new (empty) sound named name. If the type and other
arguments are not specified, the raw file dialog is posted to get the
needed values which default to the current raw-type and related settings.
normalize-view () normalize Snd display as in View menu Normalize option.
ok? (snd) return #t if snd (an index) is active.
open-raw-sound (name chans srate format) open name as a raw (no header) sound in the layout specified.
open-sound (name) open name as in File menu Open option.
open-sound-file (name chans srate comment)
Open (create) a sound file name (defaults to "test.snd" or "test.wav"). It is assumed
that the data will be floats in the native format (written by the caller interleaving channels),
and that the file will be closed by close-sound-file.
One simple way to write the data is to call vct->sound-file.
open-alternate-sound(name) close the currently selected file, if any, and open name.
orientation-dialog() fire up the Orientation dialog.
override-data-format(format snd)force data format (ignore header)
override-data-location(loc snd) force data location (ignore header)
override-data-size(samps snd) force data size (ignore header)
peaks (file snd chn) display fft peak information. If file is not null, write the information
to that file, else post it in a help window (where it can be selected and
pasted elsewhere). This function follows the state of the various 'sync'
buttons, given snd and chn.
play (samp snd chn) play snd's channel chn starting from sample samp.
play-and-wait (samp snd chn) play snd's channel chn starting from sample samp and wait for it to finish.
play-region (reg) play region reg.
preload-directory (dir) preload sound files from directory dir (see -p).
preload-file (file) preload file (see View menu's View Files option).
progress-report (pct name current-channel channels snd)
The functions start-progress-report, progress-report, and finish-progress-report
handle the animated hour-glass icon used to amuse the idle user while some long
computation is allegedly in progress. The pct argument is a float between
0.0 and 1.0 which indicates how far along we are in the computation (there are
actually only 15 or 20 separate icons, so there's no point in calling this more
often than that). start-progress-report posts the initial icon, and finish-progress-report
removes it. If the icons are not available, a message is posted in snd's minibuffer
using name and so on to identify itself.
protect-region (reg protect) protect/unprotect region reg from deletion in the region browser.
read-only (snd) return #t if snd is read-only, #f otherwise.
recorder-dialog () fire up recorder window.
recorder-gain (gain) return recorder input (soundcard-audio) gain gain.
recorder-in-amp (in out) return recorder input channel in to output channel out amplitude.
recorder-out-amp (out) return recorder file output channel out amplitude.
redo (edits snd chn) redo edits edits (default is 1) in snd's channel chn.
region-chans (reg) return number of channels in region reg.
region-dialog () fire up region browser (a no-op if no regions).
region-length (reg) return number of samples (per channel) in region reg.
region-maxamp (reg) return maximum amplitude of region reg.
region-sample (samp reg chn) return value of sample samp in region reg in snd's channel chn.
region-samples (samp samps reg chn)
return vector of samps samples starting at samp in region reg's channel chn.
region-samples->vct (samp samps reg chn)
return vct struct of samps samples starting at samp in region reg's channel chn.
region-srate (reg) return original (nominal) sampling rate of region reg.
regions () return number of regions in the region stack.
remove-from-menu (top-menu menu-label)
remove menu menu-label from the top top-level menu whose index is top-menu.
report-in-minibuffer (msg snd) post msg in snd's minibuffer.
restore-control-panel (snd) same as pushing the control panel 'r' button.
reverb-feedback (snd) return snd's reverb feedback coefficient.
reverb-length (snd) return reverb delay line length scaler (control panel).
reverb-lowpass (snd) return reverb low pass filter coefficient.
reverb-scale (snd) return reverb amount (control panel).
reverbing (snd) return #t if snd's reverb button is on.
reverse-selection () reverse data delineated by current selection.
reverse-sound (snd chn) reverse data.
revert-sound (snd) revert snd to saved state (undo all edits).
right-sample (snd chn) return position (samples) of right edge of time domain waveform.
sample (samp snd chn) return value of sample samp in snd's channel chn.
samples (samp samps snd chn)
return vector of samps samples starting at samp in snd's channel chn.
samp defaults to 0. samps defaults to frames - samp.
samples->vct (samp samps snd chn)
return vct struct with same data as in samples call above.
save-control-panel(snd) same as pushing the control panel 's' button.
save-edit-history (filename snd chn) save current edit list(s) in filename.
If chn is omitted, all snd's channels are saved; if snd is omitted,
all edit list are saved. If the underlying files are not subsequently
changed, you can load this file to restore the current edit list state.
Returns #t if successful (file opened ok); #f is something went wrong.
save-envelopes (filename) save envelope editor contents in filename.
save-macros () save keyboard macros in Snd's init file (.snd).
save-marks (snd) save snd's marks, writing a file <name>.marks.
save-options (filename) save options in filename.
save-region (reg filename format)
save region reg in filename in data format format (default snd-16-linear).
save-selection (file header-type data-format srate comment)
save the currently selected data in file.
save-sound (snd) save snd; same as File menu's Save option.
save-sound-as (filename snd header-type data-format srate)
save snd as filename (same as File Save as option).
save-state (filename) save current state of Snd in filename.
scale-by (scalers snd chn)
scale amplitude of snd by scalers. Unlike most of these functions,
scale-by follows the 'sync' buttons and affects all currently sync'd channels.
scalers can be either a float or a vector of floats. In the latter case,
the values are used one by one, applying each as scale-by moves through the channels.
If control: 4, meta: 8 (see /usr/include/X11/X.h ControlMask et al).
left-sample (snd chn) return the position in samples of the left edge of the time domain
waveform for snd's channel chn.
list->vct (lst) return vct object with elements of list lst
load-colormap (colors) use colors in colors (a vector) as current colormap.
This is still kludgey, but the following shows how to use it:
(load "rgb.scm")
(define hi (make-vector 512)) ;use 64 if not using big colormaps
(do ((i 0 (+ i 4))) ((>= i 512))
(vector-set! hi i red) (vector-set! hi (+ i 1) blue)
(vector-set! hi (+ i 2) green) (vector-set! hi (+ i 3) black))
(load-colormap hi)
make-color (r g b) return a color value using the red/green/blue values r/g/b -- each of these
is a float running from 0.0 to 1.0. (make-color 1.0 0.0 0.0) returns red.
make-region (beg end snd chn)
create a new region spanning samples beg to end in snd's channel chn.
make-vct (len) create vct struct of size len.
map-across-all-chans (func start end edname) apply func to all open channels in parallel (see Scanning Data).
map-across-chans (func start end edname) apply func to currently syncd channels in parallel
map-across-sound-chans (func start end edname snd) apply func to sound's channels in parallel
map-all-chans (func start end edname) apply func to all open channels
map-chan (func start end edname snd chn) apply func to samples in current channel (see Scanning Data).
map-chans (func start end edname) apply func to currently syncd channels
map-sound-chans (func start end edname snd) apply func to current sound's channels
mark-name (id snd chn) return name of mark id.
mark-sample (id snd chn) return position of mark id.
marks (snd chn) return number of marks in snd's channel chn.
max-sounds () return current size of sound array (grows as required, may contain holes).
maxamp (snd chn) return max amp of snd's channel chn.
mix (file samp in_chan snd chn)
mix file's channel in_chan starting at samp in snd's channel chn.
if only the file argument is given, this is equivalent to the File menu's Mix option.
mix-amp (mix chan) return amplitude of mix's channel chan.
mix-anchor (mix) return anchor position (within the mix) of mix.
mix-groups (mix) return a bit-wise indication of the groups mix is participating in.
That is, group 0 is bit 0, etc. If mix is in groups 3 and 4, this returns 24.
mix-length (mix) return length in samples of mix.
mix-position (mix) return position (sample number) of mix.
mix-region (samp scaler reg snd chn)
Mix in region reg at sample samp (defaulting to the cursor sample),
scaled by scaler (defaults to 1.0) in snd's channel chn.
mix-speed (mix) return speed of mix.
mix-state (mix) return console state of mix (0=open, 1=title bar, 2=name[0]).
new-sound (name header-type data-format srate chans)
create a new (empty) sound named name. If the type and other
arguments are not specified, the raw file dialog is posted to get the
needed values which default to the current raw-type and related settings.
normalize-view () normalize Snd display as in View menu Normalize option.
ok? (snd) return #t if snd (an index) is active.
open-raw-sound (name chans srate format) open name as a raw (no header) sound in the layout specified.
open-sound (name) open name as in File menu Open option.
open-sound-file (name chans srate comment)
Open (create) a sound file name (defaults to "test.snd" or "test.wav"). It is assumed
that the data will be floats in the native format (written by the caller interleaving channels),