Incudine

Music/DSP programming environment for Common Lisp

Next:   [Contents][Index]

Incudine

Table of Contents


Next: , Previous: , Up: Incudine   [Contents][Index]

1 Introduction

Incudine is useful to design software synthesizers or sound plugins from scratch, exploiting the expressive power of Common Lisp, without the constraint to use pre-built unit generators. It is also a compositional tool that allows to produce high quality sounds controllable at the sample level, defining and redefining the digital signal processors and the musical structures on-the-fly.

Incudine introduces the Virtual UGen (VUG), a new mechanism for defining primitive unit generators by writing concise and reusable code. The definition of a VUG can contain lisp code, other nested VUGs or “real” unit generators (compiled VUGs), and it is re-arranged (i.e. after the inference of init- and performance-time actions) and compiled efficiently during the creation of a DSP.


Next: , Previous: , Up: Incudine   [Contents][Index]

2 Features


3 Installation


Next: , Up: Installation   [Contents][Index]

3.1 Requirements

Incudine works with SBCL, an implementation of ANSI Common Lisp with a high-performance native compiler.


3.1.1 Common Lisp packages


3.1.2 Foreign libraries

Some Linux distributions provide separated devel packages necessary to compile Incudine, for example jack-audio-connection-kit-devel, portaudio-devel, etc.


Next: , Previous: , Up: Installation   [Contents][Index]

3.2 Download

The latest source code can be obtained via Git:

git clone git://git.code.sf.net/p/incudine/incudine

Mirror:

git clone git://github.com/titola/incudine.git

Previous: , Up: Installation   [Contents][Index]

3.3 Configuration

Put the incudine directory where ASDF finds your systems, for example:

mv incudine ${HOME}/common-lisp/

If you use Quicklisp:

mv incudine /path/to/quicklisp/local-projects/

Edit and copy the sample configuration file, with particular attention to the priorities *rt-priority*, *nrt-priority* and *receiver-default-priority*

cp /path/to/incudine/incudinerc-example ${HOME}/.incudinerc

If MMCSS (Multimedia Class Scheduler Service) is available on Windows, the realtime thread is associated with the “Pro Audio” task.

Here is a test:

(require :incudine)
(in-package :scratch)
(dsp! hello-world () (out (sine 440 .3)))
(rt-start)
;; You should hear an oscillation at 440 Hz.
(hello-world)
(free 0)
(rt-stop)
;; It writes a soundfile.
(bounce-to-disk ("/tmp/test.wav" :channels 1 :duration 1) (hello-world))

GNU Emacs and Texinfo are required to build the documentation:

cd doc/manual && make info html pdf

This builds the Info, HTML and PDF documentation from the Org and Texinfo sources.

If you want to create and install the incudine command:

cd src && ./install_executable

The options for the script ‘install_executable’ are:

--prefix=PREFIX       install architecture-independent files in PREFIX
                      [/usr/local]
--bindir=DIR          user executables [PREFIX/bin]
--swank-loader=PATH   support for Swank server with path to swank-loader.lisp
--without-aclrepl     do not use Allegro CL-style Read-Eval-Print Loop.
--with-clm            use cudere-clm, the Incudine version of CLM.
--with-linedit        support for Linedit, readline-style library in CL.
--with-fluidsynth     support for FluidSynth SoundFont synthesizer.
--with-ladspa         support for LADSPA plugins.
--with-lv2            support for LV2 plugins.
--with-snd            support for the sound editor Snd.
--with-module=NAME    load the module NAME before to create the executable.
--save-options=OPTS   further arguments for SAVE-LISP-AND-DIE.
--sbcl-options=OPTS   options for SBCL.
--before-save=FORM    read and evaluate FORM before to create the executable.

For example:

sh install_executable \
  --bindir=/computer/music \
  --swank-loader=/path/to/slime/swank-loader.lisp \
  --with-linedit \
  --with-clm \
  --with-snd \
  --with-ladspa \
  --with-lv2 \
  --with-fluidsynth \
  --with-module=series \
  --with-module=anaphora \
  --save-options=":compression t" \
  --before-save="(series::install :pkg :scratch :shadow nil)"

Note: the support for LV2 plugins requires Lilv, a LV2 host library. The option :compression t works if :sb-core-compression was enabled in SBCL at build-time.

There are two major modes for GNU Emacs: incudine-mode and incudine-rego-mode for editing lisp (cudo) and score (rego) files, respectively. If you want to install them, add the following lines to your .emacs file:

(push "/path/to/incudine/contrib/editors/emacs" load-path)
(require 'incudine)
;; org-babel source code block.
(require 'ob-incudine)

3.3.1 Sample configuration file

;;; .incudinerc
;;;
;;; Sample configuration file for Incudine
;;;

;;;-------------------------[ C compiler ]--------------------------

(setq *c-compiler* "cc")

;; A list, in which each element is a string, a pathname, or a simple Lisp
;; expression. Used only if the dynamic linker fails to search a library
;; (see CFFI:*FOREIGN-LIBRARY-DIRECTORIES*)
(setq *foreign-library-directories* nil)

;; Directories to be searched for header files. A list, in which each
;; element is a string, a pathname, or a simple Lisp expression.
(setq *foreign-header-file-directories* nil)

;;;--------------------[ RT and NRT priorities ]--------------------

;; Thread scheduling algorithm.
(setq *sched-policy*
      #+linux "SCHED_FIFO"
      #-linux "SCHED_RR")

;; Note: if MMCSS (Multimedia Class Scheduler Service) is available on
;; Windows, the realtime thread is associated with the "Pro Audio" task.
;; Currently the other priority settings are ignored on Windows.

;; Priority of the realtime thread.
(setq *rt-priority* 68)

;; Priority of the non-realtime thread.
(setq *nrt-priority* 60)

;; Priority for the threads of the receivers (i.e. MIDI input)
(setq *receiver-default-priority* 63)

;; Zero-based number of CPU reserved for the realtime thread.
; (setq *rt-cpu* 0)

;;;-----------------------[ Audio settings ]------------------------

;; Real time audio:
;;
;;     :dummy
;;     :jack
;;     :portaudio
;;     :portaudio-jack
;;
;; :portaudio and :portaudio-jack are the same, but with the last
;; it is possible to set the Jack client name.
;;
(setq *audio-driver*
      #+linux :jack
      #-linux :portaudio)

(setq *max-buffer-size* 1024)

;; Realtime block size in frames.
(setq *rt-block-size* 1)

(setq *sample-rate* 48000)
(setq *client-name* "incudine")
(setq *max-number-of-channels* 1024)
(setq *number-of-input-bus-channels* 2)
(setq *number-of-output-bus-channels* 2)
(setq *number-of-bus-channels* 4096)

;; Control-string or function of one argument (the port number) to get
;; the short name of a JACK port. The default is "in_~D" for the input
;; ports and "out_~D" for the output ports. If the function doesn't
;; return a string, the port name is the default.
;(setq *audio-input-port-name* "in_~D")
;(setq *audio-output-port-name* "out_~D")

;; Used only with PortAudio.
(setq *frames-per-buffer* 512)

;; Recovery of audio cycles suspended during gc by processing the
;; cached audio inputs and MIDI events (audio outputs are ignored).
;; For example, this setting allows HD recording without losing audio
;; inputs during gc if there aren't xruns.
;; Note: if *RECOVER-SUSPENDED-AUDIO-CYCLES-P* is NIL (default), the
;; time is not incremented after gc, therefore the old scheduled
;; functions are delayed by the garbage collection time.
;(setq *recover-suspended-audio-cycles-p* t)

;; PORTAUDIO-DEVICE-INFO prints the list of the devices (-1 = default).
;(setq *portaudio-input-device* -1)
;(setq *portaudio-output-device* -1)

;; Latencies for PortAudio stream:
;;     positive value: latency in seconds
;;     negative value: the absolute value is the latency in number of periods
;;                  0: default latency for interactive performance
;(setq *portaudio-input-latency* 0)
;(setq *portaudio-output-latency* 0)

;;;-----------------------[ MIDI settings ]-------------------------

(setq *enable-jack-midi* nil)

;; Timestamp with sample offset for PortMidi output in rt-thread
;; (T by default with PortAudio).
;(setq *enable-portmidi-output-sample-offset* (not (eq *audio-driver* :jack)))

;; Number of milliseconds before to test whether MIDI input is
;; available (useful with PortMidi because it does not support a
;; blocking read).
;; low value = low latency but minor CPU time for the system
(setq *midi-input-timeout* 1)

;;;------------------------[ Networking ]---------------------------

;; addrinfo-flags for the argument 'hints' of the c-call getaddrinfo.
(setq *addrinfo-hints-flags* 0)

;; Size of the foreign buffer used to read/write octets.
(setq *network-buffer-size* 1000)

;; Open Sound Control
(setq *osc-buffer-size* 1500)
(setq *osc-max-values* 50)

;; INCUDINE.OSC package nicknames [default: (list "OSC")]
;(setq *osc-package-nicknames* nil)

;;;---------------------------[ Graph ]-----------------------------

(setq *max-number-of-nodes* 1024)

;;;----------------------[ Event scheduling ]-----------------------

;; array or list
(setq *fifo-buffer-type* 'array)

;; A power of two if *FIFO-BUFFER-TYPE* is ARRAY
(setq *fifo-buffer-size* 128)

;; Max number of scheduled events in realtime (a power of two).
(setq *rt-edf-heap-size* 1024)

;; Max number of scheduled events in non-realtime (a power of two).
(setq *nrt-edf-heap-size* 65536)

;; Pool size of the temporary EDF heaps.
(setq *edf-heap-pool-size* 2)

;; New EDF heaps to add when the pool is empty.
(setq *edf-heap-pool-grow* 1)

;;;-------------------------[ Soundfile ]---------------------------

;; Safe upper limit when the duration of the soundfile is undefined.
(setq *bounce-to-disk-guard-size* 300) ; 5 minutes

(setq *sndfile-buffer-size* 1024)
(setq *default-header-type* #-darwin "wav" #+darwin "aiff")
(setq *default-data-format* "pcm-24")

;;;--------------------[ Foreign memory pool ]----------------------

;; Size (in bytes) of the pool for the C heap used in realtime.
(setq *foreign-sample-pool-size* (* 64 1024 1024))
(setq *foreign-rt-memory-pool-size* (* 64 1024 1024))

;; Size of the pool used for temporary C malloc in non-realtime.
(setq *foreign-nrt-memory-pool-size* (* 64 1024 1024))

;;;---------------------------[ Misc ]------------------------------

;; Size in samples (power of two) for frequently used waveforms
;; (i.e. *SINE-TABLE* and *COSINE-TABLE*).
(setq *default-table-size* 65536)

;; Initial tempo in beats per minute.
(setq *default-bpm* 60)

;;; Default curve for fade in/out.
(setq *fade-curve* :lin)

;;; Default duration for fade in/out.
(setq *fade-time* 0)

;;; Velocity of the sound at 22 degrees Celsius, 1 atmosfera.
(setq *sound-velocity* 345)


;;; Local Variables:
;;; mode: lisp
;;; End:

4 The Incudine dictionary


4.1 Condition

Condition: incudine-error

All types of Incudine error conditions inherit from this condition.

Macro: incudine-error format-control &rest format-arguments

Signals an incudine-simple-error controlled by format-control and format-arguments.

Condition: incudine-simple-error

Subtype of incudine-error and simple-error.

Condition: incudine-compile-error

Signaled if there is an error during the compilation of the Incudine library.

Subtype of incudine-simple-error.

Condition: incudine-memory-fault-error

Signaled if there is an unhandled memory fault.

Subtype of incudine-simple-error.

Condition: incudine-storage-condition

Subtype of incudine-simple-error and storage-condition.

Condition: incudine-network-error

Conditions that relate to networking interface should inherit from this type.

Subtype of incudine-simple-error.

Condition: incudine-node-error

Conditions that relate to the node tree should inherit from this type.

Subtype of incudine-simple-error.

Condition: incudine-missing-arg

Signaled if there is a missing argument.

Subtype of incudine-simple-error.

Function: incudine-missing-arg datum

Signals an incudine-missing-arg error.

Condition: incudine-unknown-time-unit

Signaled if the time unit is unknown.

Condition: incudine-undefined-vug

Signaled if the virtual unit generator is undefined.

Condition: incudine-undefined-ugen

Signaled if the unit generator is undefined.

Condition: incudine-undefined-dsp

Signaled if the DSP is undefined.

Condition: midifile:midifile-error

All types of error conditions about MIDI files inherit from this condition.

Subtype of incudine-simple-error.

Condition: midifile:midifile-parse-error

Signaled if there is a MIDI file parsing error.

Condition: midifile:invalid-variable-length-quantity

Signaled if the MIDI file parser encounters an invalid variable-length-quantity.

Subtype of midifile-parse-error.

Condition: midifile:invalid-running-status

Signaled if the MIDI file parser encounters an invalid running status.

Subtype of midifile-parse-error.

Condition: midifile:invalid-track-chunk-length

Signaled if the MIDI file parser encounters a header-chunk with invalid length of track data.

Subtype of midifile-parse-error.

Condition: soundfile:soundfile-error

All types of error conditions about sound files inherit from this condition.

Subtype of incudine-simple-error and file-error.

Condition: ana:analysis-file-error

All types of error conditions about analysis files inherit from this condition.

Subtype of incudine-simple-error and file-error.

Condition: vug:foreign-plugin-error

All types of error conditions about foreign plugin inherit from this condition.

Subtype of incudine-simple-error.


Next: , Previous: , Up: The Incudine dictionary   [Contents][Index]

4.2 Bus

Function: bus number

Return the value of the zero-based bus number. Setfable.

No bounds checking.

The utility bus is similar to smp-ref with a pre-allocated foreign array of type sample:

(bus 123)
(setf (bus 123) value)

is equivalent to

(smp-ref preallocated-foreign-array 123)
(setf (smp-ref preallocated-foreign-array 123) (sample value))

Example:

(in-package :scratch)

(dsp! master ()
  ;; Stereo output from the first two buses.
  (out (bus 0) (bus 1))
  ;; Zero before the next audio cycle.
  (setf (bus 0) 0)
  (setf (bus 1) 0))

(dsp! track (freq amp pos)
  (foreach-channel
    ;; We can use CURRENT-CHANNEL here because MASTER reads the buses
    ;; 0 and 1, and CURRENT-CHANNEL starts from 0. INCF means "mix"
    ;; (use SETF if you want to overwrite the current bus value).
    (incf (bus current-channel) (pan2 (sine freq amp) pos))))

(dsp! stereo-test (freq amp (nbus fixnum))
  ;; The adjacent bus number is explicitally computed.
  ;; Note: this initialization avoids a sum during the performance
  ;; and it is necessary because BUS is a function.
  (with ((nbus2 (+ nbus 1)))
    (incf (bus nbus) (sine freq amp))
    ;; Note: SINE is a VUG, therefore the initialization for `(* freq 3/2)'
    ;; is implicit (there is a hidden WITH).
    (incf (bus nbus2) (sine (* freq 3/2) amp))))

(set-rt-block-size 1)
(rt-start)

(master :id 1)
;; In this case `:before 1' is unnecessary because the new node is
;; added at the head of the root node by default.
(track 440 .1 .3 :before 1)
(track 660 .15 .9 :before 1)
(stereo-test 220 .1 0 :before 1)

(free 0)

If the block size is greater than 1, it is necessary to change the strategy. The following example is a possible implementation but we can also define other utilities for custom structures (i.e. a matrix frames*channels):

(dsp! master ()
  (with ((frames (block-size)))
    (foreach-frame
      ;; Stereo output from the first blocksize*2 buses.
      (out (bus current-frame) (bus (+ frames current-frame)))
      (setf (bus current-frame) 0)
      (setf (bus (+ frames current-frame)) 0))))

(dsp! track (freq amp pos)
  (with ((frames (block-size)))
    (foreach-frame
      (foreach-channel
        (incf (bus (+ current-frame
                      (the fixnum (* frames current-channel))))
              (pan2 (sine freq amp) pos))))))

(dsp! stereo-test (freq amp (nbus fixnum))
  (with ((frames (+ nbus (block-size))))
    (declare (fixnum frames))
    (foreach-frame
      (incf (bus (+ nbus current-frame)) (sine freq amp))
      (incf (bus (+ frames current-frame)) (sine (* freq 3/2) amp)))))

(set-rt-block-size 64)
(rt-start)

(master :id 1)
(track 440 .1 .3)
(track 660 .15 .9)
(stereo-test 220 .1 0)

(free 0)
(set-rt-block-size 1)
Function: audio-in channel &optional frame

Return the value of the channel of the input buffer frame.

channel and frame are zero-based.

If audio-in is used within a VUG definition, frame is ignored.

No bounds checking.

Function: audio-out channel &optional frame

Return the value of the channel of the output buffer frame. Setfable.

channel and frame are zero-based.

If audio-out is used within a VUG definition, frame is ignored.

No bounds checking.

Function: peak-info channel

Return peak information for the zero-based channel.

No bounds checking.

Function: print-peak-info &optional channels stream

Print the peak information.

The number of the channels defaults to *number-of-output-bus-channels*.

The output stream is *logger-stream* by default.

No bounds checking.

Function: reset-peak-meters

Reset the peak meters.

Function: set-number-of-channels inputs outputs

Safe way to change the number of the input/output channels.

This setting stops the real-time thread.


Next: , Previous: , Up: The Incudine dictionary   [Contents][Index]

4.3 Buffer

Structure: buffer

Buffer type.

Variable: *sine-table*

buffer structure of size *default-table-size* with a single cycle sinusoid.

Variable: *cosine-table*

buffer structure of size *default-table-size* with a single cycle cosinusoid.

Function: make-buffer frames &key channels file offset sample-rate real-time-p initial-contents fill-function start end normalize-p

Create a new buffer with frames sample frames.

If file is non-NIL, copy the sample frames of a soundfile starting from offset sample frame.

initial-contents is used to initialize the contents of the buffer from start to end frame.

fill-function is a function used to fill the buffer from start to end frame. The function arguments are the foreign pointer to the buffer data and the buffer size (i.e. gen routines are valid functions).

If normalize-p is t, normalize the initial content of the buffer.

Set real-time-p to nil to disallow real-time memory pools.

Function: copy-buffer buffer

Return a copy of buffer.

Function: buffer-p object

Return t if object is of type buffer.

Method: free buffer

Deallocate the buffer.

Method: free-p buffer

Return t if the buffer is deallocated.

Function: buffer-data obj

Return the foreign pointer to the buffer data.

Function: buffer-size instance

Return the buffer size.

Function: buffer-frames instance

Return the number of the sample frames of the buffer.

Function: buffer-channels instance

Return the number of the channels of the buffer.

Function: buffer-sample-rate instance

Return the buffer sample rate.

Function: buffer-file instance

If the buffer is created with buffer-load or make-buffer with a non-NIL file argument, return the pathname.

Function: buffer-mask instance

If the buffer size is a power of two, return that size minus one, otherwise the returned value is

(1- (next-power-of-two (ash (buffer-size instance) -1)))
Function: buffer-lobits instance

The phase computed for a table of size +table-maxlen+ is shifted right by buffer-lobits bits to get the index for a table lookup.

Return the number of bits for the arithmetic shift operation.

Function: buffer-lodiv instance

Return the division of the buffer size by +table-maxlen+.

Function: buffer-lomask instance

Return the division of +table-maxlen+ by the buffer size, minus one.

Example: wavetable lookup oscillator with phase of type integer between 0 and +table-maxlen+. Buffer size is assumed to be a power of two.

The following DSP

(dsp! oscillator-test ((buf buffer) freq amp)
  (out (osc buf freq amp 0 :linear)))

is equivalent to

(dsp! oscillator-test ((buf buffer) freq amp)
  (with ((frac (sample 0))
         (phase 0)
         ;; Memo: *CPS2INC* is table_maxlen/sample_rate
         (phase-increment (sample->fixnum (* freq *cps2inc*)))
         (minus-lobits (- (buffer-lobits buf)))
         (index 0))
    (declare (type sample frac)
             (type fixnum phase phase-increment index)
             (type (integer #.(- +max-lobits+) 0) minus-lobits))
    (setf frac (* (buffer-lodiv buf) (logand phase (buffer-lomask buf))))
    (setf index (ash phase minus-lobits))
    (out (* amp (linear-interp frac
                  (buffer-value buf index)
                  (buffer-value buf (logand (the fixnum (1+ index))
                                            (buffer-mask buf))))))
    ;; Phase increment without branching.
    (setf phase (logand (the fixnum (+ phase phase-increment))
                        +phase-mask+))))

;; Buffer size 8192 = 2^13
(defvar *waveform* (make-buffer 8192 :fill-function (gen:partials '(1))))

(rt-start)

(oscillator-test *waveform* 440 .3)
Function: buffer-value buffer index

Return the buffer value stored at the sample frame index. Setfable.

Function: buffer-load path &key offset frames channel channels sample-rate headerless-p data-format data-location

Create a new buffer by loading the file path (string or pathname).

If path represents a sound file, load that file starting from offset sample frame (defaults to 0).

If path corresponds to a text file that contains numbers, create a buffer with that values. There is not the parsing of the numbers, a text file is valid if it contains numbers separated with spaces, tabs or newlines. It is possible to use line comments that begin with the ’;’ character.

If frames is non-NIL, create a buffer with frames sample frames.

If channel is greater than or equal to zero, load that channel (zero based) of the sound file, otherwise import all the channels (default).

The number of channels is channels or the number of channels of the sound file if channels is nil (default).

If headerless-p is t, load a headerless file with data-location in bytes (defaults to 0) and sample type data-format (defaults to “double”). See bounce-to-disk for the list of available data formats.

sample-rate is *sample-rate* by default.

Function: buffer-save buf path &key start end sample-rate textfile-p header-type data-format

Save the buffer data of buf to the file path.

start specifies an offset into the buffer and marks the beginning position of that buffer. end marks the position following the last value of the buffer.

If sample-rate is non-NIL, it replaces the sample rate of the buffer.

If textfile-p is t, save the buffer data to a text file.

header-type defaults to *default-header-type*.

data-format defaults to *default-data-format*.

See bounce-to-disk for the list of available header types and data formats.

Function: map-buffer function buffer

Destructively modifies buffer to contain the results of applying function to each buffer value. The function arguments are the index and the buffer value.

Function: map-into-buffer result-buffer function &rest buffers

Destructively modifies result-buffer to contain the results of applying function to each element in the argument buffers in turn

function is a function of as many arguments as there are buffers.

Function: resize-buffer buffer frames &optional channels

Resize buffer to frames sample frames.

If channels is non-NIL, the resized buffer is created with that number of channels.

Function: scale-buffer buffer mult

Multiply the buffer values by mult.

Function: normalize-buffer buffer value

Scale the buffer values to be between -value and value.

Function: rescale-buffer buffer min max

Rescale the buffer values to be between min and max.

Function: sort-buffer buffer

Destructively sort buffer and return it.

Method: circular-shift buffer n

Perform a circular shift of length n.

Method: quantize buffer from &key start end filter-function

Quantize buffer with respect to a real number, a vector, a buffer or tuning structure in sorted order.

The keywords start and end are the bounding index designators, and the keyword filter-function is usable to apply a function to the quantized value. The arguments of that function are the vector index and the quantized value.

Function: buffer->array buf

Create a new array of type (simple-array sample (*)) with the content of the buffer.

Function: buffer->list buf

Create a new list with the content of the buffer.

Function: fill-buffer buffer obj &key start end sndfile-start channel-map normalize-p headerless-p data-format data-location

If obj is a function, fill the buffer to contain the results of applying obj. The function arguments are the foreign pointer to the buffer data and the buffer size (i.e. gen routines are valid functions).

If obj is a list, a vector or an envelope struct, it is used to fill the buffer.

If obj is of type string or pathname, load that file. If the file is a sound file, load obj starting from sndfile-start sample frame (defaults to 0). If headerless-p is t, load a headerless file with data-location in bytes (defaults to 0) and sample type data-format (defaults to “double”). See bounce-to-disk for the list of available data formats. If obj corresponds to a text file that contains numbers, fill the buffer with that values. There is not the parsing of the numbers, a text file is valid if it contains numbers separated with spaces, tabs or newlines. It is possible to use line comments that begin with the ’;’ character.

start specifies an offset into the buffer and marks the beginning position of that buffer. end marks the position following the last value of the buffer.

channel-map is a list of lists (soundfile-channel buffer-channel) used to define the mapping between the sound file channel data and the buffer channel data. For example, channel-map ’((1 0) (0 1)) fills the first two buffer channel data with the swapped channels of a stereo sound file.

If normalize-p is t, normalize the buffer data between -1 and 1.

Macro: with-buffer (var frames &rest args) &body body

Bind var to a newly allocated buffer structure with dynamic extent during body.

frames and the other keyword arguments args are passed to make-buffer.

Macro: with-buffers bindings &body body

Create bindings to newly allocated buffer structures with dynamic extent during body.

bindings is a list of lists

(var frames &rest args)

where var is the variable bound to a buffer, frames and the other keyword arguments args are passed to make-buffer.


Next: , Previous: , Up: The Incudine dictionary   [Contents][Index]

4.4 Tuning

Structure: tuning

Tuning type.

Variable: *default-tuning*

Default tuning structure.

Function: make-tuning &key notes file description keynum-base freq-base degree-index real-time-p

Create and return a new tuning structure with optional description.

If notes is non-NIL, it is a list of pitch values that are ratios and/or floating point values (cents). The first note 1/1 (or 0.0) is implicit. This format is compatible with the Scale file format described at http://www.huygens-fokker.org/scala/scl_format.html.

If file is non-NIL, get the scale from a Scala file.

If notes and file are nil, create a 12-tone equal tempered scale.

The reference frequency freq-base, the related key number keynum-base and degree-index default to 440, 69 and 9 respectively.

Set real-time-p to nil to disallow real-time memory pools.

Function: copy-tuning tuning

Return a copy of tuning.

Method: free tuning

Deallocate the tuning.

Method: free-p tuning

Return t if the tuning is deallocated.

Function: tuning-description instance

Return the description of the tuning.

Function: tuning-cents tuning

Return the list of pitch values of the tuning in cents.

Function: tuning-ratios tuning

Return the list of pitch values of the tuning as ratios.

Function: tuning-cps tuning keynum

Return the frequency of the key number keynum in a tuning. Setfable.

Function: tuning-data obj

Return the foreign pointer to the tuning data.

Function: tuning-degree-index tuning

Return the scale degree of tuning used as reference.

Function: tuning-freq-base tuning

Return the reference frequency of tuning.

Function: tuning-keynum-base tuning

Return the key number of tuning used as reference.

Function: set-tuning tuning notes-or-file &optional description keynum-base freq-base degree-index

Change the notes and optionally the description, the reference frequency freq-base, keynum-base and degree-index of a tuning structure.

If notes-or-file is the path of a Scala file, import the notes from that file.

Function: set-tuning-reference tuning keynum-base freq-base degree-index

Change keynum-base, freq-base and degree-index used as reference to generate the frequencies of the tuning.

Function: set-tuning-from-midi obj stream &optional device-id

If obj is a tuning structure, the frequencies and the description of obj are changed with the data received from a MIDI bulk tuning dump message. If obj is a function, it is called with the program number contained in the MIDI bulk tuning message. The function has to return the tuning structure to set or nil to ignore the MIDI message. The checksum of the message is ignored.

Function: minimize-tuning-ratios tuning &optional significand-error

Try to minimize the tuning ratios by introducing an error in the significand of the floating point numbers. The error is 0.0005% by default.

Function: tuning-notes-from-data tuning start end &optional description significand-error

Compute the notes of the scale from the frequencies stored in a tuning structure, starting from the key number start and ending to the key number end. The ratio between the frequencies in start and end is the last tuning ratio. If significand-error is non-zero (default), try to minimize the tuning ratios by introducing an error (default 0.0005%) in the significand of the floating point numbers.

Function: tuning-save tuning path

Save pitch values and description of a tuning structure to the file path in Scale file format.

Function: load-sclfile path

Return the pitch values, the number of notes and the description of the scale stored in the Scala file path.

Function: cps->pch freq &optional tuning

Convert from freq cycles-per-second to pitch class value.

The tuning structure defaults to *default-tuning*.

Function: pch->cps pitch-class &optional tuning

Convert from pitch-class value to cycles-per-second. If tuning is nil, the table lookup is the same used by Csound’s cpspch opcode. If tuning is a tuning structure, pitch-class is a floating point number xx.yy[z]* where

xx  = octave number from 0 to 14
yy  = scale degree from 0 to 99
z*  = fractional part 0.z* to interpolate between yy and (+ yy 1)

Example with et12 scale:

pchcps
8.00261
8.09440
8.095453
8.10466
8.12523
9.00523
Function: keynum->pch keynum &optional tuning

Convert from key number keynum to pitch class value.

The tuning structure defaults to *default-tuning*.

Function: pch->keynum pitch-class &optional tuning

Convert from pitch-class value to key number. The second returned value is the fractional part. pitch-class is a floating point number xx.yy[z]* where

xx  = octave number from 0 to 14
yy  = scale degree from 0 to 99
z*  = fractional part 0.z* to interpolate between yy and (+ yy 1)

Note: if the returned key number is used without the fractional part, it is necessary to avoid round off problems by adding 1e-6 to pitch-class before the conversion.

Example with et12 scale:

pchkeynumfrac
8.00600.000
8.09690.000
8.10700.000
8.095690.500
8.12710.999
8.120001720.000
9.00720.000
Method: quantize tuning from &key start end filter-function

Quantize tuning with respect to a real number, a vector, a buffer or tuning structure in sorted order.

The keywords start and end are the bounding index designators, and the keyword filter-function is usable to apply a function to the quantized value. The arguments of that function are the vector index and the quantized value.


Next: , Previous: , Up: The Incudine dictionary   [Contents][Index]

4.5 Envelope

Structure: envelope

Envelope type.

Function: make-envelope levels times &key curve base loop-node release-node restart-level real-time-p

Create and return a new envelope structure from a list of levels and a list of times in seconds.

If base is a number, it is the envelope’s base in the style of clm (Common Lisp Music), where base is e^k and the curvature depends on the highest and lowest levels.

curve sets the shape of the segments; the possible values are :step, :lin or :linear (default), :exp or :exponential, :sin or :sine, :wel or :welch, :sqr or :square, :cub or :cubic, a number that represents the curvature value between two levels for all the segments or a list of the prior values to specify the curvature values for each segment. curve is ignored if base is non-NIL.

If the envelope is sustained, release-node specifies the point of the release (starting from 0). The default is -1 that means ’envelope without sustain’.

If loop-node is a non-negative value, it is the starting point of the loop of the segments during the sustain phase of the envelope. The ending point is the point that precedes the release point release-node.

If restart-level is nil (default), the envelope restarts from the current level otherwise it restarts from the value restart-level.

Set real-time-p to nil to disallow real-time memory pools.

Function: copy-envelope envelope

Return a copy of envelope.

Function: envelope-p object

Return t if object is of type envelope.

Method: free envelope

Deallocate the envelope.

Method: free-p envelope

Return t if the envelope is deallocated.

Function: envelope-data obj

Return the foreign pointer to the envelope data.

Function: envelope-duration instance

Return the duration of the envelope.

Function: envelope-points instance

Return the number of envelope points.

Function: envelope-loop-node instance

Return a non-negative value if it is the starting point of the loop of the segments during the sustain phase of the envelope.

Function: envelope-release-node instance

Return the point of the release (starting from 0) or -1 if the envelope is without sustain.

Function: envelope-restart-level instance

Return the restart level of the envelope or nil if it is the value of the level before to restart. Setfable.

Function: envelope-base->curves base levels

Return the list of curvature values for the curve keyword in make-envelope related to an envelope’s base in the style of clm.

Function: edit-envelope &optional-key env levels times linen perc cutoff asr adsr dadsr peak-level curve base loop-node release-node restart-level

Edit an envelope structure.

If levels is non-NIL, change the list of levels and the list of times.

curve sets the shape of the segments; the possible values are :step, :lin or :linear, :exp or :exponential, :sin or :sine, :wel or :welch, :sqr or :square, :cub or :cubic, a number that represents the curvature value between two levels for all the segments or a list of the prior values to specify the curvature values for each segment. curve is ignored if base is non-NIL.

If the envelope is sustained, release-node specifies the point of the release (starting from 0). -1 means ’envelope without sustain’.

If loop-node is a non-negative value, it is the starting point of the loop of the segments during the sustain phase of the envelope. The ending point is the point that precedes the release point release-node.

linen is nil or a list (attack-time sustain-time release-time). curve defaults to :linear.

perc is nil or a list (attack-time release-time). curve defaults to -4.

cutoff is nil or the release time. curve defaults to :exponential and release-node is 0.

asr is nil or the list (attack-time sustain-level release-time). curve and release-node default to -4 and 1 respectively.

adsr is nil or the list (attack-time decay-time sustain-level release-time). curve and release-node default to -4 and 2 respectively. sustain-level is a ratio of peak-level.

dadsr is nil or the list (delay-time attack-time decay-time sustain-level release-time). curve and release-node default to -4 and 3 respectively. sustain-level is a ratio of peak-level.

peak-level is the peak level (1 by default) when levels and asr are nil.

If restart-level is nil, the envelope restarts from the current level otherwise it restarts from the value restart-level.

Function: envelope-level env node-number

Return the level of the envelope env at node-number. Setfable.

Function: envelope-time env node-number

Return the time of the envelope env at node-number. Setfable.

Function: envelope-curve env node-number

Return the curvature of the envelope env at node-number. Setfable.

Function: set-envelope-base env base

Set the curvature of the envelope in the style of clm, where base is e^k and the curvature depends on the highest and lowest levels.

Function: envelope-at env time

Return the level of the envelope env at time time.

Function: scale-envelope env mult

Multiply the levels of the envelope by mult.

Function: normalize-envelope env value

Scale the levels of the envelope to be between -value and value.

Function: rescale-envelope env min max

Rescale the levels of the envelope to be between min and max.

Function: breakpoints->env bp-seq &key curve base scaler offset duration loop-node release-node restart-level real-time-p

Create and return a new envelope from a sequence of break-point pairs.

If base is a number, it is e^k and the curvature depends on the highest and lowest levels.

If scaler is non-NIL, the levels of the envelope are scaled by that value.

If offset is non-NIL, it is the value added to the levels of the envelope.

If duration is non-NIL, it is the duration of the envelope in seconds.

curve sets the shape of the segments; the possible values are :step, :lin or :linear (default), :exp or :exponential, :sin or :sine, :wel or :welch, :sqr or :square, :cub or :cubic, a number that represents the curvature value between two levels for all the segments or a list of the prior values to specify the curvature values for each segment. curve is ignored if base is non-NIL.

If the envelope is sustained, release-node specifies the point of the release (starting from 0). The default is -1 that means ’envelope without sustain’.

If loop-node is a non-negative value, it is the starting point of the loop of the segments during the sustain phase of the envelope. The ending point is the point that precedes the release point release-node.

If restart-level is nil (default), the envelope restarts from the current level otherwise it restarts from the value restart-level.

Set real-time-p to nil to disallow real-time memory pools.

Function: freq-breakpoints->env bp-seq &key freq-max curve base real-time-p

Create and return a new envelope from a sequence of break-point pairs interpreted as frequency response.

freq-max is the highest frequency and defaults to the half of *sample-rate*.

If base is a number, it is e^k and the curvature depends on the highest and lowest levels.

curve sets the shape of the segments; the possible values are :step, :lin or :linear (default), :exp or :exponential, :sin or :sine, :wel or :welch, :sqr or :square, :cub or :cubic, a number that represents the curvature value between two levels for all the segments or a list of the prior values to specify the curvature values for each segment. curve is ignored if base is non-NIL.

Set real-time-p to nil to disallow real-time memory pools.

Function: make-linen attack-time sustain-time release-time &key level restart-level real-time-p

Create and return a new envelope structure with peak level and a straight line rise and decay pattern by default.

Function: make-perc attack-time release-time &key level curve base restart-level real-time-p

Create and return a new envelope structure with peak level, attack-time and release-time.

The curvature curve defaults to -4.

Function: make-cutoff release-time &key level curve base restart-level real-time-p

Create and return a new envelope structure with peak level and release-time.

The curvature curve defaults to :exponential.

Function: make-asr attack-time sustain-level release-time &key curve base restart-level real-time-p

Create and return a new envelope structure with attack-time, sustain-level and release-time.

The curvature curve defaults to -4.

Function: make-adsr attack-time decay-time sustain-level release-time &key peak-level curve base restart-level real-time-p

Create and return a new envelope structure with attack-time, peak-level, decay-time, sustain-level and release-time.

peak-levels defaults to 1.

sustain-level is a ratio of peak-level for compatibility with Env.adsr in SuperCollider.

The curvature curve defaults to -4.

Other available keyword arguments are base, restart-level and real-time-p. See make-envelope for details.

Function: make-dadsr delay-time attack-time decay-time sustain-level release-time &key peak-level curve base restart-level real-time-p

Create and return a new envelope structure with delay-time, attack-time, peak-level, decay-time, sustain-level and release-time.

peak-levels defaults to 1.

sustain-level is a ratio of peak-level for compatibility with Env.adsr in SuperCollider.

The curvature curve defaults to -4.

Other available keyword arguments are base, restart-level and real-time-p. See make-envelope for details.


4.6 Time

Structure: tempo

Tempo type.

Function: make-tempo value &optional unit

Create and return a new tempo structure.

unit is :bpm (default), :spb or :bps to set the tempo value in beats per minute, seconds per beat or beats per second respectively.

Function: tempo-p object

Return t if object is of type tempo.

Variable: *tempo*

Default tempo structure.

The value is initially *default-bpm* beats per minute.

Function: bpm tempo

Return the tempo in beats per minute. Setfable.

Function: bps tempo

Return the tempo in beats per second. Setfable.

Function: spb tempo

Return the tempo in seconds per beat. Setfable.

Structure: tempo-envelope

Temporal envelope type.

Function: make-tempo-envelope bpms beats &key curve loop-node release-node restart-level real-time-p

Create and return a new tempo-envelope structure from a list of tempo values in beats per minute and a list of times in beats.

curve sets the shape of the segments; the possible values are :step, :lin or :linear (default), :exp or :exponential, :sin or :sine, :wel or :welch, :sqr or :square, :cub or :cubic, a number that represents the curvature value between two levels for all the segments or a list of the prior values to specify the curvature values for each segment. curve is ignored if base is non-NIL.

If the envelope is sustained, release-node specifies the point of the release (starting from 0). The default is -1 that means ’envelope without sustain’.

If loop-node is a non-negative value, it is the starting point of the loop of the segments during the sustain phase of the envelope. The ending point is the point that precedes the release point release-node.

If restart-level is nil (default), the envelope restarts from the current level otherwise it restarts from the value restart-level.

Set real-time-p to nil to disallow real-time memory pools.

Function: tempo-envelope-p object

Return t if object is of type tempo-envelope.

Function: copy-tempo-envelope tenv

Return a copy of a tempo-envelope structure.

Method: free obj

Deallocate the tempo or tempo-envelope instance.

Method: free-p obj

Return t if the tempo or tempo-envelope instance is deallocated.

Function: set-tempo-envelope env bpms beats &key curve loop-node release-node restart-level

Change a tempo-envelope structure.

bpms is a list of tempo values in beats per minute.

beats is a list of times in beats.

curve sets the shape of the segments; the possible values are :step, :lin or :linear (default), :exp or :exponential, :sin or :sine, :wel or :welch, :sqr or :square, :cub or :cubic, a number that represents the curvature value between two levels for all the segments or a list of the prior values to specify the curvature values for each segment. curve is ignored if base is non-NIL.

If the envelope is sustained, release-node specifies the point of the release (starting from 0). The default is -1 that means ’envelope without sustain’.

If loop-node is a non-negative value, it is the starting point of the loop of the segments during the sustain phase of the envelope. The ending point is the point that precedes the release point release-node.

If restart-level is nil (default), the envelope restarts from the current level otherwise it restarts from the value restart-level.

Function: tempo-breakpoints tempo-env &key transition-time-step

Return a list of {beats bpm} break-point pairs obtained from a tempo-envelope structure.

If the curve of a transition is not :step, transition-time-step is the time in beats between adjacent points during that transition.

transition-time-step defaults to 1/8.

Function: bpm-at tempo-env beats

Return the tempo in beats per minute of a tempo-envelope structure at time beats.

Function: bps-at tempo-env beats

Return the tempo in beats per second of a tempo-envelope structure at time beats.

Function: spb-at tempo-env beats

Return the tempo in seconds per beat of a tempo-envelope structure at time beats.

Function: beats->seconds tempo-env beats &optional offset

Convert the time from number of beats to seconds by following a tempo-envelope structure, starting from offset beats (zero by default).

Function: seconds->beats tempo-env seconds &optional offset

Convert the time from seconds to number of beats by following a tempo-envelope structure, starting from offset seconds (zero by default).

The returned time in beats is always precise if the segments of the envelope have shapes :step, :linear, :exponential, :square or :cubic. It is approximated during the transitions between two BPM’s if the curvatures are sinusoidal, Welch or custom.

Function: now

Return the current time in samples.

Macro: with-local-time (&key start) &body body

Use a local counter during body.

start is the initial time in samples and defaults to zero.

The function now is setfable to change the time, for example:

(with-local-time
  (loop repeat 8 collect (incf (now))))
;; => (1.0d0 2.0d0 3.0d0 4.0d0 5.0d0 6.0d0 7.0d0 8.0d0)
Function: tempo-sync period

Get the time synchronized to period samples. It is equivalent to

(- (+ (now) period) (mod (now) period))
Function: timestamp

Return a double float value for the current time of day in universal time format.

Macro: enable-sharp-square-bracket-syntax

Enable the reader syntax #[…] to enter the time in samples by using different units, and to begin and end a string as an alternative to double-quote. The syntax is

#[number unit]

#[number-of-beats b.*]

#[number-of-beats b.* tempo]

#[number-of-beats b.* tempo-envelope offset-in-beats]

#[[text]]

The number of beats depends on a tempo or tempo-envelope structure. The default is *tempo*.

The possible units are:

unitthe symbol starts withexamples
samplesasa, samp, samps, samples
millisecondmsms, msec
secondss, sec, seconds
minutemimi, min, minutes
hourhh, hours
daydd, days
weekww, weeks
beatbb, beats
metermm, meters

The number of meters depends on the velocity of the sound in m/s at 22 degrees Celsius, 1 atmosfera (the default is *sound-velocity*).


4.7 Foreign Array

Macro: incudine.util:with-foreign-array (var type &optional count) &body body

Bind var to a newly allocated foreign array of type type and size count with dynamic extent during body.

Macro: incudine.util:with-samples bindings &body body

Create new variable bindings to sample values by allocating foreign memory with dynamic extent during body.

With the exception of the initializations of VUG, UGEN or DSP instances, with-samples performs the bindings in parallel.

Within the definition of a VUG, UGEN or DSP,

(with-samples ((var0 form0) (var1 form1) ... (varN formN)) ...)

is equivalent to

(with ((var0 form0) (var1 form1) ... (varN formN))
  (declare (type sample var0 var1 ... varN))
  ...)
Macro: incudine.util:with-samples* bindings &body body

Create new variable bindings to sample values by allocating foreign memory with dynamic extent during body.

with-samples* performs the bindings sequentially.

Function: incudine.util:i8-ref ptr &optional index

Access the foreign array element of type :int8 specified by index. Setfable.

Function: incudine.util:i16-ref ptr &optional index

Access the foreign array element of type :int16 specified by index. Setfable.

Function: incudine.util:i32-ref ptr &optional index

Access the foreign array element of type :int32 specified by index. Setfable.

Function: incudine.util:i64-ref ptr &optional index

Access the foreign array element of type :int64 specified by index. Setfable.

Function: incudine.util:u8-ref ptr &optional index

Access the foreign array element of type :uint8 specified by index. Setfable.

Function: incudine.util:u16-ref ptr &optional index

Access the foreign array element of type :uint16 specified by index. Setfable.

Function: incudine.util:u32-ref ptr &optional index

Access the foreign array element of type :uint32 specified by index. Setfable.

Function: incudine.util:u64-ref ptr &optional index

Access the foreign array element of type :uint64 specified by index. Setfable.

Function: incudine.util:f32-ref ptr &optional index

Access the foreign array element of type :float specified by index. Setfable.

Function: incudine.util:f64-ref ptr &optional index

Access the foreign array element of type :double specified by index. Setfable.

Function: incudine.util:ptr-ref ptr &optional index

Access the foreign array element of type :pointer specified by index. Setfable.

Function: incudine.external:foreign-set ptr c size

Fills the first size bytes of the foreign memory area pointed to by ptr with the byte C.

Return the pointer to the memory area ptr.

Function: incudine.external:foreign-copy dest src bytes

Copy bytes bytes from foreign memory area src to foreign memory area dest. The memory areas must not overlap.

Function: incudine.external:foreign-copy-samples dest src size

Copy size samples from foreign memory area src to foreign memory area dest. The memory areas must not overlap.

Function: incudine.external:foreign-zero-sample ptr size

Set the first size samples of the area starting at ptr to zero.


4.8 Memory Management

Generic Function: free obj

Deallocate the object obj.

Generic Function: free-p obj

Return t if the object obj is deallocated.


4.8.1 Foreign Memory

Function: incudine.external:foreign-alloc-sample size

Allocate enough foreign memory to hold size samples.

Function: incudine.util:foreign-realloc ptr type &key zero-p initial-element initial-contents count

Change the size of the memory block pointed to by ptr to hold count objects of type type. If zero-p is t, the memory is initialized with zeros. If initial-element is supplied, each element of the newly reallocated memory is initialized with its value. If initial-contents is supplied, each of its elements will be used to initialize the contents of the newly reallocated memory.

Function: incudine.util:get-nrt-memory-max-size

Return the maximum size of the foreign memory pool used to allocate temporary foreign arrays from any non-real-time thread.

Function: incudine.util:get-nrt-memory-free-size

Return the number of bytes that can be allocated from the foreign memory pool used to allocate temporary foreign arrays from any non-real-time thread.

Function: incudine.util:get-nrt-memory-used-size

Return the number of bytes allocated from the foreign memory pool used to allocate temporary foreign arrays from any non-real-time thread.


4.8.1.1 Allocation in Realtime Thread

Variable: incudine.util:*allow-rt-memory-pool-p*

Whether the foreign memory pool is usable from the real-time thread.

Function: incudine.util:allow-rt-memory-p

Return t if the current thread is the real-time thread and the related foreign memory pool is usable.

Function: incudine.util:foreign-rt-alloc type &key zero-p initial-element initial-contents count

Allocate enough memory to hold count objects of type type. If zero-p is t, the memory is initialized with zeros. If initial-element is supplied, each element of the newly allocated memory is initialized with its value. If initial-contents is supplied, each of its elements will be used to initialize the contents of the newly allocated memory.

This function has to be called from the real-time thread.

Function: incudine.util:foreign-rt-realloc ptr type &key zero-p initial-element initial-contents count

Change the size of the memory block pointed to by ptr to hold count objects of type type. If zero-p is t, the memory is initialized with zeros. If initial-element is supplied, each element of the newly reallocated memory is initialized with its value. If initial-contents is supplied, each of its elements will be used to initialize the contents of the newly reallocated memory.

This function has to be called from the real-time thread.

Function: incudine.util:foreign-rt-free ptr

Free ptr previously allocated by foreign-rt-alloc.

This function has to be called from the real-time thread.

Function: incudine.util:safe-foreign-rt-free ptr

Call foreign-rt-free from the real-time thread.

Function: incudine.util:get-rt-memory-max-size

Return the maximum size of the foreign memory pool used from the real-time thread.

Function: incudine.util:get-rt-memory-free-size

Return the the number of bytes that can be allocated from the foreign memory pool used from the real-time thread.

Function: incudine.util:get-rt-memory-used-size

Return the number of bytes allocated from the foreign memory pool used from the real-time thread.

Function: incudine.util:get-foreign-sample-max-size

Return the maximum size of the foreign memory pool used to allocate arrays of samples in DSP and UGEN instances from the real-time thread.

Function: incudine.util:get-foreign-sample-free-size

Return the number of bytes that can be allocated from the foreign memory pool used to allocate arrays of samples in DSP and UGEN instances from the real-time thread.

Function: incudine.util:get-foreign-sample-used-size

Return the number of bytes allocated from the foreign memory pool used to allocate arrays of samples in DSP and UGEN instances from the real-time thread.


4.8.2 Finalization

Macro: with-cleanup &body body

All the objects with finalizations arranged by incudine-finalize and method incudine:free instantiated within body are invalid beyond the dynamic extent of body.

Macro: without-cleanup &body body

Used inside the body of with-cleanup to ignore the dynamic finalizers during body.

Function: dynamic-incudine-finalizer-p

Return t within the dynamic extend of with-cleanup.

Function: incudine-finalize obj function &optional dynamic-p

Arrange for the designated function to be called when there are no more references to obj, including references in function itself.

If dynamic-p is nil, the object is valid outside with-cleanup.

Function: incudine-cancel-finalization obj

Cancel all finalizations arranged for obj.


4.8.3 Cons Pool

Structure: incudine.util:cons-pool

Cons pool type.

Function: incudine.util:make-cons-pool &key data size expand-function grow

Create and return a new cons-pool structure initialized with the list data or a list of length size (128 by default).

If expand-function is a function of one argument, the pool, it is called to add new conses to the pool if necessary. See also expand-cons-pool.

The pool is incremented by grow if more conses are required. grow defaults to 128.

Macro: incudine.util:cons-pool-pop-cons pool

Get a cons cell from pool.

Macro: incudine.util:cons-pool-push-cons pool cons

Return the cons cell to the pool.

Macro: incudine.util:cons-pool-pop-list pool list-size

Get a list of length list-size from pool.

Macro: incudine.util:cons-pool-push-list pool list

Return the list to the pool.

Function: incudine.util:cons-pool-size instance

Return the cons pool size.

Macro: incudine.util:expand-cons-pool pool delta &optional new-form

If delta is a number, add delta cons cells to the pool. If delta is nil, the pool size is incremented by the value specified with make-cons-pool.

new-form is evaluated to set the car of a cons.


4.8.3.1 Realtime Cons Pool

Function: incudine.util:rt-global-pool-pop-cons

Return a preallocated cons cell.

This function has to be called from the real-time thread.

Function: incudine.util:rt-global-pool-push-cons cons

Return the cons cell to the global pool.

This function has to be called from the real-time thread.

Function: incudine.util:rt-global-pool-pop-list list-size

Return a preallocated list of length list-size.

This function has to be called from the real-time thread.

Function: incudine.util:rt-global-pool-push-list lst

Return the list to the global pool.

This function has to be called from the real-time thread.


Next: , Previous: , Up: Cons Pool   [Contents][Index]

4.8.3.2 Non-Realtime Cons Pool

Function: incudine.util:nrt-global-pool-pop-cons

Return a preallocated cons cell.

This function has to be called from any non-real-time thread.

Function: incudine.util:nrt-global-pool-push-cons cons

Return the cons cell to the global pool.

This function has to be called from any non-real-time thread.

Function: incudine.util:nrt-global-pool-pop-list list-size

Return a preallocated list of length list-size.

This function has to be called from any non-real-time thread.

Function: incudine.util:nrt-global-pool-push-list lst

Return the list to the global pool.

This function has to be called from any non-real-time thread.


4.8.3.3 Tlist

Function: incudine.util:make-tlist pool

Get a cons cell from pool and return an empty tlist.

Function: incudine.util:tlist-empty-p tl

Returns t if tl is the empty tlist; otherwise, returns nil.

Function: incudine.util:tlist-add-left tl obj pool

Get a cons cell from the cons pool and add obj to the left of the tlist tl.

Function: incudine.util:tlist-add-right tl obj pool

Get a cons cell from the cons pool and add obj to the right of the tlist tl.

Function: incudine.util:tlist-left tl

Return the left element of the tlist tl.

Function: incudine.util:tlist-remove-left tl pool

Remove the left element of the tlist tl and return it.

Return the cons cell to the cons pool.

Function: incudine.util:tlist-right tl

Return the right element of the tlist tl.


Next: , Previous: , Up: Memory Management   [Contents][Index]

4.8.4 Foreign Pool

Function: incudine.external:init-foreign-memory-pool size ptr

Initialize the foreign memory pool of size size pointed to by ptr.

Example:

;; Pool size of 10 MB
(define-constant +mem-pool-size+ (* 10 1024 1024))

(defvar *mem-pool* (cffi:foreign-alloc :char :count +mem-pool-size+))
(declaim (type foreign-pointer *mem-pool*))

(incudine.external:init-foreign-memory-pool +mem-pool-size+ *mem-pool*)
Function: incudine.external:destroy-foreign-memory-pool pool

Destroy the foreign memory pool pointed to by pool.

Function: incudine.external:foreign-alloc-ex size pool

Allocate size bytes from the foreign memory pool and return a pointer to the allocated memory.

Function: incudine.external:foreign-realloc-ex ptr size pool

Change the size of the foreign memory block of pool to size bytes.

Return a pointer to the newly allocated memory.

Function: incudine.external:foreign-free-ex ptr pool

Free ptr previously allocated by foreign-alloc-ex.

Function: incudine.external:get-foreign-max-size pool

Return the maximum size of the foreign memory pool.

Function: incudine.external:get-foreign-used-size pool

Return the number of bytes allocated from the foreign memory pool.


4.8.5 Consing

Function: incudine.util:get-bytes-consed-in time

Rough estimate of the bytes consed in time seconds.


4.9 Realtime

Variable: incudine.util:*block-size-hook*

A list of function designators which are called in an unspecified order when the block size is changed via set-rt-block-size.

Macro: set-rt-block-size value

Change the block size, update the default realtime loop callback and run the hook incudine.util:*block-size-hook*.

This setting stops the real-time thread.

Function: set-max-buffer-size value

Safe way to set the maximum number of frames per period (not used in PortAudio).

This setting stops the real-time thread during the change.

See also the configuration variable *max-buffer-size*.

Macro: rt-loop-callback block-size

Return a real-time loop callback with an arbitrary block-size.

Function: rt-silent-errors silent-p

If silent-p is nil, display jack error messages.

Function: rt-start &rest args &key cpu preamble-function thread-name thread-function thread-function-args after-stop-function gc-p

Create the real-time thread named thread-name and return :started if no error has occured.

Call init to initialize Incudine if necessary.

If cpu is non-NIL, it is the zero-based number of cpu reserved for the real-time thread. The thread affinities of the other threads are reverted during rt-stop if they are unchanged in the meanwhile.

cpu defaults to the configuration variable *rt-cpu*.

preamble-function is called before to create the thread. By default it starts the auxiliary non-real-time threads and set the client name.

thread-name defaults to “audio-rt-thread”.

thread-function is called on the arguments thread-function-args for the initialisation and to call the real-time loop callback.

after-stop-function is called by rt-stop and it terminates the audio loop by default.

If gc-p is t (default), initiate a garbage collection before to create the thread.

Function: rt-stop

Stop the real-time thread and return :stopped.

Function: rt-status

Real-time thread status. Return :started or :stopped.

Variable: *rt-thread-start-hook*

A list of function designators which are called in an unspecified order when the real-time thread starts.

Variable: *rt-thread-exit-hook*

A list of function designators which are called in an unspecified order when the real-time thread exits.

Function: rt-cpu

Return the zero-based number of cpu reserved for the real-time thread. Setfable.

Function: recover-suspended-audio-cycles-p

Whether the audio cycles suspended during gc are recovered by processing the cached audio inputs and MIDI events (audio outputs are ignored). Setfable.

If nil, the time is not incremented after gc, therefore the old scheduled functions are delayed by the garbage collection time.

The default is the value of the configuration variable *recover-suspended-audio-cycles-p*, or nil if that variable is not set.

Function: rt-buffer-size

Return the number of frames passed to the real-time callback function. Setfable for Jack audio after rt-start if the value is not greater than the maximum size for Incudine. See also incudine:set-max-buffer-size.

Function: rt-sample-rate

Return the sample rate of the real-time audio system.

Function: rt-xruns &optional reset-p

Return the number of the occurred xruns and the time in samples of the last xrun. If reset-p is non-NIL, set the number of xruns to zero.

Function: rt-time-offset &optional time-unit

Return the time from the start of the current real-time process cycle.

time-unit is frames or seconds (default).

Example:

;;; How to fix a relative OSC time in real-time thread.

(in-package :scratch)

(rt-start)

(defvar *oscout* (osc:open :direction :output))

(defun osc-test (time)
  (let ((os (rt-time-offset)))
    ;; osc-time is (+ (timestamp) os .3)
    (osc:simple-bundle *oscout* (+ os .3) "/time/test" "d" os)
    (aat (+ time #[1/3 s]) #'osc-test it)
    (nrt-msg info "~A" os)))

(setf (logger-level) :info)
(rt-eval () (osc-test (now)))

(flush-pending)
(rt-stop)
Function: incudine.external:rt-cycle-start-time

Return the time in samples of the start of the current real-time process cycle.

Function: incudine.external:rt-client

Return the foreign pointer to the jack client or PortAudio stream.

Macro: incudine.util:rt-eval (&key return-value-p) &body form

Evaluate form in real-time thread.

If return-value-p is t, return the results of form.

Function: incudine.util:rt-thread-p

Return t if the current thread is the real-time thread.

Variable: incudine.util:*rt-thread*

Real-time thread or nil.

Variable: incudine.util:*nrt-thread*

Non-real-time thread or nil.

Variable: incudine.util:*fast-nrt-thread*

Fast-non-real-time thread or nil.

The fast-non-real-time thread is used for fast communication with the real-time thread.

Variable: incudine.util:*rt-priority*

Priority of the real-time thread.

Variable: incudine.util:*nrt-priority*

Priority of the non-real-time thread.

Variable: incudine.util:*fast-nrt-priority*

Priority of the fast non-real-time thread.


Up: Realtime   [Contents][Index]

4.9.1 Receiver

Structure: responder

Responder type.

Function: make-responder stream function

Create and return a responder for stream.

function is added to the list of receiver-functions called whenever there is input available from stream.

If stream is a MIDI input stream, the function requires one, three or four arguments:

(func stream)
(func status-byte data-byte-1 data-byte-2)
(func status-byte data-byte-1 data-byte-2 stream)
(func status-byte data-byte-1 data-byte-2 &optional stream)
(func &rest arguments)

If stream is a net:input-stream, the function takes the stream as argument.

If stream is a cl:input-stream, the function takes the value returned by the read-function passed to recv-start.

Macro: make-osc-responder stream address types function

Create and return a responder for a osc:input-stream that responds to an OSC message with address and types.

Note: the receiver reads the OSC messages from an OSC bundle too, therefore an OSC bundle doesn’t require a specific responder. See osc:receive and osc:message-time for details.

function is added to the list of receiver-functions for stream.

The function takes the OSC values as arguments.

Example:

(make-osc-responder *oscin* "/osc/test" "iii"
                    (lambda (a b c)
                      (msg warn "~D ~D ~D" a b c)))
Function: add-responder resp

Add the function of the responder resp to the list of the receiver-functions.

Function: remove-responder resp

Remove the function of the responder resp from the list of the receiver-functions.

Function: all-responders stream

Return the list of the responders for stream.

Function: remove-all-responders &optional stream

Remove the responders for stream or all the responders if stream is nil.

Structure: receiver

Receiver type.

Function: receiver stream

Return the receiver related to stream if it exists. Otherwise, return nil.

Function: receiver-stream obj

Return the input stream of a receiver.

Function: remove-receiver stream

Remove the receiver related to stream.

Function: all-receivers

Return the list of the receivers.

Function: remove-all-receivers

Remove all the receivers.

Function: recv-functions stream

Return the list of the receiver-functions called whenever there is input available from stream.

Generic Function: recv-start stream &key priority update-midi-table-p timeout read-function

Start receiving from stream.

priority is the priority of the receiver-thread that defaults to *receiver-default-priority*.

If update-midi-table-p is t (default), update the MIDI table used by DSP and UGEN instances.

PortMidi receiver is started with polling timeout that defaults to *midi-input-timeout*.

If stream is a cl:input-stream, the required read-function is the function of one argument used to read from the stream. This function returns the value passed to the responders of stream. If an end of file occurs, the receiver is stopped.

Generic Function: recv-stop stream

Stop receiving from stream.

Function: recv-status stream

Receiver status for stream. Return :running, :stopped or :unknown.


4.10 Multithreaded Synchronization


4.10.1 Lock-Free FIFO

Function: nrt-funcall function

Use a lock-free fifo to run function from “audio-nrt-thread”.

This function has to be called from the real-time thread. See also rt-funcall.

Example:

(in-package :scratch)

(rt-start)

(rt-eval ()
  ;; From rt-thread to nrt-thread.
  (nrt-funcall
    (lambda ()
      (msg warn "[~A] sleeping..."
           (bt:thread-name (bt:current-thread)))
      ;; Block in nrt-thread.
      (sleep 1)
      (msg warn "[~A] ... and real-time funcall"
           (bt:thread-name (bt:current-thread)))
      (rt-funcall
        (lambda ()
          ;; From rt-thread to nrt-thread.
          (nrt-funcall
            (lambda ()
              (msg warn "hello from ~S."
                   (bt:thread-name (bt:current-thread))))))))))
;; => WARN: [audio-nrt-thread] sleeping...
;;    WARN: [audio-nrt-thread] ... and real-time funcall
;;    WARN: hello from "audio-nrt-thread".
Function: fast-nrt-funcall function

Use a lock-free fifo to run function from “audio-fast-nrt-thread”.

This function has to be called from the real-time thread. See also fast-rt-funcall.

Function: rt-funcall function

Use a lock-free fifo to run function from the real-time thread.

This function has to be called from “audio-nrt-thread”. See also nrt-funcall.

Function: fast-rt-funcall function

Use a lock-free fifo to run function from the real-time thread.

This function has to be called from “audio-fast-nrt-thread”. See also fast-nrt-funcall.

Macro: incudine.util:barrier (kind) &body body

See documentation for sb-thread:barrier.

Macro: incudine.util:compare-and-swap place old new

See documentation for sb-ext:compare-and-swap.


4.10.2 Spinlock Support

Structure: incudine.util:spinlock

Spinlock type.

Function: incudine.util:make-spinlock &optional name

Create and return a spinlock with optional name.

Function: incudine.util:spinlock-name instance

The name of the spinlock. Setfable.

Function: incudine.util:acquire-spinlock spinlock

Acquire the spinlock.

Function: incudine.util:try-acquire-spinlock spinlock

Return nil if the spinlock was already locked. Otherwise, acquire the spinlock and return t.

Example:

(defun do-something-out-of-audio-thread (lock)
  (incudine.util:with-spinlock-held (lock)
    (do-something)))

(defun maybe-do-something-in-audio-thread (lock)
  (let ((ret nil))
    (unwind-protect
         (progn
           ;; TRY-ACQUIRE-SPINLOCK is lock-free.
           (setf ret (incudine.util:try-acquire-spinlock lock))
           (if ret
               (do-something)
               (nrt-funcall #'do-something-out-of-audio-thread)))
      (if ret (incudine.util:release-spinlock lock)))))

(at time #'maybe-do-something-in-audio-thread spinlock)
Function: incudine.util:release-spinlock spinlock

Release the spinlock.

Macro: incudine.util:with-spinlock-held (spinlock) &body body

Acquire spinlock for the dynamic scope of body.


4.11 Scheduling

Function: at time function &rest arguments

Schedule function to be called with the supplied arguments from the real-time thread at time samples.

Macro: aat time function &rest arguments

Like at, except bind the time to it for the scope of the rest of the arguments.

Example:

(defun simple-test (time)
  (set-controls 1 :freq (+ 100 (random 1000)))
  (aat (+ time #[1 beat]) #'simple-test it))
Macro: with-schedule &body body

Fast way to schedule multiple events in realtime without an extensive use of memory barriers and/or cas. It fills a temporary queue in non-realtime, then it pours the content of the queue on the realtime edf heap.

The temporary queue introduces a generally unspecified latency. If the first form in body is a list

(:start-time value-form)

value-form is the absolute time offset in samples of the first scheduled event if

(>= value-form (+ (now) latency))

If it is necessary to change the start-time within body, the specification is

(:start-time initial-value-form variable)

In this case, a variable is bound to a time-getter function. It is a function because the computation occurs in rt-thread.

Examples:

(with-schedule
  (:start-time (tempo-sync #[4 beats]))
  ...)

(with-schedule
  (:start-time (incudine.edf:next-time #'phrase-7))
  ...)

(with-schedule
  (:start-time 0 start)
  ;; Initially, the variable START is `(lambda () 0)'
  ...
  (setf start (lambda () (tempo-sync #[1 b])))
  ...)

The sample counter is zero and read-only inside with-schedule:

(with-schedule (incf (now)) (princ (now)))
;; => 0.0d0

However, we can require a SETFable local counter:

(with-schedule (with-local-time () (incf (now)) (princ (now))))
;; => 1.0d0
Function: unschedule-if test

Cancel the scheduled events that satisfy the test.

The function test takes three arguments: time in samples, function and function arguments of a scheduled event.

Example:

;; Cancel the events with function PLAY-FUNCTION (i.e. scheduled
;; from a sequencer during the playback and cancelled after stop).
(unschedule-if
  (lambda (time function args)
    (declare (ignore time args))
    ;; Warning: it returns NIL if PLAY-FUNCTION is an inlined function.
    (eq function #'play-function)))
Function: flush-pending &optional time-step

If time-step is nil (default), cancel all the scheduled events. If time-step is a number, the evaluation of a pending event is forced every time-step samples.

Function: flush-all-fifos

Clear the buffers of the real-time FIFO’s.


4.11.1 Earliest Deadline First Scheduling

Structure: incudine.edf:node

Heap node type.

Function: incudine.edf:make-node

Create and return a new heap node structure.

Structure: incudine.edf:heap

Heap type.

Variable: incudine.edf:*heap*

Default edf heap.

Variable: incudine.edf:*heap-size*

Max number of scheduled events. It is assumed to be a power of two.

Function: incudine.edf:make-heap &optional size

Create and return a new heap structure to schedule at maximum size events.

size defaults to heap-size.

Function: incudine.edf:heap-empty-p

Whether the edf heap is empty.

Function: incudine.edf:heap-count

Return the number of entries in the edf heap.

Constant: incudine.edf:+root-node+

Integer identifier for the root node of the edf heap.

Function: incudine.edf:schedule-at time function args

Schedule function to be called with the supplied arguments at time samples.

Macro: incudine.edf:sched-loop

Earliest Deadline First scheduling loop to call the functions scheduled at the current time.

Function: incudine.edf:next-time &optional function start-time

Return the time in samples of the next scheduled function, starting its search at start-time (zero by default). Otherwise, return zero if the searched event is not available.

If function is nil (default), return the time of the next scheduled event.

Example:

;; The bass line is synchronized with the next drum pattern.
;; Note: the time is more reliable from rt-thread.
(rt-eval ()
  (at (incudine.edf:next-time #'drum-pattern) #'bass-line ...))
Function: incudine.edf:last-time

Return the time in samples of the last scheduled function to call.

Function: incudine.edf:add-flush-pending-hook function

Regiter a hook function to be run when flush-pending is called.

Function: incudine.edf:remove-flush-pending-hook function

Unregister the flush-pending hook function.

Function: incudine.edf:reduce-heap-pool

Reset the heap-pool size to the value of the configuration variable *edf-heap-pool-size*.


4.12 DSP Graph

Structure: node

Node type.

Function: node id

Return the node with integer identifier id.

Function: node-p object

Return t if object is of type node.

Variable: *root-node*

The root node of the node tree.

Function: node-id instance

Return the integer identifier of the node or nil if the node is null.

Function: node-name instance

Return the name of the node.

Function: live-nodes

Return the number of live nodes.

Method: free node

Deallocate the node.

node is a node structure or the integer identifier of the node.

Function: node-free-all

Free all the nodes.

Function: null-node-p obj

Return t if the node is null.

Function: node-gain obj

Return the current value of the node-gain. Setfable.

Function: node-enable-gain-p instance

Return t if node output is enabled. Setfable.

Variable: *node-enable-gain-p*

Whether node output is enabled for all the nodes.

Function: node-fade-time obj

Return the duration of the fade in/out of the node output. Setfable.

Variable: incudine.util:*fade-time*

Default fade-time.

Function: node-fade-curve obj

Return the curve of the envelope structure used to fade in/out the node output. Setfable.

Variable: incudine.util:*fade-curve*

Default curve of the envelope structure used for fade in/out.

Function: node-fade-in obj &optional duration curve

If *node-enable-gain-p* is t or node-enable-gain-p returns t, change the node-gain from 0 to 1 in duration or node-fade-time seconds.

The fade curve is the curve of an envelope structure or nil to use the curve returned by node-fade-curve.

Function: node-fade-out obj &optional duration curve

If *node-enable-gain-p* is t or node-enable-gain-p returns t, change the node-gain from the current value to zero in duration or node-fade-time seconds.

The fade curve is the curve of an envelope structure or nil to use the curve returned by node-fade-curve.

Function: node-segment obj end dur &optional start curve done-action

Change the node-gain of obj from start to end in dur seconds.

obj is a node structure or the integer identifier of the node.

start defaults to the current level.

The fade curve is the curve of an envelope structure or nil to use the curve returned by node-fade-curve.

The one-argument function done-action, #'identity by default, is called when the DSP finished playing. The function argument is the DSP node.

Function: node-release-phase-p instance

Return t if the node is related to a released object (i.e. DSP instance).

Function: node-start-time obj

Return the start time of the node in samples.

Function: node-uptime obj

How long the node has been running. The returned time is in samples.

Function: next-node-id

Return the next avalaible integer identifier for a node.

Generic Function: free-hook obj

A list of function designators which are called in an unspecified order at the time the object obj is freed. The function argument is the object to free.

Generic Function: stop-hook obj

A list of function designators which are called in an unspecified order at the time the object obj is stopped by calling the stop method. The function argument is the object to stop.

Function: group obj

Return the parent group of the node obj.

Function: make-group &optional-key id head tail before after name action stop-hook free-hook

Create a group node.

id is an integer identifier or nil to use the next available id.

The keywords head, tail, before and after specify the add-action to add the new group node. The value is the target node or node-id. By default the new group node is added at the head of the root node.

If name is non-NIL, it is the name of the group.

If action is non-NIL, it is a one-argument function called on the group node after the initialization.

free-hook is a list of function designators which are called in an unspecified order at the time the group node is freed. The function argument is the group node to free. stop-hook is a similar list but it is called when the group node is stopped.

Function: group-p obj

Return t if obj is a group node.

Macro: dograph (var &optional node result) &body body

Iterate over the live nodes with var bound to each node and execute the body once for each node, then result form is evaluated.

The first node is node or *root-node*.

Macro: dogroup (var group &optional result recursive-p) &body body

Iterate over the nodes of the group node with var bound to each node and execute the body once for each node, then result form is evaluated.

If recursive-p is t (default), iterate over the nodes of the sub-groups of group.

Function: move node move-action target

Move a live node of the node tree.

If move-action is :head, move node at the head of the group node target.

If move-action is :tail, move node at the tail of the group node target.

If move-action is :before, move node immediately before target.

If move-action is :after, move node immediately after target.

Function: after-p node0 node1

Return t if node1 precedes node0.

Function: before-p node0 node1

Return t if node0 precedes node1.

Function: head-p node group

Return t if node is at the head of group.

Function: tail-p node group

Return t if node is at the tail of group.

Generic Function: play obj &key init-function id head tail before after replace name action stop-hook free-hook

Start playing.

init-function is the one-argument initialization function called on the node object. init-function defaults to #'identity.

id is an integer identifier or nil to use the next available id.

The keywords head, tail, before, after and replace specify the add-action to add the new node. The value is the target node or node-id. By default the new node is added at the head of the root node.

If name is non-NIL, it is the name of the node object.

If action is non-NIL, it is a one-argument function called on the node object after the initialization.

free-hook is a list of function designators which are called in an unspecified order at the time the node object is freed. The function argument is the node to free. stop-hook is a similar list but it is called when the node object is stopped.

Example: low-passed noise with single-float values (no consing on 64-bit platforms).

(set-rt-block-size 1)
(rt-start)

(play
  (let ((y0 0.0)
        (y1 0.0))
    (declare (single-float y0 y1))
    (lambda ()
      (setf y0 (- (random .04) .02))
      (setf y1 (+ y0 (* .995 y1)))
      (incf (audio-out 0) (sample y1))
      ;; Consing if the function returns a double-float value.
      (values))))

A similar example with buses and double-float values:

(rt-start)

(play
  (symbol-macrolet ((y0 (bus 0))
                    (y1 (bus 1))
                    (coef (bus 2)))
    (setf y1 (sample 0))
    (setf coef (sample .995))
    (lambda ()
      (setf y0 (sample (- (random .04) .02)))
      (setf y1 (+ y0 (* coef y1)))
      (incf (audio-out 0) y1)
      (values))))
Generic Function: stop obj

Stop playing.

Generic Function: pause obj

Pause the object.

Generic Function: unpause obj

Unpause the object.

Generic Function: pause-p obj

Return t if object is paused.

Function: done-p &optional node

Whether the DSP related to node finished playing. Setfable.

node defaults to vug:dsp-node.

Function: reinit node &rest args

Reinitialize node by calling the initialization function with arguments args.

Generic Function: dump obj &optional stream

Dump information about obj to stream.

Example: DSP cycle on demand through unpause

(dsp! cycle-on-demand ()
  (with ((i 1))
    (declare (fixnum i))
    (nrt-msg warn "DSP cycle number ~D" i)
    (incf i)
    (pause (dsp-node))))

(rt-start)

(cycle-on-demand :id 1)  ; WARN: DSP cycle number 1
(pause-p 1)
;; => T

(dump (node 0))
;; group 0
;;     node 1 (pause)
;;       CYCLE-ON-DEMAND

(unpause 1)              ; WARN: DSP cycle number 2
(unpause 1)              ; WARN: DSP cycle number 3
(unpause 1)              ; WARN: DSP cycle number 4

(reinit 1)

(unpause 1)              ; WARN: DSP cycle number 1
(unpause 1)              ; WARN: DSP cycle number 2
(unpause 1)              ; WARN: DSP cycle number 3

(free 1)
Function: control-getter obj control-name

Return the getter function to get the control parameter control-name related to the node obj.

obj is a node structure or the integer identifier of the node.

Function: control-setter obj control-name

Return the setter function to set the control parameter control-name related to the node obj.

obj is a node structure or the integer identifier of the node.

Function: control-list obj

Return the list of the values of the control parameters related to the node obj.

Function: control-names obj

Return the list of the names of the control parameters related to the node obj.

Function: control-value obj control-name

Return the value of the control parameter control-name related to the node obj. Setfable.

obj is a node structure or the integer identifier of the node.

Function: control-pointer obj control-name

If the control parameter control-name is represented by a foreign object (i.e. a control of type sample), the first returned value is a foreign pointer to the control value. The second returned value is the function of no arguments called to update the dependencies if it exists.

Example:

(in-package :scratch)

(dsp! dsp-control ((node (or fixnum node)) (control-name symbol)
                   initial-value value duration)
  (with ((ptr (cffi:null-pointer))
         (func nil)
         (this (dsp-node)))
    (declare (type pointer ptr)
             (type (or function null) func)
             (type node this))
    (initialize
      ;; The foreign pointer is useless if the controlled node is freed.
      (push (lambda (n) n (free this))
            (free-hook node))
      (setf (values ptr func)
            (control-pointer node control-name)))
    (setf (smp-ref ptr) (line initial-value value duration))
    (if func (funcall (the function func)))))

(dsp! oscilla (freq amp)
  (stereo (sine freq amp)))

(rt-start)

(oscilla 440 .3 :id 1
  :action (lambda (n) (dsp-control n 'freq 440 880 1 :id 2 :before n)))

(set-controls 2 :value 100 :duration 3)
(set-controls 2 :value 440 :duration .25)

;; `(free 2)' is called from the free-hook of node 1.
(free 1)
Function: set-control obj control-name value

Set the value of the control parameter control-name related to the node obj.

obj is a node structure or the integer identifier of the node.

Function: set-controls obj &rest plist

Set one or more control parameters related to the node obj.

obj is a node structure or the integer identifier of the node.

The rest is an even number of arguments that are alternating control parameter names and values.


4.13 Logging

Variable: incudine.util:*logger-stream*

Stream for log messages.

Variable: incudine.util:*null-output*

Output stream for null output.

Variable: incudine.util:*logger-force-output-p*

Whether force-output is called after a log message.

Macro: incudine.util:msg type format-control &rest format-arguments

Produce a formatted log message controlled by format-control and format-arguments.

type should be one of error, warn, info or debug.

Macro: incudine.util:nrt-msg type format-control &rest format-arguments

Produce a formatted log message in nrt-thread controlled by format-control and format-arguments.

type should be one of error, warn, info or debug.

Function: incudine.util:logger-level

Return the log level. Should be one of :error, :warn (default), :info or :debug. Setfable.

Function: incudine.util:logger-time

Return the time unit used for the log messages. Should be one of :sec, :samp or nil (default). Setfable.

Function: incudine.util:logger-time-function

Return the function of no arguments to format the timestamp used for the log messages. Setfable.

Function: incudine.util:default-logger-time-function

Default function to format the timestamp used for the log messages.

Macro: incudine.util:with-logger (&optional-key stream level time-unit time-format-function) &optional-key &rest body

Log level, time-unit and time-format-function to log messages inside body.


4.14 defun*, lambda* and defmacro*

defun*, lambda* and defmacro* are inspired by the extensions define*, lambda* and define-macro* in Bill Schottstaedt’s Scheme implementation s7 1.

Some examples from s7.html translated to CL:

(defun* hi (a (b 32) (c "hi")) (list a b c))

(hi 1)             ; => (1 32 "hi")
(hi :b 2 :a 3)     ; => (3 2 "hi")
(hi 3 2 1)         ; => (3 2 1)

(defun* foo ((a 0) (b (+ a 4)) (c (+ a 7))) (list a b c))

(foo :b 2 :a 60)   ; => (60 2 67)

(defun* foo (&rest a &rest b) (mapcar #'+ a b))

(foo 1 2 3 4 5)    ; => (3 5 7 9)

(defun* foo ((b 3) &rest x (c 1)) (list b c x))

(foo 32)           ; => (32 1 NIL)
(foo 1 2 3 4 5)    ; => (1 3 (2 3 4 5))

(funcall (lambda* ((b 3) &rest x (c 1) . d) (list b c x d)) 1 2 3 4 5)
; => (1 3 (2 3 4 5) (4 5))

(defmacro* add-2 (a (b 2)) `(+ ,a ,b))

(add-2 1 3)        ; => 4
(add-2 1)          ; => 3
(add-2 :b 3 :a 1)  ; => 4
Macro: incudine.util:defun* name (&rest args) &body body

Every argument in args has a default value and is automatically available as a keyword argument. The default value is either nil if unspecified, or given in a list whose first member is the argument name. The last argument can be preceded by &rest or a dot to indicate that all other trailing arguments should be packaged as a list under that argument’s name. A trailing or rest argument’s default value is nil. You can have more than one &rest parameter.

Macro: incudine.util:lambda* (&rest args) &body body

See defun*.

Macro: incudine.util:defmacro* name (&rest arguments) &body body

See defun* for details.

A nested lambda list with optional keywords begins with the special keyword &optional-key, and precedes the optional keywords of the (possibly nested) lambda list. For example:

(defmacro* optkey-test-1 ((a 1) (b 2) (c 3))
  `(list ,a ,b ,c))

(defmacro* optkey-test-2 ((&optional-key (a 1) (b 2)) &rest rest)
  `(list ,a ,b ,@rest))

(defmacro* optkey-test-3 ((&optional-key (a 1) (b 2))
                          (&optional-key
                           (&optional-key (c 3) (d 4)) (e 5))
                          (f 6) g . h)
  `(list ,a ,b ,c ,d ,e ,f ,g ,@h))

(optkey-test-1)                   ; => (1 2 3)
(optkey-test-1 :b 123)            ; => (1 123 3)
(optkey-test-2)                   ; => (1 2)
(optkey-test-2 (:b 3) 4 5 6)      ; => (1 3 4 5 6)
(optkey-test-3)                   ; => (1 2 3 4 5 6 NIL)
(optkey-test-3 () ((:d 123)))     ; => (1 2 3 123 5 6 NIL)
(optkey-test-3 () () :h (1 2 3))  ; => (1 2 3 4 5 6 NIL 1 2 3)

(optkey-test-3 (10) ((20) 30) :g 40 :f 50 :h (60))
;; => (10 2 20 4 30 50 40 60)
Function: incudine.util:lambda-list-to-star-list arglist

Return the optional-key arguments of arglist.


4.15 Sharp-T Reader Macro

Macro: enable-sharp-t-syntax

Enable sharp-t reader syntax, useful to apply a filter multiple times.

Example: apply a pole filter four times (4t)

#4t(pole in coef)

is equivalent to

(pole (pole (pole (pole in coef) coef) coef) coef)

Often the input of a filter is the first argument, but if it is not the case, an integer after sharp-t specifies the position of the input in the argument list starting from zero. Example:

#4t1(fname x in y)

is equivalent to

(fname x (fname x (fname x (fname x in y) y) y) y)

4.16 Numeric Types

Type: incudine.util:sample
Function: incudine.util:sample number

Coerce number to type sample.

Type: incudine.util:positive-sample
Type: incudine.util:non-positive-sample
Type: incudine.util:negative-sample
Type: incudine.util:non-negative-sample
Type: incudine.util:limited-sample

A limited-sample is a sample between -4e18 and 4e18.

sin, cos and tan are optimized on x86 if the argument type is limited-sample.

Type: incudine.util:maybe-limited-sample

Correspond to limited-sample on sbcl x86.

Constant: incudine.util:least-negative-sample
Constant: incudine.util:most-negative-sample
Constant: incudine.util:least-positive-sample
Constant: incudine.util:most-positive-sample
Type: incudine.util:frame

Type designator for a foreign array of samples.

Type: incudine.util:bus-number
Type: incudine.util:channel-number
Type: incudine.util:non-negative-fixnum64

Non negative fixnum on 64-bit platforms.

Constant: incudine.util:most-positive-fixnum64

4.17 Constants

Constant: incudine.util:+sample-zero+

Zero coerced to sample.

Constant: incudine.util:+twopi+

Two pi coerced to sample.

Constant: incudine.util:+rtwopi+

The inverse of two pi coerced to sample.

Constant: incudine.util:+half-pi+

Half pi coerced to sample

Constant: incudine.util:+log001+

Natural logarithm of 0.001 coerced to sample.

Constant: incudine.util:+sqrt2+

Square root of two coerced to sample.

Constant: incudine.util:+foreign-sample-size+

Size in bytes of the foreign type sample.

Constant: incudine.util:+foreign-complex-size+

Size in bytes of a foreign complex number.

Constant: incudine.util:+pointer-size+

Size in bytes of the foreign pointer.

Constant: incudine.util:+pointer-address-type+

Foreign address type. Should be one of :int32, :int64.

Constant: incudine.util:+table-maxlen+

Maximum table length used to compute the phase of type integer for a wavetable lookup oscillator with power-of-two buffer size.

Constant: incudine.util:+phase-mask+

The bitmask calculated as +table-maxlen+ minus 1.

Constant: incudine.util:+max-lobits+

Number of bits needed to represent the bitmask +phase-mask+.

Constant: incudine.util:+rad2inc+

Division of +table-maxlen+ by two pi.


4.18 Utilities

Function: incudine.util:incudine-version

Return a string that identifies the Incudine version.

Function: incudine.util:incudine-version->= &rest subversions

Whether the current Incudine version is equal to or greater than the version specified in the arguments.

Example:

(incudine-version->= 0 9 25)
Function: deprecated-symbol-names &key obsolete-p

Return a list of lists

(deprecated-symbol :from date)

If obsolete-p is t, the deprecated symbol is obsolete starting from the specified date.

A deprecated symbol is obsolete after one year.

Function: init &optional force-p

Incudine initialization, optionally forced if force-p is t.

Function: incudine.util:exit &optional code

Exit lisp with code from a non-real-time thread.

code defaults to 0.

Variable: incudine.util:*reduce-warnings*

Declaration to muffle compiler-notes.

Macro: incudine.util:reduce-warnings &body body

Execute body by muffling compiler-notes.

Function: incudine.external:errno-to-string &optional errno

Return a string that describes the error code errno.

errno defaults to the foreign integer variable errno. See errno man page for details.

Function: block-size

Return the block size.

Macro: dsp-seq &rest function-call-forms

Define a sequence of DSP’s by using the stop-hook of the functions defined by DSP!. The last of the function-call-forms is arbitrary and useful to define recursive sequences.

Example:

(defun seq-test (rep freq amp)
  (when (plusp rep)
    (dsp-seq (dsp-test freq amp env)
             (dsp-test (* freq 7/4) amp env)
             (dsp-test (* freq 2) amp env)
             (seq-test (1- rep) freq amp))))
Generic Function: circular-shift obj n &key before-windowing-p

Perform a circular shift of length n.

Generic Function: quantize obj from &key start end filter-function

Quantize obj with respect to a real number, a vector, a buffer or tuning structure in sorted order.

If obj is a vector, a buffer or tuning structure, the keywords start and end are the bounding index designators, and the keyword filter-function is usable to apply a function to the quantized value. The arguments of that function are the vector index and the quantized value.

Function: incudine.util:pow base power

Return base raised to the power. The returned value is of type double-float.

If base is a negative value and power is not an integer, floating-point-invalid-operation is signalled.

Function: incudine.util:linear-interp in y0 y1

Linear interpolation between y0 and y1 by in.

Function: incudine.util:cubic-interp in y0 y1 y2 y3

Four-point interpolation.

Function: incudine.util:cos-interp in y0 y1

Sinusoidal interpolation between y0 and y1 by in.

Function: incudine.util:hz->radians value

Convert the value from Hz to radians.

Function: incudine.util:radians->hz value

Convert the value from radians to Hz.

Function: incudine.util:db->linear value

Convert the value from dB to linear.

Function: incudine.util:linear->db value

Convert the value from linear to dB.

Function: incudine.util:sample->fixnum value &key roundp

Coerce value from type sample to type fixnum.

If roundp is t, round value to the nearest integer.

value has to be between most-negative-fixnum and most-positive-fixnum.

Function: incudine.util:sample->int value

Coerce value from type sample to type integer.

Function: incudine.util:float->fixnum value &key roundp

Coerce value from type single-float or double-float to type fixnum.

If roundp is t, round value to the nearest integer.

value has to be between most-negative-fixnum and most-positive-fixnum.

Function: incudine.util:t60->pole time

Return a real pole for a 60dB exponential decay in time seconds.

Function: incudine.external:complex-to-polar ptr size

Convert the representation of the complex sample data from complex to polar.

ptr is the foreign pointer to size complex samples.

Function: incudine.external:polar-to-complex ptr size

Convert the representation of the complex sample data from polar to complex.

ptr is the foreign pointer to size complex samples.

Function: incudine.util:sort-samples pointer size

Sort a foreign array of size samples pointed to by pointer.

Function: incudine.util:rationalize* x &optional significand-error

Convert reals to rationals and try to minimize the ratios by introducing an error in the significand of the floating point number. The error is 0.0005% by default.

Function: incudine.util:parse-float string &key start end type

Parse a floating point number from the substring of string delimited by start and end.

The first value returned is either the floating point number that was parsed or nil.

The second value is either the index into the string of the delimiter that terminated the parse, or the upper bounding index of the substring.

The type of the returned value is single-float by default.

Macro: incudine.util:dochannels (var channels &optional result) &body body

Iterate over the channels with var bound to each number of channel and execute the body once for each channel, then result form is evaluated.

Function: incudine.util:smp-ref ptr &optional index

Access the foreign array element of type sample specified by index. Setfable.

Function: incudine.util:power-of-two-p n

Whether the positive integer n is a power of two.

Function: incudine.util:next-power-of-two n

Return the next power of two of the positive integer n.

Variable: incudine.util:*sample-rate*

Sample rate in Hz.

Variable: incudine.util:*sample-duration*

Duration of one sample in seconds.

Variable: incudine.util:*sample-rate-hook*

A list of function designators which are called in an unspecified order when the sample rate is changed via set-sample-rate or set-sample-duration.

Function: incudine.util:set-sample-rate value

Set the sample rate to value and run the hook *sample-rate-hook*.

The following variables are updated: *sample-rate*, *sample-duration*, *twopi-div-sr*, *sr-div-twopi*, *pi-div-sr*, *minus-pi-div-sr* and *cps2inc*.

Function: incudine.util:set-sample-duration value

Set the sample duration to value and run the hook *sample-rate-hook*.

The following variables are updated: *sample-rate*, *sample-duration*, *twopi-div-sr*, *sr-div-twopi*, *pi-div-sr*, *minus-pi-div-sr* and *cps2inc*.

Variable: incudine.util:*cps2inc*

Division of +table-maxlen+ by the sample rate.

Variable: incudine.util:*twopi-div-sr*

Division of two pi by the sample rate.

Variable: incudine.util:*sr-div-twopi*

Division of the sample rate by two pi.

Variable: incudine.util:*pi-div-sr*

Division of pi by the sample rate.

Variable: incudine.util:*minus-pi-div-sr*

Division of minus pi by the sample rate.

Variable: incudine.util:*sound-velocity*

Velocity of the sound in m/s at 22 degrees Celsius, 1 atmosfera.

Variable: incudine.util:*r-sound-velocity*

The inverse of the sound velocity in s/m at 22 degrees Celsius, 1 atmosfera.

Variable: incudine.util:*sound-velocity-hook*

A list of function designators which are called in an unspecified order when the sound velocity is changed via set-sound-velocity.

Function: incudine.util:set-sound-velocity value

Set the the velocity of the sound in m/s at 22 degrees Celsius, 1 atmosfera and run the hook *sound-velocity-hook*.

Function: incudine.util:seed-random-state &optional state

Set the current random state.

Function: incudine.util:thread-affinity thread

Return the cpu affinity mask of thread. Setfable.

It is also possible to specify a list of zero-based processors to set the thread affinity.

For more details on cpu affinity masks, see taskset and/or sched_setaffinity man page.

Example: 8 processors

(rt-stop)

(mapcar (lambda (thr)
          ;; Exclude processor 0. The list is equivalent
          ;; to the affinity mask #b11111110.
          (setf (thread-affinity thr) '(1 2 3 4 5 6 7)))
        (bt:all-threads))

(rt-start)

;; Dedicate processor 0 to real-time thread.
(setf (thread-affinity *rt-thread*) '(0))
;; => 1

;; Verify affinity mask.
(mapcar #'thread-affinity (bt:all-threads))
;; => (1 254 254 254)
Function: incudine.util:thread-priority thread

Return the thread priority. Setfable.

Macro: incudine.util:with-pinned-objects (&rest objects) &body body

See documentation for sb-sys:with-pinned-objects.

Macro: incudine.util:without-interrupts &body body

See documentation for sb-sys:without-interrupts.


4.19 Analysis


4.19.1 Analysis Structure

Structure: ana:analysis

Analysis type.

Function: ana:analysis-p object

Return t if object is of type analysis.

Function: ana:analysis-input-buffer instance

Return the foreign pointer to the analysis input buffer.

Function: ana:analysis-input-buffer-size instance

Return the analysis input buffer size.

Function: ana:analysis-output-buffer instance

Return the foreign pointer to the analysis output buffer.

Function: ana:analysis-output-buffer-size instance

Return the analysis output buffer size.

Function: ana:analysis-time obj

Return the time in samples of the last analysis. Setfable.

Function: ana:touch-analysis obj

Update the modification time of the analysis.

Function: ana:discard-analysis obj

Discard the analysis.


4.19.2 Analysis Buffer

Structure: ana:abuffer

Abuffer (Analysis Buffer) type.

Function: ana:make-abuffer analysis-object &optional real-time-p

Create and return a new abuffer structure linked to analysis-object.

Set real-time-p to nil to disallow real-time memory pools.

Function: ana:abuffer-p object

Return t if object is of type abuffer.

Method: free abuffer

Deallocate the abuffer.

Method: free-p abuffer

Return t if the abuffer is deallocated.

Function: ana:abuffer-data instance

Return the foreign pointer to the abuffer data.

Function: ana:abuffer-size instance

Return the abuffer data size.

Function: ana:abuffer-nbins instance

Return the number of analysis bins of the abuffer.

Return the analysis object linked to the abuffer.

Function: ana:abuffer-time obj

Return the modification time in samples of the abuffer obj. Setfable.

Function: ana:abuffer-normalized-p instance

Whether the abuffer is normalized.

Function: ana:abuffer-complex obj

Convert the representation of the abuffer data from polar to complex if necessary.

Function: ana:abuffer-polar obj

Convert the representation of the abuffer data from complex to polar if necessary.

Function: ana:abuffer-imagpart obj nbin

Return the imaginary part of the analysis bin nbin of the abuffer obj. Setfable.

Function: ana:abuffer-realpart obj nbin

Return the real part of the analysis bin nbin of the abuffer obj. Setfable.

Function: ana:compute-abuffer abuf &optional force-p

Fill the abuffer with the updated analysis data of the linked analysis object.

If force-p is nil (default), the abuffer is updated once for the current time.

Generic Function: ana:update-linked-object obj force-p

Called within compute-abuffer to update the linked object.

Function: ana:touch-abuffer obj

Update the modification time of the abuffer data.

Function: ana:discard-abuffer obj

Discard the retrieved data of the abuffer object obj.


4.19.3 Fast Fourier Transform

Structure: ana:fft

FFT type.

Function: ana:make-fft size &key window-size window-function flags real-time-p

Create and return a new FFT structure with the specified size.

window-size is the size of the analysis window and defaults to size.

window-function is nil or a function of two arguments called to fill the FFT data window. The function arguments are the foreign pointer to the data window of type sample and the window size respectively. If window-function is nil, the window is initially rectangular but we can call fft-window to get the pointer to the buffer and directly manipulate the sample values. window-function defaults to *fft-default-window-function*.

The argument flags for the FFT planner is usually +fft-plan-optimal+, +fft-plan-best+ or +fft-plan-fast+. If a cached fft-plan with the same size already exists, return it if the current thread is the real-time thread, otherwise recompute the plan if flags is non-NIL or the cached fft-plan is not the best. Without a cached fft-plan, flags defaults to +fft-plan-fast+.

Set real-time-p to nil to disallow real-time memory pools.

Function: ana:fft-p object

Return t if object is of type FFT.

Function: ana:fft-size instance

Return the FFT size.

Structure: ana:fft-plan

FFT planner type.

Function: ana:fft-plan instance

Return the planner of the FFT instance.

Function: ana:fft-window obj

Return the foreign pointer to the sample values of the FFT window and the FFT window size.

Function: ana:fft-input fft

Return the sample value of the current FFT input.

Setfable also with an input value of type real, but it is faster if the type is sample.

The FFT structure uses a ring buffer internally and the input buffer is filled during the transform.

Function: ana:compute-fft obj &optional force-p

Compute an unnormalized fast Fourier transform on the input data of the FFT structure obj and write the results into the FFT output buffer. compute-ifft normalizes the input data before the inverse transform.

If force-p is nil (default), the transform is computed once for the current time.

Example:

(in-package :scratch)

(defvar *fft* (make-fft 8 :window-function #'rectangular-window))

;; Fill the internal ring buffer with an impulse.
(setf (fft-input *fft*) 1d0)
(loop repeat (1- (fft-size *fft*)) do (setf (fft-input *fft*) 0d0))

(compute-fft *fft* t)

;; Output with 5 complex analysis bins.
(loop for i below (analysis-output-buffer-size *fft*)
      collect (smp-ref (analysis-output-buffer *fft*) i))
;; => (1.0d0 0.0d0 1.0d0 0.0d0 1.0d0 0.0d0 1.0d0 0.0d0 1.0d0 0.0d0)
Method: circular-shift fft n

Perform a circular shift of length n during compute-fft.

Structure: ana:ifft

IFFT type.

Function: ana:make-ifft size &key window-size window-function flags real-time-p

Create and return a new IFFT structure with the specified size.

window-size is the size of the analysis window and defaults to size.

window-function is nil or a function of two arguments called to fill the FFT data window. The function arguments are the foreign pointer to the data window of type sample and the window size respectively. If window-function is nil, the window is initially rectangular but we can call ifft-window to get the pointer to the buffer and directly manipulate the sample values. window-function defaults to *fft-default-window-function*.

The argument flags for the FFT planner is usually +fft-plan-optimal+, +fft-plan-best+ or +fft-plan-fast+. If a cached fft-plan with the same size already exists, return it if the current thread is the real-time thread, otherwise recompute the plan if flags is non-NIL or the cached fft-plan is not the best. Without a cached fft-plan, flags defaults to +fft-plan-fast+.

Set real-time-p to nil to disallow real-time memory pools.

Function: ana:ifft-p object

Return t if object is of type IFFT.

Function: ana:ifft-size instance

Return the IFFT size.

Function: ana:ifft-plan instance

Return the planner of the IFFT instance.

Function: ana:ifft-window obj

Return the foreign pointer to the sample values of the IFFT window and the IFFT window size.

Function: ana:ifft-output ifft

Return the sample value of the current IFFT output.

Function: ana:compute-ifft obj &optional abuffer force-p

Compute an inverse fast Fourier transform on the input data of the IFFT structure obj and write the results into the IFFT output buffer.

If abuffer is non-NIL, update that abuffer and copy the results into the IFFT input buffer before to calculate the transform. If the abuffer is linked to a FFT object, the copied analysis data are normalized because the fast Fourier transform of compute-fft is unnormalized.

If force-p is nil (default), the transform is computed once for the current time.

Example:

(in-package :scratch)

(defvar *ifft* (make-ifft 8 :window-function #'rectangular-window))

;; Set the real part of the complex analysis bins to 1/8.
(dotimes (i (analysis-input-buffer-size *ifft*))
  (setf (smp-ref (analysis-input-buffer *ifft*) i)
        (if (evenp i) 125d-3 0d0)))

(compute-ifft *ifft* nil t)

;; The output is an impulse.
(loop for i below (ifft-size *ifft*) collect (ifft-output *ifft*))
;; => (1.0d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0)
Method: circular-shift ifft n &key before-windowing-p

Perform a circular shift of length n.

If before-windowing-p is T, perform the shift during compute-ifft, before the application of the window.

Generic Function: ana:window-size obj

Return the analysis window size. Setfable.

Generic Function: ana:window-function obj

nil or the function of two arguments called to fill an analysis data window. The function arguments are the foreign pointer to the data window of type sample and the window size respectively. Setfable.

Generic Function: ana:hop-size obj

Return the STFT frame offset. Setfable.

Variable: ana:*fft-default-window-function*

Default function of two arguments called to fill an analysis data window. The function arguments are the foreign pointer to the data window of type sample and the window size respectively.

Initially this is set to (GEN:SINE-WINDOW).

Function: ana:rectangular-window foreign-array size

Fill a foreign-array of the given size and type sample with a rectangular window.

Macro: ana:dofft (index-var nbins-var abuffer-src-list abuffer-dest-list x-var-prefix y-var-prefix &key coord-complex-p index-start index-end coord-check-p init result) &body body

Iterate over the complex values of one or more abuffer structures in abuffer-src-list and abuffer-dest-list with index-var bound to each number of analysis bin from index-start to index-end, then result form is evaluated.

nbins-var is bound to the number of analysis bins that it is supposed to be the same for all the abuffer’s.

index-start and index-end default to 0 and the number of analysis bins.

The strings x-var-prefix and y-var-prefix are the prefixes of the real and imaginary parts of a complex number, respectively. For example, if x-var-prefix is “MAG”, the variables mag0, mag1 and mag2 are bound to the real parts of each complex value related to the first three abuffer’s.

If coord-check-p is t (default), the representation of the data for the abuffer’s in abuffer-src-list is converted if necessary.

The optional init form is inserted before the loop.

The modification time of the abuffer’s in abuffer-dest-list is updated.

Macro: ana:dofft-polar (index-var nbins-var abuffer-src-list abuffer-dest-list &key index-start index-end coord-check-p init result) &body body

Iterate over the complex values of one or more abuffer structures in abuffer-src-list and abuffer-dest-list by using polar coordinates, with index-var bound to each number of analysis bin from index-start to index-end, then result form is evaluated.

nbins-var is bound to the number of analysis bins that it is supposed to be the same for all the abuffer’s.

index-start and index-end default to 0 and the number of analysis bins.

“MAG” and “PHASE” are the prefixes of the variables bound to the real and imaginary parts of each complex value of the abuffer’s: mag0 and phase0 for the first abuffer, mag1 and phase1 for the second, etc.

If coord-check-p is t (default), the representation of the data for the abuffer’s in abuffer-src-list is converted if necessary.

The optional init form is inserted before the loop.

The modification time of the abuffer’s in abuffer-dest-list is updated.

Examples:

(dofft-polar (i nbins ((compute-abuffer abuf)) () :result abuf)
  (when (>= i threshold)
    (setf mag0 +sample-zero+)))

(dofft-polar (i nbins ((compute-abuffer abuf-src)) (abuf-dest)
              :result abuf-dest :index-start 1 :index-end (1- nbins))
  (if (or (< mag0 threshold)
          (< (abuffer-realpart abuf-src (1- i)) threshold)
          (< (abuffer-realpart abuf-src (1+ i)) threshold))
      (setf mag1 +sample-zero+ phase1 +sample-zero+)
      (setf mag1 mag0 phase1 phase0)))
Macro: ana:dofft-complex (index-var nbins-var abuffer-src-list abuffer-dest-list &key index-start index-end coord-check-p init result) &body body

Iterate over the complex values of one or more abuffer structures in abuffer-src-list and abuffer-dest-list by using complex coordinates, with index-var bound to each number of analysis bin from index-start to index-end, then result form is evaluated.

nbins-var is bound to the number of analysis bins that it is supposed to be the same for all the abuffer’s.

index-start and index-end default to 0 and the number of analysis bins.

“RE” and “IM” are the prefixes of the variables bound to the real and imaginary parts of each complex value of the abuffer’s: re0 and im0 for the first abuffer, re1 and im1 for the second, etc.

If coord-check-p is t (default), the representation of the data for the abuffer’s in abuffer-src-list is converted if necessary.

The optional init form is inserted before the loop.

The modification time of the abuffer’s in abuffer-dest-list is updated.

Function: ana:new-fft-plan size &optional flags

Calculate and cache a new fft-plan structure with the specified size if necessary.

flags is usually +fft-plan-optimal+, +fft-plan-best+ or +fft-plan-fast+. If a cached fft-plan with the same size already exists, return it if the current thread is the real-time thread, otherwise recompute the plan if flags is non-NIL or the cached fft-plan is not the best. Without a cached fft-plan, flags defaults to +fft-plan-fast+.

Constant: ana:+fft-plan-fast+

Fast computation of a reasonable FFT plan.

Constant: ana:+fft-plan-best+

Slow computation of an accurate FFT plan.

Constant: ana:+fft-plan-optimal+

Slowest computation of an optimal FFT plan.

Function: ana:remove-fft-plan size

Remove the cached fft-plan with the specified size.

Function: ana:get-fft-plan size

Return the cached fft-plan with the specified size if it exists. Otherwise, return nil.

Function: ana:fft-plan-list &optional only-size-p

Return the list of the cached fft-plan instances.

If only-size-p is t, return the sizes of these planners.


4.19.4 Short-Time Fourier Transform and Phase Vocoder

Structure: ana:pvbuffer

PVbuffer type.

A pvbuffer contains a sequence of spectral data.

Function: ana:make-pvbuffer frames fft-size &key channels sample-rate data-type window-size window-function hop-size normalized-p real-time-p

Create and return a new pvbuffer structure with the specified frames and fft-size.

The number of channels defaults to 1.

The sample-rate of the analysed data is incudine.util:*sample-rate* by default.

data-type is one of :complex (default), :magnitude-phase or :magnitude-frequency.

window-size is the size of the analysis window and defaults to fft-size.

window-function is nil or a function of two arguments called to fill the window buffer. The function arguments are the foreign pointer to the data window of type sample and the window size respectively. window-function defaults to *fft-default-window-function*.

If the pvbuffer is used to store the STFT frames, hop-size is the STFT frame offset and defaults to a quarter of window-size.

Set real-time-p to nil to disallow real-time memory pools.

Function: ana:make-part-convolve-buffer buf partsize &key start frames

Create and return a new PVbuffer structure with spectral data obtained from a sequence of FFT’s of the buffer structure buf partitioned with partition size partsize. This PVbuffer works with part-convolve, a VUG to compute the partitioned convolution between a signal and a multi-channel impulse response.

The optional keywords start and frames mark the beginning position in frames and the number of frames of the buffer, respectively.

Function: ana:make-fft-from-pvbuffer instance &key flags real-time-p

Create and return a new FFT structure to fill the PVbuffer frames.

The argument flags for the FFT planner is usually +fft-plan-optimal+, +fft-plan-best+ or +fft-plan-fast+. If a cached fft-plan with the same size already exists, return it if the current thread is the real-time thread, otherwise recompute the plan if flags is non-NIL or the cached fft-plan is not the best. Without a cached fft-plan, flags defaults to +fft-plan-fast+.

Set real-time-p to nil to disallow real-time memory pools.

Function: ana:make-ifft-from-pvbuffer instance &key flags real-time-p

Create and return a new IFFT structure to transform the PVbuffer data.

The argument flags for the FFT planner is usually +fft-plan-optimal+, +fft-plan-best+ or +fft-plan-fast+. If a cached fft-plan with the same size already exists, return it if the current thread is the real-time thread, otherwise recompute the plan if flags is non-NIL or the cached fft-plan is not the best. Without a cached fft-plan, flags defaults to +fft-plan-fast+.

Set real-time-p to nil to disallow real-time memory pools.

Function: ana:stft input fft-size &key window-size window-function hop-size start frames normalized-p zero-phase-window-p

Create and return a new PVbuffer structure with spectral data obtained from the Short-Time Fourier Transform of a sound file or buffer data with the specified fft-size.

input is of type string, pathname or buffer.

window-size defaults to half fft-size.

window-function is a function of two arguments called to fill the FFT data window. The function arguments are the foreign pointer to the data window of type sample and the window size respectively. window-function defaults to *fft-default-window-function*.

hop-size is the STFT frame offset and defaults to a quarter of window-size.

start and frames mark the beginning position in frames and the number of frames of input, respectively.

If normalized-p is t (default), the FFT analysis data are normalized.

If zero-phase-window-p is t, the FFT windows are zero-phase.

Method: free pvbuffer

Deallocate the pvbuffer.

Method: free-p pvbuffer

Return t if the pvbuffer is deallocated.

Function: ana:pvbuffer-window instance

Return the foreign pointer to the sample values of the analysis window data and window size of the PVbuffer.

Method: ana:window-size pvbuffer

Return the analysis window size of the pvbuffer frames. Setfable.

Method: ana:window-function pvbuffer

Return the analysis window function of the pvbuffer frames. Setfable.

Method: ana:hop-size pvbuffer

Return the STFT frame offset of the pvbuffer. Setfable.

Function: ana:pvbuffer-data instance &optional frame channel

Return the foreign pointer to the data frame of a PVbuffer channel.

frame and channel default to zero.

No bounds checking.

Function: ana:fill-pvbuffer instance frame obj &key channel

If the PVbuffer data type is not :magnitude-frequency and obj is of type FFT or abuffer, fill the data frame of the PVbuffer channel with the FFT analysis.

channel defaults to 0.

Example:

(defvar *pvb* (make-pvbuffer 10 1024 :window-size 512))
(defvar *fft* (make-fft-from-pvbuffer *pvb*))

(dotimes (frame 10)
  (dotimes (i 1024)
    (setf (fft-input *fft*) (random 1d0)))
  ;; zero-phase FFT window.
  (circular-shift *fft* -256)
  (fill-pvbuffer *pvb* frame (compute-fft *fft*)))

;; Convert data type from complex to magnitude-frequency.
;; (setf (pvbuffer-data-type *pvb*) :magnitude-frequency)
Function: ana:copy-pvbuffer-data instance destination &optional frame channel

If the PVbuffer data type is not :magnitude-frequency, copy the data frame of a PVbuffer channel to destination and return the PVbuffer instance.

destination is of type IFFT or abuffer.

Function: ana:pvbuffer-size instance

Return the PVbuffer size.

Function: ana:pvbuffer-channels instance

Return the number of the PVbuffer channels.

Function: ana:pvbuffer-frames instance

Return the number of the PVbuffer spectral frames.

Function: ana:pvbuffer-sample-rate instance

Return the PVbuffer sample rate. Setfable.

Function: ana:pvbuffer-fft-size instance

Return the FFT size used to compute the spectral data of the PVbuffer.

Function: ana:pvbuffer-block-size instance

Return the PVbuffer block size.

Function: ana:pvbuffer-data-type obj

Return the PVbuffer data type. It is one of :complex (default), :magnitude-phase or :magnitude-frequency. Setfable.

Function: ana:pvbuffer-scale-factor instance

Return the PVbuffer scale factor. It is one if the PVbuffer data are normalized.

Function: ana:normalize-pvbuffer obj

Multiply the magnitudes of the unnormalized PVbuffer data by 1/fftsize.

Function: ana:pvbuffer-normalized-p instance

Whether the PVbuffer data are normalized.

Function: ana:pvbuffer-save instance path

Save the PVbuffer analysis data to the file path.

path is of type string or pathname.

Function: ana:pvbuffer-load path

Create a new PVbuffer by loading the file path.

path is of type string or pathname.


Next: , Previous: , Up: The Incudine dictionary   [Contents][Index]

4.20 GEN Routines


Next: , Up: GEN Routines   [Contents][Index]

4.20.1 Analysis

Function: gen:analysis obj

Return a function called to fill a foreign array with the analysis data of an analysis or abuffer structure passed as argument.

The returned function takes two arguments, the foreign pointer to the sample data and the data size, and returns the foreign array.


Next: , Previous: , Up: GEN Routines   [Contents][Index]

4.20.2 Envelope

Function: gen:envelope env &key periodic-p normalize-p

Return a function called to fill a foreign array with the envelope defined in the passed envelope structure env.

The returned function always refers to the same envelope structure. It takes two arguments, the foreign pointer to the sample data and the data size, and returns three values: the foreign array, the scale factor to normalize the samples and the boolean normalize-p to specify whether the normalization is necessary.

If periodic-p is t (default), the resultant envelope is a cycle of a periodic waveform.


Next: , Previous: , Up: GEN Routines   [Contents][Index]

4.20.3 Filter

Function: gen:fir breakpoints &key sample-rate base curve normalize-p

Return a function called to fill a foreign array with the FIR filter coefficients obtained from a sequence of break-point pairs interpreted as frequency response.

The returned function takes two arguments, the foreign pointer to the sample data and the data size, and returns three values: the foreign array, the scale factor to normalize the samples and the boolean normalize-p to specify whether the normalization is necessary.

sample-rate defaults to sample-rate.

curve sets the shape of the segments of the frequency response; the possible values are :step, :lin or :linear, :exp or :exponential, :sin or :sine, :wel or :welch, :sqr or :square, :cub or :cubic, a number that represents the curvature value between two levels for all the segments or a list of the prior values to specify the curvature values for each segment. curve is ignored if base is non-NIL.

base (1 by default) is e^k and the curvature depends on the highest and lowest levels.

Function: gen:hilbert &key window-function

Return a function called to fill a foreign array with the FIR filter coefficients necessary to approximate a Hilbert transform.

If window-function is non-NIL, it is a function of two arguments (i.e. the function created by gen:kaiser), the foreign pointer to the data window of type sample and the window size, called to scale the filter coefficients. The window function is the Hamming window by default.

The returned function takes two arguments, the foreign pointer to the sample data and the data size, and returns two values: the foreign array and the (generally unnecessary) scale factor to normalize the samples. If the data size is an even number, the last coefficient value is zero.

The FIR Hilbert filter is causal with the coefficients for the zero-phase impulse response shifted right by order:

(datasize - 1)/2  for datasize odd
datasize/2 - 1    for datasize even

Example:

(in-package :scratch)

(define-vug ssb-am (input (fir-hilbert buffer) frequency-shift)
  "Single side-band AM."
  (with ((order (ash (logior (1- (buffer-size fir-hilbert)) 1) -1)))
    (declare (type non-negative-fixnum order))
    (- (* (delay-s input 4000 order) (sine frequency-shift 1 +half-pi+))
       (* (direct-convolve input fir-hilbert) (sine frequency-shift)))))

(dsp! ssb-am-test ((fir-hilbert buffer) frequency-shift)
  "Modulation of the sound obtained from the first input channel."
  (out (ssb-am (butter-lp (audio-in 0) 8000) fir-hilbert frequency-shift)))

;; Order 149 => causal FIR filter with 149*2 + 1 coefficients.
(defvar *fir-hilbert* (make-buffer 299 :fill-function (gen:hilbert)))

(defun set-fir-hilbert-window-function (func)
  (fill-buffer *fir-hilbert* (gen:hilbert :window-function func)))

(rt-start)

(ssb-am-test *fir-hilbert* 567)

(rt-eval () (set-fir-hilbert-window-function #'rectangular-window))

(rt-eval () (set-fir-hilbert-window-function (gen:kaiser 6)))

Next: , Previous: , Up: GEN Routines   [Contents][Index]

4.20.4 Partials

Function: gen:partials list &key periodic-p normalize-p

Return a function called to fill a foreign array with a composite waveform made up of weighted sums of sinusoids. If periodic-p is t (default), the result is a cycle of a periodic waveform. list is a list where each element is one of the following:

  • value: relative strength of the partial. A negative value implies a phase inversion. The number of the partial is the position in the list plus a possible offset introduced by a previous list (partial-number strength [phase] [dc]). Example:
(with-buffers
  ((b0 16 :fill-function (gen:partials '(1 0 .5 0 0 0 .2 .1)))
   (b1 16 :fill-function (gen:partials '(1 0 .5 (7 .2) .1))))
  (equal (buffer->list b0) (buffer->list b1)))
;; => T
  • list (partial-number strength): strength is the strength of the partial partial-number (not necessarily an integer value). A negative strength value implies a phase inversion.
  • list (partial-number strength phase): phase is the initial phase of the partial. It is a multiplier for +twopi+.
  • list (partial-number strength phase dc): DC is the DC offset of the partial.

The returned function takes two arguments, the foreign pointer to the sample data and the data size, and returns three values: the foreign array, the scale factor to normalize the samples and the boolean normalize-p to specify whether the normalization is necessary.

Function: gen:gbuzz num-harm &optional lowest-harm mul

Return a function called to fill a foreign array with a composite waveform made up of harmonically related sine partials.

num-harm is the number of harmonics.

lowest-harm is the lowest harmonic and defaults to 1.

mul is a real number and defaults to 1. It specifies the multiplier of a power series where

(* strength-coeff (expt mul n))

is the strength of the partial (+ lowest-harm n).

The returned function takes two arguments, the foreign pointer to the sample data and the data size, and returns the foreign array.

Function: gen:chebyshev-1 strength-list &key xmin xmax offset-p normalize-p

Return a function called to fill a foreign array by using a weighted combination of Chebyshev polynomials of the first kind.

The Chebyshev functions take values between xmin and xmax (-1 and 1 by default).

If offset-p is t (default), the center value of the wavetable is zero.

The returned function takes two arguments, the foreign pointer to the sample data and the data size, and returns three values: the foreign array, the scale factor to normalize the samples and the boolean normalize-p to specify whether the normalization is necessary.

Example:

(in-package :scratch)

(define-vug shaper (in (buf buffer))
  (with ((n (ash (buffer-frames buf) -1)))
    (declare (fixnum n))
    (buffer-read buf (+ (* in n) n) :interpolation :linear)))

(defvar *cheb*
  (make-buffer
    512 :fill-function (gen:chebyshev-1 '(1 1/2 1/3 1/4 1/5))))

(dsp! cheby-test (freq amp dur)
  (:defaults 440 .3 4)
  (out (* amp (shaper (sine freq (line 0 .99 dur #'free) 0) *cheb*))))
Function: incudine.util:cheb order x

Return the order Chebyshev polynomial calculated at the point x.


Next: , Previous: , Up: GEN Routines   [Contents][Index]

4.20.5 Polynomial

Function: gen:polynomial coefficients &key xmin xmax normalize-p

Return a function called to fill a foreign array by evaluating a nth-order polynomial in x between xmin and xmax (-1 and 1 by default) with coefficients

(cN ... c2 c1 c0)

The returned function takes two arguments, the foreign pointer to the sample data and the data size, and returns three values: the foreign array, the scale factor to normalize the samples and the boolean normalize-p to specify whether the normalization is necessary.

Example: 2 x^2 - 3, with x in [-1, 1]

(gen:polynomial '(2 0 -3))

Next: , Previous: , Up: GEN Routines   [Contents][Index]

4.20.6 Random

Function: gen:all-random-distributions

Return the list of the available random number distributions.

The keyword names of a sublist are aliases for the same distribution.

Macro: gen:rand distribution &key a b c n n1 n2 p alpha beta mu nu nu1 nu2 sigma tt zeta seed

Return a function called to fill a foreign array with random numbers from a random number distribution.

The returned function takes two arguments, the foreign pointer to the sample data and the data size, and returns the foreign array.

See all-random-distributions for the list of the available random number distributions and rand-args for the related keyword arguments.

Function: gen:rand-args distribution

Return the list of arguments

(return-type [((param0 param-type) . default)
              ((param1 param-type) . default)
              ...])

for gen:rand used with the random number distribution.


Previous: , Up: GEN Routines   [Contents][Index]

4.20.7 Windows

Macro: gen:defwindow name (foreign-array-var size-var &rest args) &body body

Define a new gen routine named name with lambda-list args to generate window functions.

The variables foreign-array-var and size-var are bound to the window function arguments.

Example:

(gen:defwindow hanning (foreign-array size)
  (with-samples ((delta (/ +twopi+ (1- size)))
                 (phase +sample-zero+))
    (gen:symmetric-loop (i j size foreign-array)
      (gen:symmetric-set foreign-array i j
        (* 0.5 (- 1.0 (cos (the limited-sample phase)))))
      (incf phase delta))))
Macro: gen:symmetric-loop (var0 var1 count &optional result) &body body

Iterate over the integer from 0 up to but not including the half of count, execute body with var0 bound to each integer and var1 bound to the integers from count minus 1 down to the half of count, then result form is evaluated.

Example:

(gen:symmetric-loop (i j 8) (princ (list i j)))
;; => (0 7)(1 6)(2 5)(3 4)
Macro: gen:symmetric-set foreign-array index0 index1 value

Companion of symmetric-loop, set the symmetric elements of foreign-array specified by index0 and index1 to value.

Function: gen:bartlett

Return a function called to fill a foreign array with a Bartlett window.

The returned function takes two arguments, the foreign pointer to the sample data and the data size, and returns the foreign array.

Function: gen:blackman

Return a function called to fill a foreign array with a Blackman window.

The returned function takes two arguments, the foreign pointer to the sample data and the data size, and returns the foreign array.

Function: gen:gaussian &optional beta

Return a function called to fill a foreign array with a Gaussian window using beta (4.5 by default) as the window parameter.

The returned function takes two arguments, the foreign pointer to the sample data and the data size, and returns the foreign array.

Function: gen:hamming

Return a function called to fill a foreign array with a Hamming window.

The returned function takes two arguments, the foreign pointer to the sample data and the data size, and returns the foreign array.

Function: gen:hanning

Return a function called to fill a foreign array with a Hanning window.

The returned function takes two arguments, the foreign pointer to the sample data and the data size, and returns the foreign array.

Function: gen:kaiser &optional beta

Return a function called to fill a foreign array with a Kaiser window using beta (12 by default) as the window parameter.

The returned function takes two arguments, the foreign pointer to the sample data and the data size, and returns the foreign array.

Function: gen:sinc &optional beta

Return a function called to fill a foreign array with a sinc window using beta (1 by default) as the window parameter.

The returned function takes two arguments, the foreign pointer to the sample data and the data size, and returns the foreign array.

Function: gen:dolph-chebyshev &optional attenuation

Return a function called to fill a foreign array with a Dolph-Chebyshev window using attenuation (120 dB by default) as the window parameter.

The returned function takes two arguments, the foreign pointer to the sample data and the data size, and returns the foreign array.

Function: gen:sine-window

Return a function called to fill a foreign array with a sine window.

The returned function takes two arguments, the foreign pointer to the sample data and the data size, and returns the foreign array.


4.21 MIDI

Function: midiout status data1 data2 stream

Send three bytes status, data1 and data2 of a generic MIDI message to a MIDI output stream.

Function: midiout-sysex seq stream

Send a MIDI SysEx message to a MIDI output stream.

seq is of type sequence.

Function: midiin-sysex-octets stream &optional octets start

Return the vector of octets stored in the buffer of the MIDI input stream and the MIDI SysEx message size.

Create a new vector if octets is nil (default).

start specifies an offset into octets and marks the beginning position of that vector.

Example:

(in-package :scratch)

;; Test with PortMidi.
(defvar *midiin-test* (pm:open (pm:get-default-input-device-id)))

(defun verbose-responder (status data1 data2)
  (cond ((= status #xf0)
         (format *logger-stream* "MIDI SysEx: ~A~%"
                 (midiin-sysex-octets *midiin-test*)))
        ((>= status #x80)
         (format *logger-stream* "MIDI event: ~D ~D ~D~%"
                 status data1 data2)))
  (force-output *logger-stream*))

(make-responder *midiin-test* #'verbose-responder)

(recv-start *midiin-test*)

;; Send a MIDI SysEx message from a sequencer...

;; Get the octets of the last received MIDI SysEx.
(midiin-sysex-octets *midiin-test*)

(recv-stop *midiin-test*)
(remove-all-responders *midiin-test*)
(remove-receiver *midiin-test*)
(pm:close *midiin-test*)

;; The same test with JACK MIDI.
(setf *midiin-test* (jackmidi:open))

;; Start JACK.
(rt-start)

(make-responder *midiin-test* #'verbose-responder)

(recv-start *midiin-test*)

;; Connect a sequencer to the JACK MIDI input port "incudine:midi_in",
;; send a MIDI SysEx message from the sequencer...

;; Octets of the last received MIDI SysEx.
(midiin-sysex-octets *midiin-test*)

(recv-stop *midiin-test*)
(remove-all-responders *midiin-test*)
(remove-receiver *midiin-test*)
(jackmidi:close *midiin-test*)
(rt-stop)
Function: midi-tuning-sysex tuning stream &optional device-id program single-note-tuning-p checksum-function

Send a bulk tuning dump message to a MIDI output stream. The new frequencies are related to a tuning structure. If single-note-tuning-p is non-NIL, send 128 single note tuning change messages instead. The optional checksum-function requires two arguments: the foreign buffer containing the MIDI SysEx message and the buffer size in bytes. It is useful if the manufacturer implements a different checksum.

device-id and program default to 0.


Next: , Previous: , Up: The Incudine dictionary   [Contents][Index]

4.22 Mouse Support

Currently, mouse pointer support requires X window system.

Function: incudine.util:mouse-start

Create the mouse-loop thread and return :started if no error has occured.

Function: incudine.util:mouse-stop

Stop the mouse-loop thread and return :stopped.

Function: incudine.util:mouse-status

Mouse-loop thread status. Return :started or :stopped.

Function: incudine.util:get-mouse-x

Return the coordinate x of the mouse pointer position. This value is of type sample in the range [0,1].

Function: incudine.util:get-mouse-y

Return the coordinate y of the mouse pointer position. This value is of type sample in the range [0,1].

Function: incudine.util:get-mouse-button

Return the mouse button state. 1 means the button has been pressed, 0 means it hasn’t.


4.23 Voicer

Structure: voicer:voicer

Voicer type.

Macro: voicer:create polyphony form &key steal-voice

Create and return a new voicer structure usable for voice management.

polyphony is the maximum number of allocable voices.

form is the template of the DSP related to the voicer:

(dsp-function-name &rest dsp-function-arguments)

If steal-voice is :first or :last, release the first or the last allocated voice when there aren’t available voices.

Example:

(defvar *voi* (voicer:create 20 (superbass 110 .2 1)))

where 110, 0.2 and 1 are the default control parameters
of the DSP instances.
Macro: voicer:update voicer form

Update the voicer instance with a new template form:

(dsp-function-name &rest dsp-function-arguments)
Method: free voicer

Deallocate the voicer.

Function: voicer:empty-p voicer

Return t if all the voices of the given voicer are available.

Function: voicer:full-p voicer

Return t if all the voices of the given voicer are allocated.

Function: voicer:polyphony voicer

Return the maximum number of voices allocable by the given voicer. Setfable.

Function: voicer:steal-voice-mode voicer

Voice to steal when all the voices of the voicer are allocated. Should be one of :first, :last or nil. Setfable.

Function: voicer:trigger voicer tag

Allocate a voice of the given voicer with identifier tag.

Function: voicer:release voicer tag

Release a voice of the given voicer with identifier tag.

Function: voicer:control-list voicer

Return the list of the values of the control parameters related to the given voicer.

Function: voicer:control-names voicer

Return the list of control names related to the given voicer.

Function: voicer:control-value voicer control-name

Return the value of the control parameter control-name related to the given voicer. Setfable.

Function: voicer:set-controls voicer &rest arguments

Set the control parameters of the given voicer.

arguments is an even number of arguments that are alternating control parameter names and values.

Macro: voicer:define-map name voicer controls &body function-body

Define a mapping function named name to call immediately after voicer:trigger, before the new event.

controls is the list of the control parameters used within function-body.

Example:

(voicer:define-map map-test my-voicer (freq amp)
  (setf freq (+ 100 (random 2000))
        amp (random (if (> freq 800) .1 .3))))
Function: voicer:remove-map voicer name

Remove the mapping function definition named name related to the voicer.

Function: voicer:remove-all-maps voicer

Remove all the mapping function definitions related to the voicer.

Function: voicer:panic voicer

Force the release of the voices allocated by the given voicer.

Structure: voicer:midi-event

MIDI event type for voice management.

Macro: voicer:midi-bind voicer stream &key channel lokey hikey freq-keyword freq-function amp-keyword amp-mult amp-function gate-keyword gate-value note-off-p

Create and return a new midi-event structure bound to voicer and MIDI input stream.

Allocate a new voice if the received MIDI channel is channel (0 by default) and the MIDI key number is an integer between lokey and hikey (0 and 127 by default).

The keywords freq-keyword, amp-keyword and gate-keyword related to the control parameters to set the DSP frequency, amplitude and gate, default to :freq, :amp and :gate respectively.

gate-value is the value of the control parameter gate and defaults to 1.

If freq-function is a function of one argument, it is used to convert from MIDI key number to frequency value in Hz.

If amp-function is a function of one argument, it is used to convert from MIDI velocity to amplitude value.

If note-off-p is t (default), a note-on message (status byte 9) with velocity 0 is interpreted as a note-off message.

Function: voicer:scale-midi-amp midi-event mult

Scale the table of the amplitudes of midi-event by mult.

Function: voicer:fill-amp-table midi-event obj

Fill the table of the amplitudes of midi-event with the content of a incudine:buffer or by calling a function with the key number as argument.

If obj is nil, use the default function.

Function: voicer:fill-freq-table midi-event obj

Fill the table of the frequencies of midi-event with the content of a incudine:tuning, incudine:buffer or by calling a function with the key number as argument.

If obj is nil, use the default function.


4.24 Virtual Unit Generator

Structure: vug:vug

Virtual Unit Generator type.

Function: vug:vug name

Return the VUG or vug-macro named name if it exists.

Structure: vug:vug-macro

Virtual Unit Generator Macro type.

Function: vug:vug-p object

Return t if object is of type VUG or vug-macro.

Function: vug:vug-macro-p object

Return t if object is of type vug-macro.

Macro: vug:define-vug name arglist &body body

Define a new VUG and the auxiliary function named name. Remove the UGEN definition of name if it exists.

Each element of the arglist is a list

(argument-name argument-type)

or a symbol argument-name if the control parameter is of type sample.

The auxiliary function name is used within the body of define-vug, define-vug-macro, define-ugen or DSP!.

If the first forms in body are lists beginning with a keyword, they are VUG SPEC’s. The keyword indicates the interpretation of the other forms in the specification:

:DEFAULTS default-values
    Default values for VUG parameter controls.

:METADATA Type Value
    Set the metadata Type to Value.

If the specification :defaults is defined, all the arguments of the auxiliary function are optional keywords.

Return the new VUG structure.

Macro: vug:define-vug-macro name lambda-list &body body

Define a new vug-macro and the auxiliary macro named name.

lambda-list is an ordinary lambda list without default values. Each element of lambda-list is not necessarily the name of a control parameter; use vug-input or with-vug-inputs to specify the VUG inputs or vuglet to define a local VUG definition. Example:

(define-vug-macro megasynth (freq amp &optional interpolation)
  (with-vug-inputs ((f freq)
                    (a amp))
    (if interpolation
        `(megasynth-with-interpolation ,f ,a)
        `(megasynth-without-interpolation ,f ,a))))

;; Alternative.
(define-vug-macro megasynth (freq amp &optional interpolation)
  (with-gensyms (megasynth)
    `(vuglet ((,megasynth (f a)
                ,(if interpolation
                     `(megasynth-with-interpolation f a)
                     `(megasynth-without-interpolation f a))))
       (,megasynth ,freq ,amp))))

The auxiliary macro name is used within the body of define-vug, define-vug-macro, define-ugen or DSP!.

If the first forms in body are lists beginning with a keyword, they are VUG SPEC’s. The keyword indicates the interpretation of the other forms in the specification:

:DEFAULTS default-values
    Default values for VUG parameter controls.

:METADATA Type Value
    Set the metadata Type to Value.

If the specification :defaults is defined, all the arguments of the auxiliary macro are optional keywords.

Return the new vug-macro structure.

Function: vug:vug-lambda-list name

Return the lambda list and the default values for the VUG name.

name can also be a VUG structure.

Function: vug:rename-vug old-name new-name

Rename the VUG named old-name to new-name.

Function: vug:destroy-vug name

Remove the VUG or vug-macro definition, if any, of name.

Function: vug:all-vug-names &optional inaccessible-p

Return the name list of the defined VUG’s and VUG-MACRO’s.

If inaccessible-p is t, the list also includes the symbols unexported from the other packages.

Function: vug:fix-vug name

The function named name is forced to be the auxiliary function of the VUG or vug-macro with the same name. Useful if that function is accidentally redefined.

Function: vug:vug-input arg

Used within the body of define-vug-macro to declare and return the VUG input arg (not all macro arguments are necessarily control parameters).

Macro: vug:with-vug-inputs bindings &body body

Used within the body of define-vug-macro to create bindings to VUG inputs (not all macro arguments are necessarily control parameters).

bindings is a list of lists

(vug-varname value)

where value is a VUG input.

Macro: vug:vuglet definitions &body body-forms

Evaluate the body-forms with local VUG definitions within the body of define-vug, define-vug-macro, define-ugen or DSP!.

The local VUG names shadow the global VUG’s or functions with the same name.

Macro: vug:with bindings &body body

Create new variable bindings within the definition of a VUG, UGEN or DSP.

The bindings are performed sequentially.

If the form associated with a variable includes one or more control parameters, that variable is updated during the performance-function if some of these control parameters change. See without-follow to remove some dependences.

Declarations may appear at the beginning of the body. with also accepts the following declare expressions:

(performance-time var*)
(preserve var*)

A variable is performance-time if its value changes during the execution of the performance-function. A variable is performance-time by default if its value is changed by using setf, setq, incf, decf, psetf or psetq.

VUG, vug-macro and UGEN are always performance-time.

If there are redundant variables, they are removed during the compilation. The declaration preserve avoids that simplification and it is generally useful for debugging purposes.

Macro: vug:with-follow parameters &body body

Explicitally define the dependence on some parameters.

If with-follow is within a initialize construct, the code is expanded at initialization-time and updated after the change of the ’followed’ parameters.

If with-follow is within the body of a vug/ugen/dsp, the code is evaluated only after the change of the ’followed’ parameters.

If there is a binding between a vug-variable and with-follow, the variable is updated after the change of the ’followed’ parameters.

Example:

(dsp! with-follow-test (freq amp)
  (with-follow (freq)
    (setf amp (sample (if (< freq 500) .5 .2))))
  ;; AMP is updated if FREQ changes.
  (out (sine freq amp 0)))
Macro: vug:without-follow parameters &body body

Form associated with a variable in with binding to remove the dependence on some parameters.

Example:

(dsp! without-follow-test (freq amp)
  (with-samples ((g (without-follow (amp)
                      (setf amp (sample (if (< freq 500) .5 .2))))))
    ;; G is updated only if the control parameter FREQ changes.
    (out (sine freq g 0))))
Function: vug:init-only &rest forms

Form associated with a variable in with binding to ensure an initialization-time variable when forms is performance-time.

Function: vug:external-variable name

Return the variable name defined out of the scope of a macro or vug-macro expansion.

Function: vug:initialize &rest forms

Used within the definition of a VUG, UGEN or DSP to specify the forms to evaluate at initialization-time.

Function: vug:tick &rest forms

Execute forms at performance-time. Example:

(dsp! tick-test (amp)
  ;; A normal function is init-time by default.
  (out (* amp (1- (tick (random (sample 2)))))))
Function: vug:update var

Update the value of the variable var by evaluating the form associated in with binding.

Example:

(dsp! update-test ()
  (with-samples ((rnd (1- (tick (random (sample 2))))))
    (out
      ;; A performance-time variable is updated when it occurs the
      ;; first time within the body of a definition.
      rnd
      ;; Update again.
      (update rnd))))
Macro: vug:foreach-channel &body body

Used within the definition of a VUG, UGEN or DSP to iterate over the number of output channels with current-channel bound to each number of channel.

Examples:

(dsp! foreach-channel-example-1 (amp)
  (foreach-channel
    ;; Single noise generator for each output channel: the
    ;; generator doesn't depend on CURRENT-CHANNEL.
    (incf (audio-out current-channel) (white-noise amp))))

;; The same example with the VUG-MACRO COUT.
(dsp! foreach-channel-example-1 (amp)
  (foreach-channel (cout (white-noise amp))))

(dsp! foreach-channel-example-2 (amp)
  (vuglet ((randi (freq)
             (interpolate (white-noise) freq))
           (sig (freq offset mult)
             (:defaults 1 2000 1950)
             (osc *sine-table* (+ offset (* mult (randi freq))) amp)))
    (foreach-channel
      ;; These generators depend on CURRENT-CHANNEL.
      ;; In this case there are four generators for the
      ;; first four output channels.
      (cout (case current-channel
              (0 (sig 8))
              (1 (sig 19))
              (2 (sig 41))
              (3 (sig 23))
              (otherwise (sample 0)))))))
Macro: vug:foreach-frame &body body

Used within the definition of a VUG, UGEN or DSP to iterate over the number of frames with current-frame, current-input-sample and current-sample bound to each frame, input-sample and output-sample, respectively.

Macro: vug:foreach-tick &body forms

Execute forms once at current time.

Macro: vug:maybe-expand &body body

Used within the definition of a VUG, UGEN or DSP, to update the variables in body if necessary, and inhibit the expansion of one or more performance-time variables after a particular point of the code (i.e. loop or condition).

Example:

(dsp! maybe-expand-test ((rain-p boolean))
  (with-samples ((s (performance-time-humidity)))
    (maybe-expand s)
    (out (if rain-p s (* s 0.15)))))
Macro: vug:get-pointer variable

Used within the body of with to retrieve the foreign pointer to the value of a bound variable of type sample, pointer or foreign array.

Function: vug:dsp-node

Return the DSP node.

Function: vug:free-self

Free the DSP node.

Macro: vug:make-i32-array size &key zero-p initial-element initial-contents

Associated with a variable in with binding to create a foreign array of type signed-byte 32 and size size.

Macro: vug:make-u32-array size &key zero-p initial-element initial-contents

Associated with a variable in with binding to create a foreign array of type unsigned-byte 32 and size size.

Macro: vug:make-i64-array size &key zero-p initial-element initial-contents

Associated with a variable in with binding to create and foreign array of type signed-byte 64 and size size.

Macro: vug:make-u64-array size &key zero-p initial-element initial-contents

Associated with a variable in with binding to create a foreign array of type unsigned-byte 64 and size size.

Macro: vug:make-f32-array size &key zero-p initial-element initial-contents

Associated with a variable in with binding to create a foreign array of type single-float and size size.

Macro: vug:make-f64-array size &key zero-p initial-element initial-contents

Associated with a variable in with binding to create a foreign array of type double-float and size size.

Macro: vug:make-pointer-array size

Associated with a variable in with binding to create a foreign array of type foreign-pointer and size size.

Macro: vug:maybe-make-i32-array size &key zero-p initial-element initial-contents

Associated with a variable in with binding to create an array of type (signed-byte 32) and size size. The array is foreign on 32-bit platforms because the size of a fixnum is less than 32 bits.

Macro: vug:maybe-i32-ref array index

Access the element of the array created by maybe-make-i32-array. Setfable.

Macro: vug:maybe-make-u32-array size &key zero-p initial-element initial-contents

Associated with a variable in with binding to create an array of type (unsigned-byte 32) and size size. The array is foreign on 32-bit platforms because the size of a fixnum is less than 32 bits.

Macro: vug:maybe-u32-ref array index

Access the element of the array created by maybe-make-u32-array. Setfable.

Function: vug:foreign-array-type-of pointer

Return the type of a foreign array created by one of the make-*-array utilities associated with a variable in with binding.

Function: vug:foreign-length pointer

Return the number of elements in a foreign array created by one of the make-*-array utilities associated with a variable in with binding.

Macro: vug:samples-zero &rest sample-vars

Zero the variables sample-vars of type sample.


4.25 Built-in Virtual Unit Generators


4.25.1 Output

VUG Macro: vug:out &rest values

Mix the values into the output busses.

VUG Macro: vug:cout &rest values

Mix the nth element of values into the nth output bus if n is equal to current-channel.

Example:

(dsp! cout-test (freq amp pos)
  (foreach-channel (cout (pan2 (sine freq amp) pos))))
Macro: vug:frame-out ptr channels &optional offset scale scale-type

Mix channels values of a foreign array of samples ptr into the output busses.

offset is the array index of the first sample to write.

The samples are scaled by scale (1 by default).

If scale-type is non-NIL, it is the (unquoted) type of scale.

VUG Macro: vug:node-out &rest values

Mix the nth element of values, scaled by the node-gain, into the nth output bus if n is equal to current-channel.


4.25.2 Generator

VUG Macro: vug:buzz freq amp num-harm &key phase table-lookup-p buffer harm-change-lag interpolation

Band limited impulse generator with frequency freq, amplitude amp and phase. The output is a set of num-harm harmonically related sine partials.

phase defaults to zero.

If table-lookup-p is t, use the buffer with a single cycle sinusoid instead of the function sin. buffer defaults to *sine-table*. The buffer size is assumed to be a power of two.

harm-change-lag is the lag-time for the crossfade when the number of the harmonics changes.

interpolation is one of :linear (default), :cubic or nil.

VUG Macro: vug:gbuzz freq amp num-harm lowest-harm mul &key phase table-lookup-p buffer harm-change-lag interpolation

Band limited impulse generator with frequency freq, amplitude amp and phase. The output is a set of num-harm harmonically related sine partials.

phase defaults to zero.

mul is a real number and defaults to 1. It specifies the multiplier of a power series where

(* strength-coeff (expt mul n))

is the strength of the partial (+ lowest-harm n).

If table-lookup-p is t, use the buffer with a single cycle sinusoid instead of the function cos. buffer defaults to *cosine-table*. The buffer size is assumed to be a power of two.

harm-change-lag is the lag-time for the crossfade when the number of the harmonics changes.

interpolation is one of :linear (default), :cubic or nil.

VUG Macro: vug:impulse &optional freq amp phase

Impulse oscillator with frequency freq, amplitude amp and phase.

If freq is not set, play back a single impulse.

Frquency, amplitude and phase default to 0, 1 and 0 respectively.

VUG Macro: vug:osc buffer &optional freq amp phase interpolation

Wavetable lookup oscillator with frequency freq, amplitude amp and phase.

freq, amp and phase default to 440, 1 and 0 respectively.

interpolation is one of :linear, :cubic or nil (default).

The buffer size is assumed to be a power of two.

VUG: vug:oscr freq amp

Sinusoidal oscillator based on 2d vector rotation (sine output by default) with frequency freq and amplitude amp.

VUG: vug:oscrc freq amp

Sinusoidal oscillator based on 2d vector rotation (cosine output) with frequency freq and amplitude amp.

VUG: vug:oscrq freq

Sinusoidal oscillator based on 2d vector rotation (sine and cosine outputs) with frequency freq.

VUG: vug:oscrs freq amp

Sinusoidal oscillator based on 2d vector rotation (sine output) with frequency freq and amplitude amp.

VUG: vug:phasor &optional-key freq init

Produce a normalized moving phase value with frequency freq and initial value init (0 by default).

VUG: vug:phasor-loop rate start-pos loopstart loopend

Produce a normalized moving phase value with a loop between loopstart and loopend, and initial value start-pos.

rate is the multiply factor of the rate.

VUG: vug:pulse &optional-key freq amp width

Pulse wave oscillator with frequency freq, amplitude amp and width between 0 and 1.

VUG: vug:sine &optional-key freq amp phase

High precision sine wave oscillator with frequency freq, amplitude amp and phase.


4.25.3 Noise

VUG: vug:white-noise &optional-key amp

White noise generator with output optionally scaled by amp.

VUG Macro: vug:pink-noise &optional-key amp number-of-bands

Pink Noise generator using the Gardner method with the James McCartney’s optimization.

The output is optionally scaled by amp.

number-of-bands defaults to 20.

VUG Macro: vug:fractal-noise amp beta &key poles-density filter-order lowest-freq

Fractal noise generator implemented as a white noise filtered by a cascade of filter-order (15 by default) filters.

The output is scaled by amp.

beta is the spectral parameter related to the fractal dimension (defines the target 1/f^beta spectrum). Examples:

betanoise
0white
1pink
2brown

poles-density defaults to 6.

The frequency lowest-freq of the first pole defaults to 50.

VUG: vug:crackle &optional-key param amp init-value

Noise generator based on a chaotic function with scale factor amp (1 by default).

The formula is

y[n] = | param * y[n-1] - y[n-2] - 0.05 |

init-value is the initial value of y and defaults to 0.3.

VUG Macro: vug:rand distribution &key a b c n n1 n2 p alpha beta mu nu nu1 nu2 sigma tt zeta seed

Noise generator with random number distribution.

distributionparam 1param 2param 3return type
:linear:a 0.0:b 1.0double
:high:a 0.0:b 1.0double
:triangular:a 0.0:b 1.0double
:gauss:sigma 1.0double
:gauss-tail:a 1.0:sigma 1.0double
:exp:mu 1.0double
:laplace:a 1.0double
:exppow:a 1.0:b 1.5double
:cauchy:a 1.0double
:rayleigh:sigma 1.0double
:rayleigh-tail:a 1.0:sigma 1.0double
:landaudouble
:levy:c 1.0:alpha 1.0double
:levy-skew:c 1.0:alpha 1.0:beta 1.0double
:gamma:a 1.0:b 1.0double
:uni:a 0.0:b 1.0double
:lognormal:zeta 1.0:sigma 1.0double
:chisq:nu 1.0double
:f:nu1 1.0:nu2 1.0double
:t:nu 1.0double
:beta:a 1.0:b 1.0double
:pareto:a 1.0:b 1.0double
:logistic:a 1.0double
:weibull:a 1.0:b 1.0double
:gumbel1:a 1.0:b 1.0double
:gumbel2:a 1.0:b 1.0double
:poisson:mu 1.0uint
:bernoulli:p 0.5uint
:binomial:n 1uint
:negative-binomial:p 0.5:n 1.0uint
:pascal:p 0.5:n 1uint
:geom:p 0.5uint
:hypergeom:n1 1:n2 1:tt 1uint
:log:p 0.5uint

See also gen:all-random-distributions and gen:rand-args.


4.25.4 Amplitude

VUG: vug:env-follower in attack-time decay-time

Envelope follower.

VUG: vug:rms &optional-key in hp

rms value of the input in.

The response curve’s half-power point hp of the low-pass filter defaults to 10 Hz.

VUG: vug:gain &optional-key in rms hp

Scale the input in to match a rms value.

The response curve’s half-power point hp of the low-pass filter defaults to 10 Hz.

VUG: vug:balance &optional-key in comp hp

Scale the input in according to a rms value of the comparator signal comp.

The response curve’s half-power point hp of the low-pass filter defaults to 10 Hz.

Example:

(dsp! balance-test (scl dur)
  (with-samples ((in (white-noise scl)))
    (out (balance (bpf in (expon 100 4000 dur #'free) 100) in))))

4.25.5 Envelope

VUG: vug:decay in decay-time

Exponential decay.

VUG: vug:decay-2 in attack-time decay-time

Exponential decay with the attack obtained by subtracting two DECAY’s.

VUG: vug:line &optional-key start end duration done-action

Linear ramp from start to end in duration seconds.

If the control parameter duration is changed, start a new ramp from the new start, or current level, to the new end. Example:

(dsp! ramp-test (start end duration)
  (out (* (line start end duration) (white-noise))))

(rt-start)
(ramp-test 0 1 3)
(set-controls 1 :end 0 :duration 2)
(set-controls 1 :end .5 :duration .3)
(set-controls 1 :start 0 :end 1 :duration .5)

start, end and duration default to 0, 1 and 1 respectively.

The one-argument function done-action, #'identity by default, is called at the end of the ramp. The function argument is the DSP node.

VUG: vug:expon &optional-key start end duration done-action

Exponential curve from start to end in duration seconds.

If start or end is 0, it is reset to 0.00001.

If the control parameter duration is changed, start a new curve from the new start, or current level, to the new end.

start, end and duration default to 0.00001, 1 and 1 respectively.

The one-argument function done-action, #'identity by default, is called at the end of the curve. The function argument is the DSP node.

VUG: vug:envelope &optional-key env gate time-scale done-action location

Play back the curves of the envelope env.

gate is one of:

           0   start the release phase
          -1   immediate cutoff
less than -1   release stage with a custom duration -1 minus GATE

The envelope is re-triggered if the difference between the gate of the current audio cycle and the gate of the previous audio cycle is a positive value.

gate and time-scale default to 1.

The one-argument function done-action, #'identity by default, is called at the end of the envelope. The function argument is the DSP node.

location, 0 by default, is the current position in samples (an integer) of the envelope.


4.25.6 Panpot

VUG: vug:fpan2 in pos

Fast stereo equal power panpot with position pos between 0 (left) and 1 (right).

VUG: vug:pan2 in pos

Stereo equal power panpot with position pos between 0 (left) and 1 (right).

VUG: vug:stereo input

Mix the input into the first two output busses.


4.25.7 Delay

VUG: vug:buf-delay-s buffer in delay-samples

Buffer based delay line with delay time in samples.

Use all the buffer memory if the buffer size is a power of two.

VUG: vug:buf-delay buffer in delay-time

Buffer based delay line with delay-time in seconds.

Use all the buffer memory if the buffer size is a power of two.

VUG Macro: vug:buf-vdelay buffer in delay-time &optional interpolation write-head-var

Buffer based delay line with interpolation and delay-time in seconds.

If write-head-var is non-NIL, it is the name of the variable used as write head.

Use all the buffer memory if the buffer size is a power of two.

VUG: vug:delay1 in

One sample delay.

VUG: vug:delay-s in max-delay-samples delay-samples

Delay line with delay time in samples.

VUG: vug:delay in max-delay-time delay-time

Delay line with delay-time in seconds.

VUG Macro: vug:vdelay in max-delay-time delay-time &optional interpolation

Delay line with interpolation and delay-time in seconds.

interpolation is one of :linear (default), :cubic or nil.

VUG Macro: vug:vtap buffer delay-time write-head-var &optional interpolation

Tap a buffer based delay line with interpolation at delay-time seconds.

write-head-var is the name of the variable used as write head.

Use all the buffer memory if the buffer size is a power of two.

Function: vug:delay-feedback delay-time decay-time

Feedback coefficient for a feed back comb filter with delay-time and decay-time.

VUG: vug:allpass-s in max-delay-time delay-time gain

Allpass filter without interpolation and delay-time in samples.

VUG: vug:allpass in max-delay-time delay-time gain

Allpass filter without interpolation and delay-time in seconds.

VUG Macro: vug:vallpass in max-delay-time delay-time gain &optional interpolation

Allpass filter with delay-time in seconds.

VUG Macro: vug:fb-comb in max-delay-time delay-time coef &optional interpolation

Feed back comb filter with delay-time in seconds.

VUG Macro: vug:ff-comb in max-delay-time delay-time b0 bm &optional interpolation

Feed forward comb filter with delay-time in seconds.


4.25.8 Filter

VUG Macro: vug:~ in &key type initial-value

Anaphoric VUG macro for recursive composition.

VUG: vug:apf in freq q

Second-order allpass filter.

VUG: vug:biquad in b0 b1 b2 a0 a1 a2

Biquad filter.

VUG: vug:bpf in freq q

Second-order bandpass filter.

VUG: vug:butter-bp in fcut bandwidth

Second-order Butterworth bandpass filter.

VUG: vug:butter-br in fcut bandwidth

Second-order Butterworth bandreject filter.

VUG: vug:butter-hp in fcut

Second-order Butterworth highpass filter.

VUG: vug:butter-lp in fcut

Second-order Butterworth lowpass filter.

VUG: vug:cs-atone in hp

A first-order recursive highpass filter where hp is the response curve’s half-power point.

VUG: vug:cs-tone in hp

A first-order recursive lowpass filter where hp is the response curve’s half-power point.

VUG: vug:dcblock in coef

DC blocking filter.

VUG: vug:diff in

First order difference.

VUG: vug:direct-convolve in buf

Direct convolution of an input with a finite impulse response stored in a buffer.

VUG: vug:fofilter in freq attack-time decay-time

FOF-like filter.

VUG: vug:hi-shelf in freq s db

Second-order high shelf filter.

VUG: vug:hpf in freq q

Second-order highpass filter.

VUG: vug:integrator in

Integrate the input in.

VUG: vug:lag in time

Scaled one pole filter with the coefficient calculated from a 60 dB lag time.

VUG: vug:lag-ud in attack-time decay-time

Scaled one pole filter with the coefficient calculated from a 60 dB lag attack-time and decay-time.

VUG: vug:low-shelf in freq s db

Second-order low shelf filter.

VUG: vug:lpf in freq q

Second-order lowpass filter.

VUG: vug:lpf18 in freq resonance distortion

Digital emulation of a 3 pole lowpass filter.

VUG: vug:maf in max-size size

Moving Average Filter.

VUG: vug:median in max-size size

Median filter.

VUG: vug:moogff in freq resonance reset-p

A discrete-time version of the Moog vcf.

VUG: vug:moogladder in freq resonance

Non linear digital implementation of the Moog ladder filter.

VUG: vug:nlf2 in freq r

Second order normalized digital waveguide resonator.

VUG: vug:notch in freq q

Second-order notch filter.

VUG: vug:part-convolve in pvbuf

Partitioned convolution. The pvbuffer contains the partitioned FFT of a multichannel finite impulse response.

VUG: vug:peak-eq in freq q db

Second-order peaking equalizer.

VUG: vug:pole in coef

One pole filter.

VUG: vug:pole* in coef

Scaled one pole filter.

VUG: vug:reson in freq q

Two pole resonant filter.

VUG: vug:resonr in freq q

Two pole resonant filter with zeroes located at +/- sqrt(radius).

VUG: vug:resonz in freq q

Two pole resonant filter with zeroes located at z = 1 and z = -1.

VUG: vug:ringr in freq decay-time

Two pole resonant filter with zeroes located at +/- sqrt(radius). The bandwidth is specified in a 60dB ring decay-time and a constant scale factor.

VUG: vug:ringz in freq decay-time

Two pole resonant filter with zeroes located at z = 1 and z = -1. The bandwidth is specified in a 60dB ring decay-time and a constant scale factor.

VUG: vug:svf in fcut resonance drive

State Variable Filter.

VUG: vug:two-pole in freq radius

Two pole filter.

VUG: vug:two-zero in freq radius

Two zero filter.

VUG: vug:zero in coef

One zero filter.

VUG: vug:zero* in coef

Scaled one zero filter.


4.25.9 Conversion

VUG: vug:lin->lin input old-min old-max new-min new-max

Return a value between new-min and new-max that is the linear mapping of the input sample in the range of old-min to old-max.

VUG: vug:lin->exp in old-min old-max new-min new-max

Return a value between new-min and new-max that is the exponential mapping of the input sample in the range of old-min to old-max.


4.25.10 Buffer

VUG Macro: vug:buffer-read buffer frame &key wrap-p interpolation

Return the value of the current-channel of the buffer frame.

If wrap-p is t, wrap around if necessary.

interpolation is one of :linear, :cubic or nil (default).

VUG: vug:buffer-write buf frame input

Write input to the current-channel of the buffer frame.

Return the related buffer index.

VUG: vug:buffer-play &optional-key buffer rate start-pos loop-p done-action

Play back the current-channel of the buffer data starting from the frame start-pos (0 by default).

rate is the multiply factor of the sampling rate of buffer. For example, 1 (default) is the original, 1.5 is a fifth up and 0.5 is an octave down.

If loop-p is t, play it back in a loop.

The one-argument function done-action, #'free by default, is called when loop-p is nil and the buffer is finished playing. The function argument is the DSP node.

Example:

(dsp! buffer-play-test ((buf buffer))
  (foreach-channel (cout (buffer-play buf))))
VUG Macro: vug:buffer-frame buffer frame &key wrap-p interpolation

Return the buffer frame.

If wrap-p is t, wrap around if necessary.

interpolation is one of :linear, :cubic or nil (default).


4.25.11 Frame

Macro: vug:make-frame size &key zero-p initial-element initial-contents

Associated with a variable in with binding to create a foreign array of type sample and size size.

Function: vug:frame-ref ptr index

Access the foreign array element of type sample specified by index. Setfable.

Macro: vug:multiple-sample-bind vars frame &body body

Used within the definition of a VUG, UGEN or DSP to bind the variables vars to the corresponding values in the foreign array of samples frame.

Macro: vug:samples &rest values

Used within the definition of a VUG, UGEN or DSP to return values as a foreign array of samples. The second returned value is the number of samples.


4.25.12 Distortion

Function: vug:clip input low high

Clip the input sample to a value between low and high.

VUG Macro: vug:nclip in low high

Destructively clip the input sample to a value between low and high.

VUG: vug:wrap in low high

Wrap-around the input sample that exceeds the low and high thresholds.

VUG Macro: vug:nwrap in low high &optional range offset

Destructively wrap-around the input sample that exceeds the low and high thresholds.

VUG: vug:mirror in low high

Reflect the input sample that exceeds the low and high thresholds.

VUG Macro: vug:nmirror in low high &optional range two-range offset

Destructively reflect the input sample that exceeds the low and high thresholds.


4.25.13 Analysis

VUG: vug:centroid abuf

Compute the spectral centroid of the abuffer data using moments.

Overwrite the abuffer data with the result.

Example:

(dsp! centroid-test ()
  (with ((fft (make-fft 1024 :window-size 512 :window-function (gen:hanning)))
         (abuf (make-abuffer fft))
         (result +sample-zero+))
    (declare (type sample result))
    (setf (fft-input fft)
          ;; Exponential growth from 1 to 30 harmonics in 20 seconds
          (buzz 440 .5 (sample->fixnum (expon 1 30 20 #'free))))
    (with-control-period ((sample->fixnum *sample-rate*))
      (setf result (* (centroid abuf) *sample-rate* 0.5))
      (nrt-msg info "~D" (sample->fixnum result)))
    (out (tick (fft-input fft)))))
VUG: vug:flatness abuf

Compute the spectral flatness of the abuffer data.

Overwrite the abuffer data with the result.

Example:

(define-vug crossfade (in1 in2 pos)
  (with-samples ((alpha (* +half-pi+ pos)))
    (+ (* (cos alpha) in1) (* (sin alpha) in2))))

(dsp! flatness-test ()
  (with ((fft (make-fft 1024 :window-function (gen:hanning)))
         (abuf (make-abuffer fft))
         (result +sample-zero+))
    (declare (type sample result))
    (setf (fft-input fft)
          (crossfade (sine 1000 .5 0) (white-noise .1)
                     (line 0 1 8 #'free)))
    (with-control-period (1024)
      (setf result (flatness abuf))
      (nrt-msg info "~D" (sample->fixnum (* 100 result))))
    (out (tick (fft-input fft)))))
VUG Macro: vug:flux abuf &optional half-wave-rectifier-p l1-norm-p

Compute the spectral flux of the abuffer data.

If half-wave-rectifier-p is t, use the half-wave rectifier function.

If l1-norm-p is t, return the L1-norm of the spectral flux.

Overwrite the abuffer data with the result.

Examples:

(dsp! flux-test ((buf buffer))
  (with ((fft (make-fft 2048 :window-function (gen:hamming)))
         (abuf (make-abuffer fft))
         (hop-size (sample->fixnum (* *sample-rate* 0.1)))
         (result +sample-zero+))
    (declare (type sample result))
    (setf (fft-input fft) (buffer-play buf 1 0 nil #'free))
    (with-control-period (hop-size)
      (setf result (flux abuf))
      (nrt-msg info "~D" (sample->fixnum result)))
    (out (tick (fft-input fft)))))

(dsp! flux-rectified-test ((buf buffer) flux-threshold)
  (with ((fft (make-fft 2048 :window-function (gen:hamming)))
         (abuf (make-abuffer fft))
         (hop-size (sample->fixnum (* *sample-rate* 0.1)))
         ;; The result of FLUX is unnormalized
         (threshold (* flux-threshold (fft-size fft)))
         (result +sample-zero+))
    (declare (type sample threshold result))
    (setf (fft-input fft) (buffer-play buf 1 0 t #'identity))
    (with-control-period (hop-size)
      ;; Spectral flux with half-wave rectifier function
      ;; and L1-norm (Dixon DAFx-06)
      (setf result (sample (if (> (flux abuf t t) threshold) 100 0))))
    (out (tick (fft-input fft))
         (prog1 (ringz result 3000 .1)
           (unless (zerop result)
             (setf result +sample-zero+))))))
VUG: vug:rolloff abuf percent

Compute the spectral rolloff of the abuffer data.

Overwrite the abuffer data with the result.

Example:

(dsp! rolloff-test (percent)
  (with ((fft (make-fft 1024 :window-function (gen:hanning)))
         (abuf (make-abuffer fft))
         (srdiv2 (* *sample-rate* 0.5))
         (perc (sample->fixnum (* percent 100)))
         (result +sample-zero+))
    (declare (type sample srdiv2 result))
    (setf (fft-input fft) (audio-in 0))
    (with-control-period (1024)
      (setf result (* (rolloff abuf percent) srdiv2))
      (nrt-msg info "~D% rolloff: ~D" perc (sample->fixnum result)))))
VUG: vug:spectral-rms abuf

Compute the spectral rms of the abuffer data.

Overwrite the abuffer data with the result.

Example:

(dsp! spectral-rms-test ()
  (with ((fft (make-fft 1024 :window-function (gen:hanning)))
         (abuf (make-abuffer fft))
         (mult (/ (sample 1.0) (fft-size fft)))
         (rms +sample-zero+))
    (declare (type sample mult rms))
    (setf (fft-input fft) (audio-in 0))
    (with-control-period (1024)
      (setf rms (* (spectral-rms abuf) mult))
      (reduce-warnings (nrt-msg info "~F" rms)))))

4.25.14 Chaos

VUG Macro: vug:cusp freq a b xinit &optional interpolation

Cusp map chaotic generator with frequency freq.

The formula is

x = a - b * sqrt(|x|)

interpolation is one of :linear, :cos, :cubic or nil (default).

VUG Macro: vug:fb-sine freq index-mult feedback phase-mult phase-add xinit yinit &optional interpolation

Feedback sine with chaotic phase indexing and frequency freq.

The formula is

x = sin(index_mult * y + feedback * x)
y = (phase_mult * y + phase_add) % 2pi

interpolation is one of :linear, :cos, :cubic or nil (default).

VUG Macro: vug:gbman freq xinit yinit &optional interpolation

Gingerbreadman map chaotic generator with frequency freq.

The formula is

x1 = x0
x0 = 1 - y + |x0|
y  = x1

interpolation is one of :linear, :cos, :cubic or nil (default).

VUG Macro: vug:gendy amp-distr dur-distr amp-distr-param dur-distr-param freq-min freq-max amp-scale dur-scale &optional max-points used-points interpolation

Dynamic stochastic approach to waveform synthesis conceived by Iannis Xenakis.

The waveform is generated by used-points minus 1 segments and is repeated in the time. The vertexes (control points) are moved according to a stochastic action and they are limited within the boundaries of a mirror formed by an amplitude barrier and a time barrier.

amp-distr is the probability distribution for the next perturbation of the amplitude of a control point. The valid distributions are:

0 - LINEAR
1 - CAUCHY
2 - LOGIST
3 - HYPERBCOS
4 - ARCSINE
5 - EXPON
6 - SINUS (external signal)

amp-distr-param is the parameter for the amp-distr distribution. Should be in the range of 0.0001 to 1 or a form that represents a random number generator if amp-distr is 6.

dur-distr is the distribution for the perturbation of the current inter control point duration. See amp-distr for the valid distributions.

dur-distr-param is the parameter for the dur-distr distribution. Should be in the range of 0.0001 to 1 or a form that represents a random number generator if dur-distr is 6.

freq-min and freq-max are the minimum and maximum allowed frequency of oscillation.

amp-scale is the multiplier for the distribution’s delta value for amplitude (1.0 is full range).

dur-scale is the multiplier for the distribution’s delta value for duration.

max-points minus 1 is the maximum number of segments.

interpolation is one of :linear (default), :cos, :cubic or nil.

VUG Macro: vug:henon freq a b x0 x1 &optional interpolation

Hénon map chaotic generator with frequency freq.

The formula is

x = 1 - a*x0^2 + b*x1

interpolation is one of :linear, :cos, :cubic or nil (default).

VUG Macro: vug:latoocarfian freq a b c d xinit yinit &optional interpolation

Latoocarfian chaotic generator with frequency freq.

The formula is

x1 = x0
x0 = sin(b*y) + c*sin(b*x0)
y  = sin(a*y) + d*sin(a*x1)

interpolation is one of :linear, :cos, :cubic or nil (default).

VUG Macro: vug:lin-cong freq mult increment modulus xinit &optional interpolation

Linear congruential chaotic generator with frequency freq.

The formula is

x = (mult * x + increment) % modulus

interpolation is one of :linear, :cos, :cubic or nil (default).

VUG: vug:lorenz s r b integration-time xinit yinit zinit

Lorenz chaotic generator with frequency freq.

The formula is

x' = s*(y - x)
y' = x*(r - z) - y
z' = x*y - b*z

interpolation is one of :linear, :cos, :cubic or nil (default).

Return a frame with the three coordinates.

VUG Macro: vug:quad-map freq a b c xinit &optional interpolation

General quadratic map chaotic generator with frequency freq.

The formula is

x = a*x^2 + b*x + c

interpolation is one of :linear, :cos, :cubic or nil (default).

VUG Macro: vug:standard-map freq perturbation xinit yinit &optional interpolation

Standard map chaotic generator with frequency freq.

The formula is

x = (x + y) % 2pi
y = (y + perturbation * sin(x)) % 2pi

interpolation is one of :linear, :cos, :cubic or nil (default).


4.25.15 MIDI

Variable: vug:*linear-midi-table*

buffer structure of size 128 for linear mapping from [0, 127] to [0.0, 1.0].

Function: vug:midi-note-p status

Return t if status is the status byte of a MIDI note. Otherwise, return nil.

VUG: vug:midi-note-off channel

Return the key number of the last received MIDI note-off message for the channel.

Function: vug:midi-note-off-p status

Return t if status is the status byte of a MIDI note-off. Otherwise, return nil.

VUG: vug:midi-note-on channel

Return the key number of the last received MIDI note-on message for the channel.

Function: vug:midi-note-on-p status

Return t if status is the status byte of a MIDI note-on. Otherwise, return nil.

VUG: vug:midi-lowest-keynum channel

Return the lowest received MIDI key number for channel.

VUG: vug:midi-highest-keynum channel

Return the highest received MIDI key number for channel.

VUG: vug:midi-velocity channel keynum

Return the velocity of the last received MIDI note for channel and key number keynum.

VUG: vug:midi-amp ampbuf channel keynum

Return the amplitude that is the linear mapping of the last received MIDI note for channel and key number keynum.

ampbuf is the buffer structure of size 128 used for linear mapping from key number to amplitude.

VUG: vug:midi-cps tun keynum

Return the frequency of the key number keynum in a tuning.

VUG: vug:midi-cc channel number

Return the value of the last received MIDI cc number for channel.

Function: vug:midi-cc-p status

Return t if status is the status byte of a MIDI cc. Otherwise, return nil.

VUG: vug:midi-program channel

Return the MIDI program for channel.

Function: vug:midi-program-p status

Return t if status is the status byte of a MIDI program. Otherwise, return nil.

VUG: vug:midi-pitch-bend channel

Return the last received MIDI pitch bend for channel.

Function: vug:midi-pitch-bend-p status

Return t if status is the status byte of a MIDI pitch-bend. Otherwise, return nil.

VUG: vug:midi-poly-aftertouch channel keynum

Return the last received MIDI poly-aftertouch for channel and key number keynum.

Function: vug:midi-poly-aftertouch-p status

Return t if status is the status byte of a MIDI poly-aftertouch. Otherwise, return nil.

VUG: vug:midi-global-aftertouch channel

Return the MIDI global-aftertouch for channel.

Function: vug:midi-global-aftertouch-p status

Return t if status is the status byte of a MIDI global-aftertouch. Otherwise, return nil.

VUG: vug:lin-midi-cc channel number min max

Return a value between min and max that is the linear mapping of the last received MIDI cc number for channel.

VUG: vug:lin-midi-pitch-bend channel min max

Return a value between min and max that is the linear mapping of the last received MIDI pitch bend for channel.

VUG: vug:lin-midi-poly-aftertouch channel keynum min max

Return a value between min and max that is the linear mapping of the last received MIDI poly-aftertouch for channel and key number keynum.

VUG: vug:lin-midi-global-aftertouch channel min max

Return a value between min and max that is the linear mapping of the last received MIDI global-aftertouch for channel and key number keynum.

VUG: vug:exp-midi-cc channel number min max

Return a value between min and max that is the exponential mapping of the last received MIDI cc number for channel.

VUG: vug:exp-midi-pitch-bend channel min max

Return a value between min and max that is the exponential mapping of the last received MIDI pitch bend for channel.

VUG: vug:exp-midi-poly-aftertouch channel keynum min max

Return a value between min and max that is the exponential mapping of the last received MIDI poly-aftertouch for channel and key number keynum.

VUG: vug:exp-midi-global-aftertouch channel min max

Return a value between min and max that is the exponential mapping of the last received MIDI global-aftertouch for channel and key number keynum.

Function: vug:played-midi-note note-number channel

Return three values: the played MIDI note-number starting from zero, the related MIDI velocity and t if the note is played. This is useful to create MIDI arpeggiators.

channel is the MIDI channel from 0 to 15.

Examples:

;; F7 chord [65 69 72 75] played on the first channel.
(played-midi-note 1 0) ; => 69, 96, T
(played-midi-note 3 0) ; => 75, 89, T
(played-midi-note 6 0) ; =>  0,  0, NIL
Function: vug:reset-midi-notes &optional channel

Zero the MIDI note table for channel or all the tables if channel is nil.


4.25.16 Misc

VUG Macro: vug:counter start end &key step loop-p done-action

Count from start to end (excluded) by step, optionally in loop if loop-p is t.

The one-argument function done-action is called at the end if loop-p is nil. The function argument is the DSP node.

VUG: vug:downsamp control-period input

Downsampling of input with control-period.

VUG Macro: vug:interpolate generator-form freq &optional interpolation initial-value-p

Interpolation of the values generated by a performance-time generator-form.

The values of the generator are calculated with a modulable frequency freq.

interpolation is one of :linear (default), :cos, :cubic or nil (sample-and-hold).

If interpolation is :cubic and initial-value-p is t, three adjacent points are initialized with the same value.

Example:

(define-vug randi (amp freq)
  (* amp (interpolate (white-noise) freq)))
VUG: vug:samphold &optional-key input gate initial-value initial-threshold

Sample and hold the input whenever gate decreases from one sample to the next, for example when a phasor wraps around. This mechanism is similar to the Pd-version.

initial-value and initial-threshold default to 0 and 1 respectively.

VUG: vug:snapshot gate start-offset input

input is updated every gate samples, on demand or never.

If gate is positive, the output is input calculated every gate samples. If gate is zero, the output is the old value of input. If gate is negative, the output is the current value of input and gate becomes zero.

start-offset is the initial offset for the internal counter.

VUG Macro: vug:with-control-period (n &optional start-offset) &body body

The body forms are updated every n samples, on demand or never.

If n is positive, body is updated every n samples. If n is zero, body is not updated. If n is negative, body is updated and n becomes zero.

start-offset (0 by default) is the initial offset for the internal counter.


4.25.17 Mouse

VUG: vug:mouse-x

Return the coordinate x of the mouse pointer position. This value is of type sample in the range [0,1].

VUG: vug:mouse-y

Return the coordinate y of the mouse pointer position. This value is of type sample in the range [0,1].

VUG: vug:mouse-button

Return the mouse button state. 1 means the button has been pressed, 0 means it hasn’t.

VUG: vug:lin-mouse-x min max

Return the coordinate x of the mouse pointer position, linearly rescaled to be between min and max.

VUG: vug:lin-mouse-y min max

Return the coordinate y of the mouse pointer position, linearly rescaled to be between min and max.

VUG: vug:exp-mouse-x min max

Return the coordinate x of the mouse pointer position, exponentially rescaled to be between min and max.

VUG: vug:exp-mouse-y min max

Return the coordinate y of the mouse pointer position, exponentially rescaled to be between min and max.


4.25.18 Foreign Plugin

Structure: vug-foreign:plugin

Foreign plugin type.

Function: vug-foreign:make-plugin &rest args
Structure: vug-foreign:plugin-instance

Foreign plugin instance type.

Function: vug-foreign:plugin-instance-pointer obj

Return the foreign plugin instance pointer.

Function: vug-foreign:plugin-port-pointer obj index

Return the foreign pointer to the data of the plugin port index.

Structure: vug-foreign:port

Foreign plugin port type.

Constant: vug-foreign:+input-port+
Constant: vug-foreign:+output-port+
Constant: vug-foreign:+audio-port+
Constant: vug-foreign:+control-port+
Constant: vug-foreign:+midi-port+
Constant: vug-foreign:+event-port+
Function: vug-foreign:input-port-p port
Function: vug-foreign:output-port-p port
Function: vug-foreign:audio-port-p port
Function: vug-foreign:control-port-p port
Function: vug-foreign:midi-port-p port
Function: vug-foreign:event-port-p port
Function: vug-foreign:make-port &key name id type default value-type
Macro: vug-foreign:port-loop (port-var index-var plugin) &body body
Macro: vug-foreign:with-vug-plugin (vug-name plugin block-size control-arguments-p &key event-buffer-size make-event-form reset-event-form) &body body
Generic Function: vug-foreign:doc-string plugin

Documentation string for VUG.

Function: vug-foreign:update-io-number plugin

4.26 Unit Generator

Structure: vug:ugen

Unit Generator type.

Function: vug:ugen name

Return the UGEN named name if it exists.

Macro: vug:define-ugen name return-type arglist &body body

Define a new VUG, the UGEN obtained by compiling that VUG and the auxiliary function named name.

If the UGEN is declared inline within the definition of a VUG, UGEN or DSP, it is replaced with the parent VUG.

The UGEN output is of type return-type.

Each element of the arglist is a list

(argument-name argument-type)

or a symbol argument-name if the control parameter is of type sample.

If the auxiliary function name is used within the body of define-vug, define-vug-macro, define-ugen or DSP!, the behaviour is analogous to the auxiliary function of a VUG. Otherwise, it returns the function of no arguments to allocate new UGEN instances. In the last case, it accepts an UGEN node as optional argument.

If the first forms in body are lists beginning with a keyword, they are UGEN SPEC’s. The keyword indicates the interpretation of the other forms in the specification:

:DEFAULTS default-values
    Default values for UGEN parameter controls.

:INSTANCE-TYPE Name
    Type of the UGEN instance (default: UGEN-INSTANCE).

:CONSTRUCTOR Name
    Contructor function used to create a UGEN instance
    (default: MAKE-[instance-type]).

:READERS {(Control-Name {Key Value}*)}*
    Specifications of the control getters.
    The valid keywords are:

    :NAME         Getter name (default: [ugen-name]-[control-name])
    :ARG-NAME     Argument name for the UGEN instance (default: UGEN-INSTANCE)
    :INLINE-P     T to declare the function inline
                  (default: T if METHOD-P NIL)
    :METHOD-P     T to define the getter with DEFMETHOD (default: nil)

:WRITERS {(Control-Name {Key Value}*)}*
    Specifications of the control setters.
    The valid keywords are:

    :NAME         Setter name (default: SET-[ugen-name]-[control-name])
    :ARG-NAME     Argument name for the UGEN instance (default: UGEN-INSTANCE)
    :VALUE-NAME   Argument name for the new value (default: VALUE)
    :VALUE-TYPE   New value type
    :INLINE-P     T to declare the function inline
                  (default: T if METHOD-P NIL)
    :METHOD-P     T to define the setter with DEFMETHOD (default: nil)

:ACCESSORS {(Control-Name {Key Value}*)}*
    Specifications of the control getters and setters.
    The valid keywords are:

    :NAME :ARG-NAME :VALUE-NAME :VALUE-TYPE :INLINE-P :METHOD-P

    If :METHOD-P is NIL and :NAME is specified, the function NAME
    is SETF-able:

        (defun name ...)
        (defun set-name ...)
        (defsetf name set-name)

    If :METHOD-P is T, define the methods:

        (defmethod name ...)
        (defmethod (setf name) ...)

:METADATA Type Value
    Set the metadata Type to Value.

:OPTIMIZE {Quality | (Quality Value)}*
    Optimization qualities for the declaration OPTIMIZE.

If the specification :defaults is defined, all the arguments of the auxiliary function are optional keywords.

Return the new UGEN structure.

Macro: vug:ugen-debug name return-type arglist &body body

Return a function to show the code generated by define-ugen.

See define-ugen for the macro function arguments.

The returned function requires the UGEN arguments plus one optional argument to specify the output stream.

Function: vug:ugen-lambda-list name

Return the lambda list, the default values and the return type for the UGEN name.

name can also be a UGEN structure.

Variable: vug:*eval-some-specials-p*

Whether the dynamic variables in *specials-to-eval* are evaluated during the compilation of a UGEN or DSP. The default is nil.

Variable: vug:*specials-to-eval*

List of the dynamic variables to eval during the compilation of a UGEN or DSP if *eval-some-specials-p* is t.

Function: vug:compile-vug &optional-key name-or-vug return-type force-p ugen-instance-constructor optimize

Define a new UGEN and the auxiliary function named name by compiling an existing VUG.

name-or-vug is a VUG structure or a VUG name.

The UGEN output is of type return-type.

If force-p is t, force the compilation.

If ugen-instance-constructor is non-NIL, it is the constructor used to create the UGEN instances.

If optimize is non-NIL, it is the quoted list of optimization qualities for the declaration optimize.

Function: vug:compiled-vug-p obj

Whether obj is a compiled VUG or the name of a compiled VUG.

Function: vug:rename-ugen old-name new-name

Rename the UGEN named old-name to new-name.

Function: vug:destroy-ugen name

Remove the UGEN definition, if any, of name.

Function: vug:all-ugen-names &optional inaccessible-p

Return the name list of the defined UGEN’s.

If inaccessible-p is t, the list also includes the symbols unexported from the other packages.

Function: vug:fix-ugen name

The function named name is forced to be the auxiliary function of the UGEN with the same name. Useful if that function is accidentally redefined.

Structure: vug:ugen-instance

UGen instance type.

Macro: vug:with-ugen-instance (var ugen-name &rest args) &body body

Bind var to a newly allocated UGEN instance with arguments args and dynamic extent during body.

Macro: vug:with-ugen-instances bindings &body body

Create bindings to newly allocated UGEN instances with dynamic extent during body.

bindings is a list of lists

(var ugen-name &rest args)

where var is the variable bound to a UGEN instance named ugen-name with arguments args.

Method: free ugen-instance

Deallocate the ugen-instance.

Method: free-p ugen-instance

Return t if the ugen-instance is deallocated.

Function: vug:ugen-perf-function ugen-instance

Return the ugen-instance performance function.

If the return type of ugen-instance is sample or a foreign pointer, the performance function returns no values. In this case, the function ugen-return-pointer has to be called to get the foreign pointer to the returned value.

Function: vug:ugen-reinit-function ugen-instance

Return the function to reinitialize ugen-instance.

Function: vug:ugen-return-pointer ugen-instance

If the return type of ugen-instance is sample or a foreign pointer, return the foreign pointer to the returned value. Otherwise, return nil.

Function: vug:ugen-control-pointer ugen-instance control-name-or-index

If the ugen-instance control control-name-or-index is represented by a foreign object (i.e. a control of sample type), the first returned value is a foreign pointer to the control value, otherwise it is a function of no arguments called to get the control value.

The second returned value is the function of no arguments called to update the dependencies if it exists.

Macro: vug:define-ugen-control-getter &optional-key ugen-name control-name getter-name arg-name ugen-instance-type inline-p method-p

Define a UGEN control getter for the control control-name.

The getter-name defaults to [ugen-name]-[control-name].

The argument name arg-name for the UGEN instance defaults to ugen-instance.

ugen-instance-type defaults to ugen-instance.

If inline-p is t (default if method-p is nil), the getter is declared inline.

If method-p is t, the getter is defined as a method on a generic function.

Macro: vug:define-ugen-control-setter &optional-key ugen-name control-name setter-name value-type value-name arg-name ugen-instance-type inline-p method-p

Define a UGEN control setter for the control control-name.

The setter-name defaults to set-[ugen-name]-[control-name].

If value-type is non-NIL, it is the new value type.

value-name is the argument name for the new value and defaults to value.

The argument name arg-name for the UGEN instance defaults to ugen-instance.

ugen-instance-type defaults to ugen-instance.

If inline-p is t (default if method-p is nil), the setter is declared inline.

If method-p is t, the setter is defined as a method on a generic function.


4.27 DSP

Variable: vug:*update-dsp-instances-p*

Whether the running DSP instances are updated when a DSP is redefined. The default is t.

Macro: vug:dsp! name arglist &body body

Define a new DSP and the auxiliary function named name.

Each element of the arglist is a list

(argument-name argument-type)

or a symbol argument-name if the control parameter is of type sample.

If *update-dsp-instances-p* is t, update the running DSP instances for name if the arguments remain the same.

If the first forms in body are lists beginning with a keyword, they are DSP SPEC’s. The keyword indicates the interpretation of the other forms in the specification:

:DEFAULTS default-values
    Default values for DSP parameter controls.

:METADATA Type Value
    Set the metadata Type to Value.

:OPTIMIZE {Quality | (Quality Value)}*
    Optimization qualities for the declaration OPTIMIZE.

The auxiliary function name is called to allocate and run a new DSP instance. It requires the DSP arguments and accepts the following keywords arguments:

(&key ID HEAD TAIL BEFORE AFTER REPLACE ACTION STOP-HOOK
 FREE-HOOK FADE-TIME FADE-CURVE)

However, if the specification :defaults is defined, all the arguments are optional keywords.

id is an integer identifier or nil to use the next available id.

The keywords head, tail, before, after and replace specify the add-action to add the new node. The value is the target node or node-id. By default the new node is added at the head of the root node.

If action is non-NIL, it is a one-argument function called on the node object after the initialization.

free-hook is a list of function designators which are called in an unspecified order at the time the node object is freed. The function argument is the node to free. stop-hook is a similar list but it is called when the node object is stopped.

If the node output is enabled (i.e. by using the vug-macro node-out instead of out), a non-NIL fade-time and fade-curve are the duration in seconds and the curve of the envelope structure to fade in/out the node output.

Return the auxiliary function name.

Macro: vug:dsp-debug name arglist &body body

Return a function to show the code generated by DSP!.

See DSP! for the macro function arguments.

The returned function requires the DSP arguments plus one optional argument to specify the output stream.

Function: vug:dsp-lambda-list name

Return the lambda list and the default values for the DSP name.

Generic Function: vug:metadata obj &optional type

If the metadata type is nil (default), return the association list of the metadata for the object obj. If type is non-NIL, return its corresponding metadata value.

The metadata type is a symbol or a string.

Example:

(in-package :scratch)

(dsp! panner ((buffer buffer) pan)
  (:defaults (incudine-missing-arg "BUFFER") 0.5)
  (:metadata :inputs 1)
  (:metadata :outputs 2)
  (with-samples ((alpha (* +half-pi+ pan))
                 (left (cos alpha))
                 (right (sin alpha)))
    (loop for i below (buffer-size buffer) by 2 do
         (setf (buffer-value buffer (1+ i))
               (* right (buffer-value buffer i)))
         (setf (buffer-value buffer i)
               (* left (buffer-value buffer i))))))

(metadata 'panner)
;; => ((:INPUTS . 1) (:OUTPUTS . 2))

(defparameter *effect-chain-buffer*
  (make-buffer (block-size)
    :channels (max (metadata 'panner :inputs)
                   (metadata 'panner :outputs))))
Function: vug:destroy-dsp name

Remove the DSP definition, if any, of name.

Function: vug:free-dsp-instances &optional name

If name is non-NIL, free the cached DSP instances named name. Otherwise, free all the cached DSP instances.

Function: vug:all-dsp-names

Return the name list of the defined DSP’s.


Next: , Previous: , Up: The Incudine dictionary   [Contents][Index]

4.28 The rule of the first expansion

If a variable is bound to a performance-time value, for example:

(define-vug first-expansion-test ((rain-p boolean))
  (with-samples ((s (performance-time-humidity)))
    (out (* s .5) (* s .3))))

the variable is set the first time that it appears within the body of the definition:

(out (* (setf s (performance-time-humidity)) .5)
     (* s .3))

It is generally correct. Unfortunately, there is the posibility to introduce a bug if the performance-time variable is updated inside a branching, for example:

(define-vug first-expansion-test ((rain-p boolean))
  (with-samples ((s (performance-time-humidity)))
    (out (if rain-p s (* s 0.15)))))

In this case, the result is

(out (if rain-p
         (setf s (performance-time-humidity))
         (* s 0.15)))

where S is performance-time only if it’s raining. The simplest solution for this example is to explicitally set the variable before branching:

(define-vug first-expansion-test ((rain-p boolean))
  (with-samples (s)
    (setf s (performance-time-humidity))
    (out (if rain-p s (* s 0.15)))))

However the problem persists with a VUG input (obviously only if it is performance-time):

(define-vug first-expansion-test (s (rain-p boolean))
  (out (if rain-p s (* s 0.15))))

The definitive solution is to indicate where the variable is updated if necessary (the VUG input is possibly set before this point):

(define-vug first-expansion-test (s (rain-p boolean))
  (maybe-expand s)
  (out (if rain-p s (* s 0.15))))

Note: it is also possible to force the setting of a variable, for example:

(define-vug snapshot ((gate fixnum) (start-offset fixnum) input)
  (with-samples ((next-time (init-only (+ (now) gate)))
                 (value (sample 0)))
    (initialize (setf next-time (+ (now) start-offset)))
    (cond ((plusp gate)
           (unless (< (now) next-time)
             (setf value (update input))
             (setf next-time (+ (now) gate))))
          ((minusp gate)
           (setf value (update input) gate 0)))
    value))

in this case the performance-time loop is:

(labels ((set-input[gensym-ed] ()
           (setf input ...)))
  (cond ((plusp gate)
         (unless (< (now) next-time)
           (setf value (set-input[gensym-ed]))
           (setf next-time (+ (now) gate))))
        ((minusp gate)
         (setf value (set-input[gensym-ed]) gate 0)))
  value))

4.29 Mixdown

Variable: incudine.util:*bounce-to-disk-guard-size*

Max size in seconds of the written sound file when the duration is undefined.

Macro: bounce-to-disk (output-filename &key input-filename channels duration pad sample-rate header-type data-format metadata) &body body

Write the audio frames generated during body to the sound file output-filename.

The execution of body doesn’t interfere with the real-time context.

If input-filename is a sound file, it represents the audio input accessible via audio-in.

channels is the number of output channels and defaults to *number-of-output-bus-channels*.

If duration is non-NIL, it is the duration in seconds of the sound data.

If the duration is undefined, i.e. the code in body schedules infinite events, the duration is *bounce-to-disk-guard-size*.

pad is the duration of the silence to add at the end of the produced sound. pad is 2 by default but it is ignored if duration is non-NIL.

sample-rate defaults to *sample-rate*.

The string header-type specifies the type of the header (*) for the output file and defaults to *default-header-type*.

TypeDescription
wavWAV (Microsoft)
aiffAIFF (Apple/SGI)
auAU (Sun/NeXT)
rawRAW (header-less)
pafPAF (Ensoniq PARIS)
svxIFF (Amiga IFF/SVX8/SV16)
nistWAV (NIST Sphere)
vocVOC (Creative Labs)
ircamSF (Berkeley/IRCAM/CARL)
w64W64 (SoundFoundry WAVE 64)
mat4MAT4 (GNU Octave 2.0 / Matlab 4.2)
mat5MAT5 (GNU Octave 2.1 / Matlab 5.0)
pvfPVF (Portable Voice Format)
xiXI (FastTracker 2)
htkHTK (HMM Tool Kit)
sdsSDS (Midi Sample Dump Standard)
avrAVR (Audio Visual Research)
wavexWAVEX (Microsoft)
sd2SD2 (Sound Designer II)
flacFLAC (Free Lossless Audio Codec)
cafCAF (Apple Core Audio File)
wveWVE (Psion Series 3)
oggOGG (OGG Container format)
mpc2kMPC (Akai MPC 2k)
rf64RF64 (RIFF 64)
mpegMPEG-1/2 Audio

The string data-format is the format (*) of the sample for the output file and defaults to *default-data-format*.

FormatDescription
pcm-s8Signed 8 bit PCM
pcm-16Signed 16 bit PCM
pcm-24Signed 24 bit PCM
pcm-32Signed 32 bit PCM
pcm-u8Unsigned 8 bit PCM
float32 bit float
double64 bit float
ulawU-Law
alawA-Law
ima-adpcmIMA ADPCM
ms-adpcmMicrosoft ADPCM
gsm610GSM 6.10
vox-adpcmVOX ADPCM
nms-adpcm-1616kbs NMS ADPCM
nms-adpcm-2424kbs NMS ADPCM
nms-adpcm-3232kbs NMS ADPCM
g721-3232kbs G721 ADPCM
g723-2424kbs G723 ADPCM
g723-4040kbs G723 ADPCM
dwvw-1212 bit DWVW
dwvw-1616 bit DWVW
dwvw-2424 bit DWVW
dpcm-88 bit DPCM
dpcm-1616 bit DPCM
vorbisVorbis
opusOpus
alac-1616 bit ALAC
alac-2020 bit ALAC
alac-2424 bit ALAC
alac-3232 bit ALAC
mpeg-layer-IMPEG Layer I
mpeg-layer-IIMPEG Layer II
mpeg-layer-IIIMPEG Layer III

(*) The recognized headers and formats depend on the version of libsndfile.

metadata is a property list to set string metadata in output-filename. Not all file types support metadata. The valid properties are: title, copyright, software, artist, comment, date, album, license, tracknumber and genre.

The max number of scheduled events is the value of the configuration variable *nrt-edf-heap-size* (a power of two).

Macro: bounce-to-buffer (output-buffer &key input-buffer start frames sample-rate mix-p) &body body

Write the audio frames generated during body to the buffer structure output-buffer, starting from the buffer frame start (0 by default).

The execution of body doesn’t interfere with the real-time context.

If frames is non-NIL, it is the number of frames to write.

If input-buffer is a buffer structure, it represents the audio input accessible via audio-in.

sample-rate defaults to *sample-rate*.

If mix-p is t, mix the new data with the old content of the buffer.

The max number of scheduled events is the value of the configuration variable *nrt-edf-heap-size* (a power of two).

Macro: with-nrt (channels sample-rate &key bpm) &body body

Execute body without to interfere with the real-time context.

channels and sample-rate are the number of the output channels and the sample rate respectively.

bpm is the tempo in beats per minute and defaults to *default-bpm*.


4.30 Rego File

A rego file can contain time-tagged lisp functions, lisp statements, arbitrary score statements and lisp tags. Besides, the rego file format supports the Org markup language. It is possible to edit and organize score files with spreedsheet-like capabilities, headlines, unordered lists, blocks, properties, hyperlinks, todo items, tags, deadlines, scheduling, etc.

The syntax of a time-tagged lisp function is:

start-time-in-beats [time-increment]* function-name [arg1] [arg2] ...

The optional numbers between start-time-in-beats and function-name increment the start time. For example:

0.8          foo 220 .2
2.5 .15      foo 440 .5
3.2 .25 -.11 foo 432 .2

is equivalent to

0.8              foo 220 .2
(+ 2.5 .15)      foo 440 .5
(+ 3.2 .25 -.11) foo 432 .2

A line comment starts with a semicolon. A line continuation requires the character \ at the end of the line. The comments and the blocks in Org markup language are ignored too.

If the symbol // is used to separate the functions with the same time-tag, the result is a polyphonic vertical sequencer in text files. A quoted function name is ignored; useful to mute an instrument.

For example:

2.5 foo 440 .08 // bar 550 .1 // 'baz 660 .05 // sev 770 .1
3.2                           //  baz 330 .03
4.5 foo 220 .02                               // sev 772 .07

is equivalent to

2.5 foo 440 .08
2.5 bar 550 .1
2.5 sev 770 .1
3.2 baz 330 .03
4.5 foo 220 .02
4.5 sev 772 .07

Example with common start-time and different delay-time:

0 .11 i1 1 2 3 // .25 i2 1 2 3 //  .05 i3 1 2 3
1
2     i1 1 2 3 // .05 i2 1 2 3 // -.15 i3 1 2 3
3

is equivalent to

0.05 i3 1 2 3
0.11 i1 1 2 3
0.25 i2 1 2 3
1.85 i3 1 2 3
2.00 i1 1 2 3
2.05 i2 1 2 3

An isolated number is not a lisp tag otherwise a time-tagged function gets confused. A single column of numbers is useful for rhythm templates.

There are predefined variable bindings usable inside a rego file:

SCORE-ARGS

List of score function arguments.

SCORE-REALTIME-P

T if the events are scheduled in real-time.

TEMPO-ENV

Temporal envelope of the events.

TIME

Time offset in beats.

Note: we can use tempo-env within an event function only if the event terminates before the end of the rego file.

The score statement :score-time: sets the variable time. The name is surrounded by colons, so it is also a valid property in Org markup language. For example:

:PROPERTIES:
:score-time: 8
:END:

is equivalent to

(setf time 8)

The score statement :score-start-time: sets the start time in beats. The events scheduled before that time and the score start time of the included files are ignored.

It is possible to create other variable bindings through with at the beginning of the score. For example:

;;; test.rego
with (id 1) (last 4)

;; simple oscillators
0          simple 440 .2 :id id
1          simple 448 .2 :id (+ id 1)
(1- last)  simple 661 .2 :id (+ id 2)
last       free 0

We can also add a declare expression after the bindings.

The score statement :score-bindings: is an alias of with.

The score statement :score-package: sets the name of the package used to read the rest of the score lines. For example:

:score-package: string-quartet
0 vla p1 p2 p3
0 vl  q1 q2 q3

is equivalent to

0 string-quartet:vla string-quartet::p1 string-quartet::p2 string-quartet::p3
0 string-quartet:vl  string-quartet::q1 string-quartet::q2 string-quartet::q3

dur is a local macro to convert the duration from beats to seconds with respect to tempo-env.

tempo is a local macro to change the tempo of the score. The syntax is

(tempo bpm)
(tempo bpms beats &key curve loop-node release-node
                       restart-level real-time-p)

The score statement :score-tempo: is an alternative to the local macro tempo:

:score-tempo: bpm
:score-tempo: bpms beats &key curve [...]

If a function created with regofile->function or regostring->function is scheduled in real-time:

;; The real scheduled time is `(+ time latency)'.
(at time function-from-regofile ...)

there is a latency introduced during the creation of a temporary queue for the score events (see also with-schedule). If a precise scheduling in real-time is required, the score statement :score-realtime-offset: sets the absolute time offset in samples for the scheduled score events. For example, if the rego file begins with the following lines:

:score-tempo: '(180 95) '(4) :curve :exp
:score-realtime-offset: (tempo-sync #[4 b tempo-env 0])

a scheduled function is synchronized to a period of 4 beats.

The syntax to include the content of an external rego file is:

include "regofile" [time] {value}* {(var value)}*

where time is an optional time offset in beats, and the variable bindings set some score bindings of the included file. For example:

include "phrase-7.rego"
include "phrase-7.rego" 4
include "phrase-7.rego" 8 (keynum 63) (channel 3)

;; Set the first score binding and CHANNEL in "phrase-7.rego".
include "phrase-7.rego" 12 68 (channel 3)

;; Set the first two score bindings in "phrase-7.rego".
include "phrase-7.rego" 16 70 3

time and tempo-env are a parent’s copy within an included rego file, so we can locally change the temporal envelope and/or the time offset without side effects. Moreover, all the local bindings and the labels contained in a rego file continue to have lexical scope and dynamic extent, therefore it is possible to include the same rego file multiple times without name collisions.

A time-tagged string is an alternative syntax to include the content of a rego file:

time "regofile" {value}* {(var value)}*

There is not a specific limit on the depth of included rego files.

A score macro is defined with a macro block in Org markup language:

#+begin_macro name
...
#+end_macro

The syntax for a score macro expansion is:

name [time] {value}* {(var value)}*

or the time-tagged version:

time name {value}* {(var value)}*

The inclusion of a rego file is equivalent to the expansion of a score macro defined with the same file contents (dynamic extent bindings, tempo, etc). For example:

:score-tempo: 120

#+begin_macro macro-test
with x y z
:score-tempo: '(120 30) '(12) :curve :exp
0 test x
4 test y
8 test z
#+end_macro

16 bridge

|------------+------+---+---+---|
| !          | time | x | y | z |
|------------+------+---+---+---|
| macro-test |    0 | 1 | 2 | 3 |
| macro-test |   12 | 4 | 5 | 6 |
|------------+------+---+---+---|

30 free 0

is equivalent to

0.0d0                test 1
2.542321754062445d0  test 2
6.0d0                test 4
6.578005980902809d0  test 3
8.0d0                bridge
8.542321754062446d0  test 5
12.578005980902809d0 test 6
15.0d0               free 0

A rego file ends after the last event or after a long pending event if the duration is known (defined with the local macro dur). For example:

0    ...
1.5  ...
3    ...

ends after 3 beats but

0    ...
1.5  ... (dur 5) ...
3    ...

ends after 6.5 beats.

A line with a form feed character marks the end of score. For example, we can create and edit a rego file in Emacs SES (Simple Emacs Spreadsheet) mode.

The score statement :score-radix: sets the variable *read-base* to read the rest of the score lines.

:score-radix: defaults to 10 if there is not a parent rego file.

Example:

12 i2 60 100
15 i2 63 78

:score-radix: 16
00 i1 7f ff 1f 1a
0b i1 2b 08 0c 3c

;; Ratios are affected by *READ-BASE*
ff/1f i3 1/ff f/a

:score-radix: 2
00011010 add 10101010 11001011

Warning: we could introduce some bugs if :score-radix: is greater than 10. For example:

:score-radix: 16
0 cc 10 7f
1 foo 'babba

is equivalent to

0 204 16 127
1 foo 764858

The score statement :score-float-format: sets the variable *read-default-float-format* to read the rest of the score lines.

:score-float-format: defaults to double-float (the sample type) if there is not a parent rego file.

Example:

0 print (list 1.0 1.2345 1.125s3 123.456d0 1f-3 1d-3 1e-3 1.234l0)
;; => (1.0d0 1.2345d0 1125.0 123.456d0 0.001 0.001d0 0.001d0 1.234d0)

:score-float-format: single-float
0 print (list 1.0 1.2345 1.125s3 123.456d0 1f-3 1d-3 1e-3 1.234l0)
;; => (1.0 1.2345 1125.0 123.456d0 0.001 0.001d0 0.001 1.234d0)

** double-float again
   :PROPERTIES:
   :score-float-format: double-float
   :END:

0 print (list 1.0 1.2345 1.125s3 123.456d0 1f-3 1d-3 1e-3 1.234l0)
;; => (1.0d0 1.2345d0 1125.0 123.456d0 0.001 0.001d0 0.001d0 1.234d0)

0 force-output

The score statement call pushes the return position on the stack and transfers program control to the point labeled by a tag. The score statement return transfers control to the return position located on the top of the stack.

Syntax for call statement (a tag between [[]] is a facility for the Org markup language):

call tag
call tag time
call [[tag]] time                ; the target label is <<tag>>
call [[tag][description]] time   ; the target label is <<tag>>

Example:

* score
** sequence
call p1 0
call [[p2][pattern two]] 1
call p3 1.5
call p1 2
return              ; end of score

** pattern 1
p1
0 write-line "pattern 1" // force-output
call p3 .1
call p3 .25
return

** pattern 2
<<p2>>
0 write-line "pattern 2" // force-output
return

** pattern 3
p3
0 write-line "pattern 3" // force-output
return
Macro: defscore-statement name args &rest body

Define an arbitrary score statement named name, formed by the elements of the returned list.

The name of the score statement is a symbol or a string. The symbol SomeName is equivalent to the string “somename”. The symbol |SomeName| is equivalent to the string “SomeName”.

Example:

(defscore-statement i1 (time dur freq amp)
  `(,time my-func (dur ,dur) ,freq ,amp))

where the Csound score statement

i1 3.4 1.75 440 .3

will be expanded in a time tagged lisp function

3.4 my-func (dur 1.75) 440 0.3
Function: delete-score-statement name

Delete the score statement defined by defscore-statement or ignore-score-statements.

Function: ignore-score-statements name-list

Ignore the score statements in name-list. The name of a statement is a symbol, a string or a list of two score statements which delimit a score block to ignore.

Variable: *score-readtable*

Readtable to read a rego file.

Function: regofile->sexp path &optional function-name compile-rego-p

From a rego file path, return the corresponding lisp form inside the definition of a function optionally named function-name.

If compile-rego-p is nil (default), use an interpreter to evaluate the event list at runtime when this function is called.

Function: regofile->function path &optional function-name compile-rego-p

From a rego file path, define a function optionally named function-name to evaluate the corresponding lisp form.

If compile-rego-p is nil (default), use an interpreter to evaluate the event list at runtime.

The score statement :score-function-name: or :score-local-function-name: is an alternative method to set the function name.

Example:

* Score functions recursively scheduled
:PROPERTIES:
:score-bindings: (n (or (pop score-args) 12345)) \
                 (m (or (pop score-args) 16)) \
                 (local-call-p (pop score-args)) \
                 (freq (* m 100)) \
                 (next (if score-realtime-p 1/8 1/4)) \
                 (last (if score-realtime-p (- 4 1/8) 4))
:score-function-name: rego-function-name-test-1
:score-local-function-name: self
:score-tempo: 240
:score-realtime-offset: (tempo-sync #[1/4 beats tempo-env 0])
:END:

#+begin_src incudine :results silent
  (dsp! rego-test-3 (freq amp dur)
    (stereo (* (envelope (make-perc .1 .9) 1 dur #'free)
               (sine freq amp))))
#+end_src

** Recursion of SELF

(unless (> m 0) (go end-of-score))

0 rego-test-3 (* freq (expt 2 3/12)) (/ m 20) (dur 1/5)
next self n (1- m) t

(if local-call-p (go end-of-score))

** Recursion of REGO-FUNCTION-NAME-TEST-1

(unless (> n 0) (go end-of-score))

last rego-function-name-test-1 (1- n) 16

(if (< n 12345) (go end-of-score))

** New definition for REGO-FUNCTION-NAME-TEST-1

;; The definition of REGO-FUNCTION-NAME-TEST-1 changes after 3 cycles
;; but the recursive local function SELF fills the fourth cycle.
(* 4 3) .1 (lambda () (setf (symbol-function 'rego-function-name-test-1) \
                            (constantly nil)))

** End

end-of-score
Function: regostring->function string &optional function-name compile-rego-p

From a string containing a score in rego file format, define a function optionally named function-name to evaluate the corresponding lisp form.

If compile-rego-p is nil (default), use an interpreter to evaluate the event list at runtime.

The score statement :score-function-name: or :score-local-function-name: is an alternative method to set the function name.

Function: regofile->lispfile path &optional function-name lisp-file compile-rego-p

Convert from a rego file to a lisp file.

The lisp file contains the definition of a function optionally named function-name.

If lisp-file is nil, the name of the lisp file is the name of the rego file path with file extension “cudo”.

If compile-rego-p is nil (default), use an interpreter to evaluate the event list at runtime when the function is called.

Function: regofile->list path &key score-args

From a rego file path, return the corresponding event list as a list of lists (time function-name &rest arguments).

Function: regostring->list string &key score-args

From a string containing a score in rego file format, return the corresponding event list as a list of lists (time function-name &rest arguments).

Function: regolist->file list path

Write a rego file path with the event list obtained from a list of lists (time function-name &rest arguments).


4.31 Networking


4.31.1 General Stream Sockets

Type: net:stream

Stream socket type.

Extension of osc:stream.

Structure: net:input-stream

Input stream socket type.

Extension of osc:input-stream.

Function: net:input-stream-p object

Return t if object is of type net:input-stream.

Structure: net:output-stream

Output stream socket type.

Extension of osc:output-stream.

Function: net:output-stream-p object

Return t if object is of type net:output-stream.

Constant: net:+default-msg-flags+

Default flags for the C functions send, sendto, recv and recvfrom. It defaults to MSG_NOSIGNAL (don’t generate a sigpipe signal) on Linux. See the manual pages of the C functions and bits/socket.h for details.

Variable: net:*buffer-size*

Size in bytes of the net:stream buffer used to read or write octets.

Variable: net:*listen-backlog*

The maximum length to which the queue of pending connections for a socket stream may grow.

Function: net:host stream

Return the address associated with stream.

Function: net:port stream

Return the numeric port associated with stream.

Function: net:direction stream

Return the stream direction.

Function: net:protocol stream

Return the stream protocol.

Function: net:protocolp stream protocol

Return t if the stream protocol is protocol; otherwise, return nil.

Function: net:buffer-pointer stream

Return the foreign pointer to the stream buffer.

Function: net:buffer-size stream

Return the size in bytes of the stream buffer.

Function: net:open &key host port direction protocol buffer-size auto-connect-p max-values message-encoding

Create and return a new net:stream.

The host address/name and port default to “localhost” and 24134 (aka #36rime).

direction is :input (default) or :output to return a net:input-stream or a net:output-stream respectively.

protocol is :tcp (default) or :udp. If protocol is :tcp and auto-connect-p is t (default), try to connect the output stream socket. See also incudine.net:connect and incudine.net:connected-p.

buffer-size is the size in bytes of the buffer used to read or write octets. It defaults to net:*buffer-size*.

If the net:stream is also used with the OSC (Open Sound Control) utilities (i.e. osc:send and osc:receive), max-values is the maximum number of the required values of a OSC message. It defaults to osc:*max-values*. message-encoding is nil (default) or :slip.

Function: net:open-p stream

Whether stream is an open stream socket.

Variable: net:*before-close-hook*

List of the functions of one argument called before to close a stream socket. The function argument is the stream to close.

Function: net:close stream

Close the stream socket.

Function: net:read stream &optional flags

Receive a message from a stream socket and return the number of octets read.

flags defaults to net:+default-msg-flags+. See the manual pages for recv and recvfrom for details on the flags argument.

Function: net:write stream obj &key start end flags

Send the octets from obj into a stream socket and return the number of octets written.

obj is one of nil, a vector of octets or a string. If nil, send the octets stored in the stream buffer.

start and end are the bounding index designators of the array.

flags defaults to net:+default-msg-flags+. See the manual pages for send and sendto for details on the flags argument.

Function: net:foreign-read stream buffer-pointer buffer-size &optional flags

Read buffer-size octets from a stream socket into a foreign buffer pointed to by buffer-pointer. Return the number of octets read.

flags defaults to net:+default-msg-flags+. See the manual pages for recv and recvfrom for details on the flags argument.

Function: net:foreign-write stream buffer-pointer buffer-size &optional flags

Send buffer-size octets from a foreign buffer pointed to by buffer-pointer into a stream socket. Return the number of octets written.

flags defaults to net:+default-msg-flags+. See the manual pages for send and sendto for details on the flags argument.

Function: net:broadcast stream

Whether broadcasting is enabled for the stream socket. Setfable.

Function: net:block-p stream

Whether the stream socket is in blocking mode. Setfable.

Macro: net:without-block (var input-stream) &body body

Bind var to input-stream socket and set the non-blocking mode during body.

Function: net:socket-fd stream

Return the socket file descriptor of the stream socket.

Function: net:last-recv-fd stream

Return the file descriptor for the accepted connection used to get the last received message.

Function: net:socket-send sockfd octets &optional flags

Send octets on a socket with file descriptor sockfd.

flags defaults to net:+default-msg-flags+. See the manual pages for send and sendto for details on the flags argument.

Function: net:connect stream

Close the output stream socket, create a new socket and try to connect it.

Function: net:connected-p stream

Whether stream socket is connected.

Function: net:connections stream

Return the number of the connections accepted by the listening stream socket.

Function: net:connections-fd stream

Return the file descriptors of the connections accepted by the listening stream socket.

Function: net:close-connections stream

Close all the connections to the stream socket.

Function: net:reject stream

Close the input stream socket and create a new socket.

Function: net:buffer-to-string stream

Return the string stored in the buffer of the stream socket.

Function: net:string-to-buffer string stream

Copy the string into the buffer of the stream socket.

Function: net:buffer-to-octets stream &optional octets start end

Return the vector of octets stored in the buffer of the stream socket.

Create a new vector if octets is nil (default).

start and end are the bounding index designators of the vector.

Function: net:octets-to-buffer octets stream &optional start end osc-message-p

Copy the octets into the buffer of the stream socket.

start and end are the bounding index designators of the vector.

If osc-message-p is t (default), the content of the buffer is an OSC message and the osc:stream structure is specially updated.

Function: net:slip-encode stream &optional ptr length

Serial Line ip encoding.

Function: net:slip-decode stream

Serial Line ip decoding.


4.31.2 Open Sound Control

Structure: osc:stream

Stream socket type for OSC (Open Sound Control) messages.

Structure: osc:input-stream

Input stream socket type for OSC (Open Sound Control) messages.

Function: osc:input-stream-p object

Return t if object is of type osc:input-stream.

Structure: osc:output-stream

Output stream socket type for OSC (Open Sound Control) messages.

Function: osc:output-stream-p object

Return t if object is of type osc:output-stream.

Variable: osc:*buffer-size*

Size in bytes of the osc:stream buffer used to read or write octets.

Variable: osc:*max-values*

Maximum number of the values required by an OSC message.

Function: osc:latency stream

Latency in seconds for OSC bundles sent from stream. Setfable.

Function: osc:max-values stream

Maximum number of the values required by an OSC message for stream.

Function: osc:message-encoding stream

Return the encoding type associated with stream. Setfable.

Function: osc:open &key host port direction protocol buffer-size latency auto-connect-p max-values message-encoding input-stream-constructor output-stream-constructor

Create and return a new osc:stream.

The host address/name and port default to “localhost” and 32126 (aka #36rose).

direction is :input (default) or :output to return an osc:input-stream or an osc:output-stream respectively.

protocol is :tcp or :udp (default). If protocol is :tcp and auto-connect-p is t (default), try to connect the output stream socket. See also incudine.net:connect and incudine.net:connected-p.

buffer-size is the size in bytes of the buffer used to read or write octets. It defaults to osc:*buffer-size*.

latency (0 by default) is the latency in seconds for OSC bundles.

max-values is the maximum number of the required values of an OSC message. It defaults to osc:*max-values*.

message-encoding is nil (default) or :slip.

Macro: osc:with-stream (stream &rest arguments) &body body

Use osc:open with arguments to create an osc:stream. When control leaves the body, either normally or abnormally, the osc:stream is automatically closed.

Function: osc:message-pointer stream

Return the foreign pointer to the OSC message stored in the stream buffer.

Function: osc:message-length stream

Return the length of the OSC message stored in the stream buffer. Setfable.

Function: osc:bundle-length stream

If the contents of the stream buffer are an OSC bundle, return the length of that bundle. Otherwise, return zero.

Function: osc:message-time stream &optional time-unit

If the OSC packet received through the stream socket is an OSC bundle, return the time obtained from the OSC time tag. Otherwise, return zero.

If time-unit is nil (default), the time value in samples is suitable as first argument to incudine:at

(at (osc:message-time stream) function ...)

where message-time is the OSC bundle time or zero.

If time-unit is seconds, the bundle time is in universal time format.

Function: osc:message stream address types &rest values

Send an OSC message with OSC address, OSC types and arbitrary values.

OSC typeLisp type
b(or simple-vector (simple-array (unsigned-byte 8) (*)))
cstandard-char
ddouble-float
fsingle-float
Fno required value
h(signed-byte 64)
i(signed-byte 32)
Ino required value
m(unsigned-byte 32) i.e. (midifile:message 176 7 42)
Nno required value
sstring
Sstring
t(or (unsigned-byte 64) double-float)
Tno required value

No buffer bounds checking because it is an unnecessary lost of time for the usual OSC messages. You can call your bounds checking routine before osc:message if you are sending OSC messages out of control. See also :buffer-size and :max-values in osc:open.

Function: osc:start-message stream address types

Write the OSC address pattern and the OSC types to the stream buffer, then index the required values.

No buffer bounds checking because it is an unnecessary lost of time for the usual OSC messages. You can call your bounds checking routine before osc:start-message if you are sending OSC messages out of control. See also :buffer-size and :max-values in osc:open.

Function: osc:send stream &optional flags

Send the OSC message stored in the stream buffer.

flags defaults to net:+default-msg-flags+. See the manual pages for send and sendto for details on the flags argument.

Function: osc:simple-bundle stream seconds address types &rest values

Send an OSC message with timestamp seconds plus stream latency, OSC address, OSC types and arbitrary values.

If values is :send-p nil, or there are no values and the string types implies some required values, prepare the OSC message but don’t send it.

The OSC timestamp seconds is used with dual meaning: if it is greater than 63103 seconds (about 17 hours), the time is absolute otherwise it is added to the current time. 63104 is the offset of the NTP Timestamp Era 1 (from 8 Feb 2036), so this hack will work for centuries.

No buffer bounds checking because it is an unnecessary lost of time for the usual OSC messages. You can call your bounds checking routine before osc:simple-bundle if you are sending OSC messages out of control. See also :buffer-size and :max-values in osc:open.

Example:

(osc:simple-bundle stream .5 "/osc/test" "iii" 1 2 3)
;; => 52

is equivalent to

(osc:simple-bundle stream 0 "/osc/test" "iii")
;; => 0

(setf (osc:value stream 0) 1)
(setf (osc:value stream 1) 2)
(setf (osc:value stream 2) 3)
(osc:send-bundle stream .5)
;; => 52
Function: osc:bundle stream seconds message &rest more-messages

Send an OSC bundle with timestamp seconds plus stream latency. An OSC message is a list

(address types &rest values)

If seconds is nil, prepare the OSC message but don’t send it.

The OSC timestamp seconds is used with dual meaning: if it is greater than 63103 seconds (about 17 hours), the time is absolute otherwise it is added to the current time. 63104 is the offset of the NTP Timestamp Era 1 (from 8 Feb 2036), so this hack will work for centuries.

No buffer bounds checking. You can call your bounds checking routine before osc:bundle if you are sending OSC messages out of control. See also :buffer-size and :max-values in osc:open.

Example:

(defvar *oscout* (osc:open :direction :output :port 9999))

(osc:bundle *oscout* 3/4
  '("/bp/freq" "f" 2909.09)
  '("/bp/q" "f" 60.0)
  '("/bp/gain" "f" 6.5))

(loop for i below (osc:required-values *oscout*)
      collect (osc:value *oscout* i))
;; => (2909.09 60.0 6.5)

(setf (osc:value *oscout* 0) 3469.88)
(setf (osc:value *oscout* 2) 8.2)
(osc:send-bundle *oscout* .4)
Function: osc:send-bundle stream &optional seconds flags

Send the OSC bundle stored in the stream buffer with OSC timestamp seconds (0.0 by default) plus the stream latency.

See osc:bundle or osc:simple-bundle for details about the OSC timestamp seconds.

flags defaults to net:+default-msg-flags+. See the manual pages for send and sendto for details on the flags argument.

Note: osc:send-bundle continues to work after osc:message if the message length is equal to the length of the prior contents.

Function: osc:receive stream &optional flags

Store the received OSC packet into the stream buffer.

If the packet is an OSC bundle, the current OSC message is the first message of that bundle. The other messages are queued for the successive calls to osc:receive. See osc:message-time for the time value obtained from the OSC time tag.

flags defaults to net:+default-msg-flags+. See the manual pages for recv and recvfrom for details on the flags argument.

Return the number of bytes of the OSC message.

Function: osc:end-of-bundle-p input-stream

Return t if the current OSC message is the last of the received OSC bundle, and a secondary value t if the message is part of a bundle.

Function: osc:flush-bundle input-stream

osc:flush-bundle discards the queued OSC messages.

The next call to osc:receive waits for a new OSC packet.

Function: osc:copy-packet source destination

Copy the contents of an OSC stream buffer to an OSC output stream buffer.

No bounds checking. You can call your bounds checking routine if the streams were created with different buffer size or maximum number of required values (see buffer-size and max-values parameters to osc:open).

Function: osc:address-pattern stream &optional typetag-p

Return the OSC address pattern stored in the stream buffer, and the OSC type tag as secondary value if typetag-p is t.

Function: osc:check-pattern stream address types

Return t if the OSC address pattern and the OSC type tag stored in the stream buffer are address and types.

Function: osc:index-values stream &optional force-p swap-p

If necessary or force-p is t, update the foreign pointers to the required values of the OSC message stored in the stream buffer.

If swap-p is t, the byte order of the values is reversed on little endian machine.

Function: osc:value stream index

Access a required value of the OSC message stored in the stream buffer. The OSC value is specified by the zero-based index.

Setfable with no buffer bounds checking when the value is a string or a blob. You can call your bounds checking routine before (SETF osc:value) if you are changing the data length out of control. See also :buffer-size and :max-values in osc:open.

Function: osc:value-pointer stream index

Return the foreign pointer to a required value of the OSC message stored in the stream buffer. The OSC value is specified by the zero-based index.

No bounds checking.

Macro: osc:with-values value-names (stream types) &body body

Create new symbol macro bindings value-names to the OSC values of an osc:stream with OSC types during body.

Example:

(incudine.osc:with-values (a b c) (*oscin* "iii")
  (msg info "~D ~D ~D" a b c))
Function: osc:required-values stream

Number of the required values of the OSC message stored in the stream buffer.

Function: osc:midi port-id status data1 data2

Encode a short MIDI message into an OSC value with MIDI message type tag (m).

Function: osc:fix-size n

Adjust the size n of a zero-padded OSC data. The new size will be a multiple of four (bytes).


4.32 Serial IO

Function: open-serial-port port &key baud-rate element-type

Create, open and return a stream that is connected to a serial port with speed baud-rate, 8 data bits, no parity checking and one stop-bit.

baud-rate defaults to 9600.

element-type is the type specifier character (default) or unsigned-byte 8.

Example:

(in-package :scratch)

(defvar *uno* (open-serial-port "/dev/ttyACM0"))

(make-responder *uno*
  (lambda (x)
    (when (numberp x)
      (barrier (:write)
        (setf (bus 0) (sample (the single-float x))))
      nil)))

(recv-start *uno*
  :read-function (lambda (stream)
                   (let ((str (read-line stream nil nil)))
                     (and str (parse-float str)))))

;; stop
(recv-stop *uno*)
(remove-all-responders *uno*)
(remove-receiver *uno*)
(close *uno*)
Function: serial-stream-p stream

Whether stream refers to a serial port.

Function: serial-flush stream &key direction

If direction is :input or :io (default), flush data received from the serial port stream but not read.

If direction is :output or :io, flush data written to stream but not transmitted.


4.33 Midifile

Structure: midifile:stream

MIDI file stream type.

Structure: midifile:input-stream

MIDI file input stream type.

Function: midifile:input-stream-p object

Return t if object is of type midifile:input-stream.

Structure: midifile:output-stream

MIDI file output stream type.

Function: midifile:output-stream-p object

Return t if object is of type midifile:output-stream.

Function: midifile:open filename &key direction if-exists format ppqn buffer-size

Create and return a new midifile:stream.

direction is :input (default) or :output to return a midifile:input-stream or a midifile:output-stream respectively.

if-exists should be one of :error, :new-version, :rename, :rename-and-delete, :overwrite, :append, :supersede or nil. The default is :error.

If direction is :output, the MIDI file format defaults to 0 and ppqn (Pulses Per Quarter Note) defaults to 480.

Function: midifile:open-p mf

Whether mf is an open midifile:stream.

Function: midifile:close mf

Close a midifile:stream.

If mf is a midifile:output-stream, write the current track.

Macro: midifile:with-open-midifile (midifile-stream filespec &rest options) &body body

Use midifile:open to create a midifile:stream. When control leaves the body, either normally or abnormally, the midifile:stream is automatically closed.

Generic Function: midifile:read-header obj

Read the header of a MIDI file and return four values: format, number of tracks, ppqn-or-smpte-format and ticks-per-frame.

Generic Function: midifile:write-header obj &key format number-of-tracks ppqn-or-smpte-format ticks-per-frame

Write the header-chunk of a MIDI file.

Default values for defined keywords:

:FORMAT 0
:NUMBER-OF-TRACKS 1
:PPQN-OR-SMPTE-FORMAT 480
:TICKS-PER-FRAME 0
Function: midifile:read-event mf

Read the next event from a midifile:input-stream and return the status byte.

Example:

(in-package :scratch)

(dsp! oscilla ((keynum fixnum) (velocity fixnum) scaler gate)
  (with-samples ((freq (tuning-cps *default-tuning* keynum))
                 (amp (* scaler velocity (sample 1/127))))
    (stereo (* (envelope (make-adsr .001 .09 .8 .7) gate 1 #'free)
               (sine freq amp)))))

(defun get-id-by-midi-note (channel keynum)
  (+ (ash channel 7) keynum 1))

(defun oscillante (status data1 data2)
  (let ((ch (logand status #xF)))
    (cond ((midi-note-on-p status)
           (oscilla data1 data2 1/10 1
                    :id (get-id-by-midi-note ch data1)))
          ((midi-note-off-p status)
           (set-control (get-id-by-midi-note ch data1) :gate 0)))))

(defun play-midifile (path)
  (with-schedule
    (with-open-midifile (mf path)
      (loop for st = (midifile:read-event mf)
            while st
            when (< st #xF0)
              do (at (* (midifile:event-seconds mf) *sample-rate*)
                     #'oscillante st
                     (midifile:message-data1 mf)
                     (midifile:message-data2 mf))))))

;; Note: all the events are scheduled if the value of the configuration
;; variable *RT-EDF-HEAP-SIZE* in ${HOME}/.incudinerc is at least:
(with-open-midifile (mf "/path/to/file.mid")
  (next-power-of-two (loop while (midifile:read-event mf) sum 1)))

(rt-start)

(play-midifile "/path/to/file.mid")

;; Stop playing before the end if necessary.
(flush-pending)
(free 0)

;; Write a sound file.
(with-logger (:level :info)
  (bounce-to-disk ("oscilla-test.wav" :channels 2 :duration 60)
    (play-midifile "/path/to/file.mid")))
Function: midifile:write-short-event mf beats msg size

Write a MIDI event with the message msg of size size encoded into four bytes to the midifile:output-stream mf.

beats is the absolute time of the message in beats. If the event precedes the last event, it is added with delta-time zero.

Function: midifile:write-event mf beats data &key start end

Write a MIDI event with the message stored in the octets data to the midifile:output-stream mf.

beats is the absolute time of the message in beats. If the event precedes the last event, it is added with delta-time zero.

The octets data are optionally bounded by start and end.

Function: midifile:write-tempo-track mf tempo-envelope &key transition-time-step write-track-chunk-p

Write a tempo track to a midifile:output-stream mf with the tempo changes obtained from a incudine:tempo-envelope.

It fails if the current track contains events at non-zero time.

If the curve of a transition is not :step, transition-time-step is the time in beats between adjacent points during that transition.

transition-time-step defaults to 1/8.

If write-track-chunk-p is t (default), write the track chunk and return the number (zero based) of the next track, otherwise return the number of the current track.

write-tempo-track works with a single time-signature (or two if the last doesn’t precede the time of the last tempo change). If there are not location markers between the first and the last tempo changes, it is also possible to add markers before to write the track chunk.

Example:

(midifile:write-event mf 0 (midifile:string-message 3 "tempo track"))
;; Initial time signature.
(midifile:write-event mf 0 (midifile:data #xFF #x58 4 3 2 24 8))
(midifile:write-tempo-track mf tempo-env :write-track-chunk-p nil)
;; WRITE-TRACK-CHUNK-P NIL allows to insert other MIDI messages
;; starting from the time of the last tempo change.
[...]
;; Write the track chunk (required if WRITE-TRACK-CHUNK-P is NIL).
(midifile:next-track mf)
Function: midifile:message status &optional data1 data2

Encode a short MIDI message into four bytes.

Function: midifile:tempo-message bpm

Return the octets of a MIDI tempo change of bpm beats per minute.

Function: midifile:string-message meta-event-type string

Return the octets of a text-based Meta event of type meta-event-type.

Function: midifile:path mf

Return the pathname of the midifile:stream mf.

Type: midifile:data

Type designator for a vector of octets.

Function: midifile:data &rest octets

Return a vector of octets.

Generic Function: midifile:format obj

Return the format of a MIDI file.

Generic Function: midifile:ppqn obj

Return the pulses per quarter note of a MIDI file.

Generic Function: midifile:smpte obj

Return two values: smpte-format and ticks-per-frame of a MIDI file.

Generic Function: midifile:number-of-tracks obj

Return the number of tracks of a MIDI file.

Function: midifile:current-track mf

Return the current track of the midifile:stream mf.

Generic Function: midifile:next-track obj

Return the number (zero based) of the next track or nil if obj is of type midifile:input-stream and there aren’t other tracks to read. Write the current track if obj is of type midifile:output-stream.

Function: midifile:end-of-track mf &optional beats

Write a MIDI End Of Track Meta event with absolute time beats. If beats is 0 (default), write the event with delta time zero.

End Of Track Meta event is automatically added if necessary before to write a track by calling midifile:next-track or midifile:close.

Multiple End Of Track Meta events are ignored.

Structure: midifile:tempo

MIDI file tempo type.

Generic Function: midifile:tempo obj

If the MIDI file contains more than one tempo event, return two lists: the values in bpm and the delta-times of the changes in beats (useful to create a incudine:tempo-envelope structure). If there aren’t changes, return the tempo in bpm.

Function: midifile:message-status mf

Return the status byte of the MIDI message read from the midifile:input-stream mf.

Function: midifile:message-data1 mf

Return the first data byte of the MIDI message read from the midifile:input-stream mf.

Function: midifile:message-data2 mf

Return the second data byte of the MIDI message read from the midifile:input-stream mf.

Function: midifile:message-length mf

Return the length of the MIDI message read from the midifile:input-stream mf.

Function: midifile:message-buffer mf

Return the buffer that contains the MIDI message read from the midifile:input-stream mf and the length of that message in bytes.

Function: midifile:event-time mf

Return the time in pulses of the last event read from a midifile:input-stream.

Function: midifile:event-delta-time mf

Return the delta time in pulses of the last event read from the midifile:input-stream mf.

Function: midifile:event-beats mf &optional output-type-spec

Return the time in beats of the last event read from a midifile:input-stream.

output-type-spec is the type of the returned value and defaults to double-float.

Function: midifile:event-seconds mf

Return the time in seconds of the last event read from a midifile:input-stream.

Function: midifile:release-cached-buffers

Release the cached adjustable buffers for midifile:stream.


4.34 Soundfile

Structure: soundfile:stream

Sound file stream type.

Structure: soundfile:input-stream

Sound file input stream type.

Function: soundfile:input-stream-p object

Return t if object is of type soundfile:input-stream.

Structure: soundfile:output-stream

Sound file output stream type.

Function: soundfile:output-stream-p object

Return t if object is of type soundfile:output-stream.

Function: soundfile:open filename &key direction if-exists sample-rate channels header-type data-format data-location buffer-size input-stream-constructor output-stream-constructor

Create, open and return a soundfile:stream that is connected to the file specified by filename.

direction is :input (default) or :output to return a soundfile:input-stream or a soundfile:output-stream respectively.

if-exists should be one of :append, :error (default), :mix, :overwrite or :supersede. If it is :supersede and there is a jump back of the file position during the output operations on the stream, the writing continues in mix mode).

sample-rate, channels, header-type and data-format determine the header of the new sound file and default to *sample-rate*, 1, *default-header-type* and *default-data-format*, respectively. See incudine:bounce-to-disk for the list of available header types and data formats.

data-location is the data start offset in bytes for a hederless file.

buffer-size is the size of the internal stream buffer and defaults to *sndfile-buffer-size*.

Function: soundfile:open-p sf

Whether sf is an open soundfile:stream.

Function: soundfile:close sf

Close a soundfile:stream.

Macro: soundfile:with-open-soundfile (stream filespec &rest options) &body body

Use soundfile:open to create a soundfile:stream. When control leaves the body, either normally or abnormally, the soundfile:stream is automatically closed.

Function: soundfile:update-header sf &key auto-p

Update the header of the file connected to the soundfile:output-stream sf.

If auto-p is t, the file header is updated after each write to the stream.

Turn off the auto header update if auto-p nil is explicitly specified.

Return t if the sound file header is updated, or if the auto header update is turned on. Otherwise, return nil.

Generic Function: soundfile:read-header obj

Read the header of a sound file and return five values: sampling rate, number of frames, number of channels, header type and data format.

Function: soundfile:read sf &optional frame channel peek-p forward-p

Read and return a value from soundfile:stream sf at frame (current by default) and channel (0 by default).

If peek-p is t (default), don’t increment the frame counter. If peek-p is nil, read forward if forward-p is t (default) or backward if forward-p is nil.

Function: soundfile:read-next sf &optional channel peek-p forward-p

If peek-p is nil (default), read and return the next value from soundfile:stream sf at channel (default 0). If peek-p is t, return the value of the current frame.

If peek-p is nil, read forward if forward-p is t (default) or backward if forward-p is nil.

Function: soundfile:read-into-buffer sf &optional update-status-p

Fill the internal stream buffer of soundfile:stream sf by reading the next data samples.

If update-status-p is t (default), update the status of sf.

Function: soundfile:foreign-read sf buffer-pointer buffer-size &optional update-position-p

A foreign buffer of type double float pointed to by buffer-pointer is filled with the next buffer-size items read from the soundfile:stream sf.

Return the number of items read.

Function: soundfile:write sf frame value &optional channel

Write value to soundfile:output-stream sf at frame and channel (0 by default).

Function: soundfile:foreign-write sf buffer-pointer buffer-size

Write buffer-size values stored in a foreign buffer of type double float pointed to by buffer-pointer to the soundfile:output-stream sf.

Return the number of the items written.

Function: soundfile:eof-p sf

Whether end of file for soundfile:stream sf is reached.

Function: soundfile:duration obj

Return the duration in seconds of the sound data in sound file.

Function: soundfile:channels obj

Return the number of channels of the sound file.

Function: soundfile:frames obj

Return the number of frames of the sound file.

Function: soundfile:sample-rate obj

Return the sampling rate of the sound file.

Function: soundfile:header-type obj

Return the header type of the sound file.

Function: soundfile:data-format obj

Return the data format of the sound file.

Generic Function: soundfile:metadata obj type

Return the string metadata type of the sound file.

type is of type symbol or string and should be one of title, copyright, software, artist, comment, date, album, license, tracknumber or genre.

Setfable.

Function: soundfile:data-location filename

Return the data location of the sound file filename.

Function: soundfile:path sf

Return the pathname of the soundfile:stream mf.

Function: soundfile:buffer-data sf

Return the foreign pointer to the sample data of soundfile:stream sf.

Function: soundfile:buffer-size sf

Return the data size of the sample data of soundfile:stream sf.

Function: soundfile:buffer-value sf index

Return the stream buffer value of soundfile:stream sf specified by index.

Function: soundfile:buffer-index sf

Return the stream buffer index of soundfile:stream sf for the first channel of the current frame.

Function: soundfile:current-frame sf

Return the current frame of soundfile:stream sf.

Function: soundfile:position sf

Return the current position in frames of soundfile:stream sf. Setfable.

Function: soundfile:offset sf

Return the stream position offset in frames of soundfile:stream sf. Setfable.

Function: soundfile:maxamp infile &optional channel

Return the maximum amplitude of the sound file infile.

infile is of type pathname or string.

If channel is an integer, return the maximum amplitude of that channel.

Function: soundfile:convert infile outfile header-type data-format &key normalize scale-by scale-to

Convert the sound file infile to another format with header-type and data-format. The resultant sound file outfile is overwritten if it already exists.

The sample data is possibly normalized to normalize dB or scale-to [0.0,1.0], or scaled by scale-by.

See incudine:bounce-to-disk for the list of available header types and data formats.

Function: soundfile:concatenate output-file input-files &key if-exists header-type data-format buffer-size

output-file is the concatenation of the sound files input-files.

The input files must have the same sampling rate and number of channels.

output-file is written with header-type and data-format that default to *default-header-type* and *default-data-format*. See incudine:bounce-to-disk for the list of available header types and data formats.

if-exists is :error by default. See soundfile:open for details.

buffer-size is the size of the internal stream buffer.

Function: soundfile:merge output-file input-files &key if-exists header-type data-format buffer-size normalize scale-by scale-to

output-file is the mix of the sound files input-files.

The input files must have the same sampling rate and number of channels.

output-file is written with header-type and data-format that default to *default-header-type* and *default-data-format*. See incudine:bounce-to-disk for the list of available header types and data formats.

if-exists is :error by default. See soundfile:open for details.

The mix is possibly normalized to normalize dB or scale-to [0.0,1.0], or scaled by scale-by.

buffer-size is the size of the internal stream buffer.


4.35 Profiling

Macro: incudine.util:profile &rest names

Extend sb-profile:profile by wrapping profiling code around the init-time and performance-time functions of the named DSPs.

Function: incudine.util:profile-node node max-number-of-calls

Wrap profiling code around the functions of a live node, then call profile-report and remove profiling code after max-number-of-calls to the wrapped functions, or when the target node is freed.

If the target node was paused, it is internally unpaused for max-number-of-calls to the profiled performance-time function.

If the target node is a group node, the paused nodes of that group are not internally unpaused.

Note: the argument name max-number-of-calls instead of max-samples in this context avoids confusion between audio samples and program execution samples.

Macro: incudine.util:unprofile &rest names

Extend sb-profile:unprofile by unwrapping any profiling code around the functions of the named DSPs.

Function: incudine.util:profile-report &key limit print-no-call-list

See documentation for sb-profile:report.

Function: incudine.util:profile-reset

Unwrap any profiling code around unreferenced DSP functions and call sb-profile:reset.


4.36 Contributed Modules


4.36.1 Jack Audio

The configuration variables *audio-input-port-name* and *audio-output-port-name* are set to a control-string, or to a function of one argument (the port number) to get the short name of a Jack port. The default is “in_~D” for the input ports and “out_~D” for the output ports. If the function doesn’t return a string, the port name is the default.

Function: audio-port-name direction number

Return the short name of the Jack audio port number (zero-based), where direction is :input or :output. Setfable.

Function: reset-audio-port-names

Reset the short names of the Jack audio ports.

See also the configuration variables *audio-input-port-name* and *audio-output-port-name*.


Next: , Previous: , Up: Contributed Modules   [Contents][Index]

4.36.2 Jack MIDI

Set the configuration variable *enable-jack-midi* to enable Jack MIDI:

;; Add to ~/.incudinerc
(setq *enable-jack-midi* t)
Structure: jackmidi:stream

Jack MIDI stream type.

Structure: jackmidi:input-stream

Jack MIDI input stream type.

Function: jackmidi:input-stream-p object

Return t if object is of type jackmidi:input-stream.

Structure: jackmidi:output-stream

Jack MIDI output stream type.

Function: jackmidi:output-stream-p object

Return t if object is of type jackmidi:output-stream.

Function: jackmidi:open &key direction port-name

Create and return a new jackmidi:stream.

direction is :input (default) or :output to return a jackmidi:input-stream or a jackmidi:output-stream respectively.

port-name defaults to “midi_in” if direction is :input or “midi_out” if direction is :output.

Function: jackmidi:open-p stream

Whether stream is an open stream.

Function: jackmidi:close obj

Close a jackmidi:stream. obj is a jackmidi:stream or the port-name of the stream to close.

Function: jackmidi:read stream octets

Read the events received from a Jack MIDI input stream into a vector of octets. Return the number of the events read.

The header of the event is 12 bytes long: a timestamp (foreign double float) and the length of the MIDI message (foreign uint32).

The MIDI messages are aligned to four bytes.

Example:

(defvar *midiin* (jackmidi:open))
(defvar *buf* (make-array 1024 :element-type '(unsigned-byte 8)))
(rt-start)
(prog1 (zerop (jackmidi:read *midiin* *buf*))
  (print *buf*))
Function: jackmidi:foreign-read stream buffer-pointer buffer-size

Read the events received from a Jack MIDI input stream into a foreign array of size buffer-size bytes pointed to by buffer-pointer. Return the number of events read.

The header of the event is 12 bytes long: a timestamp (foreign double float) and the length of the MIDI message (foreign uint32).

The MIDI messages are aligned to four bytes.

Function: jackmidi:write stream data &key start end

Write the octets data of a MIDI message into a Jack MIDI output stream.

start and end are the bounding index designators of data.

Example:

(defvar *midiout* (jackmidi:open :direction :output))

(defvar *msg0* (make-array 6 :element-type '(unsigned-byte 8)
                 :initial-contents '(#xf0 #x7e #x7f #x09 #x01 #xf7)))
(rt-start)
(at (now) #'jackmidi:write *midiout* *msg0*)

(at (now) #'jackmidi:write *midiout*
  (jackmidi:data #xf0 #x7e #x7f #x09 #x01 #xf7))

(defvar *msg1* (coerce '(144 60 96 128 60 0) 'jackmidi:data))

(at (now) #'jackmidi:write *midiout* *msg1* :end 3)           ; note on
(at (now) #'jackmidi:write *midiout* *msg1* :start 3 :end 6)  ; note off
Function: jackmidi:write-short stream message size

Write a MIDI event with the message of size size encoded into four bytes to the Jack MIDI output stream.

Example:

(defvar *midiout* (jackmidi:open :direction :output))
(rt-start)
(at (now) #'jackmidi:write-short *midiout* (jackmidi:message 144 60 96) 3)
Function: jackmidi:foreign-write stream buffer-pointer buffer-size

Write buffer-size bytes of a MIDI message stored into a foreign array pointed to by buffer-pointer to the Jack MIDI output stream.

Function: jackmidi:get-stream-by-name name

Return the Jack MIDI stream with port-name name.

Function: jackmidi:all-streams &optional direction

Return a new list with the opened Jack MIDI streams.

If direction is :input or :output, return the list of the opened input or output streams, respectively.

Function: jackmidi:port-name stream

Return the port name of a Jack MIDI stream.

Type: jackmidi:data

Type designator for a vector of octets.

Function: jackmidi:data &rest octets

Return a vector of octets.

Function: jackmidi:message status &optional data1 data2

Encode a short MIDI message into four bytes.

Function: jackmidi:decode-message msg

Decode a MIDI message encoded into four bytes.

Structure: jackmidi:event-buffer

Jack MIDI event buffer type.

Function: jackmidi:make-event-buffer &optional size

Create and return a new event-buffer structure of size size (1024 by default).

Method: free event-buffer

Deallocate the event-buffer.

Method: free-p event-buffer

Return t if the event-buffer is deallocated.

Macro: jackmidi:with-event-buffer (var &optional size) &body body

Bind var to a newly allocated event-buffer structure with dynamic extent during body.

Macro: jackmidi:doevent (event-buffer message-var stream count-form &optional timestamp-var result) &body body

Iterate over the MIDI events of the event-buffer structure related to a Jack MIDI input stream with message-var bound to each message. Then result form is evaluated.

count-form is evaluated to get the number of events.

If timestamp-var is non-NIL, it is the variable bound to the timestamp of each message.

Macro: jackmidi:with-receiver (state-form stream message-var &optional timestamp-var thread-name) &body body

If the setfable state-form is t, start receiving from the Jack MIDI input stream with message-var bound to the received MIDI message.

If timestamp-var is non-NIL, it is the variable bound to the timestamp of each message.

Optionally, the receiver thread is named thread-name.

See also incudine:make-responder and incudine:recv-start.

Function: jackmidi:sysex-message-p msg

Whether the MIDI message msg is a SysEx.

Function: jackmidi:input-stream-sysex-size stream

Return the length of the MIDI SysEx message stored in the buffer of the MIDI Jack input stream.

Function: jackmidi:input-stream-sysex-pointer stream

Return the foreign pointer to the MIDI SysEx message stored in the buffer of the MIDI Jack input stream.

Function: jackmidi:input-stream-sysex-timestamp stream

Return the timestamp of the MIDI SysEx message stored in the buffer of the MIDI Jack input stream.

Function: jackmidi:input-stream-sysex-octets stream &optional octets start

Return the vector of octets stored in the buffer of the MIDI Jack input stream and the MIDI SysEx message size.

Create a new vector if octets is nil (default).

start specifies an offset into octets and marks the beginning position of that vector.


Next: , Previous: , Up: Contributed Modules   [Contents][Index]

4.36.3 PortAudio

Set the configuration variable *audio-driver* to enable PortAudio:

;; Add to ~/.incudinerc
(setq *audio-driver* :portaudio)
(setq *frames-per-buffer* ...)
(setq *portaudio-input-device* -1)
(setq *portaudio-output-device* -1)
;; Latencies for PortAudio stream:
;;     positive value: latency in seconds
;;     negative value: the absolute value is the latency in number of periods
;;                  0: default latency for interactive performance
(setq *portaudio-input-latency* 0)
(setq *portaudio-output-latency* 0)
Function: portaudio-device-info &optional stream

Print the index and name of the audio devices to stream.

stream defaults to incudine.util:*logger-stream*.

Function: portaudio-set-device output &optional input

Set the index of the audio device.

If input is non-NIL, the indexes of the output and input devices are output and input respectively.

This setting stops the real-time thread.

See portaudio-device-info.

Function: portaudio-stream-latency direction

Return the input or output latency of the PortAudio stream. Setfable.

direction is :input or :output.

If the value is a positive number, it is the latency in seconds.

If the value is a negative number, the absolute value is the latency in number of periods. For example, -2 is

2 * frames_per_buffer / sample_rate  [seconds]

If the value is zero, the latency is the default for interactive performance.

During the performance, the value provides the most accurate estimate of latency available to the implementation, and a new latency setting is ignored but stored for the next restart (the next rt-start after rt-stop).


4.36.4 PortMidi

Set the configuration variable *enable-portmidi-output-sample-offset* to enable timestamp with sample offset for PortMidi output in real-time thread. Enabled by default if *audio-driver* is :portaudio.

Set the configuration variable *midi-input-timeout* to specify the number of milliseconds before to test whether MIDI input is available. Useful with PortMidi because it does not support a blocking read.

;; Add to ~/.incudinerc
(setq *enable-portmidi-output-sample-offset* t)

;; low value = low latency but minor CPU time for the system
(setq *midi-input-timeout* 8)
Condition: pm:portmidi-error

All types of PortMidi error conditions inherit from this condition.

Condition: pm:allocation-error

Signaled if an object allocation fails.

Subtype of portmidi-error and storage-condition.

Function: pm:allocation-error object-type

Signal a portmidi:allocation-error for object-type.

Condition: pm:error-generic

Signaled if there is a generic PortMidi error.

Function: pm:error-generic error

Signal a portmidi:error-generic.

Function: pm:has-host-error stream
Function: pm:get-error-text errnum
Function: pm:get-host-error-text msg len
Function: pm:initialize
Function: pm:terminate
Function: pm:reinitialize

Reinitialize PortMidi and reopen the streams without to create new lisp objects, so the references and bindings (i.e. from receivers, responders, variables, etc) continue to work.

pm:reinitialize should be called if portmidi:print-devices-info doesn’t print recently connected plug-and-play MIDI devices.

Structure: pm:stream

PortMidi stream type.

Structure: pm:input-stream

PortMidi input stream type.

Function: pm:input-stream-p object

Return t if object is of type portmidi:input-stream.

Structure: pm:output-stream

PortMidi output stream type.

Function: pm:output-stream-p object

Return t if object is of type portmidi:output-stream.

Function: pm:all-streams &optional direction

Return the list of the opened streams.

If direction is :input or :output, return the list of the input or output streams.

Function: pm:get-stream-by-name port-name direction

Return the portmidi:stream with port-name and direction.

direction is :input or :output.

Function: pm:stream-pointer instance

Return the foreign pointer to the portmidi:stream.

Function: pm:port-name stream

Return the port name of the portmidi:stream.

Function: pm:count-devices
Function: pm:get-device-info id

Return the property list related to the foreign struct portmidi:device-info for the device id.

Function: pm:print-devices-info &optional direction stream

Print the list of the available MIDI devices.

If direction is :input or :output, print the list of the input or output devices.

The output stream defaults to *standard-output*.

Function: pm:get-default-input-device-id
Function: pm:get-default-output-device-id
Function: pm:get-device-id-by-name port-name direction

Return the id of the MIDI device port-name.

direction is :input or :output.

Function: pm:open device-id &key direction latency buffer-size driver-info time-proc time-info

Create and return a new portmidi:stream.

direction is :input (default) or :output to return a portmidi:input-stream or a portmidi:output-stream respectively.

If direction is :output, latency is the delay in milliseconds (1 by default) applied to timestamps to determine when the output should actually occur. If latency is zero, timestamps are ignored.

buffer-size defaults to portmidi:default-sysex-buffer-size.

driver-info is a foreign pointer to an optional driver specific data structure containing additional information for device setup or handle processing. driver-info is a foreign null pointer (default) if not used.

time-proc is a foreign pointer to a procedure that returns time in milliseconds. If it is the foreign null pointer (default), a default millisecond timebase (PortTime) is used.

time-info is a foreign pointer passed to time-proc and defaults to the foreign null pointer.

Function: pm:open-p stream

Whether stream is an open stream.

Function: pm:open-input stream input-device input-driver-info buffer-size time-proc time-info
Function: pm:open-output stream output-device output-driver-info buffer-size time-proc time-info latency
Function: pm:close stream

Close the PortMidi stream.

Function: pm:message status &optional data1 data2

Encode a short MIDI message into four bytes.

Function: pm:message-status msg
Function: pm:message-data1 msg
Function: pm:message-data2 msg
Function: pm:decode-message msg

Decode a MIDI message encoded into four bytes.

Function: pm:before t1 t2
Function: pm:channel chan
Structure: pm:event-buffer

PortMidi event buffer type.

Macro: pm:doevent (evbuf message-var stream &optional timestamp-var result) &body body

Iterate over the events of a event-buffer with message-var bound to each MIDI message received from the PortMidi input stream, and execute the body once for each event, then result form is evaluated.

If timestamp-var is non-NIL, it is the variable bound to each MIDI timestamp.

Macro: pm:with-receiver (state-form stream message-var &optional timestamp-var sleep-time thread-name) &body body

If the setfable state-form is t, start receiving from the PortMidi input stream with message-var bound to the received MIDI message.

If timestamp-var is non-NIL, it is the variable bound to the timestamp of each message.

sleep-time (1 by default) is the polling timeout in milliseconds.

Optionally, the receiver thread is named thread-name.

Function: pm:make-event-buffer &optional size

Create and return a new event-buffer structure of size size.

size defaults to portmidi:default-sysex-buffer-size.

Macro: pm:with-event-buffer (var &optional size) &body body

Bind var to a newly allocated event-buffer structure with dynamic extent during body.

size defaults to portmidi:default-sysex-buffer-size.

Function: pm:free object

Deallocate the event buffer created by make-event-buffer.

Function: pm:read stream evbuf length

Read the events received from a PortMidi input stream into an event-buffer. Return the number of the events read.

Function: pm:write stream evbuf length

Write length bytes of the MIDI data stored into an event-buffer to the PortMidi output stream.

Function: pm:write-short stream when msg
Function: pm:write-sysex stream when msg
Constant: pm:default-sysex-buffer-size
Function: pm:sysex-message-p msg

Whether the MIDI message msg is a SysEx.

Macro: pm:with-input-sysex-event (ptr-var stream) &body body

Bind ptr-var to the foreign pointer to the MIDI SysEx message received from the PortMidi input stream with dynamic extent during body.

Function: pm:input-stream-sysex-octets stream &optional octets start

Return the vector of octets stored in the buffer of the PortMidi input stream and the MIDI SysEx message size.

Create a new vector if octets is nil (default).

start specifies an offset into octets and marks the beginning position of that vector.

Function: pm:input-stream-sysex-pointer instance

Return the foreign pointer to the PmEvent that contains the received SysEx message.

Function: pm:input-stream-events-remain instance

Return the number of the events starting from the received SysEx message.

Function: pm:abort stream
Function: pm:poll stream
Function: pm:synchronize stream
Function: pm:set-channel-mask stream mask
Function: pm:set-filter stream filters
Constant: pm:hdrlength
Constant: pm:host-error-msg-len
Constant: pm:no-device
Constant: pm:filt-active
Constant: pm:filt-sysex
Constant: pm:filt-clock
Constant: pm:filt-play
Constant: pm:filt-tick
Constant: pm:filt-fd
Constant: pm:filt-undefined
Constant: pm:filt-reset
Constant: pm:filt-realtime
Constant: pm:filt-note
Constant: pm:filt-channel-aftertouch
Constant: pm:filt-poly-aftertouch
Constant: pm:filt-aftertouch
Constant: pm:filt-program
Constant: pm:filt-control
Constant: pm:filt-pitchbend
Constant: pm:filt-mtc
Constant: pm:filt-song-position
Constant: pm:filt-song-select
Constant: pm:filt-tune
Constant: pm:filt-systemcommon

Up: PortMidi   [Contents][Index]

4.36.4.1 PortTime

Function: pt:start &optional resolution callback user-data
Function: pt:stop
Function: pt:started
Function: pt:time
Function: pt:sleep duration

Next: , Previous: , Up: Contributed Modules   [Contents][Index]

4.36.5 Sound editor Snd

Interface to interact with Snd.

To load incudine-snd use asdf:load-system or require.

Variable: snd:*program-name*

Snd command line program name.

Variable: snd:*program-args*

Snd command line argument list.

Variable: snd:*tmpfile*

Full path of the temporary soundfile.

Condition: snd:snd-error

All types of error conditions about the sound editor Snd inherit from this condition.

Function: snd:run &optional program-name args

Start Snd.

Function: snd:eval string &key format-arguments output-p parser

The string with optional format-arguments is evaluated by Snd.

If output-p is t (default), return the output of Snd.

Function: snd:load scmfile &optional s7-env-string

Load the scheme file in Snd.

The optional string s7-env-string is the s7 environment.

Function: snd:exit

Terminate the Snd process started by run.

Function: snd:flush-stream

Flush anything waiting on the Snd stream.

Function: snd:close-stream

Close the Snd stream.

Function: snd:emacs-mode-p

Return t to enable the interaction through the Emacs’ Snd-Scheme mode. Setfable.

It requires slime-enable-evaluate-in-emacs t on the Emacs side.

Macro: snd:enable-sharp-s7-syntax

Enable the reader syntax used to format and eval s7 forms.

Example:

#s7(let ((snd (open-sound "foo.wav")))
     (play snd :wait #t))

;; => "(let ((snd (open-sound \"foo.wav\"))) (play snd :wait #t))"

#s7(quote #.(LOOP REPEAT 8 COLLECT (RANDOM 1.0)))

;; => "(quote
;;      (0.5520501 0.4115485 0.35940528 0.0056368113 0.31019592
;;       0.4214077 0.32522345 0.2879219))"

(format nil #s7(new-sound "/tmp/foo.wav" :channels 1 :size ~D)
        (floor incudine.util:*sample-rate*))

;; => "(new-sound \"/tmp/foo.wav\" :channels 1 :size 48000)"

(snd:eval *)   ; => (SOUND 0)

#snd(...)   is equivalent to  (snd:eval #s7(...))
#0snd(...)  is equivalent to  (snd:eval #s7(...) :output-p nil)

hidden side effect:  #7s is equivalent to #s7

(defstruct point x y)
#s(point)
;; => #S(POINT :X NIL :Y NIL)
Function: snd:open-or-update-sound file

If no sound is found that matches the soundfile file, open that file in Snd. Otherwise, update the sound.

Function: snd:mix file &optional arguments output-p

Mix the file in Snd by applying the Snd function mix to the arguments.

Suppress output if output-p is nil.

Function: snd:float-vector fvec-name obj &optional start end

Define a float-vector in Snd named fvec-name initialized with the content of a incudine:buffer structure, a list, a vector or end minus start values generated by a gen routine.

The sequence is optionally bounded by start and end.

Function: snd:sound->buffer id-or-filename &rest buffer-load-args

Create a new incudine:buffer structure by loading the sound id-or-filename.

buffer-load-args are the optional arguments for incudine:buffer-load.

Function: snd:selection->buffer &rest buffer-load-args

Create a new incudine:buffer structure by loading the current selection.

buffer-load-args are the optional arguments for incudine:buffer-load.

Function: snd:region->buffer region-id &rest buffer-load-args

Create a new incudine:buffer structure by loading the region region-id.

buffer-load-args are the optional arguments for incudine:buffer-load.

Function: snd:mix->buffer mix-id &rest buffer-load-args

Create a new incudine:buffer structure by loading the mix mix-id.

buffer-load-args are the optional arguments for incudine:buffer-load.

Function: snd:float-vector->buffer fvec-string &rest buffer-load-args

Create a new incudine:buffer structure by loading the float-vector fvec-string.

buffer-load-args are the optional arguments for incudine:buffer-load.

Function: snd:buffer->sound buf file &rest buffer-save-args

The content of a incudine:buffer structure is saved in the soundfile file and opened in Snd.

buffer-save-args are the arguments for incudine:buffer-save.

Function: snd:buffer->mix buf &rest args

The content of a incudine:buffer structure is mixed in Snd.

If the first argument in args is a list, it has the arguments for the Snd function mix (file is optional). The rest of the arguments are passed to incudine:buffer-save.

Function: snd:map-channel function &key beg dur snd chn edpos origin

Apply function to each sample of the channel chn in snd (id or filename), starting at sample beg for dur samples, replacing the current value with whatever function returns.

function is a procedure of one argument (the current sample), can return nil, which means that the data passed in is deleted (replaced by nothing), or a number which replaces the current sample, or t which halts the mapping operation, leaving trailing samples unaffected, or a sequence the contents of which are spliced into the edited version, effectively replacing the current sample with any number of samples.

The utility incudine:now called from function returns the current local time.

beg defaults to 0 and dur defaults to the full length of the sound.

snd and chn default to the currently selected sound.

edpos defaults to the current edit history position.

See map-channel in Snd.

Function: snd:env-channel env &key beg dur snd chn edpos origin

Apply the amplitude envelope env, an incudine:envelope structure, to the given channel chn of snd starting at sample beg for dur samples.

beg defaults to 0 and dur defaults to the full length of the sound.

snd and chn default to the currently selected sound.

edpos defaults to the current edit history position.

See env-channel in Snd.

Function: snd:env-selection env &key origin

Apply the amplitude envelope env, an incudine:envelope structure, to the selection.

See env-selection in Snd.

Macro: bounce-to-snd (outfile &rest args) &body body

Apply bounce-to-disk to outfile and the arguments args, then open outfile in Snd.

Macro: bounce-to-snd-mix (outfile &rest args) &body body

Apply bounce-to-disk to outfile and the arguments args, then mix outfile in Snd by calling mix.

If the first argument in args is a list, it has the arguments for the Snd function mix (without file). The rest of the arguments are passed to bounce-to-disk.

Example:

(dsp! hello-snd (c i a o)
  (stereo (+ (sine c i) (sine a o))))

(bounce-to-snd-mix ("mix-1.wav" '(48000 t))
  (hello-snd 1000 .2 1220 .1))

4.36.6 Cudere CLM

Incudine version of Bill Schottstaedt’s CLM 2

ftp://ccrma-ftp.stanford.edu/pub/Lisp/clm-5.tar.gz

The original common lisp version uses the run macro to translate lisp code in efficient C code. There is a minimal mechanism in cudere-clm to read and convert

(run (loop ... do (declare ...)) ...)

in “efficient” lisp code (it depends on the body of the loop). It works with v.ins, jcrev.ins, prc-toolkit95.lisp, and other instruments with unambiguous types (if it fails, you generally have to fix some coercions).

However, the run macro is unnecessary to define new instruments because they are compiled in lisp (definstrument also works from REPL).

The new variable *clm-optimize-settings* is

(optimize speed (safety 0))

by default but it is also possible to write an explicit declaration after definstrument or definstrument* to change that default.

We can set some configuration variables in cudere-clm/clm-init.lisp (ignored by git), for example:

;;; incudine/contrib/cudere-clm/clm-init.lisp
(in-package :clm)

(setq *clm-file-name* "/tmp/test.wav")
(setq *clm-player* "sndplay")
;(setq *clm-player* "sndplay -start ~A -end ~A")

If incudine-snd is loaded and Snd is started with snd:run, the sound file generated by

(with-sound (:to-snd t) ...)  ; :to-snd is *to-snd* by default

is automatically opened (the keyword :to-snd is also used in the original Snd+CLM).

To load cudere-clm use asdf:load-system or require.


Next: , Up: Cudere CLM   [Contents][Index]

4.36.6.1 Conditions

Condition: clm:cudere-clm-error

Next: , Previous: , Up: Cudere CLM   [Contents][Index]

4.36.6.2 Constants

Constant: clm:two-pi
Constant: clm:mus-unsupported
Constant: clm:mus-next
Constant: clm:mus-aifc
Constant: clm:mus-riff
Constant: clm:mus-rf64
Constant: clm:mus-bicsf
Constant: clm:mus-nist
Constant: clm:mus-inrs
Constant: clm:mus-esps
Constant: clm:mus-svx
Constant: clm:mus-voc
Constant: clm:mus-sndt
Constant: clm:mus-raw
Constant: clm:mus-smp
Constant: clm:mus-avr
Constant: clm:mus-ircam
Constant: clm:mus-sd1
Constant: clm:mus-sppack
Constant: clm:mus-mus10
Constant: clm:mus-hcom
Constant: clm:mus-psion
Constant: clm:mus-maud
Constant: clm:mus-ieee
Constant: clm:mus-matlab
Constant: clm:mus-adc
Constant: clm:mus-midi
Constant: clm:mus-soundfont
Constant: clm:mus-gravis
Constant: clm:mus-comdisco
Constant: clm:mus-goldwave
Constant: clm:mus-srfs
Constant: clm:mus-midi-sample-dump
Constant: clm:mus-diamondware
Constant: clm:mus-adf
Constant: clm:mus-sbstudioii
Constant: clm:mus-delusion
Constant: clm:mus-farandole
Constant: clm:mus-sample-dump
Constant: clm:mus-ultratracker
Constant: clm:mus-yamaha-sy85
Constant: clm:mus-yamaha-tx16
Constant: clm:mus-digiplayer
Constant: clm:mus-covox
Constant: clm:mus-avi
Constant: clm:mus-omf
Constant: clm:mus-quicktime
Constant: clm:mus-asf
Constant: clm:mus-yamaha-sy99
Constant: clm:mus-kurzweil-2000
Constant: clm:mus-aiff
Constant: clm:mus-paf
Constant: clm:mus-csl
Constant: clm:mus-file-samp
Constant: clm:mus-pvf
Constant: clm:mus-soundforge
Constant: clm:mus-twinvq
Constant: clm:mus-akai4
Constant: clm:mus-impulsetracker
Constant: clm:mus-korg
Constant: clm:mus-nvf
Constant: clm:mus-caff
Constant: clm:mus-maui
Constant: clm:mus-sdif
Constant: clm:mus-ogg
Constant: clm:mus-flac
Constant: clm:mus-speex
Constant: clm:mus-mpeg
Constant: clm:mus-shorten
Constant: clm:mus-tta
Constant: clm:mus-wavpack
Constant: clm:mus-unknown
Constant: clm:mus-bshort
Constant: clm:mus-mulaw
Constant: clm:mus-byte
Constant: clm:mus-bfloat
Constant: clm:mus-bint
Constant: clm:mus-alaw
Constant: clm:mus-ubyte
Constant: clm:mus-b24int
Constant: clm:mus-bdouble
Constant: clm:mus-lshort
Constant: clm:mus-lint
Constant: clm:mus-lfloat
Constant: clm:mus-ldouble
Constant: clm:mus-ubshort
Constant: clm:mus-ulshort
Constant: clm:mus-l24int
Constant: clm:mus-bintn
Constant: clm:mus-lintn
Constant: clm:mus-blfoatu
Constant: clm:mus-lfloatu
Constant: clm:mus-bdoubleu
Constant: clm:mus-ldoubleu
Constant: clm:mus-audio-default
Constant: clm:mus-interp-none
Constant: clm:mus-interp-linear
Constant: clm:mus-interp-sinusoidal
Constant: clm:mus-interp-all-pass
Constant: clm:mus-interp-lagrange
Constant: clm:mus-interp-bezier
Constant: clm:mus-interp-hermite
Constant: clm:mus-linear
Constant: clm:mus-sinusoidal
Constant: clm:mus-chebyshev-first-kind
Constant: clm:mus-chebyshev-second-kind
Constant: clm:rectangular-window
Constant: clm:hann-window
Constant: clm:hanning-window
Constant: clm:welch-window
Constant: clm:parzen-window
Constant: clm:bartlett-window
Constant: clm:hamming-window
Constant: clm:blackman2-window
Constant: clm:blackman3-window
Constant: clm:blackman4-window
Constant: clm:exponential-window
Constant: clm:riemann-window
Constant: clm:kaiser-window
Constant: clm:cauchy-window
Constant: clm:poisson-window
Constant: clm:gaussian-window
Constant: clm:tukey-window
Constant: clm:dolph-chebyshev-window
Constant: clm:hann-poisson-window
Constant: clm:connes-window
Constant: clm:samaraki-window
Constant: clm:ultraspherical-window
Constant: clm:bartlett-hann-window
Constant: clm:bohman-window
Constant: clm:flat-top-window
Constant: clm:blackman5-window
Constant: clm:blackman6-window
Constant: clm:blackman7-window
Constant: clm:blackman8-window
Constant: clm:blackman9-window
Constant: clm:blackman10-window
Constant: clm:rv2-window
Constant: clm:rv3-window
Constant: clm:rv4-window

Next: , Previous: , Up: Cudere CLM   [Contents][Index]

4.36.6.3 Variables

Variable: clm:*output*
Variable: clm:*reverb*
Variable: clm:*clm-srate*
Variable: clm:*srate*
Variable: clm:*clm-channels*
Variable: clm:*channels*
Variable: clm:*clm-file-buffer-size*
Variable: clm:*clm-file-name*
Variable: clm:*clm-header-type*
Variable: clm:*header-type*
Variable: clm:*clm-data-format*
Variable: clm:*data-format*
Variable: clm:*clm-tempfile-data-format*
Variable: clm:*clm-tempfile-header-type*
Variable: clm:*clm-verbose*
Variable: clm:*verbose*
Variable: clm:*clm-play*
Variable: clm:*clm-player*
Variable: clm:*clm-dac-wait-default*
Variable: clm:*clm-table-size*
Variable: clm:*clm-safety*
Variable: clm:*safety*
Variable: clm:*clm-array-print-length*
Variable: clm:*clm-init*
Variable: clm:*clm-search-list*
Variable: clm:*clm-notehook*
Variable: clm:*notehook*
Variable: clm:*clm-clipped*
Variable: clm:*clipped*
Variable: clm:*clm-src-width*
Variable: clm:*clm-delete-reverb*
Variable: clm:*clm-reverb-channels*
Variable: clm:*clm-statistics*
Variable: clm:*statistics*
Variable: clm:*clm-default-frequency*
Variable: clm:*clm-debug*
Variable: clm:*debug*
Variable: clm:*clm-ins*
Variable: clm:*clm-locsig-type*
Variable: clm:*interrupted*
Variable: clm:*offset*
Variable: clm:*clm-with-sound-depth*
Variable: clm:*definstrument-hook*
Variable: clm:*to-snd*
Variable: clm:*clm-ugens-package*
Variable: clm:*clm-optimize-settings*
Variable: clm:*clm-logger-stream*

Next: , Previous: , Up: Cudere CLM   [Contents][Index]

4.36.6.4 Definitions

Macro: clm:define-clm-ugen name return-type lambda-list &body body
Macro: clm:definstrument name lambda-list &body body
Macro: clm:definstrument* name lambda-list &body body
Macro: clm:def-clm-struct name &rest fields
Macro: clm:def-optkey-fun name (&rest args) &body body
Macro: clm:run run-baby-run
Macro: clm:run* vars body

Next: , Previous: , Up: Cudere CLM   [Contents][Index]

4.36.6.5 Methods

Generic Function: clm:mus-channel gen
Generic Function: clm:mus-channels gen
Generic Function: clm:mus-close obj
Generic Function: clm:mus-data gen
Generic Function: clm:mus-file-name gen
Generic Function: clm:mus-feedback gen
Generic Function: clm:mus-feedforward gen
Generic Function: clm:mus-frequency gen
Generic Function: clm:mus-hop gen
Generic Function: clm:mus-increment gen
Generic Function: clm:mus-input? obj
Generic Function: clm:mus-interp-type gen
Generic Function: clm:mus-length gen
Generic Function: clm:mus-location gen
Generic Function: clm:mus-offset gen
Generic Function: clm:mus-order gen
Generic Function: clm:mus-output? obj
Generic Function: clm:mus-phase gen
Generic Function: clm:mus-ramp gen
Generic Function: clm:mus-reset gen
Generic Function: clm:mus-safety gen
Generic Function: clm:mus-scaler gen
Generic Function: clm:mus-xcoeff gen loc
Generic Function: clm:mus-xcoeffs gen
Generic Function: clm:mus-ycoeff gen loc
Generic Function: clm:mus-ycoeffs gen
Generic Function: clm:mus-width gen

Next: , Previous: , Up: Cudere CLM   [Contents][Index]

4.36.6.6 Utilities

Function: clm:hz->radians value
Function: clm:radians->hz value
Function: clm:seconds->samples &rest args
Function: clm:samples->seconds &rest args
Function: clm:times->samples beg dur
Function: clm:mus-rand-seed
Function: clm:mus-set-rand-seed seed
Function: clm:clm-random amp
Function: clm:centered-random amp
Function: clm:mus-random amp
Function: clm:sound-chans name
Function: clm:sound-duration name
Function: clm:sound-data-format name
Function: clm:sound-header-type name
Function: clm:sound-data-location file
Function: clm:sound-length name
Function: clm:sound-samples name
Function: clm:sound-frames name
Function: clm:sound-framples name
Function: clm:sound-srate name
Function: clm:sound-comment name
Function: clm:sound-datum-size name
Function: clm:sound-maxamp file chans maxamps times
Function: clm:double x
Function: clm:double-float x
Function: clm:make-double-float-array lim &key initial-contents initial-element
Macro: clm:make-double-array lim &key initial-contents initial-element
Function: clm:make-integer-array len &key initial-contents initial-element
Function: clm:clear-array double-float-array
Function: clm:array-interp array x &optional size
Function: clm:mus-interpolate type x v &optional size y1
Function: clm:partials->wave synth-data &optional table norm
Function: clm:phase-partials->wave synth-data &optional table norm
Function: clm:normalize-partials partials
Function: clm:partials->polynomial partials &optional kind
Function: clm:polynomial coeffs x
Function: clm:file->array file channel beg dur array
Function: clm:array->file file data len srate channels
Function: clm:frample->frample m f res
Function: clm:envelope->coeffs &optional-key order envelope
Function: clm:envelope-interp x fn &optional base
Function: clm:x-norm env xmax
Function: clm:reduce-amplitude-quantization-noise e dur amp &optional ramp-dur low-amp
Function: clm:inverse-integrate dist &optional data-size e-size
Function: clm:clm-cerror continue-control continue-default-value continue-test error-control &rest args
Function: clm:clm-print fstr &rest args
Function: clm:play &optional-key file start end wait
Function: clm:stop-playing
Function: clm:dac &optional-key file start end wait
Function: clm:stop-dac

4.36.6.7 FFT

Variable: clm:*fft*
Structure: clm:fft
Function: clm:fft rdat idat fftsize &optional sign fft-instance
Function: clm:make-fft size
Macro: clm:with-pointer-to-fft-data (real-ptr imag-ptr rdat idat) &body body
Function: clm:rectangular->polar rdat idat &optional size
Function: clm:rectangular->magnitudes rdat idat &optional size
Function: clm:polar->rectangular rdat idat
Function: clm:make-fft-window &optional-key type size beta mu
Function: clm:apply-window rdat window
Function: clm:spectrum rdat idat window &optional type
Function: clm:convolution rdat idat fftsize &optional ignored fft-instance
Function: clm:autocorrelate data size &optional fft-instance
Function: clm:correlate data1 data2 size &optional fft-instance

Next: , Previous: , Up: Cudere CLM   [Contents][Index]

4.36.6.8 Common Music interface

Function: clm:init-with-sound &key output sndfile channels srate continue-old-file reverb reverb-data reverb-channels revfile decay-time play notehook statistics type header-type data-format scaled-to scaled-by clipped force-recomputation verbose comment to-snd
Function: clm:finish-with-sound wsd
Function: clm:wsdat-play instance

4.36.6.9 Generators

Function: clm:make-oscil &optional-key frequency initial-phase
Function: clm:oscil os &optional fm-input pm-input
Function: clm:oscil? object
Function: clm:make-env &optional-key envelope scaler duration offset base end length
Function: clm:env e
Function: clm:env? object
Function: clm:make-table-lookup &optional-key frequency initial-phase wave size type
Function: clm:table-lookup tl &optional fm-input
Function: clm:table-lookup? object
Function: clm:make-polywave &optional-key frequency partials type
Function: clm:polywave w &optional fm-input
Function: clm:polywave? object
Function: clm:make-polyshape &optional-key frequency initial-phase coeffs partials type
Function: clm:polyshape w &optional index fm-input
Generic Function: clm:polyshape? gen
Function: clm:make-triangle-wave &optional-key frequency amplitude initial-phase
Function: clm:triangle-wave s &optional fm
Function: clm:triangle-wave? object
Function: clm:make-square-wave &optional-key frequency amplitude initial-phase
Function: clm:square-wave s &optional fm
Function: clm:square-wave? object
Function: clm:make-sawtooth-wave &optional-key frequency amplitude initial-phase
Function: clm:sawtooth-wave s &optional fm
Function: clm:sawtooth-wave? object
Function: clm:make-pulse-train &optional-key frequency amplitude initial-phase
Function: clm:pulse-train s &optional fm
Function: clm:pulse-train? object
Function: clm:make-ncos &optional-key frequency n
Function: clm:ncos cs &optional fm
Function: clm:ncos? object
Function: clm:make-nsin &optional-key frequency n
Function: clm:nsin cs &optional fm
Function: clm:nsin? object
Function: clm:make-ssb-am &optional-key frequency order window-type beta mu
Function: clm:ssb-am gen &optional insig fm
Function: clm:ssb-am? object
Function: clm:make-wave-train &optional-key frequency initial-phase wave size type
Function: clm:wave-train w &optional fm
Function: clm:wave-train? object
Function: clm:make-rand &optional-key frequency amplitude envelope distribution
Function: clm:rand r &optional sweep
Function: clm:rand? object
Function: clm:make-rand-interp &optional-key frequency amplitude envelope distribution
Function: clm:rand-interp r &optional sweep
Function: clm:rand-interp? object
Function: clm:make-one-pole &optional-key a0 b1
Function: clm:one-pole f input
Function: clm:one-pole? object
Function: clm:make-one-zero &optional-key a0 a1
Function: clm:one-zero f input
Function: clm:one-zero? object
Function: clm:make-two-pole &optional-key a0 b1 b2 frequency radius
Function: clm:two-pole f input
Function: clm:two-pole? object
Function: clm:make-two-zero &optional-key a0 a1 a2 frequency radius
Function: clm:two-zero f input
Function: clm:two-zero? object
Function: clm:make-formant &optional-key frequency radius
Function: clm:formant f input &optional freq
Function: clm:formant? object
Function: clm:make-firmant &optional-key frequency radius
Function: clm:firmant f input &optional freq
Function: clm:firmant? object
Function: clm:make-filter &optional-key order xcoeffs ycoeffs
Function: clm:filter f input
Function: clm:filter? object
Function: clm:make-fir-filter &optional-key order xcoeffs
Function: clm:fir-filter f input
Function: clm:fir-filter? object
Function: clm:make-iir-filter &optional-key order ycoeffs
Function: clm:iir-filter f input
Function: clm:iir-filter? object
Function: clm:make-delay &optional-key size initial-contents initial-element max-size type
Function: clm:delay d input &optional pm
Function: clm:delay? object
Function: clm:tap d &optional offset
Function: clm:delay-tick d input
Function: clm:make-comb &optional-key scaler size initial-contents initial-element max-size type
Function: clm:comb cflt input &optional pm
Function: clm:comb? object
Function: clm:make-filtered-comb &optional-key scaler size initial-contents initial-element max-size type filter
Function: clm:filtered-comb cflt input &optional pm
Function: clm:filtered-comb? object
Function: clm:make-notch &optional-key scaler size initial-contents initial-element max-size type
Function: clm:notch cflt input &optional pm
Function: clm:notch? object
Function: clm:make-all-pass &optional-key feedback feedforward size initial-contents initial-element max-size type
Function: clm:all-pass f input &optional pm
Function: clm:all-pass? object
Function: clm:make-moving-average &optional-key size initial-contents initial-element
Function: clm:moving-average f input
Function: clm:moving-average? object
Function: clm:make-src &optional-key input srate width window-beta src-type
Function: clm:src s &optional sr-change input-function
Function: clm:src? object
Function: clm:make-convolve &optional-key input filter fft-size filter-size filter-scaler fft-instance
Function: clm:convolve ff &optional input-function
Function: clm:convolve? object
Function: clm:convolve-files &optional-key file1 file2 maxamp output-file fft-instance
Function: clm:make-granulate &optional-key input expansion length scaler hop ramp jitter max-size edit
Function: clm:granulate e &optional input-function edit-function
Function: clm:granulate? object
Function: clm:make-phase-vocoder &optional-key input fft-size overlap interp pitch analyze edit synthesize fft-instance
Function: clm:phase-vocoder pv &optional input
Function: clm:phase-vocoder? object
Function: clm:phase-vocoder-amps gen
Function: clm:phase-vocoder-freqs gen
Function: clm:phase-vocoder-phases gen
Function: clm:phase-vocoder-amp-increments gen
Function: clm:phase-vocoder-phase-increments gen
Function: clm:make-nrxysin &optional-key frequency ratio n r
Function: clm:nrxysin gen &optional fm
Function: clm:nrxysin? object
Function: clm:make-nrxycos &optional-key frequency ratio n r
Function: clm:nrxycos gen &optional fm
Function: clm:nrxycos? object
Function: clm:make-asymmetric-fm &optional-key frequency initial-phase r ratio
Function: clm:asymmetric-fm af index &optional fm
Function: clm:asymmetric-fm? object

Next: , Previous: , Up: Cudere CLM   [Contents][Index]

4.36.6.10 Sound I/O

Function: clm:make-file->sample &optional-key file size
Structure: clm:file->sample
Function: clm:file->sample obj samp &optional chn
Function: clm:file->sample? object
Function: clm:make-file->frample &optional-key file size
Structure: clm:file->frample
Function: clm:file->frample obj samp frm
Function: clm:file->frample? object
Function: clm:make-sample->file name &optional chans format type comment
Structure: clm:sample->file
Function: clm:sample->file obj samp chan val
Function: clm:sample->file? object
Function: clm:continue-sample->file file
Function: clm:make-frample->file name &optional chans format type comment
Structure: clm:frample->file
Function: clm:frample->file obj samp val
Function: clm:frample->file? object
Function: clm:continue-frample->file file
Function: clm:make-readin &optional-key file channel start direction size
Function: clm:readin rd
Function: clm:readin? object
Function: clm:make-locsig &optional-key degree distance reverb channels type
Structure: clm:locsig
Function: clm:locsig loc i in-sig
Function: clm:locsig? object
Function: clm:locsig-ref gen chan
Function: clm:locsig-set! gen chan val
Function: clm:locsig-reverb-ref gen chan
Function: clm:locsig-reverb-set! gen chan val
Function: clm:move-locsig loc degree distance
Function: clm:locsig-type
Function: clm:make-move-sound &optional-key dlocs-list output revout
Structure: clm:move-sound
Function: clm:move-sound dloc i in-sig
Function: clm:move-sound? object
Function: clm:in-any loc channel i-stream
Macro: clm:ina loc i-stream
Macro: clm:inb loc i-stream
Function: clm:out-any loc data &optional channel o-stream
Macro: clm:outa loc data &optional o-stream
Macro: clm:outb loc data &optional o-stream
Macro: clm:outc loc data &optional o-stream
Macro: clm:outd loc data &optional o-stream
Function: clm:open-input &optional-key name verbose element-type if-does-not-exist mix-at mix-duration channel start force-recomputation
Function: clm:open-input* &optional-key name start channel restartable
Function: clm:close-input i-stream

Next: , Previous: , Up: Cudere CLM   [Contents][Index]

4.36.6.11 Score

Macro: clm:with-sound (&key output continue-old-file channels info comment srate reverb reverb-data reverb-channels revfile decay-time reverb-func reverb-args play force-recomputation notehook statistics header-type data-format save-body verbose scaled-to clipped scaled-by sampling-rate to-snd &allow-other-keys) &body body
Function: clm:clm-load pathname &key output continue-old-file channels info comment srate reverb reverb-data reverb-channels revfile decay-time play force-recomputation notehook statistics header-type data-format save-body verbose scaled-to clipped scaled-by load-package sampling-rate to-snd
Macro: clm:sound-let sounds &body body
Macro: clm:with-offset val &body body
Macro: clm:scaled-by val &body body
Macro: clm:scaled-to val &body body

Previous: , Up: Cudere CLM   [Contents][Index]

4.36.6.12 UGens

UGen: cudere-clm.ugens:oscil inc phase fm-input pm-input &optional ugen-node
UGen: cudere-clm.ugens:env list scaler duration offset base object location &optional ugen-node
UGen: cudere-clm.ugens:table-lookup inc phase fm-input wave interp-type &optional ugen-node
UGen: cudere-clm.ugens:polywave inc phase fm-input index wave type n &optional ugen-node
UGen: cudere-clm.ugens:triangle-wave inc amp phase fm-input &optional ugen-node
UGen: cudere-clm.ugens:square-wave inc amp phase fm-input width &optional ugen-node
UGen: cudere-clm.ugens:sawtooth-wave inc amp phase fm-input &optional ugen-node
UGen: cudere-clm.ugens:pulse-train inc amp phase fm-input &optional ugen-node
UGen: cudere-clm.ugens:ncos inc phase fm-input n scaler &optional ugen-node
UGen: cudere-clm.ugens:nsin inc phase fm-input n scaler &optional ugen-node
UGen: cudere-clm.ugens:ssb-am input fm-input inc sin-phase cos-phase order xcoeffs state line &optional ugen-node
UGen: cudere-clm.ugens:wave-train freq phase fm-input wave interp-type &optional ugen-node
UGen: cudere-clm.ugens:rand inc amp envelope distribution sweep phase &optional ugen-node
UGen: cudere-clm.ugens:rand-interp inc amp envelope distribution sweep phase &optional ugen-node
UGen: cudere-clm.ugens:one-pole input a0 b1 &optional ugen-node
UGen: cudere-clm.ugens:one-zero input a0 a1 &optional ugen-node
UGen: cudere-clm.ugens:two-pole input a0 b1 b2 &optional ugen-node
UGen: cudere-clm.ugens:two-zero input a0 a1 a2 &optional ugen-node
UGen: cudere-clm.ugens:formant input freq radius &optional ugen-node
UGen: cudere-clm.ugens:firmant input freq radius &optional ugen-node
UGen: cudere-clm.ugens:filter input order xcoeffs ycoeffs state &optional ugen-node
UGen: cudere-clm.ugens:fir-filter input order xcoeffs state &optional ugen-node
UGen: cudere-clm.ugens:iir-filter input order ycoeffs state &optional ugen-node
UGen: cudere-clm.ugens:delay &optional-key input pm-input size max-size line interp-type zdly scl loc zloc yn1-ptr ugen-node
UGen: cudere-clm.ugens:comb &optional-key input pm-input size max-size line interp-type zdly scl loc zloc yn1-ptr ugen-node
UGen: cudere-clm.ugens:filtered-comb &optional-key input pm-input size max-size line interp-type filter zdly scl loc zloc yn1-ptr ugen-node
UGen: cudere-clm.ugens:notch &optional-key input pm-input size max-size line interp-type zdly scl loc zloc yn1-ptr ugen-node
UGen: cudere-clm.ugens:all-pass &optional-key input pm-input size max-size line interp-type zdly fb ff loc zloc yn1-ptr ugen-node
UGen: cudere-clm.ugens:moving-average &optional-key input size line sum loc ugen-node
UGen: cudere-clm.ugens:readin sf location channel direction &optional ugen-node
UGen: cudere-clm.ugens:src rd sr-change srate sinc-table width input &optional ugen-node
UGen: cudere-clm.ugens:convolve filter fft-size input fft-instance &optional ugen-node
UGen: cudere-clm.ugens:granulate hop amp expansion jitter ramp max-size seed input edit grain grain-len output-hop self &optional ugen-node
UGen: cudere-clm.ugens:phase-vocoder input fft-size hop interp pitch freqs amps phases amp-increments phase-increments analyze edit synthesize outctr fft-instance self &optional ugen-node
UGen: cudere-clm.ugens:nrxysin inc phase fm-input n ratio r &optional ugen-node
UGen: cudere-clm.ugens:nrxycos inc phase fm-input n ratio r &optional ugen-node
UGen: cudere-clm.ugens:asymmetric-fm inc phase fm-input ratio r index &optional ugen-node

4.36.7 Fluidsynth

FluidSynth SoundFont synthesizer interface for Incudine.

To load incudine-fluidsynth use asdf:load-system or require.


Next: , Up: Fluidsynth   [Contents][Index]

4.36.7.1 Logging

Variable: fluidsynth:*logger-stream*

Next: , Previous: , Up: Fluidsynth   [Contents][Index]

4.36.7.2 Settings

Constant: fluidsynth:hint-bounded-below
Constant: fluidsynth:hint-bounded-above
Constant: fluidsynth:hint-toggled
Constant: fluidsynth:hint-sample-rate
Constant: fluidsynth:hint-logarithmic
Constant: fluidsynth:hint-integer
Constant: fluidsynth:hint-filename
Constant: fluidsynth:hint-optionlist
Constant: fluidsynth:no-type
Constant: fluidsynth:num-type
Constant: fluidsynth:int-type
Constant: fluidsynth:str-type
Constant: fluidsynth:set-type
Structure: fluidsynth:settings
Function: fluidsynth:setting settings name
Function: fluidsynth:new-settings &optional setting-list
Function: fluidsynth:delete-settings settings
Function: fluidsynth:settings-get-type settings name
Function: fluidsynth:settings-get-hints settings name
Function: fluidsynth:settings-is-realtime settings name
Function: fluidsynth:settings-setstr settings name str
Function: fluidsynth:settings-copystr settings name str len
Function: fluidsynth:settings-dupstr settings name str
Function: fluidsynth:settings-getstr-default settings name
Function: fluidsynth:settings-str-equal settings name value
Function: fluidsynth:settings-setnum settings name val
Function: fluidsynth:settings-getnum settings name val
Function: fluidsynth:settings-getnum-default settings name
Function: fluidsynth:settings-getnum-range settings name min max
Function: fluidsynth:settings-setint settings name val
Function: fluidsynth:settings-getint settings name val
Function: fluidsynth:settings-getint-default settings name
Function: fluidsynth:settings-getint-range settings name min max
Function: fluidsynth:settings-foreach-option settings name data func
Function: fluidsynth:settings-option-count settings name
Function: fluidsynth:settings-option-concat settings name separator
Function: fluidsynth:settings-foreach settings data func

4.36.7.3 Synth

Constant: fluidsynth:channel-info-name-size
Structure: fluidsynth:synth
Function: fluidsynth:new settings
Function: fluidsynth:delete synth
Function: fluidsynth:get-settings synth

Next: , Previous: , Up: Fluidsynth   [Contents][Index]

4.36.7.4 MIDI channel messages

Function: fluidsynth:noteon synth chan key vel
Function: fluidsynth:noteoff synth chan key
Function: fluidsynth:cc synth chan ctrl val
Function: fluidsynth:get-cc synth chan ctrl pval
Function: fluidsynth:sysex synth data len response response_len handled dryrun
Function: fluidsynth:pitch-bend synth chan val
Function: fluidsynth:get-pitch-bend synth chan ppitch_bend
Function: fluidsynth:pitch-wheel-sens synth chan val
Function: fluidsynth:get-pitch-wheel-sens synth chan pval
Function: fluidsynth:program-change synth chan program
Function: fluidsynth:channel-pressure synth chan val
Function: fluidsynth:bank-select synth chan bank
Function: fluidsynth:sfont-select synth chan sfont_id
Function: fluidsynth:program-select synth chan sfont_id bank_num preset_num
Function: fluidsynth:program-select-by-sfont-name synth chan sfont_name bank_num preset_num
Function: fluidsynth:get-program synth chan sfont_id bank_num preset_num
Function: fluidsynth:unset-program synth chan
Function: fluidsynth:program-reset synth
Function: fluidsynth:system-reset synth
Function: fluidsynth:all-notes-off synth chan
Function: fluidsynth:all-sounds-off synth chan
Function: fluidsynth:set-channel-type synth chan type
Function: fluidsynth:get-channel-preset synth chan
Function: fluidsynth:start synth id preset audio_chan midi_chan key vel
Function: fluidsynth:stop synth id

Next: , Previous: , Up: Fluidsynth   [Contents][Index]

4.36.7.5 SoundFont management

Function: fluidsynth:sfload synth filename reset_presets
Function: fluidsynth:sfreload synth id
Function: fluidsynth:sfunload synth id reset_presets
Function: fluidsynth:add-sfont synth sfont
Function: fluidsynth:remove-sfont synth sfont
Function: fluidsynth:sfcount synth
Function: fluidsynth:get-sfont synth num
Function: fluidsynth:get-sfont-by-id synth id
Function: fluidsynth:get-sfont-by-name synth name
Function: fluidsynth:set-bank-offset synth sfont_id offset
Function: fluidsynth:get-bank-offset synth sfont_id

Next: , Previous: , Up: Fluidsynth   [Contents][Index]

4.36.7.6 Reverb

Constant: fluidsynth:reverb-default-roomsize
Constant: fluidsynth:reverb-default-damp
Constant: fluidsynth:reverb-default-width
Constant: fluidsynth:reverb-default-level
Function: fluidsynth:set-reverb synth roomsize damping width level
Function: fluidsynth:set-reverb-on synth on
Function: fluidsynth:get-reverb-roomsize synth
Function: fluidsynth:get-reverb-damp synth
Function: fluidsynth:get-reverb-level synth
Function: fluidsynth:get-reverb-width synth

4.36.7.7 Chorus

Constant: fluidsynth:chorus-mod-sine
Constant: fluidsynth:chorus-mod-triangle
Constant: fluidsynth:chorus-default-n
Constant: fluidsynth:chorus-default-level
Constant: fluidsynth:chorus-default-speed
Constant: fluidsynth:chorus-default-depth
Constant: fluidsynth:chorus-default-type
Function: fluidsynth:set-chorus synth nr level speed depth_ms type
Function: fluidsynth:set-chorus-on synth on
Function: fluidsynth:get-chorus-nr synth
Function: fluidsynth:get-chorus-level synth
Function: fluidsynth:get-chorus-speed synth
Function: fluidsynth:get-chorus-depth synth
Function: fluidsynth:get-chorus-type synth

Next: , Previous: , Up: Fluidsynth   [Contents][Index]

4.36.7.8 Audio and MIDI channels

Function: fluidsynth:count-midi-channels synth
Function: fluidsynth:count-audio-channels synth
Function: fluidsynth:count-effects-channels synth

4.36.7.9 Synthesis parameters

Function: fluidsynth:set-sample-rate synth sample_rate
Function: fluidsynth:set-gain synth gain
Function: fluidsynth:get-gain synth
Function: fluidsynth:set-polyphony synth polyphony
Function: fluidsynth:get-polyphony synth
Function: fluidsynth:get-active-voice-count synth
Function: fluidsynth:get-internal-bufsize synth
Function: fluidsynth:set-interp-method synth chan interp_method
Constant: fluidsynth:interp-none
Constant: fluidsynth:interp-linear
Constant: fluidsynth:interp-4thorder
Constant: fluidsynth:interp-7thorder
Constant: fluidsynth:interp-default
Constant: fluidsynth:interp-highest
Function: fluidsynth:set-gen synth chan param value
Function: fluidsynth:get-gen synth chan param

Next: , Previous: , Up: Fluidsynth   [Contents][Index]

4.36.7.10 Tuning

Function: fluidsynth:activate-key-tuning synth bank prog name pitch apply
Function: fluidsynth:activate-octave-tuning synth bank prog name pitch apply
Function: fluidsynth:tune-notes synth bank prog len keys pitch apply
Function: fluidsynth:activate-tuning synth chan bank prog apply
Function: fluidsynth:deactivate-tuning synth chan apply
Function: fluidsynth:tuning-iteration-start synth
Function: fluidsynth:tuning-iteration-next synth bank prog
Function: fluidsynth:tuning-dump synth bank prog name len pitch

Next: , Previous: , Up: Fluidsynth   [Contents][Index]

4.36.7.11 Misc

Function: fluidsynth:get-cpu-load synth
Function: fluidsynth:error synth

4.36.7.12 Synthesizer plugin

Function: fluidsynth:write-s16 synth len lout loff lincr rout roff rincr
Function: fluidsynth:write-float synth len lout loff lincr rout roff rincr
Function: fluidsynth:nwrite-float synth len left right fx_left fx_right
Function: fluidsynth:process synth len nin in nout out

4.36.7.13 Synthesizer’s interface to handle SoundFont loaders

Function: fluidsynth:add-sfloader synth loader
Function: fluidsynth:alloc-voice synth sample channum key vel
Function: fluidsynth:start-voice synth voice
Function: fluidsynth:get-voicelist synth buf bufsize id
Function: fluidsynth:handle-midi-event data event

4.36.8 LADSPA plugin

LADSPA audio plugin interface for Incudine.

To load incudine-ladspa use asdf:load-system or require.

Macro: vug:ladspa->vug filename label vug-name &key block-size debug-p

Define a new VUG and the auxiliary function named vug-name to use the LADSPA plugin with label loaded from filename.

filename is the namestring of the plugin path, absolute or relative to ladspa:*ladspa-path*, with or without type extension.

The control parameter plugin-instance is set to the plugin instance during the DSP initialization. It is possible to retrieve the plugin instance through control-value. This functionality works only with a VUG or an inlined UGEN.

All the arguments of the auxiliary function are optional keywords.

If block-size is not set and the incudine block size changes, ladspa->vug should be called again.

If debug-p is t, return the lisp form to define the VUG.

Return the new VUG structure.

Example with block size 1:

(set-rt-block-size 1)

(ladspa->vug "caps" "Plate" plate-reverb)

(dsp! plate-reverb-test (trig-freq input-decay input-scale bw tail
                         damping blend)
  (with-samples ((in (* (decay (impulse trig-freq) input-decay)
                        (white-noise input-scale))))
    ;; PLATE-REVERB returns a frame because there are two outputs.
    (multiple-sample-bind (l r)
        (plate-reverb bw tail damping blend in)
      (out l r))))

Another example with block size greater than 1:

(set-rt-block-size 64)

(ladspa->vug "caps" "Plate" plate-reverb)

;; Test with a UGEN.
(compile-vug 'plate-reverb 'pointer)

(define-vug rev-input ((in pointer))
  "Read a block of audio samples from the first Incudine input port."
  (foreach-frame
    (setf (f32-ref in current-frame)
          (coerce (audio-in 0) 'single-float))))

(define-vug rev-output ((out pointer))
  "Write two blocks of audio samples to two Incudine output ports."
  (foreach-frame
    (out (f32-ref (ptr-ref out 0) current-frame)
         (f32-ref (ptr-ref out 1) current-frame))))

(dsp! rev-test (bw tail damping blend)
  (with ((in (make-f32-array (block-size)))
         (out (cffi:null-pointer)))
    (declare (pointer out))
    (rev-input in)
    (setf out (plate-reverb bw tail damping blend in))
    (rev-output out)))

(rev-test .75 .5 .25 .25 :id 8)
(set-controls 8 :tail .8 :dumping .1 :blend .5)
(free 8)

The alternative is to set a specific block size for the plugin, for example:

(ladspa->vug "cmt" "freeverb3" %freeverb :block-size 64)

(define-vug freeverb (input room-size damping wet dry width)
  (:defaults 0 .5 .5 .3 .7 .5)
  (with ((inL (make-f32-array 64 :zero-p t))
         (inR (make-f32-array 64 :zero-p t))
         (out (cffi:null-pointer))
         (i 63))
    (declare (type pointer out) (type fixnum i))
    (foreach-tick
      (when (= i 63)
        (setf out (%freeverb inL inR 0 room-size damping wet dry width)))
      (setf i (logand (1+ i) 63)))
    (maybe-expand input)
    (cond ((= current-channel 0)
           (setf (f32-ref inL i) (coerce input 'single-float)))
          ((= current-channel 1)
           (setf (f32-ref inR i) (coerce input 'single-float))))
    (if (< current-channel 2)
        (sample (f32-ref (ptr-ref out current-channel) i))
        +sample-zero+)))

(dsp! reverb-test ((buf buffer) amp room-size damping wet dry width)
  (:defaults (incudine-missing-arg "Missing buffer.") 1 .5 .5 .3 .7 .5)
  (foreach-frame
    (foreach-channel
      (cout (* amp
               (freeverb (buffer-play buf) room-size damping wet dry width))))))

(defvar *buf* (buffer-load "/path/to/soundfile.wav"))

(set-rt-block-size 256)
(rt-start)

(reverb-test *buf* .5 :wet .8)

(free 0)
(set-rt-block-size 1)
Variable: ladspa:*ladspa-path*
Condition: ladspa:ladspa-error
Function: ladspa:ladspa-error format-control &rest format-arguments
Function: ladspa:properties descriptor
Constant: ladspa:property-realtime
Constant: ladspa:property-inplace-broken
Constant: ladspa:property-hard-rt-capable
Function: ladspa:realtime-p x
Function: ladspa:inplace-broken-p x
Function: ladspa:hard-rt-capable-p x
Constant: ladspa:port-input
Constant: ladspa:port-output
Constant: ladspa:port-control
Constant: ladspa:port-audio
Function: ladspa:port-input-p x
Function: ladspa:port-output-p x
Function: ladspa:port-control-p x
Function: ladspa:port-audio-p x
Constant: ladspa:hint-bounded-below
Constant: ladspa:hint-bounded-above
Constant: ladspa:hint-toggled
Constant: ladspa:hint-sample-rate
Constant: ladspa:hint-logarithmic
Constant: ladspa:hint-integer
Constant: ladspa:hint-default-mask
Constant: ladspa:hint-default-none
Constant: ladspa:hint-default-minimum
Constant: ladspa:hint-default-low
Constant: ladspa:hint-default-middle
Constant: ladspa:hint-default-high
Constant: ladspa:hint-default-maximum
Constant: ladspa:hint-default-0
Constant: ladspa:hint-default-1
Constant: ladspa:hint-default-100
Constant: ladspa:hint-default-440
Function: ladspa:hint-bounded-below-p x
Function: ladspa:hint-bounded-above-p x
Function: ladspa:hint-toggled-p x
Function: ladspa:hint-sample-rate-p x
Function: ladspa:hint-logarithmic-p x
Function: ladspa:hint-integer-p x
Function: ladspa:hint-has-default-p x
Function: ladspa:hint-default-minimum-p x
Function: ladspa:hint-default-low-p x
Function: ladspa:hint-default-middle-p x
Function: ladspa:hint-default-high-p x
Function: ladspa:hint-default-maximum-p x
Function: ladspa:hint-default-0-p x
Function: ladspa:hint-default-1-p x
Function: ladspa:hint-default-100-p x
Function: ladspa:hint-default-440-p x
Function: ladspa:hint-default port-range-hint-pointer &optional sample-rate
Function: ladspa:descriptor instance
Function: ladspa:descriptor-slot-value descriptor slot-name
Structure: ladspa:handle
Function: ladspa:pointer instance
Function: ladspa:active-p instance
Function: ladspa:deleted-p instance
Function: ladspa:unique-id descriptor
Function: ladspa:label descriptor
Function: ladspa:name descriptor
Function: ladspa:maker descriptor
Function: ladspa:copyright descriptor
Function: ladspa:port-count descriptor
Function: ladspa:port-descriptors descriptor
Function: ladspa:port-names descriptor
Function: ladspa:port-range-hints descriptor
Function: ladspa:implementation-data descriptor
Function: ladspa:instantiate callback descriptor sample-rate
Function: ladspa:connect-port callback instance port data-location
Function: ladspa:has-activate-p descriptor
Function: ladspa:activate instance
Function: ladspa:run callback instance sample-count
Function: ladspa:has-run-adding-p descriptor
Function: ladspa:run-adding callback instance sample-count
Function: ladspa:has-set-run-adding-gain-p descriptor
Function: ladspa:set-run-adding-gain callback instance gain
Function: ladspa:has-deactivate-p descriptor
Function: ladspa:deactivate instance
Function: ladspa:cleanup instance
Function: ladspa:load-plugin-library filename
Function: ladspa:unload-plugin-library filename
Function: ladspa:unload-all-plugins
Function: ladspa:plugin-descriptor filename label

4.36.9 LV2 plugin

LV2 audio plugin interface for Incudine.

To load incudine-lv2 use asdf:load-system or require.

Macro: vug:lv2->vug uri vug-name &key block-size control-arguments-p debug-p

Define a new VUG and the auxiliary function named vug-name to use the LV2 plugin with uri.

Initialize the Lilv World if necessary.

The control parameter plugin-instance is set to the plugin instance during the DSP initialization. It is possible to retrieve the plugin instance through control-value. This functionality works only with a VUG or an inlined UGEN.

If control-arguments-p is t (default), all the LV2 controls are optional keywords of the auxiliary function. If the LV2 plugin provides many control ports, lv2->vug fails with a “Control stack exhausted” error. In this case, set control-arguments-p to nil, retrieve the plugin instance via control-value and use vug-foreign:plugin-port-pointer out of the DSP.

If the incudine block size changes, lv2->vug should be called again.

If debug-p is t, return the lisp form to define the VUG.

Return the new VUG structure.

Example of a LV2 effect:

(lv2->vug "http://plugin.org.uk/swh-plugins/amp" swh.amp)

(dsp! amp-test (gain)
  (out (swh.amp gain (white-noise))))

Example of a LV2 instrument:

(set-rt-block-size 64)

(lv2->vug SYNTH-TEST-URI synth-test)

;; Note: the control parameter PLUGIN could be of type T for simplicity.
(dsp! lv2-synth-test ((plugin (or null vug-foreign:plugin-instance)))
  (:defaults nil)
  (with ((out (cffi:null-pointer)))
    (declare (type pointer out))
    ;; If the instrument has many control ports, we can use
    ;; VUG-FOREIGN:PLUGIN-PORT-POINTER out of the DSP.
    (setf out (synth-test :plugin-instance plugin))
    (foreach-frame
      ;; Plugin with a single audio output port.
      (stereo (sample (f32-ref out current-frame)))
      ;; Plugin with multiple audio output ports, for example two:
      ;; (out (sample (f32-ref (ptr-ref out 0) current-frame))
      ;;      (sample (f32-ref (ptr-ref out 1) current-frame))))))

(rt-start)
(lv2-synth-test :id 123)

(defvar *synth-test* (control-value 123 'plugin))

*synth-test*
;; => #<LV2-PLUGIN-INSTANCE ...>

(defvar *midiin* (jackmidi:open))

(make-responder *midiin*
  (lambda (st d1 d2)
    (lv2:write-event *synth-test* (lv2:midi-message st d1 d2))))

(recv-start *midiin*)

(defun set-lv2-control (plugin port-index value)
  ;; Change the port value in rt-thread.
  (rt-eval ()
    (setf (f32-ref (vug-foreign:plugin-port-pointer plugin port-index))
          (coerce value 'single-float)))
  value)

;; Read the Turtle description of plugin /path/to/SYNTH-TEST.ttl
;; or run the command lv2info to know the port indices.
(set-lv2-control *synth-test* PORT-INDEX 0.1)

(f32-ref (vug-foreign:plugin-port-pointer *synth-test* PORT-INDEX))
;; => 0.1

;; We can set more port values from nrt-thread with a single
;; memory barrier or CAS.
(rt-eval ()
  (set-lv2-control ...)
  (set-lv2-control ...)
  ...)
Function: lv2:write-event plugin data &key index type start end

Send an event through an Atom port of a LV2 plugin. The buffer type of the Atom port is Atom Sequence.

data is a short MIDI message encoded into four bytes or a vector of octets where start and end are the optional bounding index designators.

If the plugin has more than one input event port, index is the array index of the input event ports.

The event type is a URID (an integer) obtained from lv2:uri-to-id. It is a MIDI event by default.

Function: lv2:midi-message &rest octets

Return a MIDI message encoded for lv2:write-event.

Function: set-lv2-tuning tuning plugin &key event-index device-id program single-note-tuning-p checksum-function

Send a bulk tuning dump message as a LV2 MIDI message. It obviously works if the LV2 synthesizer supports it. The new frequencies are related to a tuning structure.

If the plugin has more than one input event port, event-index is the array index of the input event ports.

If single-note-tuning-p is non-NIL, send 128 single note tuning change messages instead.

The optional checksum-function requires two arguments: the foreign buffer containing the MIDI SysEx message and the buffer size in bytes. It is useful if the manufacturer implements a different checksum.

event-index, device-id and program default to 0.

Function: lv2:uri-to-id uri

Get the numeric identifier of a Uniform Resource Identifier, a string that identifies a resource.

Function: lv2:id-to-uri id

Get the Uniform Resource Identifier for a mapped numeric id obtained from lv2:uri-to-id.

Example:

(lv2:uri-to-id "http://lv2plug.in/ns/ext/midi#MidiEvent")
;; => 62
(lv2:id-to-uri 62)
;; => "http://lv2plug.in/ns/ext/midi#MidiEvent"
Constant: lv2:+midi-event+

Numeric identifier of http://lv2plug.in/ns/ext/midi#MidiEvent.

Function: lv2:features

Return the NULL-terminated foreign array of LV2 Features supported by Incudine. The foreign array is allocated during the initialization of the Lilv World.

Structure: lv2:atom-sequence
Structure: lv2:event
Function: lilv:lv2-init

Initialize the Lilv World that represents all Lilv state.

Variable: lilv:*world*
Variable: lilv:*uri-audio-port*
Variable: lilv:*uri-control-port*
Variable: lilv:*uri-input-port*
Variable: lilv:*uri-output-port*
Variable: lilv:*uri-atom-port*
Variable: lilv:*uri-event-port*
Variable: lilv:*uri-midi-port*
Structure: lilv:world
Structure: lilv:instance
Function: lilv:free-p obj
Generic Function: lilv:free obj
Function: lilv:plugin-pointer uri
Function: lilv:uri-to-path uri
Function: lilv:file-uri-parse uri hostname
Function: lilv:new-uri world uri
Function: lilv:new-string world str
Function: lilv:new-int world val
Function: lilv:new-float world val
Function: lilv:new-bool world val
Function: lilv:node-free val
Function: lilv:node-duplicate val
Function: lilv:node-equals value other
Function: lilv:node-get-turtle-token value
Function: lilv:node-is-uri value
Function: lilv:node-as-uri value
Function: lilv:node-is-blank value
Function: lilv:node-as-blank value
Function: lilv:node-is-literal value
Function: lilv:node-is-string value
Function: lilv:node-as-string value
Function: lilv:node-get-path value hostname
Function: lilv:node-is-float value
Function: lilv:node-as-float value
Function: lilv:node-is-int value
Function: lilv:node-as-int value
Function: lilv:node-is-bool value
Function: lilv:node-as-bool value
Macro: lilv:with-node (var type value) &body body

Bind var to a newly allocated Lilv node of type with dynamic extent during body.

type is one of :bool, :float, :int, :string or :uri.

Macro: lilv:with-nodes bindings &body body

Create bindings to newly allocated Lilv nodes with dynamic extent during body.

bindings is a list of lists

(var type value)

where var is the variable bound to a node of type.

type is one of :bool, :float, :int, :string or :uri.

Function: lilv:plugin-classes-free collection
Function: lilv:plugin-classes-size collection
Function: lilv:plugin-classes-begin collection
Function: lilv:plugin-classes-get collection i
Function: lilv:plugin-classes-next collection i
Function: lilv:plugin-classes-is-end collection i
Function: lilv:plugin-classes-get-by-uri classes uri
Macro: lilv:plugin-class-loop (var plugin-classes) &rest keywords-and-forms

Iterate over the plugin-classes with var bound to each class. lilv:plugin-class-loop supports keywords-and-forms of the loop macro.

Function: lilv:scale-points-free collection
Function: lilv:scale-points-size collection
Function: lilv:scale-points-begin collection
Function: lilv:scale-points-get collection i
Function: lilv:scale-points-next collection i
Function: lilv:scale-points-is-end collection i
Macro: lilv:scale-point-loop (var scale-points) &rest keywords-and-forms

Iterate over the scale-points with var bound to each point. lilv:scale-point-loop supports keywords-and-forms of the loop macro.

Function: lilv:uis-free collection
Function: lilv:uis-size collection
Function: lilv:uis-begin collection
Function: lilv:uis-get collection i
Function: lilv:uis-next collection i
Function: lilv:uis-is-end collection i
Function: lilv:uis-get-by-uri uis uri
Macro: lilv:ui-loop (var uis) &rest keywords-and-forms

Iterate over the uis with var bound to each ui. lilv:ui-loop supports keywords-and-forms of the loop macro.

Function: lilv:nodes-free collection
Function: lilv:nodes-size collection
Function: lilv:nodes-begin collection
Function: lilv:nodes-get collection i
Function: lilv:nodes-next collection i
Function: lilv:nodes-is-end collection i
Function: lilv:nodes-get-first collection
Function: lilv:nodes-contains values value
Function: lilv:nodes-merge a b
Macro: lilv:node-loop (var nodes) &rest keywords-and-forms

Iterate over the nodes with var bound to each node. lilv:node-loop supports keywords-and-forms of the loop macro.

Example:

(lilv:node-loop (n lilv-nodes)
  if (lilv:node-is-uri n) collect (lilv:node-as-uri n))
Function: lilv:plugins-size collection
Function: lilv:plugins-begin collection
Function: lilv:plugins-get collection i
Function: lilv:plugins-next collection i
Function: lilv:plugins-is-end collection i
Function: lilv:plugins-get-by-uri plugins uri
Macro: lilv:plugin-loop (var plugins) &rest keywords-and-forms

Iterate over the plugins with var bound to each plugin. lilv:plugin-loop supports keywords-and-forms of the loop macro.

Example:

(lilv:init-world)
(lilv:plugin-loop (p (lilv:world-get-all-plugins lilv:*world*))
  collect (lilv:node-as-uri (lilv:plugin-get-uri p)))
Function: lilv:init-world
Function: lilv:world-new
Function: lilv:world-set-option world uri value
Function: lilv:world-load-all world
Function: lilv:world-load-bundle world bundle-uri
Function: lilv:world-load-resource world resource
Function: lilv:world-get-plugin-class world
Function: lilv:world-get-plugin-classes world
Function: lilv:world-get-all-plugins world
Function: lilv:world-find-nodes world subject predicate object
Function: lilv:world-get world subject predicate object
Function: lilv:world-ask world subject predicate object
Function: lilv:plugin-verify plugin
Function: lilv:plugin-get-uri plugin
Function: lilv:plugin-get-bundle-uri plugin
Function: lilv:plugin-get-data-uris plugin
Function: lilv:plugin-get-library-uri plugin
Function: lilv:plugin-get-name plugin
Function: lilv:plugin-get-class plugin
Function: lilv:plugin-get-value p predicate
Function: lilv:plugin-has-feature p feature-uri
Function: lilv:plugin-get-supported-features p
Function: lilv:plugin-get-required-features p
Function: lilv:plugin-get-optional-features p
Function: lilv:plugin-has-extension-data p uri
Function: lilv:plugin-get-extension-data p
Function: lilv:plugin-get-num-ports p
Function: lilv:plugin-get-port-ranges-float p min-values max-values def-values
Macro: lilv:plugin-get-num-ports-of-class p class-1 &rest varargs0
Function: lilv:plugin-has-latency p
Function: lilv:plugin-get-latency-port-index p
Function: lilv:plugin-get-port-by-index plugin index
Function: lilv:plugin-get-port-by-symbol plugin symbol
Function: lilv:plugin-get-port-by-designation plugin port-class designation
Function: lilv:plugin-get-project plugin
Function: lilv:plugin-get-author-name plugin
Function: lilv:plugin-get-author-email plugin
Function: lilv:plugin-get-author-homepage plugin
Function: lilv:plugin-is-replaced plugin
Function: lilv:plugin-write-description world plugin base-uri plugin-file
Function: lilv:plugin-write-manifest-entry world plugin base-uri manifest-file plugin-file-path
Function: lilv:plugin-get-related plugin type
Function: lilv:port-get-value plugin port predicate
Function: lilv:port-get plugin port predicate
Function: lilv:port-get-properties plugin port
Function: lilv:port-has-property p port property-uri
Function: lilv:port-supports-event p port event-type
Function: lilv:port-get-index plugin port
Function: lilv:port-get-symbol plugin port
Function: lilv:port-get-name plugin port
Function: lilv:port-get-classes plugin port
Function: lilv:port-is-a plugin port port-class
Function: lilv:port-get-range plugin port deflt min max
Function: lilv:port-get-scale-points plugin port
Function: lilv:state-new-from-world world map subject
Function: lilv:state-new-from-file world map subject path
Function: lilv:state-new-from-string world map str
Function: lilv:state-new-from-instance plugin instance map file-dir copy-dir link-dir save-dir get-value user-data flags features
Function: lilv:state-free state
Function: lilv:state-equals a b
Function: lilv:state-get-num-properties state
Function: lilv:state-get-plugin-uri state
Function: lilv:state-get-label state
Function: lilv:state-set-label state label
Function: lilv:state-restore state instance set-value user-data flags features
Function: lilv:state-save world map unmap state uri dir filename
Function: lilv:state-to-string world map unmap state uri base-uri
Function: lilv:scale-point-get-label point
Function: lilv:scale-point-get-value point
Function: lilv:plugin-class-get-parent-uri plugin-class
Function: lilv:plugin-class-get-uri plugin-class
Function: lilv:plugin-class-get-label plugin-class
Function: lilv:plugin-class-get-children plugin-class
Function: lilv:plugin-instantiate plugin sample-rate features
Function: lilv:instance-get-descriptor instance
Function: lilv:instance-get-handle instance
Function: lilv:instance-get-uri instance
Function: lilv:instance-connect-port instance port-index data-location
Function: lilv:instance-activate instance
Function: lilv:instance-deactivate instance
Function: lilv:instance-run instance sample-count
Macro: lilv:instance-impl-slot-value instance-ptr slot-name
Macro: lilv:instance-slot-value instance slot-name
Function: lilv:connect-port callback handle index data-location
Macro: lilv:descriptor-slot-value pointer slot-name
Function: lilv:plugin-get-uis plugin
Function: lilv:ui-get-uri ui
Function: lilv:ui-get-classes ui
Function: lilv:ui-is-a ui class-uri
Function: lilv:ui-is-supported ui supported-func container-type ui-type
Function: lilv:ui-get-bundle-uri ui
Function: lilv:ui-get-binary-uri ui

4.37 Emacs Modes


4.37.1 Incudine Mode

The major mode for editing incudine code.

Variable: incudine-mode-hook

Hook called when a buffer enters Incudine mode.

C-c s (incudine-scratch)

Switch to Incudine scratch buffer.

C-c v (incudine-show-repl)

Show REPL in other window.

C-c M-o (incudine-repl-clear-buffer)

Clear the REPL buffer.

C-c r s (incudine-rt-start)

Start the real-time thread.

With a positive argument n, set the new block size to n before starting.

C-c r q (incudine-rt-stop)

Stop the real-time thread.

C-c i e (incudine-scheduled-events)

Print the number of the scheduled events.

C-c i p (incudine-peak-info)

Display the peak info of a channel (0 by default).

With a non negative argument, display the peak info of that channel.

With a negative argument, reset the meters.

C-c i x (incudine-xruns-info)

Display the number of the occurred xruns and the time in samples of the last xrun.

With a non-NIL argument, set the number of xruns to zero.

C-M-Return (incudine-free-node)

Stop to play a node of the graph.

With a negative argument, call incudine:stop instead of incudine:free.

With zero argument (default), call incudine:flush-pending before incudine:free.

C-c p (incudine-pause-node)

Pause node.

With a numeric argument ’n’, pause the node with identifier ’n’.

C-c u (incudine-unpause-node)

Unpause node.

With a numeric argument ’n’, unpause the node with identifier ’n’.

C-c i n (incudine-live-nodes)

Print the number of the live nodes.

C-c i g (incudine-dump-graph)

Print informations about the graph of nodes.

With a numeric argument ’n’, print info about the group with identifier ’n’.

Type g in *incudine-node-tree* buffer to update it.

C-c g c (incudine-gc)

Initiate a garbage collection.

C-c g b (incudine-bytes-consed-in)

Rough estimate of the bytes consed in time seconds.

C-c i m (incudine-rt-memory-free-size)

Display the free realtime memory.

C-c i d

If the form at point starts with dsp! or define-ugen, prompt the arguments and display the generated code.

C-c l l e

Set the logger level to :error.

C-c l l w

Set the logger level to :warn.

C-c l l i

Set the logger level to :info.

C-c l l d

Set the logger level to :debug.

C-c l s e

Set the logger stream to *error-output*.

C-c l s s

Set the logger stream to *standard-output*.

C-c l s d

Set the logger stream to *debug-io*.

C-c l t n

Log messages without timestamp.

C-c l t s

Log messages with timestamp in seconds.

C-c l t S

Log messages with timestamp in samples.

C-Return

Eval the function and jump to the next defun.

C-S-Return

Eval the function and jump to the previous defun.

M-Return

Evaluate the current toplevel form.

PageUp

Jump at the end of the previous defun.

With a numeric argument, do it that many times.

PageDown

Jump at the end of the next defun.

With a numeric argument, do it that many times.

C-j

If the current buffer is not a file buffer, evaluate sexp before point and print value into the current buffer.

C-J

If the current buffer is not a file buffer, evaluate sexp before point, save point and print value into the current buffer.


Next: , Previous: , Up: Emacs Modes   [Contents][Index]

4.37.2 Incudine Rego Mode

Major mode for editing incudine rego files.

Incudine rego mode is a derivative of Org mode.

Variable: incudine-rego-mode-hook

Hook called when a buffer enters Incudine Rego mode.

f5 (incudine-regofile-to-function)

Define the function to interpret the edited rego file. With a C-u prefix, prompt the function name.

The score statement :score-function-name: or :score-local-function-name: is an alternative method to set the function name.

f9 (incudine-play-regofile)

Eval the edited rego file and schedule the obtained events.

C-c R l

Display the list of events obtained from the edited rego file.

C-c R e

Display the scheduled events obtained from the edited rego file.

C-c R s

Display the expansion of the edited rego file.

M-.

If the current line is an include statement, edit the included file name, otherwise edit a lisp definition or call find-tag.

M-,

Goto the location of the parent rego file or call tags-loop-continue.


Next: , Previous: , Up: Emacs Modes   [Contents][Index]

4.37.3 Org Mode

Code blocks in Incudine are supported. For example,

(require 'ob-incudine)

enables the execution of Incudine code blocks.

If the tangle header argument is yes, the extension of the tangled file is “cudo”.


Up: Org Mode   [Contents][Index]

4.37.3.1 Collection of code blocks

The syntax of the function call arguments in Org is

argA=value, argB=value, ...

If we forget this rule and something stops to work, we can use the interactive function load-incudine-rego-library to reload the code blocks.

Function: bounce-to-disk (:var output-filename input-filename channels duration pad sample-rate header-type data-format metadata rego-filename)

Process the current rego file or the rego-filename passed as argument.

By default output-filename is derived from the rego filename with extension “wav”.

See incudine:bounce-to-disk for the other defaults.

Example:

;;; test.rego

#+begin_src incudine :results silent
  (dsp! smart-pulses (freq amp (nh fixnum))
    (out (buzz freq amp nh)))
#+end_src

#+call: bounce-to-disk(channels=1, duration=4, sample-rate=44100)
#+call: bounce-to-disk(channels=1, header-type="au", data-format="double")
#+call: bounce-to-disk(output-filename="break-engine-gen.wav", rego-filename="buonassera-ciccio-systems.rego")
#+call: bounce-to-disk(rego-filename="various-systems.rego")
| 0 | smart-pulses | 650/3  | .30 |  7 |
| 0 | smart-pulses | 5200/3 | .45 | 11 |
Function: bounce-to-snd (:var output-filename input-filename channels duration pad sample-rate header-type data-format metadata rego-filename)

If incudine-snd is loaded and Snd is started with snd:run, process the current rego file or the rego-filename passed as argument, then open output-filename in Snd.

By default output-filename is derived from the rego filename with extension “wav”.


Previous: , Up: Emacs Modes   [Contents][Index]

4.37.4 SES Mode

It is possible to create and edit a rego file in SES (Simple Emacs Spreadsheet) mode, because the form feed character marks the beginning of the data area of a SES file and the end of a rego file.


Appendix A GNU Free Documentation License

Version 1.3, 3 November 2008
Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
https://fsf.org/

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
  1. PREAMBLE

    The purpose of this License is to make a manual, textbook, or other functional and useful document “free” in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others.

    This License is a kind of “copyleft”, which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software.

    We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference.

  2. APPLICABILITY AND DEFINITIONS

    This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The “Document”, below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as “you”. You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law.

    A “Modified Version” of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language.

    A “Secondary Section” is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document’s overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them.

    The “Invariant Sections” are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none.

    The “Cover Texts” are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words.

    A “Transparent” copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not “Transparent” is called “Opaque”.

    Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML, PostScript or PDF designed for human modification. Examples of transparent image formats include PNG, XCF and JPG. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML, PostScript or PDF produced by some word processors for output purposes only.

    The “Title Page” means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, “Title Page” means the text near the most prominent appearance of the work’s title, preceding the beginning of the body of the text.

    The “publisher” means any person or entity that distributes copies of the Document to the public.

    A section “Entitled XYZ” means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as “Acknowledgements”, “Dedications”, “Endorsements”, or “History”.) To “Preserve the Title” of such a section when you modify the Document means that it remains a section “Entitled XYZ” according to this definition.

    The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License.

  3. VERBATIM COPYING

    You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3.

    You may also lend copies, under the same conditions stated above, and you may publicly display copies.

  4. COPYING IN QUANTITY

    If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document’s license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects.

    If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages.

    If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public.

    It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document.

  5. MODIFICATIONS

    You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version:

    1. Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission.
    2. List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has fewer than five), unless they release you from this requirement.
    3. State on the Title page the name of the publisher of the Modified Version, as the publisher.
    4. Preserve all the copyright notices of the Document.
    5. Add an appropriate copyright notice for your modifications adjacent to the other copyright notices.
    6. Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below.
    7. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document’s license notice.
    8. Include an unaltered copy of this License.
    9. Preserve the section Entitled “History”, Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section Entitled “History” in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence.
    10. Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the “History” section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission.
    11. For any section Entitled “Acknowledgements” or “Dedications”, Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein.
    12. Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles.
    13. Delete any section Entitled “Endorsements”. Such a section may not be included in the Modified Version.
    14. Do not retitle any existing section to be Entitled “Endorsements” or to conflict in title with any Invariant Section.
    15. Preserve any Warranty Disclaimers.

    If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version’s license notice. These titles must be distinct from any other section titles.

    You may add a section Entitled “Endorsements”, provided it contains nothing but endorsements of your Modified Version by various parties—for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard.

    You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one.

    The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version.

  6. COMBINING DOCUMENTS

    You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers.

    The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work.

    In the combination, you must combine any sections Entitled “History” in the various original documents, forming one section Entitled “History”; likewise combine any sections Entitled “Acknowledgements”, and any sections Entitled “Dedications”. You must delete all sections Entitled “Endorsements”.

  7. COLLECTIONS OF DOCUMENTS

    You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects.

    You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document.

  8. AGGREGATION WITH INDEPENDENT WORKS

    A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an “aggregate” if the copyright resulting from the compilation is not used to limit the legal rights of the compilation’s users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document.

    If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document’s Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate.

  9. TRANSLATION

    Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail.

    If a section in the Document is Entitled “Acknowledgements”, “Dedications”, or “History”, the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title.

  10. TERMINATION

    You may not copy, modify, sublicense, or distribute the Document except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, or distribute it is void, and will automatically terminate your rights under this License.

    However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.

    Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.

    Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, receipt of a copy of some or all of the same material does not give you any rights to use it.

  11. FUTURE REVISIONS OF THIS LICENSE

    The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See https://www.gnu.org/licenses/.

    Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License “or any later version” applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation. If the Document specifies that a proxy can decide which future versions of this License can be used, that proxy’s public statement of acceptance of a version permanently authorizes you to choose that version for the Document.

  12. RELICENSING

    “Massive Multiauthor Collaboration Site” (or “MMC Site”) means any World Wide Web server that publishes copyrightable works and also provides prominent facilities for anybody to edit those works. A public wiki that anybody can edit is an example of such a server. A “Massive Multiauthor Collaboration” (or “MMC”) contained in the site means any set of copyrightable works thus published on the MMC site.

    “CC-BY-SA” means the Creative Commons Attribution-Share Alike 3.0 license published by Creative Commons Corporation, a not-for-profit corporation with a principal place of business in San Francisco, California, as well as future copyleft versions of that license published by that same organization.

    “Incorporate” means to publish or republish a Document, in whole or in part, as part of another Document.

    An MMC is “eligible for relicensing” if it is licensed under this License, and if all works that were first published under this License somewhere other than this MMC, and subsequently incorporated in whole or in part into the MMC, (1) had no cover texts or invariant sections, and (2) were thus incorporated prior to November 1, 2008.

    The operator of an MMC Site may republish an MMC contained in the site under CC-BY-SA on the same site at any time before August 1, 2009, provided the MMC is eligible for relicensing.


B Function Index

Jump to:   A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W  
Index Entry  Section

A
aat: Scheduling
add-responder: Receiver
after-p: DSP Graph
all-receivers: Receiver
all-responders: Receiver
ana:abuffer: Analysis Buffer
ana:abuffer-complex: Analysis Buffer
ana:abuffer-data: Analysis Buffer
ana:abuffer-imagpart: Analysis Buffer
ana:abuffer-link: Analysis Buffer
ana:abuffer-nbins: Analysis Buffer
ana:abuffer-normalized-p: Analysis Buffer
ana:abuffer-p: Analysis Buffer
ana:abuffer-polar: Analysis Buffer
ana:abuffer-realpart: Analysis Buffer
ana:abuffer-size: Analysis Buffer
ana:abuffer-time: Analysis Buffer
ana:analysis: Analysis Structure
ana:analysis-file-error: Condition
ana:analysis-input-buffer: Analysis Structure
ana:analysis-input-buffer-size: Analysis Structure
ana:analysis-output-buffer: Analysis Structure
ana:analysis-output-buffer-size: Analysis Structure
ana:analysis-p: Analysis Structure
ana:analysis-time: Analysis Structure
ana:compute-abuffer: Analysis Buffer
ana:compute-fft: Fast Fourier Transform
ana:compute-ifft: Fast Fourier Transform
ana:copy-pvbuffer-data: Short-Time Fourier Transform and Phase Vocoder
ana:discard-abuffer: Analysis Buffer
ana:discard-analysis: Analysis Structure
ana:dofft: Fast Fourier Transform
ana:dofft-complex: Fast Fourier Transform
ana:dofft-polar: Fast Fourier Transform
ana:fft: Fast Fourier Transform
ana:fft-input: Fast Fourier Transform
ana:fft-p: Fast Fourier Transform
ana:fft-plan: Fast Fourier Transform
ana:fft-plan: Fast Fourier Transform
ana:fft-plan-list: Fast Fourier Transform
ana:fft-size: Fast Fourier Transform
ana:fft-window: Fast Fourier Transform
ana:fill-pvbuffer: Short-Time Fourier Transform and Phase Vocoder
ana:get-fft-plan: Fast Fourier Transform
ana:hop-size: Fast Fourier Transform
ana:hop-size: Short-Time Fourier Transform and Phase Vocoder
ana:ifft: Fast Fourier Transform
ana:ifft-output: Fast Fourier Transform
ana:ifft-p: Fast Fourier Transform
ana:ifft-plan: Fast Fourier Transform
ana:ifft-size: Fast Fourier Transform
ana:ifft-window: Fast Fourier Transform
ana:make-abuffer: Analysis Buffer
ana:make-fft: Fast Fourier Transform
ana:make-fft-from-pvbuffer: Short-Time Fourier Transform and Phase Vocoder
ana:make-ifft: Fast Fourier Transform
ana:make-ifft-from-pvbuffer: Short-Time Fourier Transform and Phase Vocoder
ana:make-part-convolve-buffer: Short-Time Fourier Transform and Phase Vocoder
ana:make-pvbuffer: Short-Time Fourier Transform and Phase Vocoder
ana:new-fft-plan: Fast Fourier Transform
ana:normalize-pvbuffer: Short-Time Fourier Transform and Phase Vocoder
ana:pvbuffer: Short-Time Fourier Transform and Phase Vocoder
ana:pvbuffer-block-size: Short-Time Fourier Transform and Phase Vocoder
ana:pvbuffer-channels: Short-Time Fourier Transform and Phase Vocoder
ana:pvbuffer-data: Short-Time Fourier Transform and Phase Vocoder
ana:pvbuffer-data-type: Short-Time Fourier Transform and Phase Vocoder
ana:pvbuffer-fft-size: Short-Time Fourier Transform and Phase Vocoder
ana:pvbuffer-frames: Short-Time Fourier Transform and Phase Vocoder
ana:pvbuffer-load: Short-Time Fourier Transform and Phase Vocoder
ana:pvbuffer-normalized-p: Short-Time Fourier Transform and Phase Vocoder
ana:pvbuffer-sample-rate: Short-Time Fourier Transform and Phase Vocoder
ana:pvbuffer-save: Short-Time Fourier Transform and Phase Vocoder
ana:pvbuffer-scale-factor: Short-Time Fourier Transform and Phase Vocoder
ana:pvbuffer-size: Short-Time Fourier Transform and Phase Vocoder
ana:pvbuffer-window: Short-Time Fourier Transform and Phase Vocoder
ana:rectangular-window: Fast Fourier Transform
ana:remove-fft-plan: Fast Fourier Transform
ana:stft: Short-Time Fourier Transform and Phase Vocoder
ana:touch-abuffer: Analysis Buffer
ana:touch-analysis: Analysis Structure
ana:update-linked-object: Analysis Buffer
ana:window-function: Fast Fourier Transform
ana:window-function: Short-Time Fourier Transform and Phase Vocoder
ana:window-size: Fast Fourier Transform
ana:window-size: Short-Time Fourier Transform and Phase Vocoder
at: Scheduling
audio-in: Bus
audio-out: Bus
audio-port-name: Jack Audio

B
beats->seconds: Time
before-p: DSP Graph
block-size: Utilities
bounce-to-buffer: Mixdown
bounce-to-disk: Mixdown
bounce-to-disk: Collection of code blocks
bounce-to-snd: Sound editor Snd
bounce-to-snd: Collection of code blocks
bounce-to-snd-mix: Sound editor Snd
bpm: Time
bpm-at: Time
bps: Time
bps-at: Time
breakpoints->env: Envelope
buffer: Buffer
buffer->array: Buffer
buffer->list: Buffer
buffer-channels: Buffer
buffer-data: Buffer
buffer-file: Buffer
buffer-frames: Buffer
buffer-load: Buffer
buffer-lobits: Buffer
buffer-lodiv: Buffer
buffer-lomask: Buffer
buffer-mask: Buffer
buffer-p: Buffer
buffer-sample-rate: Buffer
buffer-save: Buffer
buffer-size: Buffer
buffer-value: Buffer
bus: Bus

C
circular-shift: Buffer
circular-shift: Utilities
circular-shift: Fast Fourier Transform
circular-shift: Fast Fourier Transform
clm:all-pass: Generators
clm:all-pass?: Generators
clm:apply-window: FFT
clm:array->file: Utilities (1)
clm:array-interp: Utilities (1)
clm:asymmetric-fm: Generators
clm:asymmetric-fm?: Generators
clm:autocorrelate: FFT
clm:centered-random: Utilities (1)
clm:clear-array: Utilities (1)
clm:clm-cerror: Utilities (1)
clm:clm-load: Score
clm:clm-print: Utilities (1)
clm:clm-random: Utilities (1)
clm:close-input: Sound I/O
clm:comb: Generators
clm:comb?: Generators
clm:continue-frample->file: Sound I/O
clm:continue-sample->file: Sound I/O
clm:convolution: FFT
clm:convolve: Generators
clm:convolve-files: Generators
clm:convolve?: Generators
clm:correlate: FFT
clm:cudere-clm-error: Conditions
clm:dac: Utilities (1)
clm:def-clm-struct: Definitions
clm:def-optkey-fun: Definitions
clm:define-clm-ugen: Definitions
clm:definstrument: Definitions
clm:definstrument*: Definitions
clm:delay: Generators
clm:delay-tick: Generators
clm:delay?: Generators
clm:double: Utilities (1)
clm:double-float: Utilities (1)
clm:env: Generators
clm:env?: Generators
clm:envelope->coeffs: Utilities (1)
clm:envelope-interp: Utilities (1)
clm:fft: FFT
clm:fft: FFT
clm:file->array: Utilities (1)
clm:file->frample: Sound I/O
clm:file->frample: Sound I/O
clm:file->frample?: Sound I/O
clm:file->sample: Sound I/O
clm:file->sample: Sound I/O
clm:file->sample?: Sound I/O
clm:filter: Generators
clm:filter?: Generators
clm:filtered-comb: Generators
clm:filtered-comb?: Generators
clm:finish-with-sound: Common Music interface
clm:fir-filter: Generators
clm:fir-filter?: Generators
clm:firmant: Generators
clm:firmant?: Generators
clm:formant: Generators
clm:formant?: Generators
clm:frample->file: Sound I/O
clm:frample->file: Sound I/O
clm:frample->file?: Sound I/O
clm:frample->frample: Utilities (1)
clm:granulate: Generators
clm:granulate?: Generators
clm:hz->radians: Utilities (1)
clm:iir-filter: Generators
clm:iir-filter?: Generators
clm:in-any: Sound I/O
clm:ina: Sound I/O
clm:inb: Sound I/O
clm:init-with-sound: Common Music interface
clm:inverse-integrate: Utilities (1)
clm:locsig: Sound I/O
clm:locsig: Sound I/O
clm:locsig-ref: Sound I/O
clm:locsig-reverb-ref: Sound I/O
clm:locsig-reverb-set!: Sound I/O
clm:locsig-set!: Sound I/O
clm:locsig-type: Sound I/O
clm:locsig?: Sound I/O
clm:make-all-pass: Generators
clm:make-asymmetric-fm: Generators
clm:make-comb: Generators
clm:make-convolve: Generators
clm:make-delay: Generators
clm:make-double-array: Utilities (1)
clm:make-double-float-array: Utilities (1)
clm:make-env: Generators
clm:make-fft: FFT
clm:make-fft-window: FFT
clm:make-file->frample: Sound I/O
clm:make-file->sample: Sound I/O
clm:make-filter: Generators
clm:make-filtered-comb: Generators
clm:make-fir-filter: Generators
clm:make-firmant: Generators
clm:make-formant: Generators
clm:make-frample->file: Sound I/O
clm:make-granulate: Generators
clm:make-iir-filter: Generators
clm:make-integer-array: Utilities (1)
clm:make-locsig: Sound I/O
clm:make-move-sound: Sound I/O
clm:make-moving-average: Generators
clm:make-ncos: Generators
clm:make-notch: Generators
clm:make-nrxycos: Generators
clm:make-nrxysin: Generators
clm:make-nsin: Generators
clm:make-one-pole: Generators
clm:make-one-zero: Generators
clm:make-oscil: Generators
clm:make-phase-vocoder: Generators
clm:make-polyshape: Generators
clm:make-polywave: Generators
clm:make-pulse-train: Generators
clm:make-rand: Generators
clm:make-rand-interp: Generators
clm:make-readin: Sound I/O
clm:make-sample->file: Sound I/O
clm:make-sawtooth-wave: Generators
clm:make-square-wave: Generators
clm:make-src: Generators
clm:make-ssb-am: Generators
clm:make-table-lookup: Generators
clm:make-triangle-wave: Generators
clm:make-two-pole: Generators
clm:make-two-zero: Generators
clm:make-wave-train: Generators
clm:move-locsig: Sound I/O
clm:move-sound: Sound I/O
clm:move-sound: Sound I/O
clm:move-sound?: Sound I/O
clm:moving-average: Generators
clm:moving-average?: Generators
clm:mus-channel: Methods
clm:mus-channels: Methods
clm:mus-close: Methods
clm:mus-data: Methods
clm:mus-feedback: Methods
clm:mus-feedforward: Methods
clm:mus-file-name: Methods
clm:mus-frequency: Methods
clm:mus-hop: Methods
clm:mus-increment: Methods
clm:mus-input?: Methods
clm:mus-interp-type: Methods
clm:mus-interpolate: Utilities (1)
clm:mus-length: Methods
clm:mus-location: Methods
clm:mus-offset: Methods
clm:mus-order: Methods
clm:mus-output?: Methods
clm:mus-phase: Methods
clm:mus-ramp: Methods
clm:mus-rand-seed: Utilities (1)
clm:mus-random: Utilities (1)
clm:mus-reset: Methods
clm:mus-safety: Methods
clm:mus-scaler: Methods
clm:mus-set-rand-seed: Utilities (1)
clm:mus-width: Methods
clm:mus-xcoeff: Methods
clm:mus-xcoeffs: Methods
clm:mus-ycoeff: Methods
clm:mus-ycoeffs: Methods
clm:ncos: Generators
clm:ncos?: Generators
clm:normalize-partials: Utilities (1)
clm:notch: Generators
clm:notch?: Generators
clm:nrxycos: Generators
clm:nrxycos?: Generators
clm:nrxysin: Generators
clm:nrxysin?: Generators
clm:nsin: Generators
clm:nsin?: Generators
clm:one-pole: Generators
clm:one-pole?: Generators
clm:one-zero: Generators
clm:one-zero?: Generators
clm:open-input: Sound I/O
clm:open-input*: Sound I/O
clm:oscil: Generators
clm:oscil?: Generators
clm:out-any: Sound I/O
clm:outa: Sound I/O
clm:outb: Sound I/O
clm:outc: Sound I/O
clm:outd: Sound I/O
clm:partials->polynomial: Utilities (1)
clm:partials->wave: Utilities (1)
clm:phase-partials->wave: Utilities (1)
clm:phase-vocoder: Generators
clm:phase-vocoder-amp-increments: Generators
clm:phase-vocoder-amps: Generators
clm:phase-vocoder-freqs: Generators
clm:phase-vocoder-phase-increments: Generators
clm:phase-vocoder-phases: Generators
clm:phase-vocoder?: Generators
clm:play: Utilities (1)
clm:polar->rectangular: FFT
clm:polynomial: Utilities (1)
clm:polyshape: Generators
clm:polyshape?: Generators
clm:polywave: Generators
clm:polywave?: Generators
clm:pulse-train: Generators
clm:pulse-train?: Generators
clm:radians->hz: Utilities (1)
clm:rand: Generators
clm:rand-interp: Generators
clm:rand-interp?: Generators
clm:rand?: Generators
clm:readin: Sound I/O
clm:readin?: Sound I/O
clm:rectangular->magnitudes: FFT
clm:rectangular->polar: FFT
clm:reduce-amplitude-quantization-noise: Utilities (1)
clm:run: Definitions
clm:run*: Definitions
clm:sample->file: Sound I/O
clm:sample->file: Sound I/O
clm:sample->file?: Sound I/O
clm:samples->seconds: Utilities (1)
clm:sawtooth-wave: Generators
clm:sawtooth-wave?: Generators
clm:scaled-by: Score
clm:scaled-to: Score
clm:seconds->samples: Utilities (1)
clm:sound-chans: Utilities (1)
clm:sound-comment: Utilities (1)
clm:sound-data-format: Utilities (1)
clm:sound-data-location: Utilities (1)
clm:sound-datum-size: Utilities (1)
clm:sound-duration: Utilities (1)
clm:sound-frames: Utilities (1)
clm:sound-framples: Utilities (1)
clm:sound-header-type: Utilities (1)
clm:sound-length: Utilities (1)
clm:sound-let: Score
clm:sound-maxamp: Utilities (1)
clm:sound-samples: Utilities (1)
clm:sound-srate: Utilities (1)
clm:spectrum: FFT
clm:square-wave: Generators
clm:square-wave?: Generators
clm:src: Generators
clm:src?: Generators
clm:ssb-am: Generators
clm:ssb-am?: Generators
clm:stop-dac: Utilities (1)
clm:stop-playing: Utilities (1)
clm:table-lookup: Generators
clm:table-lookup?: Generators
clm:tap: Generators
clm:times->samples: Utilities (1)
clm:triangle-wave: Generators
clm:triangle-wave?: Generators
clm:two-pole: Generators
clm:two-pole?: Generators
clm:two-zero: Generators
clm:two-zero?: Generators
clm:wave-train: Generators
clm:wave-train?: Generators
clm:with-offset: Score
clm:with-pointer-to-fft-data: FFT
clm:with-sound: Score
clm:wsdat-play: Common Music interface
clm:x-norm: Utilities (1)
control-getter: DSP Graph
control-list: DSP Graph
control-names: DSP Graph
control-pointer: DSP Graph
control-setter: DSP Graph
control-value: DSP Graph
copy-buffer: Buffer
copy-envelope: Envelope
copy-tempo-envelope: Time
copy-tuning: Tuning
cps->pch: Tuning
cudere-clm.ugens:all-pass: UGens
cudere-clm.ugens:asymmetric-fm: UGens
cudere-clm.ugens:comb: UGens
cudere-clm.ugens:convolve: UGens
cudere-clm.ugens:delay: UGens
cudere-clm.ugens:env: UGens
cudere-clm.ugens:filter: UGens
cudere-clm.ugens:filtered-comb: UGens
cudere-clm.ugens:fir-filter: UGens
cudere-clm.ugens:firmant: UGens
cudere-clm.ugens:formant: UGens
cudere-clm.ugens:granulate: UGens
cudere-clm.ugens:iir-filter: UGens
cudere-clm.ugens:moving-average: UGens
cudere-clm.ugens:ncos: UGens
cudere-clm.ugens:notch: UGens
cudere-clm.ugens:nrxycos: UGens
cudere-clm.ugens:nrxysin: UGens
cudere-clm.ugens:nsin: UGens
cudere-clm.ugens:one-pole: UGens
cudere-clm.ugens:one-zero: UGens
cudere-clm.ugens:oscil: UGens
cudere-clm.ugens:phase-vocoder: UGens
cudere-clm.ugens:polywave: UGens
cudere-clm.ugens:pulse-train: UGens
cudere-clm.ugens:rand: UGens
cudere-clm.ugens:rand-interp: UGens
cudere-clm.ugens:readin: UGens
cudere-clm.ugens:sawtooth-wave: UGens
cudere-clm.ugens:square-wave: UGens
cudere-clm.ugens:src: UGens
cudere-clm.ugens:ssb-am: UGens
cudere-clm.ugens:table-lookup: UGens
cudere-clm.ugens:triangle-wave: UGens
cudere-clm.ugens:two-pole: UGens
cudere-clm.ugens:two-zero: UGens
cudere-clm.ugens:wave-train: UGens

D
defscore-statement: Rego File
delete-score-statement: Rego File
deprecated-symbol-names: Utilities
dograph: DSP Graph
dogroup: DSP Graph
done-p: DSP Graph
dsp-seq: Utilities
dump: DSP Graph
dynamic-incudine-finalizer-p: Finalization

E
edit-envelope: Envelope
enable-sharp-square-bracket-syntax: Time
enable-sharp-t-syntax: Sharp-T Reader Macro
envelope: Envelope
envelope-at: Envelope
envelope-base->curves: Envelope
envelope-curve: Envelope
envelope-data: Envelope
envelope-duration: Envelope
envelope-level: Envelope
envelope-loop-node: Envelope
envelope-p: Envelope
envelope-points: Envelope
envelope-release-node: Envelope
envelope-restart-level: Envelope
envelope-time: Envelope

F
fast-nrt-funcall: Lock-Free FIFO
fast-rt-funcall: Lock-Free FIFO
fill-buffer: Buffer
fluidsynth:activate-key-tuning: Tuning (1)
fluidsynth:activate-octave-tuning: Tuning (1)
fluidsynth:activate-tuning: Tuning (1)
fluidsynth:add-sfloader: Synthesizer's interface to handle SoundFont loaders
fluidsynth:add-sfont: SoundFont management
fluidsynth:all-notes-off: MIDI channel messages
fluidsynth:all-sounds-off: MIDI channel messages
fluidsynth:alloc-voice: Synthesizer's interface to handle SoundFont loaders
fluidsynth:bank-select: MIDI channel messages
fluidsynth:cc: MIDI channel messages
fluidsynth:channel-pressure: MIDI channel messages
fluidsynth:count-audio-channels: Audio and MIDI channels
fluidsynth:count-effects-channels: Audio and MIDI channels
fluidsynth:count-midi-channels: Audio and MIDI channels
fluidsynth:deactivate-tuning: Tuning (1)
fluidsynth:delete: Synth
fluidsynth:delete-settings: Settings
fluidsynth:error: Misc (1)
fluidsynth:get-active-voice-count: Synthesis parameters
fluidsynth:get-bank-offset: SoundFont management
fluidsynth:get-cc: MIDI channel messages
fluidsynth:get-channel-preset: MIDI channel messages
fluidsynth:get-chorus-depth: Chorus
fluidsynth:get-chorus-level: Chorus
fluidsynth:get-chorus-nr: Chorus
fluidsynth:get-chorus-speed: Chorus
fluidsynth:get-chorus-type: Chorus
fluidsynth:get-cpu-load: Misc (1)
fluidsynth:get-gain: Synthesis parameters
fluidsynth:get-gen: Synthesis parameters
fluidsynth:get-internal-bufsize: Synthesis parameters
fluidsynth:get-pitch-bend: MIDI channel messages
fluidsynth:get-pitch-wheel-sens: MIDI channel messages
fluidsynth:get-polyphony: Synthesis parameters
fluidsynth:get-program: MIDI channel messages
fluidsynth:get-reverb-damp: Reverb
fluidsynth:get-reverb-level: Reverb
fluidsynth:get-reverb-roomsize: Reverb
fluidsynth:get-reverb-width: Reverb
fluidsynth:get-settings: Synth
fluidsynth:get-sfont: SoundFont management
fluidsynth:get-sfont-by-id: SoundFont management
fluidsynth:get-sfont-by-name: SoundFont management
fluidsynth:get-voicelist: Synthesizer's interface to handle SoundFont loaders
fluidsynth:handle-midi-event: Synthesizer's interface to handle SoundFont loaders
fluidsynth:new: Synth
fluidsynth:new-settings: Settings
fluidsynth:noteoff: MIDI channel messages
fluidsynth:noteon: MIDI channel messages
fluidsynth:nwrite-float: Synthesizer plugin
fluidsynth:pitch-bend: MIDI channel messages
fluidsynth:pitch-wheel-sens: MIDI channel messages
fluidsynth:process: Synthesizer plugin
fluidsynth:program-change: MIDI channel messages
fluidsynth:program-reset: MIDI channel messages
fluidsynth:program-select: MIDI channel messages
fluidsynth:program-select-by-sfont-name: MIDI channel messages
fluidsynth:remove-sfont: SoundFont management
fluidsynth:set-bank-offset: SoundFont management
fluidsynth:set-channel-type: MIDI channel messages
fluidsynth:set-chorus: Chorus
fluidsynth:set-chorus-on: Chorus
fluidsynth:set-gain: Synthesis parameters
fluidsynth:set-gen: Synthesis parameters
fluidsynth:set-interp-method: Synthesis parameters
fluidsynth:set-polyphony: Synthesis parameters
fluidsynth:set-reverb: Reverb
fluidsynth:set-reverb-on: Reverb
fluidsynth:set-sample-rate: Synthesis parameters
fluidsynth:setting: Settings
fluidsynth:settings: Settings
fluidsynth:settings-copystr: Settings
fluidsynth:settings-dupstr: Settings
fluidsynth:settings-foreach: Settings
fluidsynth:settings-foreach-option: Settings
fluidsynth:settings-get-hints: Settings
fluidsynth:settings-get-type: Settings
fluidsynth:settings-getint: Settings
fluidsynth:settings-getint-default: Settings
fluidsynth:settings-getint-range: Settings
fluidsynth:settings-getnum: Settings
fluidsynth:settings-getnum-default: Settings
fluidsynth:settings-getnum-range: Settings
fluidsynth:settings-getstr-default: Settings
fluidsynth:settings-is-realtime: Settings
fluidsynth:settings-option-concat: Settings
fluidsynth:settings-option-count: Settings
fluidsynth:settings-setint: Settings
fluidsynth:settings-setnum: Settings
fluidsynth:settings-setstr: Settings
fluidsynth:settings-str-equal: Settings
fluidsynth:sfcount: SoundFont management
fluidsynth:sfload: SoundFont management
fluidsynth:sfont-select: MIDI channel messages
fluidsynth:sfreload: SoundFont management
fluidsynth:sfunload: SoundFont management
fluidsynth:start: MIDI channel messages
fluidsynth:start-voice: Synthesizer's interface to handle SoundFont loaders
fluidsynth:stop: MIDI channel messages
fluidsynth:synth: Synth
fluidsynth:sysex: MIDI channel messages
fluidsynth:system-reset: MIDI channel messages
fluidsynth:tune-notes: Tuning (1)
fluidsynth:tuning-dump: Tuning (1)
fluidsynth:tuning-iteration-next: Tuning (1)
fluidsynth:tuning-iteration-start: Tuning (1)
fluidsynth:unset-program: MIDI channel messages
fluidsynth:write-float: Synthesizer plugin
fluidsynth:write-s16: Synthesizer plugin
flush-all-fifos: Scheduling
flush-pending: Scheduling
free: Buffer
free: Tuning
free: Envelope
free: Time
free: Memory Management
free: DSP Graph
free: Analysis Buffer
free: Short-Time Fourier Transform and Phase Vocoder
free: Voicer
free: Unit Generator
free: Jack MIDI
free-hook: DSP Graph
free-p: Buffer
free-p: Tuning
free-p: Envelope
free-p: Time
free-p: Memory Management
free-p: Analysis Buffer
free-p: Short-Time Fourier Transform and Phase Vocoder
free-p: Unit Generator
free-p: Jack MIDI
freq-breakpoints->env: Envelope

G
gen:all-random-distributions: Random
gen:analysis: Analysis (1)
gen:bartlett: Windows
gen:blackman: Windows
gen:chebyshev-1: Partials
gen:defwindow: Windows
gen:dolph-chebyshev: Windows
gen:envelope: Envelope (1)
gen:fir: Filter
gen:gaussian: Windows
gen:gbuzz: Partials
gen:hamming: Windows
gen:hanning: Windows
gen:hilbert: Filter
gen:kaiser: Windows
gen:partials: Partials
gen:polynomial: Polynomial
gen:rand: Random
gen:rand-args: Random
gen:sinc: Windows
gen:sine-window: Windows
gen:symmetric-loop: Windows
gen:symmetric-set: Windows
group: DSP Graph
group-p: DSP Graph

H
head-p: DSP Graph

I
ignore-score-statements: Rego File
incudine-cancel-finalization: Finalization
incudine-compile-error: Condition
incudine-error: Condition
incudine-error: Condition
incudine-finalize: Finalization
incudine-memory-fault-error: Condition
incudine-missing-arg: Condition
incudine-missing-arg: Condition
incudine-network-error: Condition
incudine-node-error: Condition
incudine-simple-error: Condition
incudine-storage-condition: Condition
incudine-undefined-dsp: Condition
incudine-undefined-ugen: Condition
incudine-undefined-vug: Condition
incudine-unknown-time-unit: Condition
incudine.edf:add-flush-pending-hook: Earliest Deadline First Scheduling
incudine.edf:heap: Earliest Deadline First Scheduling
incudine.edf:heap-count: Earliest Deadline First Scheduling
incudine.edf:heap-empty-p: Earliest Deadline First Scheduling
incudine.edf:last-time: Earliest Deadline First Scheduling
incudine.edf:make-heap: Earliest Deadline First Scheduling
incudine.edf:make-node: Earliest Deadline First Scheduling
incudine.edf:next-time: Earliest Deadline First Scheduling
incudine.edf:node: Earliest Deadline First Scheduling
incudine.edf:reduce-heap-pool: Earliest Deadline First Scheduling
incudine.edf:remove-flush-pending-hook: Earliest Deadline First Scheduling
incudine.edf:sched-loop: Earliest Deadline First Scheduling
incudine.edf:schedule-at: Earliest Deadline First Scheduling
incudine.external:complex-to-polar: Utilities
incudine.external:destroy-foreign-memory-pool: Foreign Pool
incudine.external:errno-to-string: Utilities
incudine.external:foreign-alloc-ex: Foreign Pool
incudine.external:foreign-alloc-sample: Foreign Memory
incudine.external:foreign-copy: Foreign Array
incudine.external:foreign-copy-samples: Foreign Array
incudine.external:foreign-free-ex: Foreign Pool
incudine.external:foreign-realloc-ex: Foreign Pool
incudine.external:foreign-set: Foreign Array
incudine.external:foreign-zero-sample: Foreign Array
incudine.external:get-foreign-max-size: Foreign Pool
incudine.external:get-foreign-used-size: Foreign Pool
incudine.external:init-foreign-memory-pool: Foreign Pool
incudine.external:polar-to-complex: Utilities
incudine.external:rt-client: Realtime
incudine.external:rt-cycle-start-time: Realtime
incudine.util:acquire-spinlock: Spinlock Support
incudine.util:allow-rt-memory-p: Allocation in Realtime Thread
incudine.util:barrier: Lock-Free FIFO
incudine.util:bus-number: Numeric Types
incudine.util:channel-number: Numeric Types
incudine.util:cheb: Partials
incudine.util:compare-and-swap: Lock-Free FIFO
incudine.util:cons-pool: Cons Pool
incudine.util:cons-pool-pop-cons: Cons Pool
incudine.util:cons-pool-pop-list: Cons Pool
incudine.util:cons-pool-push-cons: Cons Pool
incudine.util:cons-pool-push-list: Cons Pool
incudine.util:cons-pool-size: Cons Pool
incudine.util:cos-interp: Utilities
incudine.util:cubic-interp: Utilities
incudine.util:db->linear: Utilities
incudine.util:default-logger-time-function: Logging
incudine.util:defmacro*: defun* lambda* and defmacro*
incudine.util:defun*: defun* lambda* and defmacro*
incudine.util:dochannels: Utilities
incudine.util:exit: Utilities
incudine.util:expand-cons-pool: Cons Pool
incudine.util:f32-ref: Foreign Array
incudine.util:f64-ref: Foreign Array
incudine.util:float->fixnum: Utilities
incudine.util:foreign-realloc: Foreign Memory
incudine.util:foreign-rt-alloc: Allocation in Realtime Thread
incudine.util:foreign-rt-free: Allocation in Realtime Thread
incudine.util:foreign-rt-realloc: Allocation in Realtime Thread
incudine.util:frame: Numeric Types
incudine.util:get-bytes-consed-in: Consing
incudine.util:get-foreign-sample-free-size: Allocation in Realtime Thread
incudine.util:get-foreign-sample-max-size: Allocation in Realtime Thread
incudine.util:get-foreign-sample-used-size: Allocation in Realtime Thread
incudine.util:get-mouse-button: Mouse Support
incudine.util:get-mouse-x: Mouse Support
incudine.util:get-mouse-y: Mouse Support
incudine.util:get-nrt-memory-free-size: Foreign Memory
incudine.util:get-nrt-memory-max-size: Foreign Memory
incudine.util:get-nrt-memory-used-size: Foreign Memory
incudine.util:get-rt-memory-free-size: Allocation in Realtime Thread
incudine.util:get-rt-memory-max-size: Allocation in Realtime Thread
incudine.util:get-rt-memory-used-size: Allocation in Realtime Thread
incudine.util:hz->radians: Utilities
incudine.util:i16-ref: Foreign Array
incudine.util:i32-ref: Foreign Array
incudine.util:i64-ref: Foreign Array
incudine.util:i8-ref: Foreign Array
incudine.util:incudine-version: Utilities
incudine.util:incudine-version->=: Utilities
incudine.util:lambda*: defun* lambda* and defmacro*
incudine.util:lambda-list-to-star-list: defun* lambda* and defmacro*
incudine.util:limited-sample: Numeric Types
incudine.util:linear->db: Utilities
incudine.util:linear-interp: Utilities
incudine.util:logger-level: Logging
incudine.util:logger-time: Logging
incudine.util:logger-time-function: Logging
incudine.util:make-cons-pool: Cons Pool
incudine.util:make-spinlock: Spinlock Support
incudine.util:make-tlist: Tlist
incudine.util:maybe-limited-sample: Numeric Types
incudine.util:mouse-start: Mouse Support
incudine.util:mouse-status: Mouse Support
incudine.util:mouse-stop: Mouse Support
incudine.util:msg: Logging
incudine.util:negative-sample: Numeric Types
incudine.util:next-power-of-two: Utilities
incudine.util:non-negative-fixnum64: Numeric Types
incudine.util:non-negative-sample: Numeric Types
incudine.util:non-positive-sample: Numeric Types
incudine.util:nrt-global-pool-pop-cons: Non-Realtime Cons Pool
incudine.util:nrt-global-pool-pop-list: Non-Realtime Cons Pool
incudine.util:nrt-global-pool-push-cons: Non-Realtime Cons Pool
incudine.util:nrt-global-pool-push-list: Non-Realtime Cons Pool
incudine.util:nrt-msg: Logging
incudine.util:parse-float: Utilities
incudine.util:positive-sample: Numeric Types
incudine.util:pow: Utilities
incudine.util:power-of-two-p: Utilities
incudine.util:profile: Profiling
incudine.util:profile-node: Profiling
incudine.util:profile-report: Profiling
incudine.util:profile-reset: Profiling
incudine.util:ptr-ref: Foreign Array
incudine.util:radians->hz: Utilities
incudine.util:rationalize*: Utilities
incudine.util:reduce-warnings: Utilities
incudine.util:release-spinlock: Spinlock Support
incudine.util:rt-eval: Realtime
incudine.util:rt-global-pool-pop-cons: Realtime Cons Pool
incudine.util:rt-global-pool-pop-list: Realtime Cons Pool
incudine.util:rt-global-pool-push-cons: Realtime Cons Pool
incudine.util:rt-global-pool-push-list: Realtime Cons Pool
incudine.util:rt-thread-p: Realtime
incudine.util:safe-foreign-rt-free: Allocation in Realtime Thread
incudine.util:sample: Numeric Types
incudine.util:sample: Numeric Types
incudine.util:sample->fixnum: Utilities
incudine.util:sample->int: Utilities
incudine.util:seed-random-state: Utilities
incudine.util:set-sample-duration: Utilities
incudine.util:set-sample-rate: Utilities
incudine.util:set-sound-velocity: Utilities
incudine.util:smp-ref: Utilities
incudine.util:sort-samples: Utilities
incudine.util:spinlock: Spinlock Support
incudine.util:spinlock-name: Spinlock Support
incudine.util:t60->pole: Utilities
incudine.util:thread-affinity: Utilities
incudine.util:thread-priority: Utilities
incudine.util:tlist-add-left: Tlist
incudine.util:tlist-add-right: Tlist
incudine.util:tlist-empty-p: Tlist
incudine.util:tlist-left: Tlist
incudine.util:tlist-remove-left: Tlist
incudine.util:tlist-right: Tlist
incudine.util:try-acquire-spinlock: Spinlock Support
incudine.util:u16-ref: Foreign Array
incudine.util:u32-ref: Foreign Array
incudine.util:u64-ref: Foreign Array
incudine.util:u8-ref: Foreign Array
incudine.util:unprofile: Profiling
incudine.util:with-foreign-array: Foreign Array
incudine.util:with-logger: Logging
incudine.util:with-pinned-objects: Utilities
incudine.util:with-samples: Foreign Array
incudine.util:with-samples*: Foreign Array
incudine.util:with-spinlock-held: Spinlock Support
incudine.util:without-interrupts: Utilities
init: Utilities

J
jackmidi:all-streams: Jack MIDI
jackmidi:close: Jack MIDI
jackmidi:data: Jack MIDI
jackmidi:data: Jack MIDI
jackmidi:decode-message: Jack MIDI
jackmidi:doevent: Jack MIDI
jackmidi:event-buffer: Jack MIDI
jackmidi:foreign-read: Jack MIDI
jackmidi:foreign-write: Jack MIDI
jackmidi:get-stream-by-name: Jack MIDI
jackmidi:input-stream: Jack MIDI
jackmidi:input-stream-p: Jack MIDI
jackmidi:input-stream-sysex-octets: Jack MIDI
jackmidi:input-stream-sysex-pointer: Jack MIDI
jackmidi:input-stream-sysex-size: Jack MIDI
jackmidi:input-stream-sysex-timestamp: Jack MIDI
jackmidi:make-event-buffer: Jack MIDI
jackmidi:message: Jack MIDI
jackmidi:open: Jack MIDI
jackmidi:open-p: Jack MIDI
jackmidi:output-stream: Jack MIDI
jackmidi:output-stream-p: Jack MIDI
jackmidi:port-name: Jack MIDI
jackmidi:read: Jack MIDI
jackmidi:stream: Jack MIDI
jackmidi:sysex-message-p: Jack MIDI
jackmidi:with-event-buffer: Jack MIDI
jackmidi:with-receiver: Jack MIDI
jackmidi:write: Jack MIDI
jackmidi:write-short: Jack MIDI

K
keynum->pch: Tuning

L
ladspa:activate: LADSPA plugin
ladspa:active-p: LADSPA plugin
ladspa:cleanup: LADSPA plugin
ladspa:connect-port: LADSPA plugin
ladspa:copyright: LADSPA plugin
ladspa:deactivate: LADSPA plugin
ladspa:deleted-p: LADSPA plugin
ladspa:descriptor: LADSPA plugin
ladspa:descriptor-slot-value: LADSPA plugin
ladspa:handle: LADSPA plugin
ladspa:hard-rt-capable-p: LADSPA plugin
ladspa:has-activate-p: LADSPA plugin
ladspa:has-deactivate-p: LADSPA plugin
ladspa:has-run-adding-p: LADSPA plugin
ladspa:has-set-run-adding-gain-p: LADSPA plugin
ladspa:hint-bounded-above-p: LADSPA plugin
ladspa:hint-bounded-below-p: LADSPA plugin
ladspa:hint-default: LADSPA plugin
ladspa:hint-default-0-p: LADSPA plugin
ladspa:hint-default-1-p: LADSPA plugin
ladspa:hint-default-100-p: LADSPA plugin
ladspa:hint-default-440-p: LADSPA plugin
ladspa:hint-default-high-p: LADSPA plugin
ladspa:hint-default-low-p: LADSPA plugin
ladspa:hint-default-maximum-p: LADSPA plugin
ladspa:hint-default-middle-p: LADSPA plugin
ladspa:hint-default-minimum-p: LADSPA plugin
ladspa:hint-has-default-p: LADSPA plugin
ladspa:hint-integer-p: LADSPA plugin
ladspa:hint-logarithmic-p: LADSPA plugin
ladspa:hint-sample-rate-p: LADSPA plugin
ladspa:hint-toggled-p: LADSPA plugin
ladspa:implementation-data: LADSPA plugin
ladspa:inplace-broken-p: LADSPA plugin
ladspa:instantiate: LADSPA plugin
ladspa:label: LADSPA plugin
ladspa:ladspa-error: LADSPA plugin
ladspa:ladspa-error: LADSPA plugin
ladspa:load-plugin-library: LADSPA plugin
ladspa:maker: LADSPA plugin
ladspa:name: LADSPA plugin
ladspa:plugin-descriptor: LADSPA plugin
ladspa:pointer: LADSPA plugin
ladspa:port-audio-p: LADSPA plugin
ladspa:port-control-p: LADSPA plugin
ladspa:port-count: LADSPA plugin
ladspa:port-descriptors: LADSPA plugin
ladspa:port-input-p: LADSPA plugin
ladspa:port-names: LADSPA plugin
ladspa:port-output-p: LADSPA plugin
ladspa:port-range-hints: LADSPA plugin
ladspa:properties: LADSPA plugin
ladspa:realtime-p: LADSPA plugin
ladspa:run: LADSPA plugin
ladspa:run-adding: LADSPA plugin
ladspa:set-run-adding-gain: LADSPA plugin
ladspa:unique-id: LADSPA plugin
ladspa:unload-all-plugins: LADSPA plugin
ladspa:unload-plugin-library: LADSPA plugin
lilv:connect-port: LV2 plugin
lilv:descriptor-slot-value: LV2 plugin
lilv:file-uri-parse: LV2 plugin
lilv:free: LV2 plugin
lilv:free-p: LV2 plugin
lilv:init-world: LV2 plugin
lilv:instance: LV2 plugin
lilv:instance-activate: LV2 plugin
lilv:instance-connect-port: LV2 plugin
lilv:instance-deactivate: LV2 plugin
lilv:instance-get-descriptor: LV2 plugin
lilv:instance-get-handle: LV2 plugin
lilv:instance-get-uri: LV2 plugin
lilv:instance-impl-slot-value: LV2 plugin
lilv:instance-run: LV2 plugin
lilv:instance-slot-value: LV2 plugin
lilv:lv2-init: LV2 plugin
lilv:new-bool: LV2 plugin
lilv:new-float: LV2 plugin
lilv:new-int: LV2 plugin
lilv:new-string: LV2 plugin
lilv:new-uri: LV2 plugin
lilv:node-as-blank: LV2 plugin
lilv:node-as-bool: LV2 plugin
lilv:node-as-float: LV2 plugin
lilv:node-as-int: LV2 plugin
lilv:node-as-string: LV2 plugin
lilv:node-as-uri: LV2 plugin
lilv:node-duplicate: LV2 plugin
lilv:node-equals: LV2 plugin
lilv:node-free: LV2 plugin
lilv:node-get-path: LV2 plugin
lilv:node-get-turtle-token: LV2 plugin
lilv:node-is-blank: LV2 plugin
lilv:node-is-bool: LV2 plugin
lilv:node-is-float: LV2 plugin
lilv:node-is-int: LV2 plugin
lilv:node-is-literal: LV2 plugin
lilv:node-is-string: LV2 plugin
lilv:node-is-uri: LV2 plugin
lilv:node-loop: LV2 plugin
lilv:nodes-begin: LV2 plugin
lilv:nodes-contains: LV2 plugin
lilv:nodes-free: LV2 plugin
lilv:nodes-get: LV2 plugin
lilv:nodes-get-first: LV2 plugin
lilv:nodes-is-end: LV2 plugin
lilv:nodes-merge: LV2 plugin
lilv:nodes-next: LV2 plugin
lilv:nodes-size: LV2 plugin
lilv:plugin-class-get-children: LV2 plugin
lilv:plugin-class-get-label: LV2 plugin
lilv:plugin-class-get-parent-uri: LV2 plugin
lilv:plugin-class-get-uri: LV2 plugin
lilv:plugin-class-loop: LV2 plugin
lilv:plugin-classes-begin: LV2 plugin
lilv:plugin-classes-free: LV2 plugin
lilv:plugin-classes-get: LV2 plugin
lilv:plugin-classes-get-by-uri: LV2 plugin
lilv:plugin-classes-is-end: LV2 plugin
lilv:plugin-classes-next: LV2 plugin
lilv:plugin-classes-size: LV2 plugin
lilv:plugin-get-author-email: LV2 plugin
lilv:plugin-get-author-homepage: LV2 plugin
lilv:plugin-get-author-name: LV2 plugin
lilv:plugin-get-bundle-uri: LV2 plugin
lilv:plugin-get-class: LV2 plugin
lilv:plugin-get-data-uris: LV2 plugin
lilv:plugin-get-extension-data: LV2 plugin
lilv:plugin-get-latency-port-index: LV2 plugin
lilv:plugin-get-library-uri: LV2 plugin
lilv:plugin-get-name: LV2 plugin
lilv:plugin-get-num-ports: LV2 plugin
lilv:plugin-get-num-ports-of-class: LV2 plugin
lilv:plugin-get-optional-features: LV2 plugin
lilv:plugin-get-port-by-designation: LV2 plugin
lilv:plugin-get-port-by-index: LV2 plugin
lilv:plugin-get-port-by-symbol: LV2 plugin
lilv:plugin-get-port-ranges-float: LV2 plugin
lilv:plugin-get-project: LV2 plugin
lilv:plugin-get-related: LV2 plugin
lilv:plugin-get-required-features: LV2 plugin
lilv:plugin-get-supported-features: LV2 plugin
lilv:plugin-get-uis: LV2 plugin
lilv:plugin-get-uri: LV2 plugin
lilv:plugin-get-value: LV2 plugin
lilv:plugin-has-extension-data: LV2 plugin
lilv:plugin-has-feature: LV2 plugin
lilv:plugin-has-latency: LV2 plugin
lilv:plugin-instantiate: LV2 plugin
lilv:plugin-is-replaced: LV2 plugin
lilv:plugin-loop: LV2 plugin
lilv:plugin-pointer: LV2 plugin
lilv:plugin-verify: LV2 plugin
lilv:plugin-write-description: LV2 plugin
lilv:plugin-write-manifest-entry: LV2 plugin
lilv:plugins-begin: LV2 plugin
lilv:plugins-get: LV2 plugin
lilv:plugins-get-by-uri: LV2 plugin
lilv:plugins-is-end: LV2 plugin
lilv:plugins-next: LV2 plugin
lilv:plugins-size: LV2 plugin
lilv:port-get: LV2 plugin
lilv:port-get-classes: LV2 plugin
lilv:port-get-index: LV2 plugin
lilv:port-get-name: LV2 plugin
lilv:port-get-properties: LV2 plugin
lilv:port-get-range: LV2 plugin
lilv:port-get-scale-points: LV2 plugin
lilv:port-get-symbol: LV2 plugin
lilv:port-get-value: LV2 plugin
lilv:port-has-property: LV2 plugin
lilv:port-is-a: LV2 plugin
lilv:port-supports-event: LV2 plugin
lilv:scale-point-get-label: LV2 plugin
lilv:scale-point-get-value: LV2 plugin
lilv:scale-point-loop: LV2 plugin
lilv:scale-points-begin: LV2 plugin
lilv:scale-points-free: LV2 plugin
lilv:scale-points-get: LV2 plugin
lilv:scale-points-is-end: LV2 plugin
lilv:scale-points-next: LV2 plugin
lilv:scale-points-size: LV2 plugin
lilv:state-equals: LV2 plugin
lilv:state-free: LV2 plugin
lilv:state-get-label: LV2 plugin
lilv:state-get-num-properties: LV2 plugin
lilv:state-get-plugin-uri: LV2 plugin
lilv:state-new-from-file: LV2 plugin
lilv:state-new-from-instance: LV2 plugin
lilv:state-new-from-string: LV2 plugin
lilv:state-new-from-world: LV2 plugin
lilv:state-restore: LV2 plugin
lilv:state-save: LV2 plugin
lilv:state-set-label: LV2 plugin
lilv:state-to-string: LV2 plugin
lilv:ui-get-binary-uri: LV2 plugin
lilv:ui-get-bundle-uri: LV2 plugin
lilv:ui-get-classes: LV2 plugin
lilv:ui-get-uri: LV2 plugin
lilv:ui-is-a: LV2 plugin
lilv:ui-is-supported: LV2 plugin
lilv:ui-loop: LV2 plugin
lilv:uis-begin: LV2 plugin
lilv:uis-free: LV2 plugin
lilv:uis-get: LV2 plugin
lilv:uis-get-by-uri: LV2 plugin
lilv:uis-is-end: LV2 plugin
lilv:uis-next: LV2 plugin
lilv:uis-size: LV2 plugin
lilv:uri-to-path: LV2 plugin
lilv:with-node: LV2 plugin
lilv:with-nodes: LV2 plugin
lilv:world: LV2 plugin
lilv:world-ask: LV2 plugin
lilv:world-find-nodes: LV2 plugin
lilv:world-get: LV2 plugin
lilv:world-get-all-plugins: LV2 plugin
lilv:world-get-plugin-class: LV2 plugin
lilv:world-get-plugin-classes: LV2 plugin
lilv:world-load-all: LV2 plugin
lilv:world-load-bundle: LV2 plugin
lilv:world-load-resource: LV2 plugin
lilv:world-new: LV2 plugin
lilv:world-set-option: LV2 plugin
live-nodes: DSP Graph
load-sclfile: Tuning
lv2:atom-sequence: LV2 plugin
lv2:event: LV2 plugin
lv2:features: LV2 plugin
lv2:id-to-uri: LV2 plugin
lv2:midi-message: LV2 plugin
lv2:uri-to-id: LV2 plugin
lv2:write-event: LV2 plugin

M
make-adsr: Envelope
make-asr: Envelope
make-buffer: Buffer
make-cutoff: Envelope
make-dadsr: Envelope
make-envelope: Envelope
make-group: DSP Graph
make-linen: Envelope
make-osc-responder: Receiver
make-perc: Envelope
make-responder: Receiver
make-tempo: Time
make-tempo-envelope: Time
make-tuning: Tuning
map-buffer: Buffer
map-into-buffer: Buffer
midi-tuning-sysex: MIDI
midifile:close: Midifile
midifile:current-track: Midifile
midifile:data: Midifile
midifile:data: Midifile
midifile:end-of-track: Midifile
midifile:event-beats: Midifile
midifile:event-delta-time: Midifile
midifile:event-seconds: Midifile
midifile:event-time: Midifile
midifile:format: Midifile
midifile:input-stream: Midifile
midifile:input-stream-p: Midifile
midifile:invalid-running-status: Condition
midifile:invalid-track-chunk-length: Condition
midifile:invalid-variable-length-quantity: Condition
midifile:message: Midifile
midifile:message-buffer: Midifile
midifile:message-data1: Midifile
midifile:message-data2: Midifile
midifile:message-length: Midifile
midifile:message-status: Midifile
midifile:midifile-error: Condition
midifile:midifile-parse-error: Condition
midifile:next-track: Midifile
midifile:number-of-tracks: Midifile
midifile:open: Midifile
midifile:open-p: Midifile
midifile:output-stream: Midifile
midifile:output-stream-p: Midifile
midifile:path: Midifile
midifile:ppqn: Midifile
midifile:read-event: Midifile
midifile:read-header: Midifile
midifile:release-cached-buffers: Midifile
midifile:smpte: Midifile
midifile:stream: Midifile
midifile:string-message: Midifile
midifile:tempo: Midifile
midifile:tempo: Midifile
midifile:tempo-message: Midifile
midifile:with-open-midifile: Midifile
midifile:write-event: Midifile
midifile:write-header: Midifile
midifile:write-short-event: Midifile
midifile:write-tempo-track: Midifile
midiin-sysex-octets: MIDI
midiout: MIDI
midiout-sysex: MIDI
minimize-tuning-ratios: Tuning
move: DSP Graph

N
net:block-p: General Stream Sockets
net:broadcast: General Stream Sockets
net:buffer-pointer: General Stream Sockets
net:buffer-size: General Stream Sockets
net:buffer-to-octets: General Stream Sockets
net:buffer-to-string: General Stream Sockets
net:close: General Stream Sockets
net:close-connections: General Stream Sockets
net:connect: General Stream Sockets
net:connected-p: General Stream Sockets
net:connections: General Stream Sockets
net:connections-fd: General Stream Sockets
net:direction: General Stream Sockets
net:foreign-read: General Stream Sockets
net:foreign-write: General Stream Sockets
net:host: General Stream Sockets
net:input-stream: General Stream Sockets
net:input-stream-p: General Stream Sockets
net:last-recv-fd: General Stream Sockets
net:octets-to-buffer: General Stream Sockets
net:open: General Stream Sockets
net:open-p: General Stream Sockets
net:output-stream: General Stream Sockets
net:output-stream-p: General Stream Sockets
net:port: General Stream Sockets
net:protocol: General Stream Sockets
net:protocolp: General Stream Sockets
net:read: General Stream Sockets
net:reject: General Stream Sockets
net:slip-decode: General Stream Sockets
net:slip-encode: General Stream Sockets
net:socket-fd: General Stream Sockets
net:socket-send: General Stream Sockets
net:stream: General Stream Sockets
net:string-to-buffer: General Stream Sockets
net:without-block: General Stream Sockets
net:write: General Stream Sockets
next-node-id: DSP Graph
node: DSP Graph
node: DSP Graph
node-enable-gain-p: DSP Graph
node-fade-curve: DSP Graph
node-fade-in: DSP Graph
node-fade-out: DSP Graph
node-fade-time: DSP Graph
node-free-all: DSP Graph
node-gain: DSP Graph
node-id: DSP Graph
node-name: DSP Graph
node-p: DSP Graph
node-release-phase-p: DSP Graph
node-segment: DSP Graph
node-start-time: DSP Graph
node-uptime: DSP Graph
normalize-buffer: Buffer
normalize-envelope: Envelope
now: Time
nrt-funcall: Lock-Free FIFO
null-node-p: DSP Graph

O
open-serial-port: Serial IO
osc:address-pattern: Open Sound Control
osc:bundle: Open Sound Control
osc:bundle-length: Open Sound Control
osc:check-pattern: Open Sound Control
osc:copy-packet: Open Sound Control
osc:end-of-bundle-p: Open Sound Control
osc:fix-size: Open Sound Control
osc:flush-bundle: Open Sound Control
osc:index-values: Open Sound Control
osc:input-stream: Open Sound Control
osc:input-stream-p: Open Sound Control
osc:latency: Open Sound Control
osc:max-values: Open Sound Control
osc:message: Open Sound Control
osc:message-encoding: Open Sound Control
osc:message-length: Open Sound Control
osc:message-pointer: Open Sound Control
osc:message-time: Open Sound Control
osc:midi: Open Sound Control
osc:open: Open Sound Control
osc:output-stream: Open Sound Control
osc:output-stream-p: Open Sound Control
osc:receive: Open Sound Control
osc:required-values: Open Sound Control
osc:send: Open Sound Control
osc:send-bundle: Open Sound Control
osc:simple-bundle: Open Sound Control
osc:start-message: Open Sound Control
osc:stream: Open Sound Control
osc:value: Open Sound Control
osc:value-pointer: Open Sound Control
osc:with-stream: Open Sound Control
osc:with-values: Open Sound Control

P
pause: DSP Graph
pause-p: DSP Graph
pch->cps: Tuning
pch->keynum: Tuning
peak-info: Bus
play: DSP Graph
pm:abort: PortMidi
pm:all-streams: PortMidi
pm:allocation-error: PortMidi
pm:allocation-error: PortMidi
pm:before: PortMidi
pm:channel: PortMidi
pm:close: PortMidi
pm:count-devices: PortMidi
pm:decode-message: PortMidi
pm:doevent: PortMidi
pm:error-generic: PortMidi
pm:error-generic: PortMidi
pm:event-buffer: PortMidi
pm:free: PortMidi
pm:get-default-input-device-id: PortMidi
pm:get-default-output-device-id: PortMidi
pm:get-device-id-by-name: PortMidi
pm:get-device-info: PortMidi
pm:get-error-text: PortMidi
pm:get-host-error-text: PortMidi
pm:get-stream-by-name: PortMidi
pm:has-host-error: PortMidi
pm:initialize: PortMidi
pm:input-stream: PortMidi
pm:input-stream-events-remain: PortMidi
pm:input-stream-p: PortMidi
pm:input-stream-sysex-octets: PortMidi
pm:input-stream-sysex-pointer: PortMidi
pm:make-event-buffer: PortMidi
pm:message: PortMidi
pm:message-data1: PortMidi
pm:message-data2: PortMidi
pm:message-status: PortMidi
pm:open: PortMidi
pm:open-input: PortMidi
pm:open-output: PortMidi
pm:open-p: PortMidi
pm:output-stream: PortMidi
pm:output-stream-p: PortMidi
pm:poll: PortMidi
pm:port-name: PortMidi
pm:portmidi-error: PortMidi
pm:print-devices-info: PortMidi
pm:read: PortMidi
pm:reinitialize: PortMidi
pm:set-channel-mask: PortMidi
pm:set-filter: PortMidi
pm:stream: PortMidi
pm:stream-pointer: PortMidi
pm:synchronize: PortMidi
pm:sysex-message-p: PortMidi
pm:terminate: PortMidi
pm:with-event-buffer: PortMidi
pm:with-input-sysex-event: PortMidi
pm:with-receiver: PortMidi
pm:write: PortMidi
pm:write-short: PortMidi
pm:write-sysex: PortMidi
portaudio-device-info: PortAudio
portaudio-set-device: PortAudio
portaudio-stream-latency: PortAudio
print-peak-info: Bus
pt:sleep: PortTime
pt:start: PortTime
pt:started: PortTime
pt:stop: PortTime
pt:time: PortTime

Q
quantize: Buffer
quantize: Tuning
quantize: Utilities

R
receiver: Receiver
receiver: Receiver
receiver-stream: Receiver
recover-suspended-audio-cycles-p: Realtime
recv-functions: Receiver
recv-start: Receiver
recv-status: Receiver
recv-stop: Receiver
regofile->function: Rego File
regofile->lispfile: Rego File
regofile->list: Rego File
regofile->sexp: Rego File
regolist->file: Rego File
regostring->function: Rego File
regostring->list: Rego File
reinit: DSP Graph
remove-all-receivers: Receiver
remove-all-responders: Receiver
remove-receiver: Receiver
remove-responder: Receiver
rescale-buffer: Buffer
rescale-envelope: Envelope
reset-audio-port-names: Jack Audio
reset-peak-meters: Bus
resize-buffer: Buffer
responder: Receiver
rt-buffer-size: Realtime
rt-cpu: Realtime
rt-funcall: Lock-Free FIFO
rt-loop-callback: Realtime
rt-sample-rate: Realtime
rt-silent-errors: Realtime
rt-start: Realtime
rt-status: Realtime
rt-stop: Realtime
rt-time-offset: Realtime
rt-xruns: Realtime

S
scale-buffer: Buffer
scale-envelope: Envelope
seconds->beats: Time
serial-flush: Serial IO
serial-stream-p: Serial IO
set-control: DSP Graph
set-controls: DSP Graph
set-envelope-base: Envelope
set-lv2-tuning: LV2 plugin
set-max-buffer-size: Realtime
set-number-of-channels: Bus
set-rt-block-size: Realtime
set-tempo-envelope: Time
set-tuning: Tuning
set-tuning-from-midi: Tuning
set-tuning-reference: Tuning
snd:buffer->mix: Sound editor Snd
snd:buffer->sound: Sound editor Snd
snd:close-stream: Sound editor Snd
snd:emacs-mode-p: Sound editor Snd
snd:enable-sharp-s7-syntax: Sound editor Snd
snd:env-channel: Sound editor Snd
snd:env-selection: Sound editor Snd
snd:eval: Sound editor Snd
snd:exit: Sound editor Snd
snd:float-vector: Sound editor Snd
snd:float-vector->buffer: Sound editor Snd
snd:flush-stream: Sound editor Snd
snd:load: Sound editor Snd
snd:map-channel: Sound editor Snd
snd:mix: Sound editor Snd
snd:mix->buffer: Sound editor Snd
snd:open-or-update-sound: Sound editor Snd
snd:region->buffer: Sound editor Snd
snd:run: Sound editor Snd
snd:selection->buffer: Sound editor Snd
snd:snd-error: Sound editor Snd
snd:sound->buffer: Sound editor Snd
sort-buffer: Buffer
soundfile:buffer-data: Soundfile
soundfile:buffer-index: Soundfile
soundfile:buffer-size: Soundfile
soundfile:buffer-value: Soundfile
soundfile:channels: Soundfile
soundfile:close: Soundfile
soundfile:concatenate: Soundfile
soundfile:convert: Soundfile
soundfile:current-frame: Soundfile
soundfile:data-format: Soundfile
soundfile:data-location: Soundfile
soundfile:duration: Soundfile
soundfile:eof-p: Soundfile
soundfile:foreign-read: Soundfile
soundfile:foreign-write: Soundfile
soundfile:frames: Soundfile
soundfile:header-type: Soundfile
soundfile:input-stream: Soundfile
soundfile:input-stream-p: Soundfile
soundfile:maxamp: Soundfile
soundfile:merge: Soundfile
soundfile:metadata: Soundfile
soundfile:offset: Soundfile
soundfile:open: Soundfile
soundfile:open-p: Soundfile
soundfile:output-stream: Soundfile
soundfile:output-stream-p: Soundfile
soundfile:path: Soundfile
soundfile:position: Soundfile
soundfile:read: Soundfile
soundfile:read-header: Soundfile
soundfile:read-into-buffer: Soundfile
soundfile:read-next: Soundfile
soundfile:sample-rate: Soundfile
soundfile:soundfile-error: Condition
soundfile:stream: Soundfile
soundfile:update-header: Soundfile
soundfile:with-open-soundfile: Soundfile
soundfile:write: Soundfile
spb: Time
spb-at: Time
stop: DSP Graph
stop-hook: DSP Graph

T
tail-p: DSP Graph
tempo: Time
tempo-breakpoints: Time
tempo-envelope: Time
tempo-envelope-p: Time
tempo-p: Time
tempo-sync: Time
timestamp: Time
tuning: Tuning
tuning-cents: Tuning
tuning-cps: Tuning
tuning-data: Tuning
tuning-degree-index: Tuning
tuning-description: Tuning
tuning-freq-base: Tuning
tuning-keynum-base: Tuning
tuning-notes-from-data: Tuning
tuning-ratios: Tuning
tuning-save: Tuning

U
unpause: DSP Graph
unschedule-if: Scheduling

V
voicer:control-list: Voicer
voicer:control-names: Voicer
voicer:control-value: Voicer
voicer:create: Voicer
voicer:define-map: Voicer
voicer:empty-p: Voicer
voicer:fill-amp-table: Voicer
voicer:fill-freq-table: Voicer
voicer:full-p: Voicer
voicer:midi-bind: Voicer
voicer:midi-event: Voicer
voicer:panic: Voicer
voicer:polyphony: Voicer
voicer:release: Voicer
voicer:remove-all-maps: Voicer
voicer:remove-map: Voicer
voicer:scale-midi-amp: Voicer
voicer:set-controls: Voicer
voicer:steal-voice-mode: Voicer
voicer:trigger: Voicer
voicer:update: Voicer
voicer:voicer: Voicer
vug-foreign:audio-port-p: Foreign Plugin
vug-foreign:control-port-p: Foreign Plugin
vug-foreign:doc-string: Foreign Plugin
vug-foreign:event-port-p: Foreign Plugin
vug-foreign:input-port-p: Foreign Plugin
vug-foreign:make-plugin: Foreign Plugin
vug-foreign:make-port: Foreign Plugin
vug-foreign:midi-port-p: Foreign Plugin
vug-foreign:output-port-p: Foreign Plugin
vug-foreign:plugin: Foreign Plugin
vug-foreign:plugin-instance: Foreign Plugin
vug-foreign:plugin-instance-pointer: Foreign Plugin
vug-foreign:plugin-port-pointer: Foreign Plugin
vug-foreign:port: Foreign Plugin
vug-foreign:port-loop: Foreign Plugin
vug-foreign:update-io-number: Foreign Plugin
vug-foreign:with-vug-plugin: Foreign Plugin
vug:all-dsp-names: DSP
vug:all-ugen-names: Unit Generator
vug:all-vug-names: Virtual Unit Generator
vug:allpass: Delay
vug:allpass-s: Delay
vug:apf: Filter (1)
vug:balance: Amplitude
vug:biquad: Filter (1)
vug:bpf: Filter (1)
vug:buf-delay: Delay
vug:buf-delay-s: Delay
vug:buf-vdelay: Delay
vug:buffer-frame: Buffer (1)
vug:buffer-play: Buffer (1)
vug:buffer-read: Buffer (1)
vug:buffer-write: Buffer (1)
vug:butter-bp: Filter (1)
vug:butter-br: Filter (1)
vug:butter-hp: Filter (1)
vug:butter-lp: Filter (1)
vug:buzz: Generator
vug:centroid: Analysis (2)
vug:clip: Distortion
vug:compile-vug: Unit Generator
vug:compiled-vug-p: Unit Generator
vug:counter: Misc
vug:cout: Output
vug:crackle: Noise
vug:cs-atone: Filter (1)
vug:cs-tone: Filter (1)
vug:cusp: Chaos
vug:dcblock: Filter (1)
vug:decay: Envelope (2)
vug:decay-2: Envelope (2)
vug:define-ugen: Unit Generator
vug:define-ugen-control-getter: Unit Generator
vug:define-ugen-control-setter: Unit Generator
vug:define-vug: Virtual Unit Generator
vug:define-vug-macro: Virtual Unit Generator
vug:delay: Delay
vug:delay-feedback: Delay
vug:delay-s: Delay
vug:delay1: Delay
vug:destroy-dsp: DSP
vug:destroy-ugen: Unit Generator
vug:destroy-vug: Virtual Unit Generator
vug:diff: Filter (1)
vug:direct-convolve: Filter (1)
vug:downsamp: Misc
vug:dsp!: DSP
vug:dsp-debug: DSP
vug:dsp-lambda-list: DSP
vug:dsp-node: Virtual Unit Generator
vug:env-follower: Amplitude
vug:envelope: Envelope (2)
vug:exp-midi-cc: MIDI (1)
vug:exp-midi-global-aftertouch: MIDI (1)
vug:exp-midi-pitch-bend: MIDI (1)
vug:exp-midi-poly-aftertouch: MIDI (1)
vug:exp-mouse-x: Mouse
vug:exp-mouse-y: Mouse
vug:expon: Envelope (2)
vug:external-variable: Virtual Unit Generator
vug:fb-comb: Delay
vug:fb-sine: Chaos
vug:ff-comb: Delay
vug:fix-ugen: Unit Generator
vug:fix-vug: Virtual Unit Generator
vug:flatness: Analysis (2)
vug:flux: Analysis (2)
vug:fofilter: Filter (1)
vug:foreach-channel: Virtual Unit Generator
vug:foreach-frame: Virtual Unit Generator
vug:foreach-tick: Virtual Unit Generator
vug:foreign-array-type-of: Virtual Unit Generator
vug:foreign-length: Virtual Unit Generator
vug:foreign-plugin-error: Condition
vug:fpan2: Panpot
vug:fractal-noise: Noise
vug:frame-out: Output
vug:frame-ref: Frame
vug:free-dsp-instances: DSP
vug:free-self: Virtual Unit Generator
vug:gain: Amplitude
vug:gbman: Chaos
vug:gbuzz: Generator
vug:gendy: Chaos
vug:get-pointer: Virtual Unit Generator
vug:henon: Chaos
vug:hi-shelf: Filter (1)
vug:hpf: Filter (1)
vug:impulse: Generator
vug:init-only: Virtual Unit Generator
vug:initialize: Virtual Unit Generator
vug:integrator: Filter (1)
vug:interpolate: Misc
vug:ladspa->vug: LADSPA plugin
vug:lag: Filter (1)
vug:lag-ud: Filter (1)
vug:latoocarfian: Chaos
vug:lin->exp: Conversion
vug:lin->lin: Conversion
vug:lin-cong: Chaos
vug:lin-midi-cc: MIDI (1)
vug:lin-midi-global-aftertouch: MIDI (1)
vug:lin-midi-pitch-bend: MIDI (1)
vug:lin-midi-poly-aftertouch: MIDI (1)
vug:lin-mouse-x: Mouse
vug:lin-mouse-y: Mouse
vug:line: Envelope (2)
vug:lorenz: Chaos
vug:low-shelf: Filter (1)
vug:lpf: Filter (1)
vug:lpf18: Filter (1)
vug:lv2->vug: LV2 plugin
vug:maf: Filter (1)
vug:make-f32-array: Virtual Unit Generator
vug:make-f64-array: Virtual Unit Generator
vug:make-frame: Frame
vug:make-i32-array: Virtual Unit Generator
vug:make-i64-array: Virtual Unit Generator
vug:make-pointer-array: Virtual Unit Generator
vug:make-u32-array: Virtual Unit Generator
vug:make-u64-array: Virtual Unit Generator
vug:maybe-expand: Virtual Unit Generator
vug:maybe-i32-ref: Virtual Unit Generator
vug:maybe-make-i32-array: Virtual Unit Generator
vug:maybe-make-u32-array: Virtual Unit Generator
vug:maybe-u32-ref: Virtual Unit Generator
vug:median: Filter (1)
vug:metadata: DSP
vug:midi-amp: MIDI (1)
vug:midi-cc: MIDI (1)
vug:midi-cc-p: MIDI (1)
vug:midi-cps: MIDI (1)
vug:midi-global-aftertouch: MIDI (1)
vug:midi-global-aftertouch-p: MIDI (1)
vug:midi-highest-keynum: MIDI (1)
vug:midi-lowest-keynum: MIDI (1)
vug:midi-note-off: MIDI (1)
vug:midi-note-off-p: MIDI (1)
vug:midi-note-on: MIDI (1)
vug:midi-note-on-p: MIDI (1)
vug:midi-note-p: MIDI (1)
vug:midi-pitch-bend: MIDI (1)
vug:midi-pitch-bend-p: MIDI (1)
vug:midi-poly-aftertouch: MIDI (1)
vug:midi-poly-aftertouch-p: MIDI (1)
vug:midi-program: MIDI (1)
vug:midi-program-p: MIDI (1)
vug:midi-velocity: MIDI (1)
vug:mirror: Distortion
vug:moogff: Filter (1)
vug:moogladder: Filter (1)
vug:mouse-button: Mouse
vug:mouse-x: Mouse
vug:mouse-y: Mouse
vug:multiple-sample-bind: Frame
vug:nclip: Distortion
vug:nlf2: Filter (1)
vug:nmirror: Distortion
vug:node-out: Output
vug:notch: Filter (1)
vug:nwrap: Distortion
vug:osc: Generator
vug:oscr: Generator
vug:oscrc: Generator
vug:oscrq: Generator
vug:oscrs: Generator
vug:out: Output
vug:pan2: Panpot
vug:part-convolve: Filter (1)
vug:peak-eq: Filter (1)
vug:phasor: Generator
vug:phasor-loop: Generator
vug:pink-noise: Noise
vug:played-midi-note: MIDI (1)
vug:pole: Filter (1)
vug:pole*: Filter (1)
vug:pulse: Generator
vug:quad-map: Chaos
vug:rand: Noise
vug:rename-ugen: Unit Generator
vug:rename-vug: Virtual Unit Generator
vug:reset-midi-notes: MIDI (1)
vug:reson: Filter (1)
vug:resonr: Filter (1)
vug:resonz: Filter (1)
vug:ringr: Filter (1)
vug:ringz: Filter (1)
vug:rms: Amplitude
vug:rolloff: Analysis (2)
vug:samphold: Misc
vug:samples: Frame
vug:samples-zero: Virtual Unit Generator
vug:sine: Generator
vug:snapshot: Misc
vug:spectral-rms: Analysis (2)
vug:standard-map: Chaos
vug:stereo: Panpot
vug:svf: Filter (1)
vug:tick: Virtual Unit Generator
vug:two-pole: Filter (1)
vug:two-zero: Filter (1)
vug:ugen: Unit Generator
vug:ugen: Unit Generator
vug:ugen-control-pointer: Unit Generator
vug:ugen-debug: Unit Generator
vug:ugen-instance: Unit Generator
vug:ugen-lambda-list: Unit Generator
vug:ugen-perf-function: Unit Generator
vug:ugen-reinit-function: Unit Generator
vug:ugen-return-pointer: Unit Generator
vug:update: Virtual Unit Generator
vug:vallpass: Delay
vug:vdelay: Delay
vug:vtap: Delay
vug:vug: Virtual Unit Generator
vug:vug: Virtual Unit Generator
vug:vug-input: Virtual Unit Generator
vug:vug-lambda-list: Virtual Unit Generator
vug:vug-macro: Virtual Unit Generator
vug:vug-macro-p: Virtual Unit Generator
vug:vug-p: Virtual Unit Generator
vug:vuglet: Virtual Unit Generator
vug:white-noise: Noise
vug:with: Virtual Unit Generator
vug:with-control-period: Misc
vug:with-follow: Virtual Unit Generator
vug:with-ugen-instance: Unit Generator
vug:with-ugen-instances: Unit Generator
vug:with-vug-inputs: Virtual Unit Generator
vug:without-follow: Virtual Unit Generator
vug:wrap: Distortion
vug:zero: Filter (1)
vug:zero*: Filter (1)
vug:~: Filter (1)

W
with-buffer: Buffer
with-buffers: Buffer
with-cleanup: Finalization
with-local-time: Time
with-nrt: Mixdown
with-schedule: Scheduling
without-cleanup: Finalization

Jump to:   A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W  

Previous: , Up: Incudine   [Contents][Index]

C Variable Index

Jump to:   *  
A   C   F   I   L   N   O   P   S   V  
Index Entry  Section

*
*cosine-table*: Buffer
*default-tuning*: Tuning
*node-enable-gain-p*: DSP Graph
*nrt-priority*: Configuration
*receiver-default-priority*: Configuration
*root-node*: DSP Graph
*rt-priority*: Configuration
*rt-thread-exit-hook*: Realtime
*rt-thread-start-hook*: Realtime
*score-readtable*: Rego File
*sine-table*: Buffer
*tempo*: Time

A
ana:*fft-default-window-function*: Fast Fourier Transform
ana:+fft-plan-best+: Fast Fourier Transform
ana:+fft-plan-fast+: Fast Fourier Transform
ana:+fft-plan-optimal+: Fast Fourier Transform

C
clm:*channels*: Variables
clm:*clipped*: Variables
clm:*clm-array-print-length*: Variables
clm:*clm-channels*: Variables
clm:*clm-clipped*: Variables
clm:*clm-dac-wait-default*: Variables
clm:*clm-data-format*: Variables
clm:*clm-debug*: Variables
clm:*clm-default-frequency*: Variables
clm:*clm-delete-reverb*: Variables
clm:*clm-file-buffer-size*: Variables
clm:*clm-file-name*: Variables
clm:*clm-header-type*: Variables
clm:*clm-init*: Variables
clm:*clm-ins*: Variables
clm:*clm-locsig-type*: Variables
clm:*clm-logger-stream*: Variables
clm:*clm-notehook*: Variables
clm:*clm-optimize-settings*: Variables
clm:*clm-play*: Variables
clm:*clm-player*: Variables
clm:*clm-reverb-channels*: Variables
clm:*clm-safety*: Variables
clm:*clm-search-list*: Variables
clm:*clm-srate*: Variables
clm:*clm-src-width*: Variables
clm:*clm-statistics*: Variables
clm:*clm-table-size*: Variables
clm:*clm-tempfile-data-format*: Variables
clm:*clm-tempfile-header-type*: Variables
clm:*clm-ugens-package*: Variables
clm:*clm-verbose*: Variables
clm:*clm-with-sound-depth*: Variables
clm:*data-format*: Variables
clm:*debug*: Variables
clm:*definstrument-hook*: Variables
clm:*fft*: FFT
clm:*header-type*: Variables
clm:*interrupted*: Variables
clm:*notehook*: Variables
clm:*offset*: Variables
clm:*output*: Variables
clm:*reverb*: Variables
clm:*safety*: Variables
clm:*srate*: Variables
clm:*statistics*: Variables
clm:*to-snd*: Variables
clm:*verbose*: Variables
clm:bartlett-hann-window: Constants (1)
clm:bartlett-window: Constants (1)
clm:blackman10-window: Constants (1)
clm:blackman2-window: Constants (1)
clm:blackman3-window: Constants (1)
clm:blackman4-window: Constants (1)
clm:blackman5-window: Constants (1)
clm:blackman6-window: Constants (1)
clm:blackman7-window: Constants (1)
clm:blackman8-window: Constants (1)
clm:blackman9-window: Constants (1)
clm:bohman-window: Constants (1)
clm:cauchy-window: Constants (1)
clm:connes-window: Constants (1)
clm:dolph-chebyshev-window: Constants (1)
clm:exponential-window: Constants (1)
clm:flat-top-window: Constants (1)
clm:gaussian-window: Constants (1)
clm:hamming-window: Constants (1)
clm:hann-poisson-window: Constants (1)
clm:hann-window: Constants (1)
clm:hanning-window: Constants (1)
clm:kaiser-window: Constants (1)
clm:mus-adc: Constants (1)
clm:mus-adf: Constants (1)
clm:mus-aifc: Constants (1)
clm:mus-aiff: Constants (1)
clm:mus-akai4: Constants (1)
clm:mus-alaw: Constants (1)
clm:mus-asf: Constants (1)
clm:mus-audio-default: Constants (1)
clm:mus-avi: Constants (1)
clm:mus-avr: Constants (1)
clm:mus-b24int: Constants (1)
clm:mus-bdouble: Constants (1)
clm:mus-bdoubleu: Constants (1)
clm:mus-bfloat: Constants (1)
clm:mus-bicsf: Constants (1)
clm:mus-bint: Constants (1)
clm:mus-bintn: Constants (1)
clm:mus-blfoatu: Constants (1)
clm:mus-bshort: Constants (1)
clm:mus-byte: Constants (1)
clm:mus-caff: Constants (1)
clm:mus-chebyshev-first-kind: Constants (1)
clm:mus-chebyshev-second-kind: Constants (1)
clm:mus-comdisco: Constants (1)
clm:mus-covox: Constants (1)
clm:mus-csl: Constants (1)
clm:mus-delusion: Constants (1)
clm:mus-diamondware: Constants (1)
clm:mus-digiplayer: Constants (1)
clm:mus-esps: Constants (1)
clm:mus-farandole: Constants (1)
clm:mus-file-samp: Constants (1)
clm:mus-flac: Constants (1)
clm:mus-goldwave: Constants (1)
clm:mus-gravis: Constants (1)
clm:mus-hcom: Constants (1)
clm:mus-ieee: Constants (1)
clm:mus-impulsetracker: Constants (1)
clm:mus-inrs: Constants (1)
clm:mus-interp-all-pass: Constants (1)
clm:mus-interp-bezier: Constants (1)
clm:mus-interp-hermite: Constants (1)
clm:mus-interp-lagrange: Constants (1)
clm:mus-interp-linear: Constants (1)
clm:mus-interp-none: Constants (1)
clm:mus-interp-sinusoidal: Constants (1)
clm:mus-ircam: Constants (1)
clm:mus-korg: Constants (1)
clm:mus-kurzweil-2000: Constants (1)
clm:mus-l24int: Constants (1)
clm:mus-ldouble: Constants (1)
clm:mus-ldoubleu: Constants (1)
clm:mus-lfloat: Constants (1)
clm:mus-lfloatu: Constants (1)
clm:mus-linear: Constants (1)
clm:mus-lint: Constants (1)
clm:mus-lintn: Constants (1)
clm:mus-lshort: Constants (1)
clm:mus-matlab: Constants (1)
clm:mus-maud: Constants (1)
clm:mus-maui: Constants (1)
clm:mus-midi: Constants (1)
clm:mus-midi-sample-dump: Constants (1)
clm:mus-mpeg: Constants (1)
clm:mus-mulaw: Constants (1)
clm:mus-mus10: Constants (1)
clm:mus-next: Constants (1)
clm:mus-nist: Constants (1)
clm:mus-nvf: Constants (1)
clm:mus-ogg: Constants (1)
clm:mus-omf: Constants (1)
clm:mus-paf: Constants (1)
clm:mus-psion: Constants (1)
clm:mus-pvf: Constants (1)
clm:mus-quicktime: Constants (1)
clm:mus-raw: Constants (1)
clm:mus-rf64: Constants (1)
clm:mus-riff: Constants (1)
clm:mus-sample-dump: Constants (1)
clm:mus-sbstudioii: Constants (1)
clm:mus-sd1: Constants (1)
clm:mus-sdif: Constants (1)
clm:mus-shorten: Constants (1)
clm:mus-sinusoidal: Constants (1)
clm:mus-smp: Constants (1)
clm:mus-sndt: Constants (1)
clm:mus-soundfont: Constants (1)
clm:mus-soundforge: Constants (1)
clm:mus-speex: Constants (1)
clm:mus-sppack: Constants (1)
clm:mus-srfs: Constants (1)
clm:mus-svx: Constants (1)
clm:mus-tta: Constants (1)
clm:mus-twinvq: Constants (1)
clm:mus-ubshort: Constants (1)
clm:mus-ubyte: Constants (1)
clm:mus-ulshort: Constants (1)
clm:mus-ultratracker: Constants (1)
clm:mus-unknown: Constants (1)
clm:mus-unsupported: Constants (1)
clm:mus-voc: Constants (1)
clm:mus-wavpack: Constants (1)
clm:mus-yamaha-sy85: Constants (1)
clm:mus-yamaha-sy99: Constants (1)
clm:mus-yamaha-tx16: Constants (1)
clm:parzen-window: Constants (1)
clm:poisson-window: Constants (1)
clm:rectangular-window: Constants (1)
clm:riemann-window: Constants (1)
clm:rv2-window: Constants (1)
clm:rv3-window: Constants (1)
clm:rv4-window: Constants (1)
clm:samaraki-window: Constants (1)
clm:tukey-window: Constants (1)
clm:two-pi: Constants (1)
clm:ultraspherical-window: Constants (1)
clm:welch-window: Constants (1)

F
fluidsynth:*logger-stream*: Logging (1)
fluidsynth:channel-info-name-size: Synth
fluidsynth:chorus-default-depth: Chorus
fluidsynth:chorus-default-level: Chorus
fluidsynth:chorus-default-n: Chorus
fluidsynth:chorus-default-speed: Chorus
fluidsynth:chorus-default-type: Chorus
fluidsynth:chorus-mod-sine: Chorus
fluidsynth:chorus-mod-triangle: Chorus
fluidsynth:hint-bounded-above: Settings
fluidsynth:hint-bounded-below: Settings
fluidsynth:hint-filename: Settings
fluidsynth:hint-integer: Settings
fluidsynth:hint-logarithmic: Settings
fluidsynth:hint-optionlist: Settings
fluidsynth:hint-sample-rate: Settings
fluidsynth:hint-toggled: Settings
fluidsynth:int-type: Settings
fluidsynth:interp-4thorder: Synthesis parameters
fluidsynth:interp-7thorder: Synthesis parameters
fluidsynth:interp-default: Synthesis parameters
fluidsynth:interp-highest: Synthesis parameters
fluidsynth:interp-linear: Synthesis parameters
fluidsynth:interp-none: Synthesis parameters
fluidsynth:no-type: Settings
fluidsynth:num-type: Settings
fluidsynth:reverb-default-damp: Reverb
fluidsynth:reverb-default-level: Reverb
fluidsynth:reverb-default-roomsize: Reverb
fluidsynth:reverb-default-width: Reverb
fluidsynth:set-type: Settings
fluidsynth:str-type: Settings

I
incudine-mode-hook: Incudine Mode
incudine-rego-mode-hook: Incudine Rego Mode
incudine.edf:*heap*: Earliest Deadline First Scheduling
incudine.edf:*heap-size*: Earliest Deadline First Scheduling
incudine.edf:+root-node+: Earliest Deadline First Scheduling
incudine.util:*allow-rt-memory-pool-p*: Allocation in Realtime Thread
incudine.util:*block-size-hook*: Realtime
incudine.util:*bounce-to-disk-guard-size*: Mixdown
incudine.util:*cps2inc*: Utilities
incudine.util:*fade-curve*: DSP Graph
incudine.util:*fade-time*: DSP Graph
incudine.util:*fast-nrt-priority*: Realtime
incudine.util:*fast-nrt-thread*: Realtime
incudine.util:*logger-force-output-p*: Logging
incudine.util:*logger-stream*: Logging
incudine.util:*minus-pi-div-sr*: Utilities
incudine.util:*nrt-priority*: Realtime
incudine.util:*nrt-thread*: Realtime
incudine.util:*null-output*: Logging
incudine.util:*pi-div-sr*: Utilities
incudine.util:*r-sound-velocity*: Utilities
incudine.util:*reduce-warnings*: Utilities
incudine.util:*rt-priority*: Realtime
incudine.util:*rt-thread*: Realtime
incudine.util:*sample-duration*: Utilities
incudine.util:*sample-rate*: Utilities
incudine.util:*sample-rate-hook*: Utilities
incudine.util:*sound-velocity*: Utilities
incudine.util:*sound-velocity-hook*: Utilities
incudine.util:*sr-div-twopi*: Utilities
incudine.util:*twopi-div-sr*: Utilities
incudine.util:+foreign-complex-size+: Constants
incudine.util:+foreign-sample-size+: Constants
incudine.util:+half-pi+: Constants
incudine.util:+log001+: Constants
incudine.util:+max-lobits+: Constants
incudine.util:+phase-mask+: Constants
incudine.util:+pointer-address-type+: Constants
incudine.util:+pointer-size+: Constants
incudine.util:+rad2inc+: Constants
incudine.util:+rtwopi+: Constants
incudine.util:+sample-zero+: Constants
incudine.util:+sqrt2+: Constants
incudine.util:+table-maxlen+: Constants
incudine.util:+twopi+: Constants
incudine.util:least-negative-sample: Numeric Types
incudine.util:least-positive-sample: Numeric Types
incudine.util:most-negative-sample: Numeric Types
incudine.util:most-positive-fixnum64: Numeric Types
incudine.util:most-positive-sample: Numeric Types

L
ladspa:*ladspa-path*: LADSPA plugin
ladspa:hint-bounded-above: LADSPA plugin
ladspa:hint-bounded-below: LADSPA plugin
ladspa:hint-default-0: LADSPA plugin
ladspa:hint-default-1: LADSPA plugin
ladspa:hint-default-100: LADSPA plugin
ladspa:hint-default-440: LADSPA plugin
ladspa:hint-default-high: LADSPA plugin
ladspa:hint-default-low: LADSPA plugin
ladspa:hint-default-mask: LADSPA plugin
ladspa:hint-default-maximum: LADSPA plugin
ladspa:hint-default-middle: LADSPA plugin
ladspa:hint-default-minimum: LADSPA plugin
ladspa:hint-default-none: LADSPA plugin
ladspa:hint-integer: LADSPA plugin
ladspa:hint-logarithmic: LADSPA plugin
ladspa:hint-sample-rate: LADSPA plugin
ladspa:hint-toggled: LADSPA plugin
ladspa:port-audio: LADSPA plugin
ladspa:port-control: LADSPA plugin
ladspa:port-input: LADSPA plugin
ladspa:port-output: LADSPA plugin
ladspa:property-hard-rt-capable: LADSPA plugin
ladspa:property-inplace-broken: LADSPA plugin
ladspa:property-realtime: LADSPA plugin
lilv:*uri-atom-port*: LV2 plugin
lilv:*uri-audio-port*: LV2 plugin
lilv:*uri-control-port*: LV2 plugin
lilv:*uri-event-port*: LV2 plugin
lilv:*uri-input-port*: LV2 plugin
lilv:*uri-midi-port*: LV2 plugin
lilv:*uri-output-port*: LV2 plugin
lilv:*world*: LV2 plugin
lv2:+midi-event+: LV2 plugin

N
net:*before-close-hook*: General Stream Sockets
net:*buffer-size*: General Stream Sockets
net:*listen-backlog*: General Stream Sockets
net:+default-msg-flags+: General Stream Sockets

O
osc:*buffer-size*: Open Sound Control
osc:*max-values*: Open Sound Control

P
pm:default-sysex-buffer-size: PortMidi
pm:filt-active: PortMidi
pm:filt-aftertouch: PortMidi
pm:filt-channel-aftertouch: PortMidi
pm:filt-clock: PortMidi
pm:filt-control: PortMidi
pm:filt-fd: PortMidi
pm:filt-mtc: PortMidi
pm:filt-note: PortMidi
pm:filt-pitchbend: PortMidi
pm:filt-play: PortMidi
pm:filt-poly-aftertouch: PortMidi
pm:filt-program: PortMidi
pm:filt-realtime: PortMidi
pm:filt-reset: PortMidi
pm:filt-song-position: PortMidi
pm:filt-song-select: PortMidi
pm:filt-sysex: PortMidi
pm:filt-systemcommon: PortMidi
pm:filt-tick: PortMidi
pm:filt-tune: PortMidi
pm:filt-undefined: PortMidi
pm:hdrlength: PortMidi
pm:host-error-msg-len: PortMidi
pm:no-device: PortMidi

S
snd:*program-args*: Sound editor Snd
snd:*program-name*: Sound editor Snd
snd:*tmpfile*: Sound editor Snd

V
vug-foreign:+audio-port+: Foreign Plugin
vug-foreign:+control-port+: Foreign Plugin
vug-foreign:+event-port+: Foreign Plugin
vug-foreign:+input-port+: Foreign Plugin
vug-foreign:+midi-port+: Foreign Plugin
vug-foreign:+output-port+: Foreign Plugin
vug:*eval-some-specials-p*: Unit Generator
vug:*linear-midi-table*: MIDI (1)
vug:*specials-to-eval*: Unit Generator
vug:*update-dsp-instances-p*: DSP

Jump to:   *  
A   C   F   I   L   N   O   P   S   V  

Footnotes

(1)

The text of the doc-string in defun* is copied/edited from the s7.html file provided with the source code: ftp://ccrma-ftp.stanford.edu/pub/Lisp/s7.tar.gz

(2)

The sound editor Snd includes the recommended version of CLM actively maintained and enhanced by the original author Bill Schottstaedt.