.. This file is auto-generated by the Sphinx pre-build hook in
   ``documentation/source/conf.py`` from
   ``documentation/source/_data/patcher_objects.json`` and the notes in
   ``documentation/source/_data/patcher_notes/``.
   Do not edit by hand — re-run ``python yse.py dump-patcher-meta`` to
   refresh the JSON, then ``make html`` to re-render this page.

Signal generators
=================

Audio-rate sources: oscillators, noise and ramps.

4 objects. Every entry is
pulled directly from the engine source via the ``ADD_DESCRIPTION`` /
``INLET_DOC`` / ``OUTLET_DOC`` / ``PARAM_DOC`` macros (see
:file:`YseEngine/patcher/pObject.h`). The ``~`` prefix marks DSP /
audio-rate objects; ``.`` marks control-rate objects.

.. contents::
   :local:
   :depth: 1

``~line``
---------

Linear-ramp generator. Ramps an audio-rate value toward a target over a given time in ms.

:Kind: DSP (audio-rate)

A float at the left inlet starts a ramp from the current value to that
target. The ramp takes the time last set at the right inlet, so set the time
first. A new time does not change a ramp that is already running, and
sending the target the ramp already has does nothing. With a time of 0 the
output jumps to the target.

The time is counted in whole milliseconds and then rounded to whole audio
blocks; a ramp always lasts at least one block. Within a block the ramp is
smooth, sample by sample.

.. code-block:: text

   [~line 0 20]   left <- 1.   =>   rises from 0 to 1 over 20 ms

``stop`` halts the ramp and holds the output at its current value until the
next target arrives. A new time on its own does not restart it. Any target
after a ``stop``, even the one the ramp was heading for, starts a new ramp
from the held value, taking the full ramp time.

**Inlets**

.. list-table::
   :header-rows: 1
   :widths: 6 18 18 18 40

   * - #
     - Label
     - Accepts
     - Range
     - Description
   * - 0
     - target
     - FLOAT
     - any float
     - Target value to ramp toward. Also takes 'stop'.
   * - 1
     - time
     - FLOAT
     - 0+ ms
     - Ramp duration in milliseconds, used from the next new target.


**Outlets**

.. list-table::
   :header-rows: 1
   :widths: 6 18 18 18 40

   * - #
     - Label
     - Type
     - Range
     - Description
   * - 0
     - out
     - BUFFER
     - any float
     - Audio-rate ramp output.


**Parameters**

.. list-table::
   :header-rows: 1
   :widths: 22 18 18 42

   * - Name
     - Default
     - Range
     - Description
   * - target
     - 0
     - any float
     - Initial target value.
   * - time
     - 0
     - 0+ ms
     - Initial ramp time in milliseconds.


``~noise``
----------

White-noise generator. Sends a new block of random samples on every audio block.

:Kind: DSP (audio-rate)


**Outlets**

.. list-table::
   :header-rows: 1
   :widths: 6 18 18 18 40

   * - #
     - Label
     - Type
     - Range
     - Description
   * - 0
     - out
     - BUFFER
     - -1.0 to 1.0
     - White-noise audio output.



``~saw``
--------

Audio-rate sawtooth oscillator. Frequency can be set with a float or modulated with a DSP buffer.

:Kind: DSP (audio-rate)

**Inlets**

.. list-table::
   :header-rows: 1
   :widths: 6 18 18 18 40

   * - #
     - Label
     - Accepts
     - Range
     - Description
   * - 0
     - freq
     - BUFFER, FLOAT
     - 0-20000 Hz
     - Oscillator frequency in Hz. Accepts a DSP buffer (FM) or a float.


**Outlets**

.. list-table::
   :header-rows: 1
   :widths: 6 18 18 18 40

   * - #
     - Label
     - Type
     - Range
     - Description
   * - 0
     - out
     - BUFFER
     - -1.0 to 1.0
     - Sawtooth wave audio output.


**Parameters**

.. list-table::
   :header-rows: 1
   :widths: 22 18 18 42

   * - Name
     - Default
     - Range
     - Description
   * - frequency
     - 440
     - 0-20000 Hz
     - Initial frequency in Hz.


``~sine``
---------

Audio-rate sine oscillator. Frequency can be set with a float or modulated with a DSP buffer.

:Kind: DSP (audio-rate)

**Inlets**

.. list-table::
   :header-rows: 1
   :widths: 6 18 18 18 40

   * - #
     - Label
     - Accepts
     - Range
     - Description
   * - 0
     - freq
     - BUFFER, FLOAT
     - 0-20000 Hz
     - Oscillator frequency in Hz. Accepts a DSP buffer (FM) or a float.


**Outlets**

.. list-table::
   :header-rows: 1
   :widths: 6 18 18 18 40

   * - #
     - Label
     - Type
     - Range
     - Description
   * - 0
     - out
     - BUFFER
     - -1.0 to 1.0
     - Sine wave audio output.


**Parameters**

.. list-table::
   :header-rows: 1
   :widths: 22 18 18 42

   * - Name
     - Default
     - Range
     - Description
   * - frequency
     - 440
     - 0-20000 Hz
     - Initial frequency in Hz.


