Skip to content

Commit

Permalink
Fix mkdocs warnings; add copy button
Browse files Browse the repository at this point in the history
  • Loading branch information
ideoforms committed Nov 6, 2023
1 parent 060ec94 commit eac01b1
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 32 deletions.
4 changes: 2 additions & 2 deletions docs/graph/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The AudioGraph

`AudioGraph` is the global audio processing system that schedules and performs audio processing. It is comprised of an interconnected network of [Node](../node) and [Patch](../patch) objects, which audio flows through.
`AudioGraph` is the global audio processing system that schedules and performs audio processing. It is comprised of an interconnected network of [Node](../node/index.md) and [Patch](../patch/index.md) objects, which audio flows through.

Each time a new block of audio is requested by the system audio I/O layer, the `AudioGraph` object is responsible for traversing the tree of nodes and generating new samples by calling each `Node`'s `process` method.

Expand All @@ -9,4 +9,4 @@ Each time a new block of audio is requested by the system audio I/O layer, the `

---

[→ Next: Creating the graph](creating)
[→ Next: Creating the graph](creating.md)
18 changes: 9 additions & 9 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ This documentation currently focuses specifically on Python interfaces and examp

At its core, SignalFlow has a handful of key concepts.

- At the top level is the **[AudioGraph](graph)**, which connects to the system's audio input/output hardware.
- The graph comprises of a network of **[Nodes](node)**, each of which performs a single function (for example, generating a cyclical waveform, or filtering an input node). Nodes are connected by input and output relationships: the output of one node may be used to control the frequency of another. As the output of the first node increases, the frequency of the second node increases correspondingly. This modulation is applied on a sample-by-sample basis: all modulation in SignalFlow happens at audio rate.
- Nodes may have multiple **[inputs](node/inputs)**, which determine which synthesis properties can be modulated at runtime.
- A node can also have **[Buffer](buffer)** properties, which contain audio waveform data that can be read and written to, for playback or recording of samples.
- Nodes can be grouped in a **[Patch](patch)**, which is a user-defined configuration of nodes. A patch may have one or more named [inputs](patch/inputs) that are defined by the user when creating the patch. Patches can be thought of like voices of a synthesizer. A patch can also be set to [automatically remove itself](patch/auto-free) from the graph when a specified node's playback is complete, which is important for automatic memory management.
- At the top level is the **[AudioGraph](graph/index.md)**, which connects to the system's audio input/output hardware.
- The graph comprises of a network of **[Nodes](node/index.md)**, each of which performs a single function (for example, generating a cyclical waveform, or filtering an input node). Nodes are connected by input and output relationships: the output of one node may be used to control the frequency of another. As the output of the first node increases, the frequency of the second node increases correspondingly. This modulation is applied on a sample-by-sample basis: all modulation in SignalFlow happens at audio rate.
- Nodes may have multiple **[inputs](node/inputs.md)**, which determine which synthesis properties can be modulated at runtime.
- A node can also have **[Buffer](buffer/index.md)** properties, which contain audio waveform data that can be read and written to, for playback or recording of samples.
- Nodes can be grouped in a **[Patch](patch/index.md)**, which is a user-defined configuration of nodes. A patch may have one or more named [inputs](patch/inputs.md) that are defined by the user when creating the patch. Patches can be thought of like voices of a synthesizer. A patch can also be set to [automatically remove itself](patch/auto-free.md) from the graph when a specified node's playback is complete, which is important for automatic memory management.

## Example

Expand All @@ -38,9 +38,9 @@ graph.wait()

This demo shows a few syntactical benefits that SignalFlow provides to make it easy to work with audio:

- The 2-item array of frequency values passed to `SineOscillator` is expanded to create a stereo, 2-channel output. If you passed a 10-item array, the output would have 10 channels. ([Read more: Multichannel nodes](node/multichannel))
- Mathematical operators like `*` can be used to multiply, add, subtract or divide the output of nodes, and creates a new output Node that corresponds to the output of the operation. This example uses an envelope to modulate the amplitude of an oscillator. ([Read more: Node operators](node/operators))
- Even through the envelope is mono and the oscillator is stereo, SignalFlow does the right thing and upmixes the envelope's values to create a stereo output, so that the same envelope shape is applied to the L and R channels of the oscillator, before creating a stereo output. This is called "automatic upmixing", and is handy when working with multichannel graphs. ([Read more: Automatic upmixing](node/multichannel#automatic-upmixing))
- The 2-item array of frequency values passed to `SineOscillator` is expanded to create a stereo, 2-channel output. If you passed a 10-item array, the output would have 10 channels. ([Read more: Multichannel nodes](node/multichannel.md))
- Mathematical operators like `*` can be used to multiply, add, subtract or divide the output of nodes, and creates a new output Node that corresponds to the output of the operation. This example uses an envelope to modulate the amplitude of an oscillator. ([Read more: Node operators](node/operators.md))
- Even through the envelope is mono and the oscillator is stereo, SignalFlow does the right thing and upmixes the envelope's values to create a stereo output, so that the same envelope shape is applied to the L and R channels of the oscillator, before creating a stereo output. This is called "automatic upmixing", and is handy when working with multichannel graphs. ([Read more: Automatic upmixing](node/multichannel.md#automatic-upmixing))

In subsequent examples, we will skip the `import` line and assume you have already imported everything from the `signalflow` namespace.

Expand All @@ -56,5 +56,5 @@ In subsequent examples, we will skip the `import` line and assume you have alrea

## Documentation

- [Installation](getting-started/)
- [Installation](getting-started.md)
- [Example code](http://github.com/ideoforms/signalflow/tree/master/examples/python)
4 changes: 2 additions & 2 deletions docs/installation/macos.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ source signalflow-env/bin/activate

Installing SignalFlow is done using the `pip` Python package manager. The below line will install the `signalflow` library, plus support for `jupyter` interactive Python notebooks, and register your virtual environment system-wide so that notebooks can access it.

```
```shell
pip3 install signalflow jupyter
python3 -m ipykernel install --name signalflow-env
```
Expand All @@ -51,7 +51,7 @@ signalflow test

