From abc1717fe3979a468ee57140ef50ae53b36bd2b5 Mon Sep 17 00:00:00 2001 From: Gregory White Date: Mon, 4 Dec 2023 20:31:06 +0000 Subject: [PATCH 01/13] Documentation: Updating SawLFO Updating sawlfo.md to fit with latest documentation specs. --- docs/library/oscillators/sawlfo.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/docs/library/oscillators/sawlfo.md b/docs/library/oscillators/sawlfo.md index 9a407d71..5bea4674 100644 --- a/docs/library/oscillators/sawlfo.md +++ b/docs/library/oscillators/sawlfo.md @@ -1,10 +1,22 @@ +title: SawLFO node documentation +description: SawLFO: Produces a sawtooth LFO at the fiven `frequency` and `phase` offset, with output ranging from `min` to `max`. + [Reference library](../index.md) > [Oscillators](index.md) > [SawLFO](sawlfo.md) # SawLFO -Produces a sawtooth LFO, with output ranging from min to max. - -Signature: ```python SawLFO(frequency=1.0, min=0.0, max=1.0, phase=0.0) ``` + +Produces a sawtooth LFO at the fiven `frequency` and `phase` offset, with output ranging from `min` to `max`. + +### Examples + +```python + +# Siren effect, using a sawtooth LFO to modulate a sine wave's frequency +lfo = SawLFO(1, 200, 1000) +sine = SineOscillator(lfo) +sine.play() +``` \ No newline at end of file From 0063a00c971a5efa3068ffad785a95b23809b2d7 Mon Sep 17 00:00:00 2001 From: Gregory White Date: Tue, 5 Dec 2023 16:23:01 +0000 Subject: [PATCH 02/13] Documentation: Remove sawlfo.md Removing old SawLFO example. --- docs/library/oscillators/sawlfo.md | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 docs/library/oscillators/sawlfo.md diff --git a/docs/library/oscillators/sawlfo.md b/docs/library/oscillators/sawlfo.md deleted file mode 100644 index 5bea4674..00000000 --- a/docs/library/oscillators/sawlfo.md +++ /dev/null @@ -1,22 +0,0 @@ -title: SawLFO node documentation -description: SawLFO: Produces a sawtooth LFO at the fiven `frequency` and `phase` offset, with output ranging from `min` to `max`. - -[Reference library](../index.md) > [Oscillators](index.md) > [SawLFO](sawlfo.md) - -# SawLFO - -```python -SawLFO(frequency=1.0, min=0.0, max=1.0, phase=0.0) -``` - -Produces a sawtooth LFO at the fiven `frequency` and `phase` offset, with output ranging from `min` to `max`. - -### Examples - -```python - -# Siren effect, using a sawtooth LFO to modulate a sine wave's frequency -lfo = SawLFO(1, 200, 1000) -sine = SineOscillator(lfo) -sine.play() -``` \ No newline at end of file From fef0014a4737d26586418e4dfc9c9cbd58bed3a1 Mon Sep 17 00:00:00 2001 From: Gregory White Date: Tue, 5 Dec 2023 16:56:19 +0000 Subject: [PATCH 03/13] Documentation: Updating SawLFO Updating index.md and adding example-0.py --- docs/library/oscillators/sawlfo/example-0.py | 8 ++++++++ docs/library/oscillators/sawlfo/index.md | 13 +++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 docs/library/oscillators/sawlfo/example-0.py diff --git a/docs/library/oscillators/sawlfo/example-0.py b/docs/library/oscillators/sawlfo/example-0.py new file mode 100644 index 00000000..3c1aee68 --- /dev/null +++ b/docs/library/oscillators/sawlfo/example-0.py @@ -0,0 +1,8 @@ +from signalflow import * +graph = AudioGraph() + +# Siren effect, using a sawtooth LFO to modulate a sinewave's frequency +lfo = SawLFO(1, 200, 1000) +sine = SineOscillator(lfo) +sine.play() +graph.wait() diff --git a/docs/library/oscillators/sawlfo/index.md b/docs/library/oscillators/sawlfo/index.md index 92267521..fe6bbfac 100644 --- a/docs/library/oscillators/sawlfo/index.md +++ b/docs/library/oscillators/sawlfo/index.md @@ -1,5 +1,5 @@ title: SawLFO node documentation -description: SawLFO: Produces a sawtooth LFO, with output ranging from `min` to `max`. +description: SawLFO: Produces a sawtooth LFO at the given `frequency` and `phase` offset, with output ranging from `min` to `max`. [Reference library](../../index.md) > [Oscillators](../index.md) > [SawLFO](index.md) @@ -9,5 +9,14 @@ description: SawLFO: Produces a sawtooth LFO, with output ranging from `min` to SawLFO(frequency=1.0, min=0.0, max=1.0, phase=0.0) ``` -Produces a sawtooth LFO, with output ranging from `min` to `max`. +Produces a sawtooth LFO at the given `frequency` and `phase` offset, with output ranging from `min` to `max`. +### Examples + +```python + +# Siren effect, using a sawtooth LFO to modulate a sinewave's frequency +lfo = SawLFO(1, 200, 1000) +sine = SineOscillator(lfo) +sine.play() +``` \ No newline at end of file From d46cbce9c767b5e2435832dd2b097ad69aebb522 Mon Sep 17 00:00:00 2001 From: Gregory White Date: Mon, 8 Jan 2024 16:09:52 +0000 Subject: [PATCH 04/13] Documentation: Updated LFOs Updated documentation and examples for sawlfo, sinelfo, squarelfo, and trianglelfo. --- docs/library/oscillators/sawlfo/example-0.py | 2 ++ docs/library/oscillators/sawlfo/index.md | 6 ++++-- docs/library/oscillators/sinelfo/example-0.py | 2 ++ docs/library/oscillators/sinelfo/index.md | 8 +++++--- docs/library/oscillators/squarelfo/example-0.py | 10 ++++++++++ docs/library/oscillators/squarelfo/index.md | 15 +++++++++++++-- docs/library/oscillators/trianglelfo/example-0.py | 10 ++++++++++ docs/library/oscillators/trianglelfo/index.md | 15 +++++++++++++-- 8 files changed, 59 insertions(+), 9 deletions(-) create mode 100644 docs/library/oscillators/squarelfo/example-0.py create mode 100644 docs/library/oscillators/trianglelfo/example-0.py diff --git a/docs/library/oscillators/sawlfo/example-0.py b/docs/library/oscillators/sawlfo/example-0.py index 3c1aee68..5d9e9522 100644 --- a/docs/library/oscillators/sawlfo/example-0.py +++ b/docs/library/oscillators/sawlfo/example-0.py @@ -1,7 +1,9 @@ from signalflow import * graph = AudioGraph() +#------------------------------------------------------------------------------- # Siren effect, using a sawtooth LFO to modulate a sinewave's frequency +#------------------------------------------------------------------------------- lfo = SawLFO(1, 200, 1000) sine = SineOscillator(lfo) sine.play() diff --git a/docs/library/oscillators/sawlfo/index.md b/docs/library/oscillators/sawlfo/index.md index fe6bbfac..7c336468 100644 --- a/docs/library/oscillators/sawlfo/index.md +++ b/docs/library/oscillators/sawlfo/index.md @@ -1,5 +1,5 @@ title: SawLFO node documentation -description: SawLFO: Produces a sawtooth LFO at the given `frequency` and `phase` offset, with output ranging from `min` to `max`. +description: SawLFO: Produces a sawtooth LFO at the given `frequency`, with output ranging from `min` Hz to `max` Hz, with the given `phase` offset. [Reference library](../../index.md) > [Oscillators](../index.md) > [SawLFO](index.md) @@ -9,13 +9,15 @@ description: SawLFO: Produces a sawtooth LFO at the given `frequency` and `phase SawLFO(frequency=1.0, min=0.0, max=1.0, phase=0.0) ``` -Produces a sawtooth LFO at the given `frequency` and `phase` offset, with output ranging from `min` to `max`. +Produces a sawtooth LFO at the given `frequency`, with output ranging from `min` Hz to `max` Hz, with the given `phase` offset. ### Examples ```python +#------------------------------------------------------------------------------- # Siren effect, using a sawtooth LFO to modulate a sinewave's frequency +#------------------------------------------------------------------------------- lfo = SawLFO(1, 200, 1000) sine = SineOscillator(lfo) sine.play() diff --git a/docs/library/oscillators/sinelfo/example-0.py b/docs/library/oscillators/sinelfo/example-0.py index 1191df32..5ed2970c 100644 --- a/docs/library/oscillators/sinelfo/example-0.py +++ b/docs/library/oscillators/sinelfo/example-0.py @@ -1,7 +1,9 @@ from signalflow import * graph = AudioGraph() +#------------------------------------------------------------------------------- # Siren effect, using a sinewave LFO to modulate a sawtooth's frequency +#------------------------------------------------------------------------------- lfo = SineLFO(1, 200, 1000) saw = SawOscillator(lfo) saw.play() diff --git a/docs/library/oscillators/sinelfo/index.md b/docs/library/oscillators/sinelfo/index.md index 4bbc5ec5..33494022 100644 --- a/docs/library/oscillators/sinelfo/index.md +++ b/docs/library/oscillators/sinelfo/index.md @@ -1,5 +1,5 @@ title: SineLFO node documentation -description: SineLFO: Produces a sinusoidal LFO at the given `frequency` and `phase` offset, with output ranging from `min` to `max`. +description: SineLFO: Produces a sinusoidal LFO at the given `frequency`, with output ranging from `min` Hz to `max` Hz, with the given `phase` offset. [Reference library](../../index.md) > [Oscillators](../index.md) > [SineLFO](index.md) @@ -9,13 +9,15 @@ description: SineLFO: Produces a sinusoidal LFO at the given `frequency` and `ph SineLFO(frequency=1.0, min=0.0, max=1.0, phase=0.0) ``` -Produces a sinusoidal LFO at the given `frequency` and `phase` offset, with output ranging from `min` to `max`. +Produces a sinusoidal LFO at the given `frequency`, with output ranging from `min` Hz to `max` Hz, with the given `phase` offset. ### Examples ```python -# Siren effect, using a sinewave LFO to modulate a sawtooth's frequency +#------------------------------------------------------------------------------- +# Siren effect, using a sine wave LFO to modulate a sawtooth's frequency +#------------------------------------------------------------------------------- lfo = SineLFO(1, 200, 1000) saw = SawOscillator(lfo) saw.play() diff --git a/docs/library/oscillators/squarelfo/example-0.py b/docs/library/oscillators/squarelfo/example-0.py new file mode 100644 index 00000000..fde6d0de --- /dev/null +++ b/docs/library/oscillators/squarelfo/example-0.py @@ -0,0 +1,10 @@ +from signalflow import * +graph = AudioGraph() + +#------------------------------------------------------------------------------- +# Alarm effect, using a pulse wave LFO to modulate a sinewave's frequency +#------------------------------------------------------------------------------- +lfo = SquareLFO(1, 200, 400) +sine = SineOscillator(lfo) +sine.play() +graph.wait() \ No newline at end of file diff --git a/docs/library/oscillators/squarelfo/index.md b/docs/library/oscillators/squarelfo/index.md index 5b544c68..7e82be2f 100644 --- a/docs/library/oscillators/squarelfo/index.md +++ b/docs/library/oscillators/squarelfo/index.md @@ -1,5 +1,5 @@ title: SquareLFO node documentation -description: SquareLFO: Produces a pulse wave LFO with the given `frequency` and pulsewidth of `width`, ranging from `min` to `max`, where `width` of `0.5` is a square wave. +description: SquareLFO: Produces a pulse wave LFO at the given `frequency`, ranging from `min` Hz to `max` Hz, with a pulsewidth of `width` (where `width` of `0.5` is a square wave), with the given `phase` offset. [Reference library](../../index.md) > [Oscillators](../index.md) > [SquareLFO](index.md) @@ -9,5 +9,16 @@ description: SquareLFO: Produces a pulse wave LFO with the given `frequency` and SquareLFO(frequency=1.0, min=0.0, max=1.0, width=0.5, phase=0.0) ``` -Produces a pulse wave LFO with the given `frequency` and pulsewidth of `width`, ranging from `min` to `max`, where `width` of `0.5` is a square wave. +Produces a pulse wave LFO at the given `frequency`, ranging from `min` Hz to `max` Hz, with a pulsewidth of `width` (where `width` of `0.5` is a square wave), with the given `phase` offset. +### Examples + +```python + +#------------------------------------------------------------------------------- +# Alarm effect, using a square wave LFO to modulate a sinewave's frequency +#------------------------------------------------------------------------------- +lfo = SquareLFO(1, 200, 400) +sine = SineOscillator(lfo) +sine.play() +``` diff --git a/docs/library/oscillators/trianglelfo/example-0.py b/docs/library/oscillators/trianglelfo/example-0.py new file mode 100644 index 00000000..45dbd112 --- /dev/null +++ b/docs/library/oscillators/trianglelfo/example-0.py @@ -0,0 +1,10 @@ +from signalflow import * +graph = AudioGraph() + +#----------------------------------------------------------------------------------- +# Pacman ghost sound, using a triangle wave LFO to modulate a sine wave's frequency +#----------------------------------------------------------------------------------- +lfo = TriangleLFO(3, 200, 900) +sine = SineOscillator(lfo) +sine.play() +graph.wait() \ No newline at end of file diff --git a/docs/library/oscillators/trianglelfo/index.md b/docs/library/oscillators/trianglelfo/index.md index dc77239c..ffa8424a 100644 --- a/docs/library/oscillators/trianglelfo/index.md +++ b/docs/library/oscillators/trianglelfo/index.md @@ -1,5 +1,5 @@ title: TriangleLFO node documentation -description: TriangleLFO: Produces a triangle LFO with the given `frequency` and `phase` offset, ranging from `min` to `max`. +description: TriangleLFO: Produces a triangle LFO with the given `frequency`, ranging from `min` Hz to `max` Hz, with the given `phase` offset. [Reference library](../../index.md) > [Oscillators](../index.md) > [TriangleLFO](index.md) @@ -9,5 +9,16 @@ description: TriangleLFO: Produces a triangle LFO with the given `frequency` and TriangleLFO(frequency=1.0, min=0.0, max=1.0, phase=0.0) ``` -Produces a triangle LFO with the given `frequency` and `phase` offset, ranging from `min` to `max`. +Produces a triangle LFO with the given `frequency`, ranging from `min` Hz to `max` Hz, with the given `phase` offset. +### Examples + +```python + +#----------------------------------------------------------------------------------- +# Pacman ghost sound, using a triangle wave LFO to modulate a sine wave's frequency +#----------------------------------------------------------------------------------- +lfo = TriangleLFO(3, 200, 900) +sine = SineOscillator(lfo) +sine.play() +``` \ No newline at end of file From d85f35a8bf67fdbd0fac95995f2c9ba7f3f4a2bb Mon Sep 17 00:00:00 2001 From: Gregory White Date: Mon, 8 Jan 2024 17:32:06 +0000 Subject: [PATCH 05/13] Documentation: Updating LFO examples Running documentation generator on the changes to SawLFO, SineLFO, SquareLFO, and TriangleLFO. --- README.md | 4 ++-- docs/library/buffer/index.md | 2 -- docs/library/envelope/envelope/index.md | 2 +- docs/library/index.md | 3 --- docs/library/oscillators/sawlfo/index.md | 7 ++++--- docs/library/oscillators/sinelfo/index.md | 6 +++--- docs/library/oscillators/squarelfo/index.md | 7 ++++--- docs/library/oscillators/trianglelfo/index.md | 7 ++++--- docs/library/sequencing/impulsesequence/index.md | 2 +- docs/library/sequencing/index.md | 1 - docs/library/sequencing/sequence/index.md | 2 +- docs/library/stochastic/randomchoice/index.md | 2 +- 12 files changed, 21 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 41eee097..2b1c688d 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ The following Node classes are currently included with the base distribution: | Category | Classes | |:---------|:---------| | **Analysis** | CrossCorrelate, OnsetDetector, VampAnalysis | -| **Buffer** | BeatCutter, BufferLooper, BufferPlayer, BufferRecorder, FeedbackBufferReader, FeedbackBufferWriter, GrainSegments, Granulator, SegmentPlayer | +| **Buffer** | BeatCutter, BufferLooper, BufferPlayer, BufferRecorder, FeedbackBufferReader, FeedbackBufferWriter, Granulator | | **Control** | MouseX, MouseY, MouseDown | | **Envelope** | ADSREnvelope, ASREnvelope, DetectSilence, Envelope, Line, RectangularEnvelope | | **FFT** | FFTContinuousPhaseVocoder, FFTConvolve, FFT, FFTNode, FFTOpNode, FFTFindPeaks, IFFT, FFTLPF, FFTNoiseGate, FFTPhaseVocoder, FFTTonality, FFTZeroPhase | @@ -82,7 +82,7 @@ The following Node classes are currently included with the base distribution: | **Processors: Dynamics** | Compressor, Gate, Maximiser, RMS | | **Processors: Filters** | BiquadFilter, DCFilter, EQ, MoogVCF, SVFilter | | **Processors: Panning** | AzimuthPanner, ChannelPanner, SpatialPanner, StereoBalance, StereoPanner, StereoWidth | -| **Sequencing** | ClockDivider, Counter, Euclidean, FlipFlop, ImpulseSequence, Index, Latch, Sequence | +| **Sequencing** | ClockDivider, Counter, Euclidean, FlipFlop, ImpulseSequence, Latch, Sequence | | **Stochastic** | Logistic, PinkNoise, RandomBrownian, RandomChoice, RandomCoin, RandomExponentialDist, RandomExponential, RandomGaussian, RandomImpulseSequence, RandomImpulse, RandomUniform, StochasticNode, WhiteNoise | ## Contributors diff --git a/docs/library/buffer/index.md b/docs/library/buffer/index.md index 63210496..ca5f4265 100644 --- a/docs/library/buffer/index.md +++ b/docs/library/buffer/index.md @@ -8,6 +8,4 @@ - **[BufferRecorder](bufferrecorder/index.md)**: Records the input to a buffer. feedback controls overdub. - **[FeedbackBufferReader](feedbackbufferreader/index.md)**: Counterpart to FeedbackBufferWriter. - **[FeedbackBufferWriter](feedbackbufferwriter/index.md)**: Counterpart to FeedbackBufferReader. -- **[GrainSegments](grainsegments/index.md)**: GrainSegments - **[Granulator](granulator/index.md)**: Granulator. Generates a grain from the given buffer each time a clock signal is received, with the given duration/rate/pan parameters. The input buffer can be mono or stereo. -- **[SegmentPlayer](segmentplayer/index.md)**: Trigger segments of a buffer at the given onset positions. diff --git a/docs/library/envelope/envelope/index.md b/docs/library/envelope/envelope/index.md index 046c4217..4fd224b3 100644 --- a/docs/library/envelope/envelope/index.md +++ b/docs/library/envelope/envelope/index.md @@ -6,7 +6,7 @@ description: Envelope: Generic envelope constructor, given an array of levels, t # Envelope ```python -Envelope(levels=std::vector ( ), times=std::vector ( ), curves=std::vector ( ), clock=None, loop=false) +Envelope(levels=std : : vector (), times=std : : vector (), curves=std : : vector (), clock=None, loop=false) ``` Generic envelope constructor, given an array of levels, times and curves. diff --git a/docs/library/index.md b/docs/library/index.md index 185e3e0e..958456f7 100644 --- a/docs/library/index.md +++ b/docs/library/index.md @@ -19,9 +19,7 @@ - **[BufferRecorder](buffer/bufferrecorder/index.md)**: Records the input to a buffer. feedback controls overdub. - **[FeedbackBufferReader](buffer/feedbackbufferreader/index.md)**: Counterpart to FeedbackBufferWriter. - **[FeedbackBufferWriter](buffer/feedbackbufferwriter/index.md)**: Counterpart to FeedbackBufferReader. -- **[GrainSegments](buffer/grainsegments/index.md)**: GrainSegments - **[Granulator](buffer/granulator/index.md)**: Granulator. Generates a grain from the given buffer each time a clock signal is received, with the given duration/rate/pan parameters. The input buffer can be mono or stereo. -- **[SegmentPlayer](buffer/segmentplayer/index.md)**: Trigger segments of a buffer at the given onset positions. --- @@ -177,7 +175,6 @@ - **[Euclidean](sequencing/euclidean/index.md)**: Euclidean rhythm as described by Toussaint, with `sequence_length` (n) and `num_events` (k), driven by `clock`. - **[FlipFlop](sequencing/flipflop/index.md)**: Flips from 0/1 on each `clock`. - **[ImpulseSequence](sequencing/impulsesequence/index.md)**: Each time a `clock` or trigger is received, outputs the next value in `sequence`. At all other times, outputs zero. -- **[Index](sequencing/index/index.md)**: Outputs the value in `list` corresponding to `index`. - **[Latch](sequencing/latch/index.md)**: Initially outputs 0. When a trigger is received at `set`, outputs 1. When a trigger is subsequently received at `reset`, outputs 0, until the next `set`. - **[Sequence](sequencing/sequence/index.md)**: Outputs the elements in `sequence`, incrementing position on each `clock`. diff --git a/docs/library/oscillators/sawlfo/index.md b/docs/library/oscillators/sawlfo/index.md index 7c336468..a0c03236 100644 --- a/docs/library/oscillators/sawlfo/index.md +++ b/docs/library/oscillators/sawlfo/index.md @@ -1,5 +1,5 @@ title: SawLFO node documentation -description: SawLFO: Produces a sawtooth LFO at the given `frequency`, with output ranging from `min` Hz to `max` Hz, with the given `phase` offset. +description: SawLFO: Produces a sawtooth LFO, with output ranging from `min` to `max`. [Reference library](../../index.md) > [Oscillators](../index.md) > [SawLFO](index.md) @@ -9,7 +9,7 @@ description: SawLFO: Produces a sawtooth LFO at the given `frequency`, with outp SawLFO(frequency=1.0, min=0.0, max=1.0, phase=0.0) ``` -Produces a sawtooth LFO at the given `frequency`, with output ranging from `min` Hz to `max` Hz, with the given `phase` offset. +Produces a sawtooth LFO, with output ranging from `min` to `max`. ### Examples @@ -21,4 +21,5 @@ Produces a sawtooth LFO at the given `frequency`, with output ranging from `min` lfo = SawLFO(1, 200, 1000) sine = SineOscillator(lfo) sine.play() -``` \ No newline at end of file +``` + diff --git a/docs/library/oscillators/sinelfo/index.md b/docs/library/oscillators/sinelfo/index.md index 33494022..8dc75521 100644 --- a/docs/library/oscillators/sinelfo/index.md +++ b/docs/library/oscillators/sinelfo/index.md @@ -1,5 +1,5 @@ title: SineLFO node documentation -description: SineLFO: Produces a sinusoidal LFO at the given `frequency`, with output ranging from `min` Hz to `max` Hz, with the given `phase` offset. +description: SineLFO: Produces a sinusoidal LFO at the given `frequency` and `phase` offset, with output ranging from `min` to `max`. [Reference library](../../index.md) > [Oscillators](../index.md) > [SineLFO](index.md) @@ -9,14 +9,14 @@ description: SineLFO: Produces a sinusoidal LFO at the given `frequency`, with o SineLFO(frequency=1.0, min=0.0, max=1.0, phase=0.0) ``` -Produces a sinusoidal LFO at the given `frequency`, with output ranging from `min` Hz to `max` Hz, with the given `phase` offset. +Produces a sinusoidal LFO at the given `frequency` and `phase` offset, with output ranging from `min` to `max`. ### Examples ```python #------------------------------------------------------------------------------- -# Siren effect, using a sine wave LFO to modulate a sawtooth's frequency +# Siren effect, using a sinewave LFO to modulate a sawtooth's frequency #------------------------------------------------------------------------------- lfo = SineLFO(1, 200, 1000) saw = SawOscillator(lfo) diff --git a/docs/library/oscillators/squarelfo/index.md b/docs/library/oscillators/squarelfo/index.md index 7e82be2f..9acbd7cd 100644 --- a/docs/library/oscillators/squarelfo/index.md +++ b/docs/library/oscillators/squarelfo/index.md @@ -1,5 +1,5 @@ title: SquareLFO node documentation -description: SquareLFO: Produces a pulse wave LFO at the given `frequency`, ranging from `min` Hz to `max` Hz, with a pulsewidth of `width` (where `width` of `0.5` is a square wave), with the given `phase` offset. +description: SquareLFO: Produces a pulse wave LFO with the given `frequency` and pulsewidth of `width`, ranging from `min` to `max`, where `width` of `0.5` is a square wave. [Reference library](../../index.md) > [Oscillators](../index.md) > [SquareLFO](index.md) @@ -9,16 +9,17 @@ description: SquareLFO: Produces a pulse wave LFO at the given `frequency`, rang SquareLFO(frequency=1.0, min=0.0, max=1.0, width=0.5, phase=0.0) ``` -Produces a pulse wave LFO at the given `frequency`, ranging from `min` Hz to `max` Hz, with a pulsewidth of `width` (where `width` of `0.5` is a square wave), with the given `phase` offset. +Produces a pulse wave LFO with the given `frequency` and pulsewidth of `width`, ranging from `min` to `max`, where `width` of `0.5` is a square wave. ### Examples ```python #------------------------------------------------------------------------------- -# Alarm effect, using a square wave LFO to modulate a sinewave's frequency +# Alarm effect, using a pulse wave LFO to modulate a sinewave's frequency #------------------------------------------------------------------------------- lfo = SquareLFO(1, 200, 400) sine = SineOscillator(lfo) sine.play() ``` + diff --git a/docs/library/oscillators/trianglelfo/index.md b/docs/library/oscillators/trianglelfo/index.md index ffa8424a..bf0ebe10 100644 --- a/docs/library/oscillators/trianglelfo/index.md +++ b/docs/library/oscillators/trianglelfo/index.md @@ -1,5 +1,5 @@ title: TriangleLFO node documentation -description: TriangleLFO: Produces a triangle LFO with the given `frequency`, ranging from `min` Hz to `max` Hz, with the given `phase` offset. +description: TriangleLFO: Produces a triangle LFO with the given `frequency` and `phase` offset, ranging from `min` to `max`. [Reference library](../../index.md) > [Oscillators](../index.md) > [TriangleLFO](index.md) @@ -9,7 +9,7 @@ description: TriangleLFO: Produces a triangle LFO with the given `frequency`, ra TriangleLFO(frequency=1.0, min=0.0, max=1.0, phase=0.0) ``` -Produces a triangle LFO with the given `frequency`, ranging from `min` Hz to `max` Hz, with the given `phase` offset. +Produces a triangle LFO with the given `frequency` and `phase` offset, ranging from `min` to `max`. ### Examples @@ -21,4 +21,5 @@ Produces a triangle LFO with the given `frequency`, ranging from `min` Hz to `ma lfo = TriangleLFO(3, 200, 900) sine = SineOscillator(lfo) sine.play() -``` \ No newline at end of file +``` + diff --git a/docs/library/sequencing/impulsesequence/index.md b/docs/library/sequencing/impulsesequence/index.md index d5fb212a..bb3e47b0 100644 --- a/docs/library/sequencing/impulsesequence/index.md +++ b/docs/library/sequencing/impulsesequence/index.md @@ -6,7 +6,7 @@ description: ImpulseSequence: Each time a `clock` or trigger is received, output # ImpulseSequence ```python -ImpulseSequence(sequence=std::vector ( ), clock=None) +ImpulseSequence(sequence=std : : vector (), clock=None) ``` Each time a `clock` or trigger is received, outputs the next value in `sequence`. At all other times, outputs zero. diff --git a/docs/library/sequencing/index.md b/docs/library/sequencing/index.md index 27d304ec..84dc4cf9 100644 --- a/docs/library/sequencing/index.md +++ b/docs/library/sequencing/index.md @@ -7,6 +7,5 @@ - **[Euclidean](euclidean/index.md)**: Euclidean rhythm as described by Toussaint, with `sequence_length` (n) and `num_events` (k), driven by `clock`. - **[FlipFlop](flipflop/index.md)**: Flips from 0/1 on each `clock`. - **[ImpulseSequence](impulsesequence/index.md)**: Each time a `clock` or trigger is received, outputs the next value in `sequence`. At all other times, outputs zero. -- **[Index](index/index.md)**: Outputs the value in `list` corresponding to `index`. - **[Latch](latch/index.md)**: Initially outputs 0. When a trigger is received at `set`, outputs 1. When a trigger is subsequently received at `reset`, outputs 0, until the next `set`. - **[Sequence](sequence/index.md)**: Outputs the elements in `sequence`, incrementing position on each `clock`. diff --git a/docs/library/sequencing/sequence/index.md b/docs/library/sequencing/sequence/index.md index fae4bbc8..69d74017 100644 --- a/docs/library/sequencing/sequence/index.md +++ b/docs/library/sequencing/sequence/index.md @@ -6,7 +6,7 @@ description: Sequence: Outputs the elements in `sequence`, incrementing position # Sequence ```python -Sequence(sequence=std::vector ( ), clock=None) +Sequence(sequence=std : : vector (), clock=None) ``` Outputs the elements in `sequence`, incrementing position on each `clock`. diff --git a/docs/library/stochastic/randomchoice/index.md b/docs/library/stochastic/randomchoice/index.md index 0d3f0ab7..75006a26 100644 --- a/docs/library/stochastic/randomchoice/index.md +++ b/docs/library/stochastic/randomchoice/index.md @@ -6,7 +6,7 @@ description: RandomChoice: Pick a random value from the given array. If a clock # RandomChoice ```python -RandomChoice(values=std::vector ( ), clock=None, reset=None) +RandomChoice(values=std : : vector (), clock=None, reset=None) ``` Pick a random value from the given array. If a clock is passed, only picks a new value on a clock tick. From f4bbd9c559c058638bbfc9f135f0c401bf8ee9d1 Mon Sep 17 00:00:00 2001 From: Gregory White Date: Fri, 12 Jan 2024 14:15:01 +0000 Subject: [PATCH 06/13] Documentation: Updating oscillators examples Adding example files and updating the documentation for oscillators. --- .../oscillators/sawoscillator/example-0.py | 10 ++++++++++ docs/library/oscillators/sawoscillator/index.md | 11 +++++++++++ .../oscillators/sineoscillator/example-0.py | 10 ++++++++++ docs/library/oscillators/sineoscillator/index.md | 11 +++++++++++ docs/library/oscillators/squarelfo/index.md | 4 ++-- .../oscillators/squareoscillator/example-0.py | 10 ++++++++++ .../library/oscillators/squareoscillator/index.md | 15 +++++++++++++-- .../oscillators/triangleoscillator/example-0.py | 10 ++++++++++ .../oscillators/triangleoscillator/index.md | 11 +++++++++++ 9 files changed, 88 insertions(+), 4 deletions(-) create mode 100644 docs/library/oscillators/sawoscillator/example-0.py create mode 100644 docs/library/oscillators/sineoscillator/example-0.py create mode 100644 docs/library/oscillators/squareoscillator/example-0.py create mode 100644 docs/library/oscillators/triangleoscillator/example-0.py diff --git a/docs/library/oscillators/sawoscillator/example-0.py b/docs/library/oscillators/sawoscillator/example-0.py new file mode 100644 index 00000000..60473278 --- /dev/null +++ b/docs/library/oscillators/sawoscillator/example-0.py @@ -0,0 +1,10 @@ +from signalflow import * +graph = AudioGraph() + +#------------------------------------------------------------------------------- +# Simple saw wave oscillator shaped by an envelope +#------------------------------------------------------------------------------- +saw = SawOscillator(440) +envelope = ASREnvelope(0.05, 0.1, 0.5) +output = saw * envelope +output.play() diff --git a/docs/library/oscillators/sawoscillator/index.md b/docs/library/oscillators/sawoscillator/index.md index 4d90e560..a1e6b340 100644 --- a/docs/library/oscillators/sawoscillator/index.md +++ b/docs/library/oscillators/sawoscillator/index.md @@ -11,3 +11,14 @@ SawOscillator(frequency=440, phase=None, reset=None) Produces a (non-band-limited) sawtooth wave, with the given `frequency` and `phase` offset. When a `reset` or trigger is received, resets the phase to zero. +### Examples + +```python +#------------------------------------------------------------------------------- +# Simple saw wave oscillator shaped by an envelope +#------------------------------------------------------------------------------- +saw = SawOscillator(440) +envelope = ASREnvelope(0.05, 0.1, 0.5) +output = saw * envelope +output.play() +``` \ No newline at end of file diff --git a/docs/library/oscillators/sineoscillator/example-0.py b/docs/library/oscillators/sineoscillator/example-0.py new file mode 100644 index 00000000..1aae5f3d --- /dev/null +++ b/docs/library/oscillators/sineoscillator/example-0.py @@ -0,0 +1,10 @@ +from signalflow import * +graph = AudioGraph() + +#------------------------------------------------------------------------------- +# Simple sine wave oscillator shaped by an envelope +#------------------------------------------------------------------------------- +sine = SineOscillator(440) +envelope = ASREnvelope(0.1, 0.1, 0.5) +output = sine * envelope +output.play() diff --git a/docs/library/oscillators/sineoscillator/index.md b/docs/library/oscillators/sineoscillator/index.md index 2a7bacd7..d2eb1dca 100644 --- a/docs/library/oscillators/sineoscillator/index.md +++ b/docs/library/oscillators/sineoscillator/index.md @@ -11,3 +11,14 @@ SineOscillator(frequency=440) Produces a sine wave at the given `frequency`. +### Examples + +```python +#------------------------------------------------------------------------------- +# Simple sine wave oscillator shaped by an envelope +#------------------------------------------------------------------------------- +sine = SineOscillator(440) +envelope = ASREnvelope(0.1, 0.1, 0.5) +output = sine * envelope +output.play() +``` \ No newline at end of file diff --git a/docs/library/oscillators/squarelfo/index.md b/docs/library/oscillators/squarelfo/index.md index 9acbd7cd..9db8cbbe 100644 --- a/docs/library/oscillators/squarelfo/index.md +++ b/docs/library/oscillators/squarelfo/index.md @@ -1,5 +1,5 @@ title: SquareLFO node documentation -description: SquareLFO: Produces a pulse wave LFO with the given `frequency` and pulsewidth of `width`, ranging from `min` to `max`, where `width` of `0.5` is a square wave. +description: SquareLFO: Produces a pulse wave LFO with the given `frequency` and pulse `width`, ranging from `min` to `max`, where `width` of `0.5` is a square wave and other values produce a rectangular wave. [Reference library](../../index.md) > [Oscillators](../index.md) > [SquareLFO](index.md) @@ -9,7 +9,7 @@ description: SquareLFO: Produces a pulse wave LFO with the given `frequency` and SquareLFO(frequency=1.0, min=0.0, max=1.0, width=0.5, phase=0.0) ``` -Produces a pulse wave LFO with the given `frequency` and pulsewidth of `width`, ranging from `min` to `max`, where `width` of `0.5` is a square wave. +Produces a pulse wave LFO with the given `frequency` and pulse `width`, ranging from `min` to `max`, where `width` of `0.5` is a square wave and other values produce a rectangular wave. ### Examples diff --git a/docs/library/oscillators/squareoscillator/example-0.py b/docs/library/oscillators/squareoscillator/example-0.py new file mode 100644 index 00000000..f984f7a8 --- /dev/null +++ b/docs/library/oscillators/squareoscillator/example-0.py @@ -0,0 +1,10 @@ +from signalflow import * +graph = AudioGraph() + +#------------------------------------------------------------------------------- +# Simple square wave oscillator shaped by an envelope +#------------------------------------------------------------------------------- +square = SquareOscillator(440) +envelope = ASREnvelope(0, 0.1, 0.5) +output = square * envelope +output.play() diff --git a/docs/library/oscillators/squareoscillator/index.md b/docs/library/oscillators/squareoscillator/index.md index 37091869..5fd0db9b 100644 --- a/docs/library/oscillators/squareoscillator/index.md +++ b/docs/library/oscillators/squareoscillator/index.md @@ -1,5 +1,5 @@ title: SquareOscillator node documentation -description: SquareOscillator: Produces a pulse wave with the given `frequency` and pulse `width`, where `width` of `0.5` is a square wave and other `width` values produce a rectangular wave. +description: SquareOscillator: Produces a pulse wave with the given `frequency` and pulse `width`, where `width` of `0.5` is a square wave and other values produce a rectangular wave. [Reference library](../../index.md) > [Oscillators](../index.md) > [SquareOscillator](index.md) @@ -9,5 +9,16 @@ description: SquareOscillator: Produces a pulse wave with the given `frequency` SquareOscillator(frequency=440, width=0.5) ``` -Produces a pulse wave with the given `frequency` and pulse `width`, where `width` of `0.5` is a square wave and other `width` values produce a rectangular wave. +Produces a pulse wave with the given `frequency` and pulse `width`, where `width` of `0.5` is a square wave and other values produce a rectangular wave. +### Examples + +```python +#------------------------------------------------------------------------------- +# Simple square wave oscillator shaped by an envelope +#------------------------------------------------------------------------------- +square = SquareOscillator(440) +envelope = ASREnvelope(0, 0.1, 0.5) +output = square * envelope +output.play() +``` diff --git a/docs/library/oscillators/triangleoscillator/example-0.py b/docs/library/oscillators/triangleoscillator/example-0.py new file mode 100644 index 00000000..bb1892ab --- /dev/null +++ b/docs/library/oscillators/triangleoscillator/example-0.py @@ -0,0 +1,10 @@ +from signalflow import * +graph = AudioGraph() + +#------------------------------------------------------------------------------- +# Simple triangle wave oscillator shaped by an envelope +#------------------------------------------------------------------------------- +tri = TriangleOscillator(440) +envelope = ASREnvelope(0.1, 0.1, 0.5) +output = tri * envelope +output.play() diff --git a/docs/library/oscillators/triangleoscillator/index.md b/docs/library/oscillators/triangleoscillator/index.md index b305a1a3..d29f164e 100644 --- a/docs/library/oscillators/triangleoscillator/index.md +++ b/docs/library/oscillators/triangleoscillator/index.md @@ -11,3 +11,14 @@ TriangleOscillator(frequency=440) Produces a triangle wave with the given `frequency`. +### Examples + +```python +#------------------------------------------------------------------------------- +# Simple triangle wave oscillator shaped by an envelope +#------------------------------------------------------------------------------- +tri = TriangleOscillator(440) +envelope = ASREnvelope(0.1, 0.1, 0.5) +output = tri * envelope +output.play() +``` \ No newline at end of file From 0c9334ec26e10bb6162be1269bea3eda998b4731 Mon Sep 17 00:00:00 2001 From: Gregory White Date: Fri, 12 Jan 2024 14:55:35 +0000 Subject: [PATCH 07/13] Documentation: Impulse example and formatting Adding an example for the Impulse oscillator, and making formatting consistent across documentation. --- docs/library/oscillators/impulse/example-0.py | 9 +++++++++ docs/library/oscillators/impulse/index.md | 11 +++++++++++ docs/library/oscillators/index.md | 4 ++-- docs/library/oscillators/sawoscillator/index.md | 1 + docs/library/oscillators/sineoscillator/index.md | 1 + docs/library/oscillators/squareoscillator/index.md | 1 + docs/library/oscillators/triangleoscillator/index.md | 1 + 7 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 docs/library/oscillators/impulse/example-0.py diff --git a/docs/library/oscillators/impulse/example-0.py b/docs/library/oscillators/impulse/example-0.py new file mode 100644 index 00000000..04bd2363 --- /dev/null +++ b/docs/library/oscillators/impulse/example-0.py @@ -0,0 +1,9 @@ +from signalflow import * +graph = AudioGraph() + +#------------------------------------------------------------------------------- +# Impulse generator producing an impulse every second (60bpm) +#------------------------------------------------------------------------------- +impulse = Impulse(frequency=1.0) +output = impulse * 0.5 +output.play() \ No newline at end of file diff --git a/docs/library/oscillators/impulse/index.md b/docs/library/oscillators/impulse/index.md index dc463252..8849a671 100644 --- a/docs/library/oscillators/impulse/index.md +++ b/docs/library/oscillators/impulse/index.md @@ -11,3 +11,14 @@ Impulse(frequency=1.0) Produces a value of 1 at the given `frequency`, with output of 0 at all other times. If frequency is 0, produces a single impulse. +### Examples + +```python + +#------------------------------------------------------------------------------- +# Impulse generator producing an impulse every second (60bpm) +#------------------------------------------------------------------------------- +impulse = Impulse(frequency=1.0) +output = impulse * 0.5 +output.play() +``` \ No newline at end of file diff --git a/docs/library/oscillators/index.md b/docs/library/oscillators/index.md index 88495ddc..e930b722 100644 --- a/docs/library/oscillators/index.md +++ b/docs/library/oscillators/index.md @@ -8,8 +8,8 @@ - **[SawOscillator](sawoscillator/index.md)**: Produces a (non-band-limited) sawtooth wave, with the given `frequency` and `phase` offset. When a `reset` or trigger is received, resets the phase to zero. - **[SineLFO](sinelfo/index.md)**: Produces a sinusoidal LFO at the given `frequency` and `phase` offset, with output ranging from `min` to `max`. - **[SineOscillator](sineoscillator/index.md)**: Produces a sine wave at the given `frequency`. -- **[SquareLFO](squarelfo/index.md)**: Produces a pulse wave LFO with the given `frequency` and pulsewidth of `width`, ranging from `min` to `max`, where `width` of `0.5` is a square wave. -- **[SquareOscillator](squareoscillator/index.md)**: Produces a pulse wave with the given `frequency` and pulse `width`, where `width` of `0.5` is a square wave and other `width` values produce a rectangular wave. +- **[SquareLFO](squarelfo/index.md)**: Produces a pulse wave LFO with the given `frequency` and pulse `width`, ranging from `min` to `max`, where `width` of `0.5` is a square wave and other values produce a rectangular wave. +- **[SquareOscillator](squareoscillator/index.md)**: Produces a pulse wave with the given `frequency` and pulse `width`, where `width` of `0.5` is a square wave and other values produce a rectangular wave. - **[TriangleLFO](trianglelfo/index.md)**: Produces a triangle LFO with the given `frequency` and `phase` offset, ranging from `min` to `max`. - **[TriangleOscillator](triangleoscillator/index.md)**: Produces a triangle wave with the given `frequency`. - **[Wavetable](wavetable/index.md)**: Plays the wavetable stored in buffer at the given `frequency` and `phase` offset. `sync` can be used to provide a hard sync input, which resets the wavetable's phase at each zero-crossing. diff --git a/docs/library/oscillators/sawoscillator/index.md b/docs/library/oscillators/sawoscillator/index.md index a1e6b340..13c46f2e 100644 --- a/docs/library/oscillators/sawoscillator/index.md +++ b/docs/library/oscillators/sawoscillator/index.md @@ -14,6 +14,7 @@ Produces a (non-band-limited) sawtooth wave, with the given `frequency` and `pha ### Examples ```python + #------------------------------------------------------------------------------- # Simple saw wave oscillator shaped by an envelope #------------------------------------------------------------------------------- diff --git a/docs/library/oscillators/sineoscillator/index.md b/docs/library/oscillators/sineoscillator/index.md index d2eb1dca..60eee033 100644 --- a/docs/library/oscillators/sineoscillator/index.md +++ b/docs/library/oscillators/sineoscillator/index.md @@ -14,6 +14,7 @@ Produces a sine wave at the given `frequency`. ### Examples ```python + #------------------------------------------------------------------------------- # Simple sine wave oscillator shaped by an envelope #------------------------------------------------------------------------------- diff --git a/docs/library/oscillators/squareoscillator/index.md b/docs/library/oscillators/squareoscillator/index.md index 5fd0db9b..96b3f9e1 100644 --- a/docs/library/oscillators/squareoscillator/index.md +++ b/docs/library/oscillators/squareoscillator/index.md @@ -14,6 +14,7 @@ Produces a pulse wave with the given `frequency` and pulse `width`, where `width ### Examples ```python + #------------------------------------------------------------------------------- # Simple square wave oscillator shaped by an envelope #------------------------------------------------------------------------------- diff --git a/docs/library/oscillators/triangleoscillator/index.md b/docs/library/oscillators/triangleoscillator/index.md index d29f164e..34f37395 100644 --- a/docs/library/oscillators/triangleoscillator/index.md +++ b/docs/library/oscillators/triangleoscillator/index.md @@ -14,6 +14,7 @@ Produces a triangle wave with the given `frequency`. ### Examples ```python + #------------------------------------------------------------------------------- # Simple triangle wave oscillator shaped by an envelope #------------------------------------------------------------------------------- From 1b4068dc6c869efc30543eb1c6be5134791c5456 Mon Sep 17 00:00:00 2001 From: Gregory White Date: Fri, 12 Jan 2024 16:32:05 +0000 Subject: [PATCH 08/13] Documentation: Updating square wave descriptions Updating the descriptions in square.h and square-lfo.h to be more concise and clear. --- docs/library/oscillators/wavetable/index.md | 4 ++-- source/include/signalflow/node/oscillators/square-lfo.h | 5 +++-- source/include/signalflow/node/oscillators/square.h | 6 +++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/docs/library/oscillators/wavetable/index.md b/docs/library/oscillators/wavetable/index.md index e4ad42ae..f040db43 100644 --- a/docs/library/oscillators/wavetable/index.md +++ b/docs/library/oscillators/wavetable/index.md @@ -1,5 +1,5 @@ title: Wavetable node documentation -description: Wavetable: Plays the wavetable stored in buffer at the given `frequency` and `phase` offset. `sync` can be used to provide a hard sync input, which resets the wavetable's phase at each zero-crossing. +description: Wavetable: Plays the wavetable stored in `buffer` at the given `frequency` and `phase` offset. `sync` can be used to provide a hard sync input, which resets the wavetable's phase at each zero-crossing. [Reference library](../../index.md) > [Oscillators](../index.md) > [Wavetable](index.md) @@ -9,5 +9,5 @@ description: Wavetable: Plays the wavetable stored in buffer at the given `frequ Wavetable(buffer=None, frequency=440, phase=0, sync=0, phase_map=None) ``` -Plays the wavetable stored in buffer at the given `frequency` and `phase` offset. `sync` can be used to provide a hard sync input, which resets the wavetable's phase at each zero-crossing. +Plays the wavetable stored in `buffer` at the given `frequency` and `phase` offset. `sync` can be used to provide a hard sync input, which resets the wavetable's phase at each zero-crossing. diff --git a/source/include/signalflow/node/oscillators/square-lfo.h b/source/include/signalflow/node/oscillators/square-lfo.h index add1b156..42a2dc40 100644 --- a/source/include/signalflow/node/oscillators/square-lfo.h +++ b/source/include/signalflow/node/oscillators/square-lfo.h @@ -5,8 +5,9 @@ namespace signalflow { /**--------------------------------------------------------------------------------* - * Produces a pulse wave LFO with the given `frequency` and pulsewidth of `width`, - * ranging from `min` to `max`, where `width` of `0.5` is a square wave. + * Produces a pulse wave LFO with the given `frequency` and pulse `width`, + * ranging from `min` to `max`, where `width` of `0.5` is a square wave and + * other values produce a rectangular wave. *---------------------------------------------------------------------------------*/ class SquareLFO : public LFO { diff --git a/source/include/signalflow/node/oscillators/square.h b/source/include/signalflow/node/oscillators/square.h index 49955553..b4c30e22 100644 --- a/source/include/signalflow/node/oscillators/square.h +++ b/source/include/signalflow/node/oscillators/square.h @@ -5,9 +5,9 @@ namespace signalflow { /**--------------------------------------------------------------------------------* - * Produces a pulse wave with the given `frequency` and pulse `width`, where - * `width` of `0.5` is a square wave and other `width` values produce a rectangular - * wave. + * Produces a pulse wave with the given `frequency` and pulse `width`, + * where `width` of `0.5` is a square wave and other values produce a + * rectangular wave. *---------------------------------------------------------------------------------*/ class SquareOscillator : public Node { From 47f5a9abcc9b69a92dfc870d45b592495d4c7609 Mon Sep 17 00:00:00 2001 From: Gregory White Date: Fri, 12 Jan 2024 16:35:29 +0000 Subject: [PATCH 09/13] Documentation: Auto-generating new docs Automatically generating new documentation files reflecting earlier changes. Also removing unnecessary spaces in square.h and square-lfo.h. --- docs/library/index.md | 4 ++-- docs/library/oscillators/impulse/index.md | 4 ++-- docs/library/oscillators/index.md | 4 ++-- docs/library/oscillators/sawoscillator/index.md | 3 ++- docs/library/oscillators/sineoscillator/index.md | 3 ++- docs/library/oscillators/squarelfo/index.md | 4 ++-- docs/library/oscillators/squareoscillator/index.md | 5 +++-- docs/library/oscillators/triangleoscillator/index.md | 3 ++- docs/library/oscillators/wavetable/index.md | 4 ++-- source/include/signalflow/node/oscillators/square-lfo.h | 2 +- source/include/signalflow/node/oscillators/square.h | 2 +- 11 files changed, 21 insertions(+), 17 deletions(-) diff --git a/docs/library/index.md b/docs/library/index.md index 958456f7..9fe584a6 100644 --- a/docs/library/index.md +++ b/docs/library/index.md @@ -101,8 +101,8 @@ - **[SawOscillator](oscillators/sawoscillator/index.md)**: Produces a (non-band-limited) sawtooth wave, with the given `frequency` and `phase` offset. When a `reset` or trigger is received, resets the phase to zero. - **[SineLFO](oscillators/sinelfo/index.md)**: Produces a sinusoidal LFO at the given `frequency` and `phase` offset, with output ranging from `min` to `max`. - **[SineOscillator](oscillators/sineoscillator/index.md)**: Produces a sine wave at the given `frequency`. -- **[SquareLFO](oscillators/squarelfo/index.md)**: Produces a pulse wave LFO with the given `frequency` and pulsewidth of `width`, ranging from `min` to `max`, where `width` of `0.5` is a square wave. -- **[SquareOscillator](oscillators/squareoscillator/index.md)**: Produces a pulse wave with the given `frequency` and pulse `width`, where `width` of `0.5` is a square wave and other `width` values produce a rectangular wave. +- **[SquareLFO](oscillators/squarelfo/index.md)**: Produces a pulse wave LFO with the given `frequency` and pulse `width`, ranging from `min` to `max`, where `width` of `0.5` is a square wave and other values produce a rectangular wave. +- **[SquareOscillator](oscillators/squareoscillator/index.md)**: Produces a pulse wave with the given `frequency` and pulse `width`, where `width` of `0.5` is a square wave and other values produce a rectangular wave. - **[TriangleLFO](oscillators/trianglelfo/index.md)**: Produces a triangle LFO with the given `frequency` and `phase` offset, ranging from `min` to `max`. - **[TriangleOscillator](oscillators/triangleoscillator/index.md)**: Produces a triangle wave with the given `frequency`. - **[Wavetable](oscillators/wavetable/index.md)**: Plays the wavetable stored in buffer at the given `frequency` and `phase` offset. `sync` can be used to provide a hard sync input, which resets the wavetable's phase at each zero-crossing. diff --git a/docs/library/oscillators/impulse/index.md b/docs/library/oscillators/impulse/index.md index 8849a671..90bec2c1 100644 --- a/docs/library/oscillators/impulse/index.md +++ b/docs/library/oscillators/impulse/index.md @@ -20,5 +20,5 @@ Produces a value of 1 at the given `frequency`, with output of 0 at all other ti #------------------------------------------------------------------------------- impulse = Impulse(frequency=1.0) output = impulse * 0.5 -output.play() -``` \ No newline at end of file +output.play()``` + diff --git a/docs/library/oscillators/index.md b/docs/library/oscillators/index.md index e930b722..ffafb58a 100644 --- a/docs/library/oscillators/index.md +++ b/docs/library/oscillators/index.md @@ -8,8 +8,8 @@ - **[SawOscillator](sawoscillator/index.md)**: Produces a (non-band-limited) sawtooth wave, with the given `frequency` and `phase` offset. When a `reset` or trigger is received, resets the phase to zero. - **[SineLFO](sinelfo/index.md)**: Produces a sinusoidal LFO at the given `frequency` and `phase` offset, with output ranging from `min` to `max`. - **[SineOscillator](sineoscillator/index.md)**: Produces a sine wave at the given `frequency`. -- **[SquareLFO](squarelfo/index.md)**: Produces a pulse wave LFO with the given `frequency` and pulse `width`, ranging from `min` to `max`, where `width` of `0.5` is a square wave and other values produce a rectangular wave. -- **[SquareOscillator](squareoscillator/index.md)**: Produces a pulse wave with the given `frequency` and pulse `width`, where `width` of `0.5` is a square wave and other values produce a rectangular wave. +- **[SquareLFO](squarelfo/index.md)**: Produces a pulse wave LFO with the given `frequency` and pulse `width`, ranging from `min` to `max`, where `width` of `0.5` is a square wave and other values produce a rectangular wave. +- **[SquareOscillator](squareoscillator/index.md)**: Produces a pulse wave with the given `frequency` and pulse `width`, where `width` of `0.5` is a square wave and other values produce a rectangular wave. - **[TriangleLFO](trianglelfo/index.md)**: Produces a triangle LFO with the given `frequency` and `phase` offset, ranging from `min` to `max`. - **[TriangleOscillator](triangleoscillator/index.md)**: Produces a triangle wave with the given `frequency`. - **[Wavetable](wavetable/index.md)**: Plays the wavetable stored in buffer at the given `frequency` and `phase` offset. `sync` can be used to provide a hard sync input, which resets the wavetable's phase at each zero-crossing. diff --git a/docs/library/oscillators/sawoscillator/index.md b/docs/library/oscillators/sawoscillator/index.md index 13c46f2e..cfa3dc69 100644 --- a/docs/library/oscillators/sawoscillator/index.md +++ b/docs/library/oscillators/sawoscillator/index.md @@ -22,4 +22,5 @@ saw = SawOscillator(440) envelope = ASREnvelope(0.05, 0.1, 0.5) output = saw * envelope output.play() -``` \ No newline at end of file +``` + diff --git a/docs/library/oscillators/sineoscillator/index.md b/docs/library/oscillators/sineoscillator/index.md index 60eee033..83ec7ae5 100644 --- a/docs/library/oscillators/sineoscillator/index.md +++ b/docs/library/oscillators/sineoscillator/index.md @@ -22,4 +22,5 @@ sine = SineOscillator(440) envelope = ASREnvelope(0.1, 0.1, 0.5) output = sine * envelope output.play() -``` \ No newline at end of file +``` + diff --git a/docs/library/oscillators/squarelfo/index.md b/docs/library/oscillators/squarelfo/index.md index 9db8cbbe..aebb0ed5 100644 --- a/docs/library/oscillators/squarelfo/index.md +++ b/docs/library/oscillators/squarelfo/index.md @@ -1,5 +1,5 @@ title: SquareLFO node documentation -description: SquareLFO: Produces a pulse wave LFO with the given `frequency` and pulse `width`, ranging from `min` to `max`, where `width` of `0.5` is a square wave and other values produce a rectangular wave. +description: SquareLFO: Produces a pulse wave LFO with the given `frequency` and pulse `width`, ranging from `min` to `max`, where `width` of `0.5` is a square wave and other values produce a rectangular wave. [Reference library](../../index.md) > [Oscillators](../index.md) > [SquareLFO](index.md) @@ -9,7 +9,7 @@ description: SquareLFO: Produces a pulse wave LFO with the given `frequency` and SquareLFO(frequency=1.0, min=0.0, max=1.0, width=0.5, phase=0.0) ``` -Produces a pulse wave LFO with the given `frequency` and pulse `width`, ranging from `min` to `max`, where `width` of `0.5` is a square wave and other values produce a rectangular wave. +Produces a pulse wave LFO with the given `frequency` and pulse `width`, ranging from `min` to `max`, where `width` of `0.5` is a square wave and other values produce a rectangular wave. ### Examples diff --git a/docs/library/oscillators/squareoscillator/index.md b/docs/library/oscillators/squareoscillator/index.md index 96b3f9e1..b1c854eb 100644 --- a/docs/library/oscillators/squareoscillator/index.md +++ b/docs/library/oscillators/squareoscillator/index.md @@ -1,5 +1,5 @@ title: SquareOscillator node documentation -description: SquareOscillator: Produces a pulse wave with the given `frequency` and pulse `width`, where `width` of `0.5` is a square wave and other values produce a rectangular wave. +description: SquareOscillator: Produces a pulse wave with the given `frequency` and pulse `width`, where `width` of `0.5` is a square wave and other values produce a rectangular wave. [Reference library](../../index.md) > [Oscillators](../index.md) > [SquareOscillator](index.md) @@ -9,7 +9,7 @@ description: SquareOscillator: Produces a pulse wave with the given `frequency` SquareOscillator(frequency=440, width=0.5) ``` -Produces a pulse wave with the given `frequency` and pulse `width`, where `width` of `0.5` is a square wave and other values produce a rectangular wave. +Produces a pulse wave with the given `frequency` and pulse `width`, where `width` of `0.5` is a square wave and other values produce a rectangular wave. ### Examples @@ -23,3 +23,4 @@ envelope = ASREnvelope(0, 0.1, 0.5) output = square * envelope output.play() ``` + diff --git a/docs/library/oscillators/triangleoscillator/index.md b/docs/library/oscillators/triangleoscillator/index.md index 34f37395..a975b83a 100644 --- a/docs/library/oscillators/triangleoscillator/index.md +++ b/docs/library/oscillators/triangleoscillator/index.md @@ -22,4 +22,5 @@ tri = TriangleOscillator(440) envelope = ASREnvelope(0.1, 0.1, 0.5) output = tri * envelope output.play() -``` \ No newline at end of file +``` + diff --git a/docs/library/oscillators/wavetable/index.md b/docs/library/oscillators/wavetable/index.md index f040db43..e4ad42ae 100644 --- a/docs/library/oscillators/wavetable/index.md +++ b/docs/library/oscillators/wavetable/index.md @@ -1,5 +1,5 @@ title: Wavetable node documentation -description: Wavetable: Plays the wavetable stored in `buffer` at the given `frequency` and `phase` offset. `sync` can be used to provide a hard sync input, which resets the wavetable's phase at each zero-crossing. +description: Wavetable: Plays the wavetable stored in buffer at the given `frequency` and `phase` offset. `sync` can be used to provide a hard sync input, which resets the wavetable's phase at each zero-crossing. [Reference library](../../index.md) > [Oscillators](../index.md) > [Wavetable](index.md) @@ -9,5 +9,5 @@ description: Wavetable: Plays the wavetable stored in `buffer` at the given `fre Wavetable(buffer=None, frequency=440, phase=0, sync=0, phase_map=None) ``` -Plays the wavetable stored in `buffer` at the given `frequency` and `phase` offset. `sync` can be used to provide a hard sync input, which resets the wavetable's phase at each zero-crossing. +Plays the wavetable stored in buffer at the given `frequency` and `phase` offset. `sync` can be used to provide a hard sync input, which resets the wavetable's phase at each zero-crossing. diff --git a/source/include/signalflow/node/oscillators/square-lfo.h b/source/include/signalflow/node/oscillators/square-lfo.h index 42a2dc40..1e1dbfa4 100644 --- a/source/include/signalflow/node/oscillators/square-lfo.h +++ b/source/include/signalflow/node/oscillators/square-lfo.h @@ -6,7 +6,7 @@ namespace signalflow { /**--------------------------------------------------------------------------------* * Produces a pulse wave LFO with the given `frequency` and pulse `width`, - * ranging from `min` to `max`, where `width` of `0.5` is a square wave and + * ranging from `min` to `max`, where `width` of `0.5` is a square wave and * other values produce a rectangular wave. *---------------------------------------------------------------------------------*/ class SquareLFO : public LFO diff --git a/source/include/signalflow/node/oscillators/square.h b/source/include/signalflow/node/oscillators/square.h index b4c30e22..d4004777 100644 --- a/source/include/signalflow/node/oscillators/square.h +++ b/source/include/signalflow/node/oscillators/square.h @@ -6,7 +6,7 @@ namespace signalflow { /**--------------------------------------------------------------------------------* * Produces a pulse wave with the given `frequency` and pulse `width`, - * where `width` of `0.5` is a square wave and other values produce a + * where `width` of `0.5` is a square wave and other values produce a * rectangular wave. *---------------------------------------------------------------------------------*/ class SquareOscillator : public Node From 0825eb82a027dbdab6b5a8bce1441b0cb713ce4e Mon Sep 17 00:00:00 2001 From: Gregory White Date: Fri, 12 Jan 2024 16:38:15 +0000 Subject: [PATCH 10/13] Documentation: Adding graph.wait() Adding graph.wait() to oscillator examples which did not have it. --- docs/library/oscillators/impulse/example-0.py | 3 ++- docs/library/oscillators/impulse/index.md | 3 ++- docs/library/oscillators/sawoscillator/example-0.py | 1 + docs/library/oscillators/sineoscillator/example-0.py | 1 + docs/library/oscillators/squareoscillator/example-0.py | 1 + docs/library/oscillators/triangleoscillator/example-0.py | 1 + 6 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/library/oscillators/impulse/example-0.py b/docs/library/oscillators/impulse/example-0.py index 04bd2363..4a84be9e 100644 --- a/docs/library/oscillators/impulse/example-0.py +++ b/docs/library/oscillators/impulse/example-0.py @@ -6,4 +6,5 @@ #------------------------------------------------------------------------------- impulse = Impulse(frequency=1.0) output = impulse * 0.5 -output.play() \ No newline at end of file +output.play() +graph.wait() \ No newline at end of file diff --git a/docs/library/oscillators/impulse/index.md b/docs/library/oscillators/impulse/index.md index 90bec2c1..b2a113b8 100644 --- a/docs/library/oscillators/impulse/index.md +++ b/docs/library/oscillators/impulse/index.md @@ -20,5 +20,6 @@ Produces a value of 1 at the given `frequency`, with output of 0 at all other ti #------------------------------------------------------------------------------- impulse = Impulse(frequency=1.0) output = impulse * 0.5 -output.play()``` +output.play() +``` diff --git a/docs/library/oscillators/sawoscillator/example-0.py b/docs/library/oscillators/sawoscillator/example-0.py index 60473278..954874b3 100644 --- a/docs/library/oscillators/sawoscillator/example-0.py +++ b/docs/library/oscillators/sawoscillator/example-0.py @@ -8,3 +8,4 @@ envelope = ASREnvelope(0.05, 0.1, 0.5) output = saw * envelope output.play() +graph.wait() \ No newline at end of file diff --git a/docs/library/oscillators/sineoscillator/example-0.py b/docs/library/oscillators/sineoscillator/example-0.py index 1aae5f3d..487ca00d 100644 --- a/docs/library/oscillators/sineoscillator/example-0.py +++ b/docs/library/oscillators/sineoscillator/example-0.py @@ -8,3 +8,4 @@ envelope = ASREnvelope(0.1, 0.1, 0.5) output = sine * envelope output.play() +graph.wait() \ No newline at end of file diff --git a/docs/library/oscillators/squareoscillator/example-0.py b/docs/library/oscillators/squareoscillator/example-0.py index f984f7a8..79b9aade 100644 --- a/docs/library/oscillators/squareoscillator/example-0.py +++ b/docs/library/oscillators/squareoscillator/example-0.py @@ -8,3 +8,4 @@ envelope = ASREnvelope(0, 0.1, 0.5) output = square * envelope output.play() +graph.wait() \ No newline at end of file diff --git a/docs/library/oscillators/triangleoscillator/example-0.py b/docs/library/oscillators/triangleoscillator/example-0.py index bb1892ab..d9dd874d 100644 --- a/docs/library/oscillators/triangleoscillator/example-0.py +++ b/docs/library/oscillators/triangleoscillator/example-0.py @@ -8,3 +8,4 @@ envelope = ASREnvelope(0.1, 0.1, 0.5) output = tri * envelope output.play() +graph.wait() \ No newline at end of file From 64c18a78a9e5e098ed417eaa61d9a100c1579712 Mon Sep 17 00:00:00 2001 From: Gregory White Date: Fri, 26 Jan 2024 16:07:21 +0000 Subject: [PATCH 11/13] Documentation: Creating Examples Created examples for: MouseDown() MouseX() MouseY() ASREnvelope() Line() Impulse() ClockDivider() Sequence() And fixing a typo in BufferPlayer(). --- docs/library/control/mousedown/example-0.py | 11 +++++++++ docs/library/control/mousedown/example-1.py | 13 +++++++++++ docs/library/control/mousex/example-0.py | 11 +++++++++ docs/library/control/mousex/example-1.py | 13 +++++++++++ docs/library/control/mousey/example-0.py | 10 ++++++++ docs/library/control/mousey/example-1.py | 13 +++++++++++ .../library/envelope/asrenvelope/example-0.py | 11 +++++++++ docs/library/envelope/line/example-0.py | 12 ++++++++++ docs/library/oscillators/impulse/example-0.py | 8 ++++--- .../sequencing/clockdivider/example-0.py | 23 +++++++++++++++++++ docs/library/sequencing/sequence/example-0.py | 12 ++++++++++ .../signalflow/node/buffer/buffer-player.h | 2 +- 12 files changed, 135 insertions(+), 4 deletions(-) create mode 100644 docs/library/control/mousedown/example-0.py create mode 100644 docs/library/control/mousedown/example-1.py create mode 100644 docs/library/control/mousex/example-0.py create mode 100644 docs/library/control/mousex/example-1.py create mode 100644 docs/library/control/mousey/example-0.py create mode 100644 docs/library/control/mousey/example-1.py create mode 100644 docs/library/envelope/asrenvelope/example-0.py create mode 100644 docs/library/envelope/line/example-0.py create mode 100644 docs/library/sequencing/clockdivider/example-0.py create mode 100644 docs/library/sequencing/sequence/example-0.py diff --git a/docs/library/control/mousedown/example-0.py b/docs/library/control/mousedown/example-0.py new file mode 100644 index 00000000..8675b485 --- /dev/null +++ b/docs/library/control/mousedown/example-0.py @@ -0,0 +1,11 @@ +from signalflow import * +graph = AudioGraph() + +#------------------------------------------------------------------------------- +# When the left mouse button is clicked, as detected by MouseDown(), an LFO is applied to the oscillator's frequency. +#------------------------------------------------------------------------------- +lfo = SineLFO(5, 100, 600) +frequency = If(MouseDown(), lfo, 100) +osc = TriangleOscillator(frequency) +osc.play() +graph.wait() \ No newline at end of file diff --git a/docs/library/control/mousedown/example-1.py b/docs/library/control/mousedown/example-1.py new file mode 100644 index 00000000..4da74c2c --- /dev/null +++ b/docs/library/control/mousedown/example-1.py @@ -0,0 +1,13 @@ +from signalflow import * +graph = AudioGraph() + +#------------------------------------------------------------------------------- +# A simple wobbling synthesiser controlled using the mouse. When the mouse is clicked, as detected by MouseDown(), an LFO is activated and affects the oscillator's frequency. MouseX position changes the rate of the LFO. MouseY position changes the upper frequency limit, affecting pitch. +#------------------------------------------------------------------------------- +rate = MouseX() * 10 +upper_limit = MouseY() * 1500 +lfo = SineLFO(rate, 100, upper_limit) +frequency = If(MouseDown(), lfo, 100) +osc = TriangleOscillator(frequency) +osc.play() +graph.wait() \ No newline at end of file diff --git a/docs/library/control/mousex/example-0.py b/docs/library/control/mousex/example-0.py new file mode 100644 index 00000000..f1ec1572 --- /dev/null +++ b/docs/library/control/mousex/example-0.py @@ -0,0 +1,11 @@ +from signalflow import * +graph = AudioGraph() + +#------------------------------------------------------------------------------- +# Using the MouseX position to change the rate of an LFO, which is modulating an oscillator's frequency +#------------------------------------------------------------------------------- +lfo_rate = MouseX() * 10 +frequency = SineLFO(lfo_rate, 100, 600) +osc = TriangleOscillator(frequency) +osc.play() +graph.wait() \ No newline at end of file diff --git a/docs/library/control/mousex/example-1.py b/docs/library/control/mousex/example-1.py new file mode 100644 index 00000000..4da74c2c --- /dev/null +++ b/docs/library/control/mousex/example-1.py @@ -0,0 +1,13 @@ +from signalflow import * +graph = AudioGraph() + +#------------------------------------------------------------------------------- +# A simple wobbling synthesiser controlled using the mouse. When the mouse is clicked, as detected by MouseDown(), an LFO is activated and affects the oscillator's frequency. MouseX position changes the rate of the LFO. MouseY position changes the upper frequency limit, affecting pitch. +#------------------------------------------------------------------------------- +rate = MouseX() * 10 +upper_limit = MouseY() * 1500 +lfo = SineLFO(rate, 100, upper_limit) +frequency = If(MouseDown(), lfo, 100) +osc = TriangleOscillator(frequency) +osc.play() +graph.wait() \ No newline at end of file diff --git a/docs/library/control/mousey/example-0.py b/docs/library/control/mousey/example-0.py new file mode 100644 index 00000000..031548d0 --- /dev/null +++ b/docs/library/control/mousey/example-0.py @@ -0,0 +1,10 @@ +from signalflow import * +graph = AudioGraph() + +#------------------------------------------------------------------------------- +# Using the MouseY position to change the frequency of an oscillator. +#------------------------------------------------------------------------------- +frequency = MouseY() * 1000 +osc = TriangleOscillator(frequency) +osc.play() +graph.wait() \ No newline at end of file diff --git a/docs/library/control/mousey/example-1.py b/docs/library/control/mousey/example-1.py new file mode 100644 index 00000000..4da74c2c --- /dev/null +++ b/docs/library/control/mousey/example-1.py @@ -0,0 +1,13 @@ +from signalflow import * +graph = AudioGraph() + +#------------------------------------------------------------------------------- +# A simple wobbling synthesiser controlled using the mouse. When the mouse is clicked, as detected by MouseDown(), an LFO is activated and affects the oscillator's frequency. MouseX position changes the rate of the LFO. MouseY position changes the upper frequency limit, affecting pitch. +#------------------------------------------------------------------------------- +rate = MouseX() * 10 +upper_limit = MouseY() * 1500 +lfo = SineLFO(rate, 100, upper_limit) +frequency = If(MouseDown(), lfo, 100) +osc = TriangleOscillator(frequency) +osc.play() +graph.wait() \ No newline at end of file diff --git a/docs/library/envelope/asrenvelope/example-0.py b/docs/library/envelope/asrenvelope/example-0.py new file mode 100644 index 00000000..179af9f9 --- /dev/null +++ b/docs/library/envelope/asrenvelope/example-0.py @@ -0,0 +1,11 @@ +from signalflow import * +graph = AudioGraph() + +#------------------------------------------------------------------------------- +# Using an ASR Envelope to shape a square wave oscillator +#------------------------------------------------------------------------------- +osc = SquareOscillator(500) +envelope = ASREnvelope(0.1, 0.0, 0.5) +output = osc * envelope +output.play() +graph.wait() diff --git a/docs/library/envelope/line/example-0.py b/docs/library/envelope/line/example-0.py new file mode 100644 index 00000000..55423b2e --- /dev/null +++ b/docs/library/envelope/line/example-0.py @@ -0,0 +1,12 @@ +from signalflow import * +graph = AudioGraph() + +#------------------------------------------------------------------------------- +# Using a line to control the gain of an oscillator, emulating a sidechain ducking effect. +#------------------------------------------------------------------------------- +clock = Impulse(frequency=1.0) +line = Line(0.0, 0.5, 1.0, 0, clock) +osc = SawOscillator(200) +output = osc * line +output.play() +graph.wait() \ No newline at end of file diff --git a/docs/library/oscillators/impulse/example-0.py b/docs/library/oscillators/impulse/example-0.py index 4a84be9e..c326cb2d 100644 --- a/docs/library/oscillators/impulse/example-0.py +++ b/docs/library/oscillators/impulse/example-0.py @@ -2,9 +2,11 @@ graph = AudioGraph() #------------------------------------------------------------------------------- -# Impulse generator producing an impulse every second (60bpm) +# Using an Impulse node as a clock to trigger an envelope once per second. #------------------------------------------------------------------------------- -impulse = Impulse(frequency=1.0) -output = impulse * 0.5 +clock = Impulse(1.0) +osc = TriangleOscillator(250) +envelope = ASREnvelope(0.01, 0.0, 0.5, 1.0, clock) +output = osc * envelope output.play() graph.wait() \ No newline at end of file diff --git a/docs/library/sequencing/clockdivider/example-0.py b/docs/library/sequencing/clockdivider/example-0.py new file mode 100644 index 00000000..fc1e0642 --- /dev/null +++ b/docs/library/sequencing/clockdivider/example-0.py @@ -0,0 +1,23 @@ +from signalflow import * +graph = AudioGraph() + +#------------------------------------------------------------------------------- +# Using a ClockDivider to create rhythms related to the main clock. Here the oscillator in the left channel is heard on every tick of the clock. The oscillator in the right channel is heard every 3 ticks of the clock. +#------------------------------------------------------------------------------- +clock = Impulse(2.0) +divided_clock = ClockDivider(clock, 3) + +oscillator_a = TriangleOscillator(220) +oscillator_b = TriangleOscillator(440) + +envelope_a = ASREnvelope(0.01, 0.0, 0.25, 1.0, clock) +envelope_b = ASREnvelope(0.01, 0.0, 0.5, 1.0, divided_clock) + +voice_a = oscillator_a * envelope_a +voice_b = oscillator_b * envelope_b + +left = StereoPanner(voice_a, -1.0) +right = StereoPanner(voice_b, 1.0) + +left.play() +right.play() \ No newline at end of file diff --git a/docs/library/sequencing/sequence/example-0.py b/docs/library/sequencing/sequence/example-0.py new file mode 100644 index 00000000..76d3af36 --- /dev/null +++ b/docs/library/sequencing/sequence/example-0.py @@ -0,0 +1,12 @@ +from signalflow import * +graph = AudioGraph() + +#------------------------------------------------------------------------------- +# Creating a sequence using the MIDI note values of a C Major scale, starting on middle C. +#------------------------------------------------------------------------------- +clock = Impulse(2.0) +sequence = Sequence([ 60, 62, 64, 65, 67, 69, 71, 72 ], clock) +frequency = MidiNoteToFrequency(sequence) +oscillator = TriangleOscillator(frequency) +oscillator.play() +graph.wait() \ No newline at end of file diff --git a/source/include/signalflow/node/buffer/buffer-player.h b/source/include/signalflow/node/buffer/buffer-player.h index 51ac9e94..3142993b 100644 --- a/source/include/signalflow/node/buffer/buffer-player.h +++ b/source/include/signalflow/node/buffer/buffer-player.h @@ -7,7 +7,7 @@ namespace signalflow /**--------------------------------------------------------------------------------* * Plays the contents of the given buffer. start_time/end_time are in seconds. - * When a clock signal is receives, rewinds to the start_time. + * When a clock signal is received, rewinds to the start_time. *---------------------------------------------------------------------------------*/ class BufferPlayer : public Node { From 5c0d2089daef52a28dfab7a147703b6645745fba Mon Sep 17 00:00:00 2001 From: Gregory White Date: Mon, 29 Jan 2024 12:29:52 +0000 Subject: [PATCH 12/13] Documentation: Example Feedback Implementing feedback on examples for Line and ClockDivider --- docs/library/envelope/line/example-0.py | 2 +- docs/library/sequencing/clockdivider/example-0.py | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/library/envelope/line/example-0.py b/docs/library/envelope/line/example-0.py index 55423b2e..4b7325bb 100644 --- a/docs/library/envelope/line/example-0.py +++ b/docs/library/envelope/line/example-0.py @@ -5,7 +5,7 @@ # Using a line to control the gain of an oscillator, emulating a sidechain ducking effect. #------------------------------------------------------------------------------- clock = Impulse(frequency=1.0) -line = Line(0.0, 0.5, 1.0, 0, clock) +line = Line(0.0, 0.5, 0.5, False, clock) osc = SawOscillator(200) output = osc * line output.play() diff --git a/docs/library/sequencing/clockdivider/example-0.py b/docs/library/sequencing/clockdivider/example-0.py index fc1e0642..d2285800 100644 --- a/docs/library/sequencing/clockdivider/example-0.py +++ b/docs/library/sequencing/clockdivider/example-0.py @@ -13,11 +13,13 @@ envelope_a = ASREnvelope(0.01, 0.0, 0.25, 1.0, clock) envelope_b = ASREnvelope(0.01, 0.0, 0.5, 1.0, divided_clock) -voice_a = oscillator_a * envelope_a -voice_b = oscillator_b * envelope_b +voice_a = oscillator_a * envelope_a * 0.5 +voice_b = oscillator_b * envelope_b * 0.5 -left = StereoPanner(voice_a, -1.0) -right = StereoPanner(voice_b, 1.0) +left = StereoPanner(voice_a, -0.75) +right = StereoPanner(voice_b, 0.75) left.play() -right.play() \ No newline at end of file +right.play() + +graph.wait() \ No newline at end of file From 6abd66b00b9aa3c30e518796e4f8ec6431ce461b Mon Sep 17 00:00:00 2001 From: Gregory White Date: Tue, 30 Jan 2024 10:24:05 +0000 Subject: [PATCH 13/13] Documentation: Saw LFO Fixing description for Saw LFO --- source/include/signalflow/node/oscillators/saw-lfo.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/include/signalflow/node/oscillators/saw-lfo.h b/source/include/signalflow/node/oscillators/saw-lfo.h index 01ed9dfe..c21893f1 100644 --- a/source/include/signalflow/node/oscillators/saw-lfo.h +++ b/source/include/signalflow/node/oscillators/saw-lfo.h @@ -5,7 +5,7 @@ namespace signalflow { /**--------------------------------------------------------------------------------* - * Produces a sawtooth LFO, with output ranging from `min` to `max`. + * Produces a sawtooth LFO at the given `frequency` and `phase` offset, with output ranging from `min` to `max`. *---------------------------------------------------------------------------------*/ class SawLFO : public LFO {