## 4. Work with SignalFlow

Now, let's set up an editor to [work with SignalFlow](/installation/working/).
Now, let's set up an editor to [work with SignalFlow](working.md).

## Examples

Expand Down
20 changes: 10 additions & 10 deletions docs/node/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

A `Node` object is an audio processing unit that performs one single function. For example, a Node's role may be to synthesize a waveform, read from a buffer, or take two input Nodes and sum their values.

- Nodes are [played and stopped](playback) by connecting them to the AudioGraph
- A node has one or more [audio-rate inputs](inputs#audio-rate-inputs), which can be modulated by other nodes
- Some nodes can be triggered with [trigger inputs](inputs#triggers) — for example, to restart playback, or set the position of an envelope
- Some nodes can be used to play back the contents of [buffer inputs](inputs#buffer-inputs), or can use buffer data as a source of modulation
- The output of multiple nodes can be combined and modulated with use of the standard Python [operators](operators) (`+`, `-`, `*`, `%`, etc)
- The output of a node can be mono (single-channel) or [multichannel](multichannel)
- A Node's status and output can be examined by querying its [properties](properties)
- Some Nodes generate unpredictable [stochastic output](stochastic), which can be controlled via its internal random number generator
- Details of how to create a new Node type are detailed in [Developing a new Node class](developing)
- For an overview of every type of Node available in SignalFlow, see the [Node Reference Library](library)
- Nodes are [played and stopped](playback.md) by connecting them to the AudioGraph
- A node has one or more [audio-rate inputs](inputs.md#audio-rate-inputs), which can be modulated by other nodes
- Some nodes can be triggered with [trigger inputs](inputs.md#triggers) — for example, to restart playback, or set the position of an envelope
- Some nodes can be used to play back the contents of [buffer inputs](inputs.md#buffer-inputs), or can use buffer data as a source of modulation
- The output of multiple nodes can be combined and modulated with use of the standard Python [operators](operators.md) (`+`, `-`, `*`, `%`, etc)
- The output of a node can be mono (single-channel) or [multichannel](multichannel.md)
- A Node's status and output can be examined by querying its [properties](properties.md)
- Some Nodes generate unpredictable [stochastic output](stochastic.md), which can be controlled via its internal random number generator
- Details of how to create a new Node type are detailed in [Developing a new Node class](developing.md)
- For an overview of every type of Node available in SignalFlow, see the [Node Reference Library](library.md)

---

Expand Down
4 changes: 2 additions & 2 deletions docs/node/inputs.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ while True:
```

!!! note
Because the `trigger` method happens outside the audio thread, it will take effect at the start of the next audio block. This means that, if you are running at 44.1kHz with an audio buffer size of 1024 samples, this could introduce a latency of up to `1024/44100 = 0.023s`. For time-critical events like drum triggers, this can be minimised by reducing the [hardware output buffer size](/graph/config).
Because the `trigger` method happens outside the audio thread, it will take effect at the start of the next audio block. This means that, if you are running at 44.1kHz with an audio buffer size of 1024 samples, this could introduce a latency of up to `1024/44100 = 0.023s`. For time-critical events like drum triggers, this can be minimised by reducing the [hardware output buffer size](../graph/config.md).

This constraint also means that only one event can be triggered per audio block. To trigger events at a faster rate than the hardware buffer size allows, see **Audio-rate triggers** below.

Expand Down Expand Up @@ -113,7 +113,7 @@ output.play()

### Buffer inputs

The third type of input supported by nodes is the [buffer](/buffer/). Nodes often take buffer inputs as sources of audio samples. They are also useful as sources of envelope shape data (for example, to shape the grains of a Granulator), or general control data (for example, recording motion patterns from a `MouseX` input).
The third type of input supported by nodes is the [buffer](../buffer/index.md). Nodes often take buffer inputs as sources of audio samples. They are also useful as sources of envelope shape data (for example, to shape the grains of a Granulator), or general control data (for example, recording motion patterns from a `MouseX` input).

```python
buffer = Buffer("../audio/stereo-count.wav")
Expand Down
14 changes: 7 additions & 7 deletions docs/patch/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ A `Patch` represents a connected group of `Nodes`, analogous to a synthesizer. D

Behind the scenes, the structure of a `Patch` is encapsulated by a `PatchSpec`, a template which can be instantiated or serialised to a JSON file for later use.

- [A Patch structure is defined](defining) either by declaring a Patch subclass or with a JSON specification file
- [Play and stop a Patch](playback) by connecting it to the AudioGraph or the input of another Patch or Node
- Similar to nodes, a Patch can be [modulated by audio-rate inputs](inputs#audio-rate-inputs), [triggered by trigger inputs](inputs#triggers), and [access sample data via buffer inputs](inputs#buffer-inputs)
- The outputs of Patches can be altered or combined by [normal Python operators](operators)
- The status of a Patch can be queried via its [properties](properties)
- Patches can be [exported and imported to JSON](exporting)
- The [auto-free mechanism](auto-free) allows Patches to automatically stop and free their memory after playback is complete
- [A Patch structure is defined](defining.md) either by declaring a Patch subclass or with a JSON specification file
- [Play and stop a Patch](playback.md) by connecting it to the AudioGraph or the input of another Patch or Node
- Similar to nodes, a Patch can be [modulated by audio-rate inputs](inputs.md#audio-rate-inputs), [triggered by trigger inputs](inputs.md#triggers), and [access sample data via buffer inputs](inputs.md#buffer-inputs)
- The outputs of Patches can be altered or combined by [normal Python operators](operators.md)
- The status of a Patch can be queried via its [properties](properties.md)
- Patches can be [exported and imported to JSON](exporting.md)
- The [auto-free mechanism](auto-free.md) allows Patches to automatically stop and free their memory after playback is complete

---

Expand Down
2 changes: 2 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ theme:
name: material
palette:
- primary: pink
features:
- content.code.copy

repo_name: ideoforms/signalflow
repo_url: https://github.com/ideoforms/signalflow
Expand Down

0 comments on commit eac01b1

Please sign in to comment.