From 53181d0f6109449de0d4e38432a7df79bea6d5e8 Mon Sep 17 00:00:00 2001 From: Daniel Jones Date: Tue, 7 Nov 2023 22:06:45 +0000 Subject: [PATCH] Add inline documentation to Node subclasses --- .../libs/signalflow-stubs/signalflow.pyi | 390 +++++++++++++++++- .../scripts/generate-node-python-bindings.py | 26 +- .../signalflow/node/buffer/beat-cutter.h | 5 + .../signalflow/node/buffer/buffer-looper.h | 4 + .../signalflow/node/buffer/buffer-player.h | 5 + .../signalflow/node/buffer/buffer-recorder.h | 4 + .../node/buffer/feedback-buffer-reader.h | 4 + .../node/buffer/feedback-buffer-writer.h | 4 + .../signalflow/node/buffer/granulator.h | 5 + .../signalflow/node/buffer/segment-player.h | 4 + .../include/signalflow/node/control/mouse.h | 10 + .../include/signalflow/node/envelope/adsr.h | 4 + source/include/signalflow/node/envelope/asr.h | 3 + .../signalflow/node/envelope/detect-silence.h | 4 + .../signalflow/node/envelope/envelope.h | 3 + .../include/signalflow/node/envelope/line.h | 6 + .../include/signalflow/node/envelope/rect.h | 3 + .../signalflow/node/operators/channel-array.h | 3 + .../node/operators/channel-crossfade.h | 4 + .../signalflow/node/operators/channel-mixer.h | 6 + .../node/operators/channel-select.h | 4 + .../node/operators/frequency-to-midi-note.h | 4 + .../node/operators/midi-note-to-frequency.h | 4 + .../node/operators/round-to-scale.h | 4 + .../include/signalflow/node/operators/round.h | 3 + .../include/signalflow/node/operators/scale.h | 8 + .../signalflow/node/oscillators/constant.h | 3 + .../signalflow/node/oscillators/impulse.h | 4 + .../signalflow/node/oscillators/saw-lfo.h | 3 + .../include/signalflow/node/oscillators/saw.h | 4 + .../signalflow/node/oscillators/sine-lfo.h | 4 + .../signalflow/node/oscillators/sine.h | 3 + .../signalflow/node/oscillators/square-lfo.h | 4 + .../signalflow/node/oscillators/square.h | 4 + .../node/oscillators/triangle-lfo.h | 3 + .../signalflow/node/oscillators/triangle.h | 4 + .../signalflow/node/oscillators/wavetable.h | 3 + .../include/signalflow/node/processors/clip.h | 3 + .../node/processors/delays/allpass.h | 4 + .../signalflow/node/processors/delays/comb.h | 4 + .../node/processors/delays/onetap.h | 4 + .../node/processors/delays/stutter.h | 4 + .../node/processors/distortion/resample.h | 4 + .../processors/distortion/sample-and-hold.h | 3 + .../node/processors/distortion/squiz.h | 3 + .../node/processors/distortion/waveshaper.h | 3 + .../node/processors/dynamics/compressor.h | 3 + .../node/processors/dynamics/gate.h | 3 + .../node/processors/dynamics/maximiser.h | 3 + .../signalflow/node/processors/dynamics/rms.h | 4 + .../node/processors/filters/biquad.h | 6 + .../signalflow/node/processors/filters/eq.h | 3 + .../signalflow/node/processors/filters/moog.h | 3 + .../signalflow/node/processors/filters/svf.h | 5 + .../include/signalflow/node/processors/fold.h | 3 + .../node/processors/panning/azimuth-panner.h | 5 + .../node/processors/panning/channel-panner.h | 4 + .../processors/panning/spatial-environment.h | 11 + .../node/processors/panning/stereo-balance.h | 4 + .../node/processors/panning/stereo-panner.h | 4 + .../node/processors/panning/stereo-width.h | 5 + .../signalflow/node/processors/smooth.h | 4 + .../signalflow/node/processors/wetdry.h | 3 + .../include/signalflow/node/processors/wrap.h | 3 + .../node/sequencing/clock-divider.h | 5 +- .../signalflow/node/sequencing/counter.h | 3 + .../signalflow/node/sequencing/euclidean.h | 4 + .../signalflow/node/sequencing/flipflop.h | 3 + .../node/sequencing/impulse-sequence.h | 4 + .../signalflow/node/sequencing/index.h | 3 + .../signalflow/node/sequencing/latch.h | 5 + .../signalflow/node/sequencing/sequence.h | 3 + .../signalflow/node/stochastic/logistic.h | 4 + .../signalflow/node/stochastic/pink-noise.h | 4 + .../node/stochastic/random-brownian.h | 5 + .../node/stochastic/random-choice.h | 5 + .../signalflow/node/stochastic/random-coin.h | 5 + .../node/stochastic/random-exponential-dist.h | 5 + .../node/stochastic/random-exponential.h | 5 + .../node/stochastic/random-gaussian.h | 5 + .../node/stochastic/random-impulse-sequence.h | 6 + .../node/stochastic/random-impulse.h | 5 + .../node/stochastic/random-uniform.h | 5 + .../signalflow/node/stochastic/white-noise.h | 7 + source/src/python/buffer.cpp | 8 +- source/src/python/config.cpp | 2 +- source/src/python/graph.cpp | 2 +- source/src/python/node.cpp | 2 +- source/src/python/nodes.cpp | 244 +++++------ source/src/python/patch.cpp | 2 +- 90 files changed, 885 insertions(+), 137 deletions(-) diff --git a/auxiliary/libs/signalflow-stubs/signalflow.pyi b/auxiliary/libs/signalflow-stubs/signalflow.pyi index dbfe8f9d..18a32b31 100644 --- a/auxiliary/libs/signalflow-stubs/signalflow.pyi +++ b/auxiliary/libs/signalflow-stubs/signalflow.pyi @@ -11,24 +11,45 @@ import numpy import typing __all__ = ['ADSREnvelope', 'ASREnvelope', 'Abs', 'Add', 'AllpassDelay', 'AmplitudeToDecibels', 'AudioGraph', 'AudioGraphConfig', 'AudioIOException', 'AudioIn', 'AudioOut', 'AudioOut_Abstract', 'AudioOut_Dummy', 'AzimuthPanner', 'BeatCutter', 'BiquadFilter', 'Buffer', 'Buffer2D', 'BufferLooper', 'BufferPlayer', 'BufferRecorder', 'CPUUsageAboveLimitException', 'ChannelArray', 'ChannelCrossfade', 'ChannelMixer', 'ChannelPanner', 'ChannelSelect', 'Clip', 'ClockDivider', 'CombDelay', 'Compressor', 'Constant', 'Cos', 'Counter', 'CrossCorrelate', 'DecibelsToAmplitude', 'DetectSilence', 'DeviceNotFoundException', 'Divide', 'EQ', 'Envelope', 'EnvelopeBuffer', 'Equal', 'Euclidean', 'FFT', 'FFTContinuousPhaseVocoder', 'FFTConvolve', 'FFTFindPeaks', 'FFTLPF', 'FFTPhaseVocoder', 'FFTTonality', 'FeedbackBufferReader', 'FeedbackBufferWriter', 'FlipFlop', 'Fold', 'FrequencyToMidiNote', 'Gate', 'Granulator', 'GraphAlreadyCreatedException', 'GraphNotCreatedException', 'GreaterThan', 'GreaterThanOrEqual', 'IFFT', 'If', 'Impulse', 'ImpulseSequence', 'Index', 'InvalidChannelCountException', 'LFO', 'Latch', 'LessThan', 'LessThanOrEqual', 'Line', 'Logistic', 'Maximiser', 'MidiNoteToFrequency', 'Modulo', 'MoogVCF', 'MouseDown', 'MouseX', 'MouseY', 'Multiply', 'Node', 'NodeAlreadyPlayingException', 'NodeNotPlayingException', 'NodeRegistry', 'NotEqual', 'OneTapDelay', 'OnsetDetector', 'Patch', 'PatchFinishedPlaybackException', 'PatchRegistry', 'PatchSpec', 'PinkNoise', 'Pow', 'RMS', 'RandomBrownian', 'RandomChoice', 'RandomCoin', 'RandomExponential', 'RandomExponentialDist', 'RandomGaussian', 'RandomImpulse', 'RandomImpulseSequence', 'RandomUniform', 'RectangularEnvelope', 'Resample', 'Round', 'RoundToScale', 'SIGNALFLOW_DEFAULT_BLOCK_SIZE', 'SIGNALFLOW_DEFAULT_FFT_HOP_SIZE', 'SIGNALFLOW_DEFAULT_FFT_SIZE', 'SIGNALFLOW_DEFAULT_SAMPLE_RATE', 'SIGNALFLOW_DEFAULT_TRIGGER', 'SIGNALFLOW_EVENT_DISTRIBUTION_POISSON', 'SIGNALFLOW_EVENT_DISTRIBUTION_UNIFORM', 'SIGNALFLOW_FILTER_TYPE_BAND_PASS', 'SIGNALFLOW_FILTER_TYPE_HIGH_PASS', 'SIGNALFLOW_FILTER_TYPE_HIGH_SHELF', 'SIGNALFLOW_FILTER_TYPE_LOW_PASS', 'SIGNALFLOW_FILTER_TYPE_LOW_SHELF', 'SIGNALFLOW_FILTER_TYPE_NOTCH', 'SIGNALFLOW_FILTER_TYPE_PEAK', 'SIGNALFLOW_INTERPOLATION_COSINE', 'SIGNALFLOW_INTERPOLATION_LINEAR', 'SIGNALFLOW_INTERPOLATION_NONE', 'SIGNALFLOW_MAX_CHANNELS', 'SIGNALFLOW_MAX_FFT_SIZE', 'SIGNALFLOW_NODE_BUFFER_SIZE', 'SIGNALFLOW_NODE_STATE_ACTIVE', 'SIGNALFLOW_NODE_STATE_STOPPED', 'SIGNALFLOW_PATCH_STATE_ACTIVE', 'SIGNALFLOW_PATCH_STATE_STOPPED', 'SVFilter', 'SampleAndHold', 'SawLFO', 'SawOscillator', 'ScaleLinExp', 'ScaleLinLin', 'SegmentPlayer', 'Sequence', 'Sin', 'SineLFO', 'SineOscillator', 'Smooth', 'SpatialEnvironment', 'SpatialPanner', 'SpatialSpeaker', 'SquareLFO', 'SquareOscillator', 'Squiz', 'StereoBalance', 'StereoPanner', 'StereoWidth', 'StochasticNode', 'Stutter', 'Subtract', 'Sum', 'Tan', 'Tanh', 'TriangleLFO', 'TriangleOscillator', 'WaveShaper', 'WaveShaperBuffer', 'Wavetable', 'Wavetable2D', 'WetDry', 'WhiteNoise', 'Wrap', 'amplitude_to_db', 'clip', 'db_to_amplitude', 'fold', 'frequency_to_midi_note', 'midi_note_to_frequency', 'random_exponential', 'random_seed', 'random_uniform', 'save_block_to_text_file', 'save_block_to_wav_file', 'scale_exp_lin', 'scale_lin_exp', 'scale_lin_lin', 'signalflow_event_distribution_t', 'signalflow_filter_type_t', 'signalflow_interpolation_mode_t', 'signalflow_node_state_t', 'signalflow_patch_state_t', 'wrap'] class ADSREnvelope(Node): + """ + Attack-decay-sustain-release envelope. Sustain portion is held until gate is zero. + """ def __init__(self, attack: Node = 0.1, decay: Node = 0.1, sustain: Node = 0.5, release: Node = 0.1, gate: Node = 0) -> None: ... class ASREnvelope(Node): + """ + Attack-sustain-release envelope. + """ def __init__(self, attack: Node = 0.1, sustain: Node = 0.5, release: Node = 0.1, curve: Node = 1.0, clock: Node = None) -> None: ... class Abs(Node): + """ + Abs + """ def __init__(self, a: Node = 0) -> None: ... class Add(Node): + """ + Add + """ def __init__(self, a: Node = 0, b: Node = 0) -> None: ... class AllpassDelay(Node): + """ + All-pass delay, with feedback between 0 and 1. delay_time must be less than or equal to max_delay_time. + """ def __init__(self, input: Node = 0.0, delay_time: Node = 0.1, feedback: Node = 0.5, max_delay_time: float = 0.5) -> None: ... class AmplitudeToDecibels(Node): + """ + AmplitudeToDecibels + """ def __init__(self, a: Node = 0) -> None: ... class AudioGraph: + """ + The global audio signal processing graph + """ output: Node def __init__(self, config: AudioGraphConfig = None, output_device: Node = None, start: bool = True) -> None: ... @@ -204,6 +225,9 @@ class AudioGraph: int: Get a text representation of the AudioGraph's node connectivity structure. """ class AudioGraphConfig: + """ + Configuration options for the AudioGraph + """ cpu_usage_limit: float input_buffer_size: int input_device_name: str @@ -220,23 +244,43 @@ class AudioGraphConfig: class AudioIOException(Exception): pass class AudioIn(Node): + """ + AudioIn + """ def __init__(self) -> None: ... class AudioOut(AudioOut_Abstract): + """ + AudioOut + """ def __init__(self, backend_name: str = '', device_name: str = '', sample_rate: int = 0, buffer_size: int = 0) -> None: ... class AudioOut_Abstract(Node): - pass + """ + AudioOut_Abstract + """ class AudioOut_Dummy(AudioOut_Abstract): + """ + AudioOut_Dummy + """ def __init__(self, num_channels: int = 2, buffer_size: int = 256) -> None: ... class AzimuthPanner(Node): + """ + Pan input around an equally-spaced ring of num_channels speakers. pan is the pan position from -1..+1, where 0 = centre front. width is the source's width, where 1.0 spans exactly between an adjacent pair of channels. + """ def __init__(self, num_channels: int = 2, input: Node = 0, pan: Node = 0.0, width: Node = 1.0) -> None: ... class BeatCutter(Node): + """ + Cuts a buffer into segment_count segments, and stutters/jumps with the given probabilities. + """ def __init__(self, buffer: ... = None, segment_count: int = 8, stutter_probability: Node = 0.0, stutter_count: Node = 1, jump_probability: Node = 0.0, duty_cycle: Node = 1.0, rate: Node = 1.0, segment_rate: Node = 1.0) -> None: ... class BiquadFilter(Node): + """ + Biquad filter. filter_type can be 'low_pass', 'band_pass', 'high_pass', 'notch', 'peak', 'low_shelf', 'high_shelf'. Not recommended for real-time modulation; for this, use SVFilter. + """ @typing.overload def __init__(self, input: Node = 0.0, filter_type: signalflow_filter_type_t = ..., cutoff: Node = 440, resonance: Node = 0.0, peak_gain: Node = 0.0) -> None: ... @@ -245,7 +289,7 @@ class BiquadFilter(Node): ... class Buffer: """ - A buffer of audio samples + A buffer of audio samples, containing one or more channels. """ @staticmethod @typing.overload @@ -345,22 +389,37 @@ class Buffer: Returns the buffer's sample rate. """ class Buffer2D(Buffer): + """ + Two-dimensional buffer of audio samples + """ def __init__(self, arg0: list[typing_extensions.Buffer]) -> None: ... def get2D(self, arg0: float, arg1: float) -> float: ... class BufferLooper(Node): + """ + Read and write from a buffer concurrently, with controllable overdub. + """ def __init__(self, buffer: ... = None, input: Node = 0.0, feedback: Node = 0.0, loop_playback: bool = False, loop_record: bool = False) -> None: ... class BufferPlayer(Node): + """ + 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. + """ def __init__(self, buffer: ... = None, rate: Node = 1.0, loop: Node = 0, start_time: Node = None, end_time: Node = None, clock: Node = None) -> None: ... class BufferRecorder(Node): + """ + Records the input to a buffer. feedback controls overdub. + """ def __init__(self, buffer: ... = None, input: Node = 0.0, feedback: Node = 0.0, loop: bool = False) -> None: ... class CPUUsageAboveLimitException(Exception): pass class ChannelArray(Node): + """ + Takes an array of inputs and spreads them across multiple channels of output. + """ @typing.overload def __init__(self) -> None: ... @@ -377,59 +436,113 @@ class ChannelArray(Node): def __init__(self, inputs: list[float]) -> None: ... class ChannelCrossfade(Node): + """ + Given a multichannel input, crossfades between channels based on the given position within the virtual array, producing a single-channel output. + """ def __init__(self, input: Node = None, index: Node = None, num_output_channels: int = 1) -> None: ... class ChannelMixer(Node): + """ + Downmix a multichannel input to a lower-channel output. If num_channels is greater than one, spreads the input channels across the field. If amplitude_compensation is enabled, scale down the amplitude based on the ratio of input to output channels. + """ def __init__(self, num_channels: int = 1, input: Node = 0, amplitude_compensation: bool = True) -> None: ... class ChannelPanner(Node): + """ + Pan the input between a linear series of channels, where pan 0 = channel 0, 1 = channel 1, etc. No wrapping is applied. + """ def __init__(self, num_channels: int = 2, input: Node = 0, pan: Node = 0.0, width: Node = 1.0) -> None: ... class ChannelSelect(Node): + """ + Select a subset of channels from a multichannel input, starting at offset, up to a maximum of maximum, with the given step. + """ def __init__(self, input: Node = None, offset: int = 0, maximum: int = 0, step: int = 1) -> None: ... class Clip(Node): + """ + Clip the input to min/max. + """ def __init__(self, input: Node = None, min: Node = -1.0, max: Node = 1.0) -> None: ... class ClockDivider(Node): + """ + When given a clock input (e.g., an Impulse), divides the clock by the given factor. factor must be an integer greater than or equal to 1. + """ def __init__(self, clock: Node = 0, factor: Node = 1) -> None: ... class CombDelay(Node): + """ + Comb delay, with feedback between 0 and 1. delay_time must be less than or equal to max_delay_time. + """ def __init__(self, input: Node = 0.0, delay_time: Node = 0.1, feedback: Node = 0.5, max_delay_time: float = 0.5) -> None: ... class Compressor(Node): + """ + Dynamic range compression, with optional sidechain input. + """ def __init__(self, input: Node = 0.0, threshold: Node = 0.1, ratio: Node = 2, attack_time: Node = 0.01, release_time: Node = 0.1, sidechain: Node = None) -> None: ... class Constant(Node): + """ + Produces a constant value. + """ def __init__(self, value: float = 0) -> None: ... class Cos(Node): + """ + Cos + """ def __init__(self, a: Node = 0) -> None: ... class Counter(Node): + """ + Count upwards from min, driven by clock. + """ def __init__(self, clock: Node = 0, min: Node = 0, max: Node = 2147483647) -> None: ... class CrossCorrelate(Node): + """ + CrossCorrelate + """ def __init__(self, input: Node = None, buffer: ... = None, hop_size: int = 0) -> None: ... class DecibelsToAmplitude(Node): + """ + DecibelsToAmplitude + """ def __init__(self, a: Node = 0) -> None: ... class DetectSilence(Node): + """ + Detects blocks of silence below the threshold value. Used as an auto-free node to terminate a Patch after processing is complete. + """ def __init__(self, input: Node = None, threshold: Node = 1e-05) -> None: ... class DeviceNotFoundException(Exception): pass class Divide(Node): + """ + Divide + """ def __init__(self, a: Node = 1, b: Node = 1) -> None: ... class EQ(Node): + """ + Three-band EQ. + """ def __init__(self, input: Node = 0.0, low_gain: Node = 1.0, mid_gain: Node = 1.0, high_gain: Node = 1.0, low_freq: Node = 500, high_freq: Node = 5000) -> None: ... class Envelope(Node): + """ + Generic envelope constructor, given an array of levels, times and curves. + """ def __init__(self, levels: list[Node] = [], times: list[Node] = [], curves: list[Node] = [], clock: Node = None, loop: bool = False) -> None: ... class EnvelopeBuffer(Buffer): + """ + Buffer encapsulating an audio envelope + """ @typing.overload def __init__(self, arg0: int) -> None: ... @@ -440,51 +553,99 @@ class EnvelopeBuffer(Buffer): def __init__(self, arg0: str, arg1: int) -> None: ... class Equal(Node): + """ + Equal + """ def __init__(self, a: Node = 0, b: Node = 0) -> None: ... class Euclidean(Node): + """ + Euclidean rhythm as described by Toussaint, with sequence_length (n) and num_events (k), driven by clock. + """ def __init__(self, clock: Node = 0, sequence_length: Node = 0, num_events: Node = 0) -> None: ... class FFT(Node): + """ + FFT + """ def __init__(self, input: Node = 0.0, fft_size: int = 1024, hop_size: int = 128, window_size: int = 0, do_window: bool = True) -> None: ... class FFTContinuousPhaseVocoder(Node): + """ + FFTContinuousPhaseVocoder + """ def __init__(self, input: Node = None, rate: float = 1.0) -> None: ... class FFTConvolve(Node): + """ + FFTConvolve + """ def __init__(self, input: Node = None, buffer: ... = None) -> None: ... class FFTFindPeaks(Node): + """ + FFTFindPeaks + """ def __init__(self, input: Node = 0, prominence: Node = 1, threshold: Node = 1e-06, count: int = 64, interpolate: bool = True) -> None: ... class FFTLPF(Node): + """ + FFTLPF + """ def __init__(self, input: Node = 0, frequency: Node = 2000) -> None: ... class FFTPhaseVocoder(Node): + """ + FFTPhaseVocoder + """ def __init__(self, input: Node = None) -> None: ... class FFTTonality(Node): + """ + FFTTonality + """ def __init__(self, input: Node = 0, level: Node = 0.5, smoothing: Node = 0.9) -> None: ... class FeedbackBufferReader(Node): + """ + Counterpart to FeedbackBufferWriter. + """ def __init__(self, buffer: ... = None) -> None: ... class FeedbackBufferWriter(Node): + """ + Counterpart to FeedbackBufferReader. + """ def __init__(self, buffer: ... = None, input: Node = 0.0, delay_time: Node = 0.1) -> None: ... class FlipFlop(Node): + """ + Flips from 0/1 on each clock. + """ def __init__(self, clock: Node = 0) -> None: ... class Fold(Node): + """ + Fold the input beyond min/max, reflecting the excess back. + """ def __init__(self, input: Node = None, min: Node = -1.0, max: Node = 1.0) -> None: ... class FrequencyToMidiNote(Node): + """ + Map a frequency to a MIDI note (where 440Hz = A4 = 69), with floating-point output. + """ def __init__(self, a: Node = 0) -> None: ... class Gate(Node): + """ + Outputs the input value when it is above the given threshold, otherwise zero. + """ def __init__(self, input: Node = 0.0, threshold: Node = 0.1) -> None: ... class Granulator(Node): + """ + 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. + """ def __init__(self, buffer: ... = None, clock: Node = 0, pos: Node = 0, duration: Node = 0.1, pan: Node = 0.0, rate: Node = 1.0, max_grains: Node = 2048) -> None: ... class GraphAlreadyCreatedException(Exception): @@ -492,21 +653,39 @@ class GraphAlreadyCreatedException(Exception): class GraphNotCreatedException(Exception): pass class GreaterThan(Node): + """ + GreaterThan + """ def __init__(self, a: Node = 0, b: Node = 0) -> None: ... class GreaterThanOrEqual(Node): + """ + GreaterThanOrEqual + """ def __init__(self, a: Node = 0, b: Node = 0) -> None: ... class IFFT(Node): + """ + IFFT + """ def __init__(self, input: Node = None, do_window: bool = False) -> None: ... class If(Node): + """ + If + """ def __init__(self, a: Node = 0, value_if_true: Node = 0, value_if_false: Node = 0) -> None: ... class Impulse(Node): + """ + 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. + """ def __init__(self, frequency: Node = 1.0) -> None: ... class ImpulseSequence(Node): + """ + Each time a clock or trigger is received, outputs the next value in the sequence. At all other times, outputs zero. + """ @typing.overload def __init__(self, sequence: list[int] = [], clock: Node = None) -> None: ... @@ -514,53 +693,101 @@ class ImpulseSequence(Node): def __init__(self, sequence: str, clock: Node = None) -> None: ... class Index(Node): + """ + Outputs the value in list corresponding to index. + """ def __init__(self, list: list[float] = 0, index: Node = 0) -> None: ... class InvalidChannelCountException(Exception): pass class LFO(Node): + """ + LFO + """ def __init__(self, frequency: Node = 1.0, min: Node = 0.0, max: Node = 1.0, phase: Node = 0.0) -> None: ... class Latch(Node): + """ + 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. + """ def __init__(self, set: Node = 0, reset: Node = 0) -> None: ... class LessThan(Node): + """ + LessThan + """ def __init__(self, a: Node = 0, b: Node = 0) -> None: ... class LessThanOrEqual(Node): + """ + LessThanOrEqual + """ def __init__(self, a: Node = 0, b: Node = 0) -> None: ... class Line(Node): + """ + Line segment with the given start/end values and duration. If loop is true, repeats indefinitely. Retriggers on a clock signal. + """ def __init__(self, from: Node = 0.0, to: Node = 1.0, time: Node = 1.0, loop: Node = 0, clock: Node = None) -> None: ... class Logistic(Node): + """ + Logistic noise. + """ def __init__(self, chaos: Node = 3.7, frequency: Node = 0.0) -> None: ... class Maximiser(Node): + """ + Gain maximiser. + """ def __init__(self, input: Node = 0.0, ceiling: Node = 0.5, attack_time: Node = 1.0, release_time: Node = 1.0) -> None: ... class MidiNoteToFrequency(Node): + """ + Map a MIDI note to a frequency (where 440Hz = A4 = 69), supporting floating-point input. + """ def __init__(self, a: Node = 0) -> None: ... class Modulo(Node): + """ + Modulo + """ def __init__(self, a: Node = 0, b: Node = 0) -> None: ... class MoogVCF(Node): + """ + Moog ladder low-pass filter. + """ def __init__(self, input: Node = 0.0, cutoff: Node = 200.0, resonance: Node = 0.0) -> None: ... class MouseDown(Node): + """ + Outputs 1 if the left mouse button is down, 0 otherwise. + """ def __init__(self, button_index: Node = 0) -> None: ... class MouseX(Node): + """ + Outputs the normalised cursor X position, from 0 to 1. + """ def __init__(self) -> None: ... class MouseY(Node): + """ + Outputs the normalised cursor Y position, from 0 to 1. + """ def __init__(self) -> None: ... class Multiply(Node): + """ + Multiply + """ def __init__(self, a: Node = 1.0, b: Node = 1.0) -> None: ... class Node: + """ + A single signal-processing unit in the DSP graph, a node generates audio samples, optionally acting on zero or more input nodes. + """ @typing.overload def __add__(self, other: Node) -> Node: """ @@ -868,15 +1095,27 @@ class NodeRegistry: def create(self, arg0: str) -> Node: ... class NotEqual(Node): + """ + NotEqual + """ def __init__(self, a: Node = 0, b: Node = 0) -> None: ... class OneTapDelay(Node): + """ + Single-tap delay line. delay_time must be less than or equal to max_delay_time. + """ def __init__(self, input: Node = 0.0, delay_time: Node = 0.1, max_delay_time: float = 0.5) -> None: ... class OnsetDetector(Node): + """ + OnsetDetector + """ def __init__(self, input: Node = 0.0, threshold: Node = 2.0, min_interval: Node = 0.1) -> None: ... class Patch: + """ + A Patch encapsulates a connected network of nodes, analogous to a synthesizer + """ auto_free: bool auto_free_node: Node output: Node @@ -1019,33 +1258,63 @@ class PatchSpec: def name(self) -> str: ... class PinkNoise(StochasticNode): + """ + Pink noise, with specified low/high cutoffs. + """ def __init__(self, low_cutoff: float = 20.0, high_cutoff: float = 20000.0, reset: Node = None) -> None: ... class Pow(Node): + """ + Pow + """ def __init__(self, a: Node = 0, b: Node = 0) -> None: ... class RMS(Node): + """ + Outputs the root-mean-squared value of the input, in buffers equal to the graph's current buffer size. + """ def __init__(self, input: Node = 0.0) -> None: ... class RandomBrownian(StochasticNode): + """ + Outputs Brownian noise between min/max, with a mean change of delta between samples. If a clock is passed, only generates a new value on a clock tick. + """ def __init__(self, min: Node = -1.0, max: Node = 1.0, delta: Node = 0.01, clock: Node = None, reset: Node = None) -> None: ... class RandomChoice(StochasticNode): + """ + Pick a random value from the given array. If a clock is passed, only picks a new value on a clock tick. + """ def __init__(self, values: list[float] = [], clock: Node = None, reset: Node = None) -> None: ... class RandomCoin(StochasticNode): + """ + Flip a coin with the given probability. If a clock is passed, only picks a new value on a clock tick. + """ def __init__(self, probability: Node = 0.5, clock: Node = None, reset: Node = None) -> None: ... class RandomExponential(StochasticNode): + """ + Generate an random exponential value between min/max. If a clock is passed, only picks a new value on a clock tick. + """ def __init__(self, min: Node = 0.001, max: Node = 1.0, clock: Node = None, reset: Node = None) -> None: ... class RandomExponentialDist(StochasticNode): + """ + Generate an random value following the exponential distribution. If a clock is passed, only picks a new value on a clock tick. + """ def __init__(self, scale: Node = 0.0, clock: Node = None, reset: Node = None) -> None: ... class RandomGaussian(StochasticNode): + """ + Generate an random Gaussian value, with given mean and sigma. If a clock is passed, only picks a new value on a clock tick. + """ def __init__(self, mean: Node = 0.0, sigma: Node = 0.0, clock: Node = None, reset: Node = None) -> None: ... class RandomImpulse(StochasticNode): + """ + Generate random impulses at the given frequency, with either uniform or poisson distribution. + """ @typing.overload def __init__(self, frequency: Node = 1.0, distribution: signalflow_event_distribution_t = ..., reset: Node = None) -> None: ... @@ -1053,24 +1322,45 @@ class RandomImpulse(StochasticNode): def __init__(self, frequency: Node, distribution: str, reset: Node = None) -> None: ... class RandomImpulseSequence(StochasticNode): + """ + Generates a random sequence of 0/1 bits with the given length, and the given probability each each bit = 1. The position of the sequence is incremented on each clock signal. explore and generate are trigger inputs which cause the sequence to mutate and re-generate respectively. + """ def __init__(self, probability: Node = 0.5, length: Node = 8, clock: Node = None, explore: Node = None, generate: Node = None, reset: Node = None) -> None: ... class RandomUniform(StochasticNode): + """ + Generates a uniformly random value between min/max. If a clock is passed, only picks a new value on a clock tick. + """ def __init__(self, min: Node = 0.0, max: Node = 1.0, clock: Node = None, reset: Node = None) -> None: ... class RectangularEnvelope(Node): + """ + Rectangular envelope with the given sustain duration. + """ def __init__(self, sustain_duration: Node = 1.0, clock: Node = None) -> None: ... class Resample(Node): + """ + Resampler and bit crusher. sample_rate is in Hz, bit_rate is an integer between 0 and 16. + """ def __init__(self, input: Node = 0, sample_rate: Node = 44100, bit_rate: Node = 16) -> None: ... class Round(Node): + """ + Round the input to the nearest integer value. + """ def __init__(self, a: Node = 0) -> None: ... class RoundToScale(Node): + """ + Given a frequency input, generates a frequency output that is rounded to the nearest MIDI note. (TODO: Not very well named) + """ def __init__(self, a: Node = 0) -> None: ... class SVFilter(Node): + """ + State variable filter. filter_type can be 'low_pass', 'band_pass', 'high_pass', 'notch', 'peak', 'low_shelf', 'high_shelf'. + """ @typing.overload def __init__(self, input: Node = 0.0, filter_type: signalflow_filter_type_t = ..., cutoff: Node = 440, resonance: Node = 0.0) -> None: ... @@ -1078,36 +1368,69 @@ class SVFilter(Node): def __init__(self, input: Node, filter_type: str, cutoff: Node = 440, resonance: Node = 0.0) -> None: ... class SampleAndHold(Node): + """ + Samples and holds the input each time a clock signal is received. + """ def __init__(self, input: Node = None, clock: Node = None) -> None: ... class SawLFO(Node): + """ + Produces a sawtooth LFO, with output ranging from min to max. + """ def __init__(self, frequency: Node = 1.0, min: Node = 0.0, max: Node = 1.0, phase: Node = 0.0) -> None: ... class SawOscillator(Node): + """ + 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. + """ def __init__(self, frequency: Node = 440, phase: Node = None, reset: Node = None) -> None: ... class ScaleLinExp(Node): + """ + Scales the input from a linear range (between a and b) to an exponential range (between c and d). + """ def __init__(self, input: Node = 0, a: Node = 0, b: Node = 1, c: Node = 1, d: Node = 10) -> None: ... class ScaleLinLin(Node): + """ + Scales the input from a linear range (between a and b) to a linear range (between c and d). + """ def __init__(self, input: Node = 0, a: Node = 0, b: Node = 1, c: Node = 1, d: Node = 10) -> None: ... class SegmentPlayer(Node): + """ + Trigger segments of a buffer at the given onset positions. + """ def __init__(self, buffer: ... = None, onsets: list[float] = 0) -> None: ... class Sequence(Node): + """ + Outputs the elements in sequence, incrementing position on each clock. + """ def __init__(self, sequence: list[float] = [], clock: Node = None) -> None: ... class Sin(Node): + """ + Sin + """ def __init__(self, a: Node = 0) -> None: ... class SineLFO(Node): + """ + Produces a sinusoidal LFO at the given frequency and phase offset, with output ranging from min to max. + """ def __init__(self, frequency: Node = 1.0, min: Node = 0.0, max: Node = 1.0, phase: Node = 0.0) -> None: ... class SineOscillator(Node): + """ + Produces a sine wave at the given frequency. + """ def __init__(self, frequency: Node = 440) -> None: ... class Smooth(Node): + """ + Smooth the input with a given smoothing coefficient. When smooth = 0, applies no smoothing. + """ def __init__(self, input: Node = None, smooth: Node = 0.99) -> None: ... class SpatialEnvironment: @@ -1120,38 +1443,68 @@ class SpatialEnvironment: def add_speaker(self, arg0: int, arg1: float, arg2: float, arg3: float) -> None: ... class SpatialPanner(Node): + """ + Implements a spatial panning algorithm, applied to a given SpatialEnvironment. Currently, only DBAP is supported. + """ def __init__(self, env: SpatialEnvironment = None, input: Node = 0.0, x: Node = 0.0, y: Node = 0.0, z: Node = 0.0, radius: Node = 1.0, algorithm: str = 'dbap') -> None: ... class SpatialSpeaker: pass class SquareLFO(Node): + """ + Produces a pulse wave LFO with the given frequency and pulse width, ranging from min to max, where width=0.5 is a square wave. + """ def __init__(self, frequency: Node = 1.0, min: Node = 0.0, max: Node = 1.0, width: Node = 0.5, phase: Node = 0.0) -> None: ... class SquareOscillator(Node): + """ + Produces a pulse wave with the given frequency and pulse width, where width=0.5 is a square wave. + """ def __init__(self, frequency: Node = 440, width: Node = 0.5) -> None: ... class Squiz(Node): + """ + Implementation of Dan Stowell's Squiz algorithm, a kind of downsampler. + """ def __init__(self, input: Node = 0.0, rate: Node = 2.0, chunk_size: Node = 1) -> None: ... class StereoBalance(Node): + """ + Takes a stereo input and rebalances it, where 0 is unchanged, -1 is hard left, and 1 is hard right. + """ def __init__(self, input: Node = 0, balance: Node = 0) -> None: ... class StereoPanner(Node): + """ + Pans a mono input to a stereo output. Pans from -1 (hard left) to +1 (hard right), with 0 = centre. + """ def __init__(self, input: Node = 0, pan: Node = 0.0) -> None: ... class StereoWidth(Node): + """ + Reduces the width of a stereo signal. When width = 1, input is unchanged. When width = 0, outputs a pair of identical channels both containing L+R. + """ def __init__(self, input: Node = 0, width: Node = 1) -> None: ... class StochasticNode(Node): def set_seed(self, arg0: int) -> None: ... class Stutter(Node): + """ + Stutters the input whenever a signal is received on clock. Generates stutter_count repeats, with duration stutter_time. + """ def __init__(self, input: Node = 0.0, stutter_time: Node = 0.1, stutter_count: Node = 1, clock: Node = None, max_stutter_time: float = 1.0) -> None: ... class Subtract(Node): + """ + Subtract + """ def __init__(self, a: Node = 0, b: Node = 0) -> None: ... class Sum(Node): + """ + Sum + """ @typing.overload def __init__(self) -> None: ... @@ -1168,36 +1521,69 @@ class Sum(Node): def __init__(self, inputs: list[float]) -> None: ... class Tan(Node): + """ + Tan + """ def __init__(self, a: Node = 0) -> None: ... class Tanh(Node): + """ + Tanh + """ def __init__(self, a: Node = 0) -> None: ... class TriangleLFO(Node): + """ + Produces a triangle LFO with the given frequency, ranging from min to max. + """ def __init__(self, frequency: Node = 1.0, min: Node = 0.0, max: Node = 1.0, phase: Node = 0.0) -> None: ... class TriangleOscillator(Node): + """ + TriangleOscillator + """ def __init__(self, frequency: Node = 440) -> None: ... class WaveShaper(Node): + """ + Applies wave-shaping as described in buffer. + """ def __init__(self, input: Node = 0.0, buffer: ... = None) -> None: ... class WaveShaperBuffer(Buffer): + """ + Sample buffer for waveshaper nodes + """ def __init__(self, arg0: int) -> None: ... class Wavetable(Node): + """ + Plays the wavetable stored in buffer at the given frequency. + """ def __init__(self, buffer: ... = None, frequency: Node = 440, phase: Node = 0, sync: Node = 0, phase_map: ... = None) -> None: ... class Wavetable2D(Node): + """ + Wavetable2D + """ def __init__(self, buffer: ... = None, frequency: Node = 440, crossfade: Node = 0.0, phase: Node = 0.0, sync: Node = 0) -> None: ... class WetDry(Node): + """ + Takes wet and dry inputs, and outputs a mix determined by wetness. + """ def __init__(self, dry_input: Node = None, wet_input: Node = None, wetness: Node = 0.0) -> None: ... class WhiteNoise(StochasticNode): + """ + Generates whitenoise between min/max. If frequency is zero, generates at audio rate. For frequencies lower than audio rate, interpolate applies linear interpolation between values, and random_interval specifies whether new random values should be equally-spaced or randomly-spaced. + """ def __init__(self, frequency: Node = 0.0, min: Node = -1.0, max: Node = 1.0, interpolate: bool = True, random_interval: bool = True, reset: Node = None) -> None: ... class Wrap(Node): + """ + Wrap the input beyond min/max. + """ def __init__(self, input: Node = None, min: Node = -1.0, max: Node = 1.0) -> None: ... class signalflow_event_distribution_t: diff --git a/auxiliary/scripts/generate-node-python-bindings.py b/auxiliary/scripts/generate-node-python-bindings.py index 90a0b2d7..dc1a7048 100755 --- a/auxiliary/scripts/generate-node-python-bindings.py +++ b/auxiliary/scripts/generate-node-python-bindings.py @@ -40,7 +40,7 @@ source_files = list(sorted(source_files, key=lambda path: (os.path.dirname(path), path))) -def generate_class_bindings(class_name, parameter_sets, superclass="Node"): +def generate_class_bindings(class_name, parameter_sets, superclass="Node", class_docs=None): """ py::class_>(m, "Sine") .def(py::init(), "frequency"_a = NodeRef(440.0)) @@ -50,9 +50,11 @@ def generate_class_bindings(class_name, parameter_sets, superclass="Node"): """ if class_name in omitted_classes: return "" + if class_docs is None: + class_docs = class_name - output = 'py::class_<{class_name}, {superclass}, NodeRefTemplate<{class_name}>>(m, "{class_name}")\n'.format( - class_name=class_name, superclass=superclass) + output = 'py::class_<{class_name}, {superclass}, NodeRefTemplate<{class_name}>>(m, "{class_name}", "{class_docs}")\n'.format( + class_name=class_name, class_docs=class_docs, superclass=superclass) for parameter_set in parameter_sets: parameter_type_list = ", ".join([parameter["type"] for parameter in parameter_set]) output += ' .def(py::init<{parameter_type_list}>()'.format(parameter_type_list=parameter_type_list); @@ -117,6 +119,22 @@ def generate_all_bindings(): else: continue + + def extract_docs(doxygen): + lines = doxygen.split("\n") + output = "" + for line in lines: + # start or end of comment + if re.search(r"^\s*/\*", line) or re.search("\*/\s*$", line): + continue + line = re.sub("^\s*\*\s*", "", line) + output = output + line + " " + return output.strip() + + class_docs = class_name + if "doxygen" in value: + class_docs = extract_docs(value["doxygen"]) + constructor_parameter_sets = [] for method in value["methods"]["public"]: if method["constructor"]: @@ -143,7 +161,7 @@ def generate_all_bindings(): known_parent_classes = ["Node", "StochasticNode"] if parent_class not in known_parent_classes: parent_class = "Node" - output += generate_class_bindings(class_name, constructor_parameter_sets, parent_class) + output += generate_class_bindings(class_name, constructor_parameter_sets, parent_class, class_docs=class_docs) output = output.strip() output += "\n\n" if class_name in macos_only_classes: diff --git a/source/include/signalflow/node/buffer/beat-cutter.h b/source/include/signalflow/node/buffer/beat-cutter.h index fed1074c..5fa168d4 100644 --- a/source/include/signalflow/node/buffer/beat-cutter.h +++ b/source/include/signalflow/node/buffer/beat-cutter.h @@ -4,6 +4,11 @@ namespace signalflow { + +/**--------------------------------------------------------------------------------* + * Cuts a buffer into segment_count segments, and stutters/jumps with + * the given probabilities. + *---------------------------------------------------------------------------------*/ class BeatCutter : public Node { public: diff --git a/source/include/signalflow/node/buffer/buffer-looper.h b/source/include/signalflow/node/buffer/buffer-looper.h index d83b2dd3..c5ad3a0f 100644 --- a/source/include/signalflow/node/buffer/buffer-looper.h +++ b/source/include/signalflow/node/buffer/buffer-looper.h @@ -4,6 +4,10 @@ namespace signalflow { + +/**--------------------------------------------------------------------------------* + * Read and write from a buffer concurrently, with controllable overdub. + *---------------------------------------------------------------------------------*/ class BufferLooper : public Node { public: diff --git a/source/include/signalflow/node/buffer/buffer-player.h b/source/include/signalflow/node/buffer/buffer-player.h index d4e831a7..51ac9e94 100644 --- a/source/include/signalflow/node/buffer/buffer-player.h +++ b/source/include/signalflow/node/buffer/buffer-player.h @@ -4,6 +4,11 @@ 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. + *---------------------------------------------------------------------------------*/ class BufferPlayer : public Node { public: diff --git a/source/include/signalflow/node/buffer/buffer-recorder.h b/source/include/signalflow/node/buffer/buffer-recorder.h index b9f72425..d77627f7 100644 --- a/source/include/signalflow/node/buffer/buffer-recorder.h +++ b/source/include/signalflow/node/buffer/buffer-recorder.h @@ -4,6 +4,10 @@ namespace signalflow { + +/**--------------------------------------------------------------------------------* + * Records the input to a buffer. feedback controls overdub. + *---------------------------------------------------------------------------------*/ class BufferRecorder : public Node { public: diff --git a/source/include/signalflow/node/buffer/feedback-buffer-reader.h b/source/include/signalflow/node/buffer/feedback-buffer-reader.h index 9b1c9af9..9c57b62c 100644 --- a/source/include/signalflow/node/buffer/feedback-buffer-reader.h +++ b/source/include/signalflow/node/buffer/feedback-buffer-reader.h @@ -4,6 +4,10 @@ namespace signalflow { + +/**--------------------------------------------------------------------------------* + * Counterpart to FeedbackBufferWriter. + *---------------------------------------------------------------------------------*/ class FeedbackBufferReader : public Node { public: diff --git a/source/include/signalflow/node/buffer/feedback-buffer-writer.h b/source/include/signalflow/node/buffer/feedback-buffer-writer.h index 6464c3a8..df3ddf91 100644 --- a/source/include/signalflow/node/buffer/feedback-buffer-writer.h +++ b/source/include/signalflow/node/buffer/feedback-buffer-writer.h @@ -4,6 +4,10 @@ namespace signalflow { + +/**--------------------------------------------------------------------------------* + * Counterpart to FeedbackBufferReader. + *---------------------------------------------------------------------------------*/ class FeedbackBufferWriter : public Node { public: diff --git a/source/include/signalflow/node/buffer/granulator.h b/source/include/signalflow/node/buffer/granulator.h index 7aaafd42..904ee18e 100644 --- a/source/include/signalflow/node/buffer/granulator.h +++ b/source/include/signalflow/node/buffer/granulator.h @@ -22,6 +22,11 @@ class Grain float pan; }; +/**--------------------------------------------------------------------------------* + * 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. + *---------------------------------------------------------------------------------*/ class Granulator : public Node { public: diff --git a/source/include/signalflow/node/buffer/segment-player.h b/source/include/signalflow/node/buffer/segment-player.h index 42020145..00884435 100644 --- a/source/include/signalflow/node/buffer/segment-player.h +++ b/source/include/signalflow/node/buffer/segment-player.h @@ -4,6 +4,10 @@ namespace signalflow { + +/**--------------------------------------------------------------------------------* + * Trigger segments of a buffer at the given onset positions. + *---------------------------------------------------------------------------------*/ class SegmentPlayer : public Node { public: diff --git a/source/include/signalflow/node/control/mouse.h b/source/include/signalflow/node/control/mouse.h index 355ccc50..4c251a3e 100644 --- a/source/include/signalflow/node/control/mouse.h +++ b/source/include/signalflow/node/control/mouse.h @@ -6,6 +6,10 @@ namespace signalflow { + +/**--------------------------------------------------------------------------------* + * Outputs the normalised cursor X position, from 0 to 1. + *---------------------------------------------------------------------------------*/ class MouseX : public Node { public: @@ -13,6 +17,9 @@ class MouseX : public Node virtual void process(Buffer &out, int num_frames); }; +/**--------------------------------------------------------------------------------* + * Outputs the normalised cursor Y position, from 0 to 1. + *---------------------------------------------------------------------------------*/ class MouseY : public Node { public: @@ -20,6 +27,9 @@ class MouseY : public Node virtual void process(Buffer &out, int num_frames); }; +/**--------------------------------------------------------------------------------* + * Outputs 1 if the left mouse button is down, 0 otherwise. + *---------------------------------------------------------------------------------*/ class MouseDown : public Node { public: diff --git a/source/include/signalflow/node/envelope/adsr.h b/source/include/signalflow/node/envelope/adsr.h index 1003ec46..0d8ca12c 100644 --- a/source/include/signalflow/node/envelope/adsr.h +++ b/source/include/signalflow/node/envelope/adsr.h @@ -6,6 +6,10 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Attack-decay-sustain-release envelope. + * Sustain portion is held until gate is zero. + *---------------------------------------------------------------------------------*/ class ADSREnvelope : public Node { public: diff --git a/source/include/signalflow/node/envelope/asr.h b/source/include/signalflow/node/envelope/asr.h index 37c00184..46791f20 100644 --- a/source/include/signalflow/node/envelope/asr.h +++ b/source/include/signalflow/node/envelope/asr.h @@ -6,6 +6,9 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Attack-sustain-release envelope. + *---------------------------------------------------------------------------------*/ class ASREnvelope : public Node { public: diff --git a/source/include/signalflow/node/envelope/detect-silence.h b/source/include/signalflow/node/envelope/detect-silence.h index c3fb5a6b..e9e8dcf1 100644 --- a/source/include/signalflow/node/envelope/detect-silence.h +++ b/source/include/signalflow/node/envelope/detect-silence.h @@ -6,6 +6,10 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Detects blocks of silence below the threshold value. Used as an auto-free + * node to terminate a Patch after processing is complete. + *---------------------------------------------------------------------------------*/ class DetectSilence : public UnaryOpNode { public: diff --git a/source/include/signalflow/node/envelope/envelope.h b/source/include/signalflow/node/envelope/envelope.h index 443f6064..d5ccbb09 100644 --- a/source/include/signalflow/node/envelope/envelope.h +++ b/source/include/signalflow/node/envelope/envelope.h @@ -6,6 +6,9 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Generic envelope constructor, given an array of levels, times and curves. + *---------------------------------------------------------------------------------*/ class Envelope : public Node { public: diff --git a/source/include/signalflow/node/envelope/line.h b/source/include/signalflow/node/envelope/line.h index 3ae1e3e2..c55f98fa 100644 --- a/source/include/signalflow/node/envelope/line.h +++ b/source/include/signalflow/node/envelope/line.h @@ -4,6 +4,12 @@ namespace signalflow { + +/**--------------------------------------------------------------------------------* + * Line segment with the given start/end values and duration. + * If loop is true, repeats indefinitely. + * Retriggers on a clock signal. + *---------------------------------------------------------------------------------*/ class Line : public Node { public: diff --git a/source/include/signalflow/node/envelope/rect.h b/source/include/signalflow/node/envelope/rect.h index 119c2218..aea6b078 100644 --- a/source/include/signalflow/node/envelope/rect.h +++ b/source/include/signalflow/node/envelope/rect.h @@ -6,6 +6,9 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Rectangular envelope with the given sustain duration. + *---------------------------------------------------------------------------------*/ class RectangularEnvelope : public Node { public: diff --git a/source/include/signalflow/node/operators/channel-array.h b/source/include/signalflow/node/operators/channel-array.h index b2941561..87733b16 100644 --- a/source/include/signalflow/node/operators/channel-array.h +++ b/source/include/signalflow/node/operators/channel-array.h @@ -8,6 +8,9 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Takes an array of inputs and spreads them across multiple channels of output. + *---------------------------------------------------------------------------------*/ class ChannelArray : public Node { diff --git a/source/include/signalflow/node/operators/channel-crossfade.h b/source/include/signalflow/node/operators/channel-crossfade.h index 9e8cca44..27bb6227 100644 --- a/source/include/signalflow/node/operators/channel-crossfade.h +++ b/source/include/signalflow/node/operators/channel-crossfade.h @@ -8,6 +8,10 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Given a multichannel input, crossfades between channels based on the given + * position within the virtual array, producing a single-channel output. + *---------------------------------------------------------------------------------*/ class ChannelCrossfade : public UnaryOpNode { diff --git a/source/include/signalflow/node/operators/channel-mixer.h b/source/include/signalflow/node/operators/channel-mixer.h index 6bac3495..f0071c5e 100644 --- a/source/include/signalflow/node/operators/channel-mixer.h +++ b/source/include/signalflow/node/operators/channel-mixer.h @@ -8,6 +8,12 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Downmix a multichannel input to a lower-channel output. If num_channels is + * greater than one, spreads the input channels across the field. + * If amplitude_compensation is enabled, scale down the amplitude based on the + * ratio of input to output channels. + *---------------------------------------------------------------------------------*/ class ChannelMixer : public UnaryOpNode { diff --git a/source/include/signalflow/node/operators/channel-select.h b/source/include/signalflow/node/operators/channel-select.h index a8861da4..3d7cfba5 100644 --- a/source/include/signalflow/node/operators/channel-select.h +++ b/source/include/signalflow/node/operators/channel-select.h @@ -8,6 +8,10 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Select a subset of channels from a multichannel input, starting at offset, + * up to a maximum of maximum, with the given step. + *---------------------------------------------------------------------------------*/ class ChannelSelect : public UnaryOpNode { diff --git a/source/include/signalflow/node/operators/frequency-to-midi-note.h b/source/include/signalflow/node/operators/frequency-to-midi-note.h index aa9976a1..292a2a25 100644 --- a/source/include/signalflow/node/operators/frequency-to-midi-note.h +++ b/source/include/signalflow/node/operators/frequency-to-midi-note.h @@ -6,6 +6,10 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Map a frequency to a MIDI note (where 440Hz = A4 = 69), with floating-point + * output. + *---------------------------------------------------------------------------------*/ class FrequencyToMidiNote : public UnaryOpNode { diff --git a/source/include/signalflow/node/operators/midi-note-to-frequency.h b/source/include/signalflow/node/operators/midi-note-to-frequency.h index cc2cf6b9..cc8d4189 100644 --- a/source/include/signalflow/node/operators/midi-note-to-frequency.h +++ b/source/include/signalflow/node/operators/midi-note-to-frequency.h @@ -6,6 +6,10 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Map a MIDI note to a frequency (where 440Hz = A4 = 69), supporting floating-point + * input. + *---------------------------------------------------------------------------------*/ class MidiNoteToFrequency : public UnaryOpNode { diff --git a/source/include/signalflow/node/operators/round-to-scale.h b/source/include/signalflow/node/operators/round-to-scale.h index 2e397626..7e8cc272 100644 --- a/source/include/signalflow/node/operators/round-to-scale.h +++ b/source/include/signalflow/node/operators/round-to-scale.h @@ -6,6 +6,10 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Given a frequency input, generates a frequency output that is rounded to the nearest MIDI note. + * (TODO: Not very well named) + *---------------------------------------------------------------------------------*/ class RoundToScale : public UnaryOpNode { diff --git a/source/include/signalflow/node/operators/round.h b/source/include/signalflow/node/operators/round.h index 9a2277c6..fe4766b0 100644 --- a/source/include/signalflow/node/operators/round.h +++ b/source/include/signalflow/node/operators/round.h @@ -6,6 +6,9 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Round the input to the nearest integer value. + *---------------------------------------------------------------------------------*/ class Round : public UnaryOpNode { diff --git a/source/include/signalflow/node/operators/scale.h b/source/include/signalflow/node/operators/scale.h index 7f7a4a45..3042f87b 100644 --- a/source/include/signalflow/node/operators/scale.h +++ b/source/include/signalflow/node/operators/scale.h @@ -6,6 +6,10 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Scales the input from a linear range (between a and b) + * to an exponential range (between c and d). + *---------------------------------------------------------------------------------*/ class ScaleLinExp : public UnaryOpNode { @@ -17,6 +21,10 @@ class ScaleLinExp : public UnaryOpNode NodeRef a, b, c, d; }; +/**--------------------------------------------------------------------------------* + * Scales the input from a linear range (between a and b) + * to a linear range (between c and d). + *---------------------------------------------------------------------------------*/ class ScaleLinLin : public UnaryOpNode { diff --git a/source/include/signalflow/node/oscillators/constant.h b/source/include/signalflow/node/oscillators/constant.h index 26fab044..f497a087 100644 --- a/source/include/signalflow/node/oscillators/constant.h +++ b/source/include/signalflow/node/oscillators/constant.h @@ -4,6 +4,9 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Produces a constant value. + *---------------------------------------------------------------------------------*/ class Constant : public Node { public: diff --git a/source/include/signalflow/node/oscillators/impulse.h b/source/include/signalflow/node/oscillators/impulse.h index 77e2dfdb..a95d9d5a 100644 --- a/source/include/signalflow/node/oscillators/impulse.h +++ b/source/include/signalflow/node/oscillators/impulse.h @@ -5,6 +5,10 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * 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. + *---------------------------------------------------------------------------------*/ class Impulse : public Node { public: diff --git a/source/include/signalflow/node/oscillators/saw-lfo.h b/source/include/signalflow/node/oscillators/saw-lfo.h index 68163c9c..cdfefbeb 100644 --- a/source/include/signalflow/node/oscillators/saw-lfo.h +++ b/source/include/signalflow/node/oscillators/saw-lfo.h @@ -4,6 +4,9 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Produces a sawtooth LFO, with output ranging from min to max. + *---------------------------------------------------------------------------------*/ class SawLFO : public LFO { public: diff --git a/source/include/signalflow/node/oscillators/saw.h b/source/include/signalflow/node/oscillators/saw.h index 28453aba..8b644434 100644 --- a/source/include/signalflow/node/oscillators/saw.h +++ b/source/include/signalflow/node/oscillators/saw.h @@ -4,6 +4,10 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * 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. + *---------------------------------------------------------------------------------*/ class SawOscillator : public Node { public: diff --git a/source/include/signalflow/node/oscillators/sine-lfo.h b/source/include/signalflow/node/oscillators/sine-lfo.h index 4742f55e..da9e9407 100644 --- a/source/include/signalflow/node/oscillators/sine-lfo.h +++ b/source/include/signalflow/node/oscillators/sine-lfo.h @@ -4,6 +4,10 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Produces a sinusoidal LFO at the given frequency and phase offset, + * with output ranging from min to max. + *---------------------------------------------------------------------------------*/ class SineLFO : public LFO { public: diff --git a/source/include/signalflow/node/oscillators/sine.h b/source/include/signalflow/node/oscillators/sine.h index 8894cdfe..8c09fba5 100644 --- a/source/include/signalflow/node/oscillators/sine.h +++ b/source/include/signalflow/node/oscillators/sine.h @@ -4,6 +4,9 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Produces a sine wave at the given frequency. + *---------------------------------------------------------------------------------*/ class SineOscillator : public Node { public: diff --git a/source/include/signalflow/node/oscillators/square-lfo.h b/source/include/signalflow/node/oscillators/square-lfo.h index 4dd38fb5..db36bab1 100644 --- a/source/include/signalflow/node/oscillators/square-lfo.h +++ b/source/include/signalflow/node/oscillators/square-lfo.h @@ -4,6 +4,10 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Produces a pulse wave LFO with the given frequency and pulse width, ranging from + * min to max, where width=0.5 is a square wave. + *---------------------------------------------------------------------------------*/ class SquareLFO : public LFO { public: diff --git a/source/include/signalflow/node/oscillators/square.h b/source/include/signalflow/node/oscillators/square.h index 06f5c891..e5959d3e 100644 --- a/source/include/signalflow/node/oscillators/square.h +++ b/source/include/signalflow/node/oscillators/square.h @@ -4,6 +4,10 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Produces a pulse wave with the given frequency and pulse width, where width=0.5 is + * a square wave. + *---------------------------------------------------------------------------------*/ class SquareOscillator : public Node { public: diff --git a/source/include/signalflow/node/oscillators/triangle-lfo.h b/source/include/signalflow/node/oscillators/triangle-lfo.h index cee86ee5..7fcbb6bc 100644 --- a/source/include/signalflow/node/oscillators/triangle-lfo.h +++ b/source/include/signalflow/node/oscillators/triangle-lfo.h @@ -4,6 +4,9 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Produces a triangle LFO with the given frequency, ranging from min to max. + *---------------------------------------------------------------------------------*/ class TriangleLFO : public LFO { public: diff --git a/source/include/signalflow/node/oscillators/triangle.h b/source/include/signalflow/node/oscillators/triangle.h index 46eb294a..2e376867 100644 --- a/source/include/signalflow/node/oscillators/triangle.h +++ b/source/include/signalflow/node/oscillators/triangle.h @@ -4,6 +4,10 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Produces a triangle wave with the given frequency. + *---------------------------------------------------------------------------------*/ + class TriangleOscillator : public Node { public: diff --git a/source/include/signalflow/node/oscillators/wavetable.h b/source/include/signalflow/node/oscillators/wavetable.h index 828fd26a..d210b9a5 100644 --- a/source/include/signalflow/node/oscillators/wavetable.h +++ b/source/include/signalflow/node/oscillators/wavetable.h @@ -6,6 +6,9 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Plays the wavetable stored in buffer at the given frequency. + *---------------------------------------------------------------------------------*/ class Wavetable : public Node { public: diff --git a/source/include/signalflow/node/processors/clip.h b/source/include/signalflow/node/processors/clip.h index 1b39f541..2c982a56 100644 --- a/source/include/signalflow/node/processors/clip.h +++ b/source/include/signalflow/node/processors/clip.h @@ -5,6 +5,9 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Clip the input to min/max. + *---------------------------------------------------------------------------------*/ class Clip : public UnaryOpNode { public: diff --git a/source/include/signalflow/node/processors/delays/allpass.h b/source/include/signalflow/node/processors/delays/allpass.h index b58fda6f..8592af4e 100644 --- a/source/include/signalflow/node/processors/delays/allpass.h +++ b/source/include/signalflow/node/processors/delays/allpass.h @@ -9,6 +9,10 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * All-pass delay, with feedback between 0 and 1. + * delay_time must be less than or equal to max_delay_time. + *---------------------------------------------------------------------------------*/ class AllpassDelay : public UnaryOpNode { public: diff --git a/source/include/signalflow/node/processors/delays/comb.h b/source/include/signalflow/node/processors/delays/comb.h index 7f647746..b69c5667 100644 --- a/source/include/signalflow/node/processors/delays/comb.h +++ b/source/include/signalflow/node/processors/delays/comb.h @@ -9,6 +9,10 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Comb delay, with feedback between 0 and 1. + * delay_time must be less than or equal to max_delay_time. + *---------------------------------------------------------------------------------*/ class CombDelay : public UnaryOpNode { public: diff --git a/source/include/signalflow/node/processors/delays/onetap.h b/source/include/signalflow/node/processors/delays/onetap.h index 96a5572b..dc6cab3e 100644 --- a/source/include/signalflow/node/processors/delays/onetap.h +++ b/source/include/signalflow/node/processors/delays/onetap.h @@ -8,6 +8,10 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Single-tap delay line. + * delay_time must be less than or equal to max_delay_time. + *---------------------------------------------------------------------------------*/ class OneTapDelay : public UnaryOpNode { public: diff --git a/source/include/signalflow/node/processors/delays/stutter.h b/source/include/signalflow/node/processors/delays/stutter.h index 60860404..7279a078 100644 --- a/source/include/signalflow/node/processors/delays/stutter.h +++ b/source/include/signalflow/node/processors/delays/stutter.h @@ -8,6 +8,10 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Stutters the input whenever a signal is received on clock. + * Generates stutter_count repeats, with duration stutter_time. + *---------------------------------------------------------------------------------*/ class Stutter : public UnaryOpNode { public: diff --git a/source/include/signalflow/node/processors/distortion/resample.h b/source/include/signalflow/node/processors/distortion/resample.h index 6bdd9cb7..f2f5a7da 100644 --- a/source/include/signalflow/node/processors/distortion/resample.h +++ b/source/include/signalflow/node/processors/distortion/resample.h @@ -5,6 +5,10 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Resampler and bit crusher. sample_rate is in Hz, bit_rate is an integer + * between 0 and 16. + *---------------------------------------------------------------------------------*/ class Resample : public UnaryOpNode { public: diff --git a/source/include/signalflow/node/processors/distortion/sample-and-hold.h b/source/include/signalflow/node/processors/distortion/sample-and-hold.h index f5f756e0..9b3da07a 100644 --- a/source/include/signalflow/node/processors/distortion/sample-and-hold.h +++ b/source/include/signalflow/node/processors/distortion/sample-and-hold.h @@ -5,6 +5,9 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Samples and holds the input each time a clock signal is received. + *---------------------------------------------------------------------------------*/ class SampleAndHold : public UnaryOpNode { public: diff --git a/source/include/signalflow/node/processors/distortion/squiz.h b/source/include/signalflow/node/processors/distortion/squiz.h index 9ed751af..87f6c1d2 100644 --- a/source/include/signalflow/node/processors/distortion/squiz.h +++ b/source/include/signalflow/node/processors/distortion/squiz.h @@ -7,6 +7,9 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Implementation of Dan Stowell's Squiz algorithm, a kind of downsampler. + *---------------------------------------------------------------------------------*/ class Squiz : public UnaryOpNode { public: diff --git a/source/include/signalflow/node/processors/distortion/waveshaper.h b/source/include/signalflow/node/processors/distortion/waveshaper.h index 85df7839..f19f6d1b 100644 --- a/source/include/signalflow/node/processors/distortion/waveshaper.h +++ b/source/include/signalflow/node/processors/distortion/waveshaper.h @@ -5,6 +5,9 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Applies wave-shaping as described in buffer. + *---------------------------------------------------------------------------------*/ class WaveShaper : public UnaryOpNode { public: diff --git a/source/include/signalflow/node/processors/dynamics/compressor.h b/source/include/signalflow/node/processors/dynamics/compressor.h index a10bb960..72bf1188 100644 --- a/source/include/signalflow/node/processors/dynamics/compressor.h +++ b/source/include/signalflow/node/processors/dynamics/compressor.h @@ -5,6 +5,9 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Dynamic range compression, with optional sidechain input. + *---------------------------------------------------------------------------------*/ class Compressor : public UnaryOpNode { public: diff --git a/source/include/signalflow/node/processors/dynamics/gate.h b/source/include/signalflow/node/processors/dynamics/gate.h index 1d3872fd..daceec0a 100644 --- a/source/include/signalflow/node/processors/dynamics/gate.h +++ b/source/include/signalflow/node/processors/dynamics/gate.h @@ -5,6 +5,9 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Outputs the input value when it is above the given threshold, otherwise zero. + *---------------------------------------------------------------------------------*/ class Gate : public UnaryOpNode { public: diff --git a/source/include/signalflow/node/processors/dynamics/maximiser.h b/source/include/signalflow/node/processors/dynamics/maximiser.h index 1a1b00eb..74fb7a95 100644 --- a/source/include/signalflow/node/processors/dynamics/maximiser.h +++ b/source/include/signalflow/node/processors/dynamics/maximiser.h @@ -5,6 +5,9 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Gain maximiser. + *---------------------------------------------------------------------------------*/ class Maximiser : public UnaryOpNode { public: diff --git a/source/include/signalflow/node/processors/dynamics/rms.h b/source/include/signalflow/node/processors/dynamics/rms.h index 14f041d9..4f154367 100644 --- a/source/include/signalflow/node/processors/dynamics/rms.h +++ b/source/include/signalflow/node/processors/dynamics/rms.h @@ -5,6 +5,10 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Outputs the root-mean-squared value of the input, in buffers equal to the + * graph's current buffer size. + *---------------------------------------------------------------------------------*/ class RMS : public UnaryOpNode { public: diff --git a/source/include/signalflow/node/processors/filters/biquad.h b/source/include/signalflow/node/processors/filters/biquad.h index 650154dc..acffb82a 100644 --- a/source/include/signalflow/node/processors/filters/biquad.h +++ b/source/include/signalflow/node/processors/filters/biquad.h @@ -5,6 +5,12 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Biquad filter. + * filter_type can be 'low_pass', 'band_pass', 'high_pass', 'notch', 'peak', + * 'low_shelf', 'high_shelf'. + * Not recommended for real-time modulation; for this, use SVFilter. + *---------------------------------------------------------------------------------*/ class BiquadFilter : public UnaryOpNode { public: diff --git a/source/include/signalflow/node/processors/filters/eq.h b/source/include/signalflow/node/processors/filters/eq.h index 2c928b37..2a738c75 100644 --- a/source/include/signalflow/node/processors/filters/eq.h +++ b/source/include/signalflow/node/processors/filters/eq.h @@ -5,6 +5,9 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Three-band EQ. + *---------------------------------------------------------------------------------*/ class EQ : public UnaryOpNode { public: diff --git a/source/include/signalflow/node/processors/filters/moog.h b/source/include/signalflow/node/processors/filters/moog.h index a4275b1f..14d34404 100644 --- a/source/include/signalflow/node/processors/filters/moog.h +++ b/source/include/signalflow/node/processors/filters/moog.h @@ -5,6 +5,9 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Moog ladder low-pass filter. + *---------------------------------------------------------------------------------*/ class MoogVCF : public UnaryOpNode { public: diff --git a/source/include/signalflow/node/processors/filters/svf.h b/source/include/signalflow/node/processors/filters/svf.h index 6caf9fe5..52f4dfae 100644 --- a/source/include/signalflow/node/processors/filters/svf.h +++ b/source/include/signalflow/node/processors/filters/svf.h @@ -5,6 +5,11 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * State variable filter. + * filter_type can be 'low_pass', 'band_pass', 'high_pass', 'notch', 'peak', + * 'low_shelf', 'high_shelf'. + *---------------------------------------------------------------------------------*/ class SVFilter : public UnaryOpNode { public: diff --git a/source/include/signalflow/node/processors/fold.h b/source/include/signalflow/node/processors/fold.h index bbd56d50..6617436f 100644 --- a/source/include/signalflow/node/processors/fold.h +++ b/source/include/signalflow/node/processors/fold.h @@ -5,6 +5,9 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Fold the input beyond min/max, reflecting the excess back. + *---------------------------------------------------------------------------------*/ class Fold : public UnaryOpNode { public: diff --git a/source/include/signalflow/node/processors/panning/azimuth-panner.h b/source/include/signalflow/node/processors/panning/azimuth-panner.h index 3f74c6b3..0d610810 100644 --- a/source/include/signalflow/node/processors/panning/azimuth-panner.h +++ b/source/include/signalflow/node/processors/panning/azimuth-panner.h @@ -4,6 +4,11 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Pan input around an equally-spaced ring of num_channels speakers. + * pan is the pan position from -1..+1, where 0 = centre front. + * width is the source's width, where 1.0 spans exactly between an adjacent pair of channels. + *---------------------------------------------------------------------------------*/ class AzimuthPanner : public Node { public: diff --git a/source/include/signalflow/node/processors/panning/channel-panner.h b/source/include/signalflow/node/processors/panning/channel-panner.h index a2ad89ef..60063d09 100644 --- a/source/include/signalflow/node/processors/panning/channel-panner.h +++ b/source/include/signalflow/node/processors/panning/channel-panner.h @@ -4,6 +4,10 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Pan the input between a linear series of channels, where pan 0 = channel 0, + * 1 = channel 1, etc. No wrapping is applied. + *---------------------------------------------------------------------------------*/ class ChannelPanner : public Node { public: diff --git a/source/include/signalflow/node/processors/panning/spatial-environment.h b/source/include/signalflow/node/processors/panning/spatial-environment.h index 6f7c5892..2e70c236 100644 --- a/source/include/signalflow/node/processors/panning/spatial-environment.h +++ b/source/include/signalflow/node/processors/panning/spatial-environment.h @@ -6,6 +6,9 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Represents a speaker in a SpatialEnvironment. + *---------------------------------------------------------------------------------*/ class SpatialSpeaker { public: @@ -17,6 +20,10 @@ class SpatialSpeaker float z; }; +/**--------------------------------------------------------------------------------* + * Encapsulates a 3D environment containing speakers and sound sources, used + * in a SpatialPanner. + *---------------------------------------------------------------------------------*/ class SpatialEnvironment { public: @@ -30,6 +37,10 @@ class SpatialEnvironment std::vector> channels; }; +/**--------------------------------------------------------------------------------* + * Implements a spatial panning algorithm, applied to a given SpatialEnvironment. + * Currently, only DBAP is supported. + *---------------------------------------------------------------------------------*/ class SpatialPanner : public Node { public: diff --git a/source/include/signalflow/node/processors/panning/stereo-balance.h b/source/include/signalflow/node/processors/panning/stereo-balance.h index 29fd4eea..979bd838 100644 --- a/source/include/signalflow/node/processors/panning/stereo-balance.h +++ b/source/include/signalflow/node/processors/panning/stereo-balance.h @@ -4,6 +4,10 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Takes a stereo input and rebalances it, where 0 is unchanged, -1 is hard left, + * and 1 is hard right. + *---------------------------------------------------------------------------------*/ class StereoBalance : public UnaryOpNode { public: diff --git a/source/include/signalflow/node/processors/panning/stereo-panner.h b/source/include/signalflow/node/processors/panning/stereo-panner.h index 943315f6..b00d8e70 100644 --- a/source/include/signalflow/node/processors/panning/stereo-panner.h +++ b/source/include/signalflow/node/processors/panning/stereo-panner.h @@ -4,6 +4,10 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Pans a mono input to a stereo output. Pans from -1 (hard left) to +1 (hard right), + * with 0 = centre. + *---------------------------------------------------------------------------------*/ class StereoPanner : public Node { public: diff --git a/source/include/signalflow/node/processors/panning/stereo-width.h b/source/include/signalflow/node/processors/panning/stereo-width.h index a466ec28..2c415ea5 100644 --- a/source/include/signalflow/node/processors/panning/stereo-width.h +++ b/source/include/signalflow/node/processors/panning/stereo-width.h @@ -4,6 +4,11 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Reduces the width of a stereo signal. + * When width = 1, input is unchanged. + * When width = 0, outputs a pair of identical channels both containing L+R. + *---------------------------------------------------------------------------------*/ class StereoWidth : public UnaryOpNode { public: diff --git a/source/include/signalflow/node/processors/smooth.h b/source/include/signalflow/node/processors/smooth.h index 0d341944..4e57b1f7 100644 --- a/source/include/signalflow/node/processors/smooth.h +++ b/source/include/signalflow/node/processors/smooth.h @@ -6,6 +6,10 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Smooth the input with a given smoothing coefficient. + * When smooth = 0, applies no smoothing. + *---------------------------------------------------------------------------------*/ class Smooth : public UnaryOpNode { public: diff --git a/source/include/signalflow/node/processors/wetdry.h b/source/include/signalflow/node/processors/wetdry.h index 2a085734..897abb65 100644 --- a/source/include/signalflow/node/processors/wetdry.h +++ b/source/include/signalflow/node/processors/wetdry.h @@ -5,6 +5,9 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Takes wet and dry inputs, and outputs a mix determined by wetness. + *---------------------------------------------------------------------------------*/ class WetDry : public Node { public: diff --git a/source/include/signalflow/node/processors/wrap.h b/source/include/signalflow/node/processors/wrap.h index 0872c30a..d5dca1a7 100644 --- a/source/include/signalflow/node/processors/wrap.h +++ b/source/include/signalflow/node/processors/wrap.h @@ -5,6 +5,9 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Wrap the input beyond min/max. + *---------------------------------------------------------------------------------*/ class Wrap : public UnaryOpNode { public: diff --git a/source/include/signalflow/node/sequencing/clock-divider.h b/source/include/signalflow/node/sequencing/clock-divider.h index da7d94e4..0b658a46 100644 --- a/source/include/signalflow/node/sequencing/clock-divider.h +++ b/source/include/signalflow/node/sequencing/clock-divider.h @@ -3,7 +3,10 @@ namespace signalflow { - +/**--------------------------------------------------------------------------------* + * When given a clock input (e.g., an Impulse), divides the clock by the given + * factor. factor must be an integer greater than or equal to 1. + *---------------------------------------------------------------------------------*/ class ClockDivider : public Node { diff --git a/source/include/signalflow/node/sequencing/counter.h b/source/include/signalflow/node/sequencing/counter.h index 12caff7f..cc253d3a 100644 --- a/source/include/signalflow/node/sequencing/counter.h +++ b/source/include/signalflow/node/sequencing/counter.h @@ -4,6 +4,9 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Count upwards from min, driven by clock. + *---------------------------------------------------------------------------------*/ class Counter : public Node { diff --git a/source/include/signalflow/node/sequencing/euclidean.h b/source/include/signalflow/node/sequencing/euclidean.h index 67dbe898..3b9e7804 100644 --- a/source/include/signalflow/node/sequencing/euclidean.h +++ b/source/include/signalflow/node/sequencing/euclidean.h @@ -4,6 +4,10 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Euclidean rhythm as described by Toussaint, with sequence_length (n) + * and num_events (k), driven by clock. + *---------------------------------------------------------------------------------*/ class Euclidean : public Node { diff --git a/source/include/signalflow/node/sequencing/flipflop.h b/source/include/signalflow/node/sequencing/flipflop.h index 613954f5..31307b82 100644 --- a/source/include/signalflow/node/sequencing/flipflop.h +++ b/source/include/signalflow/node/sequencing/flipflop.h @@ -4,6 +4,9 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Flips from 0/1 on each clock. + *---------------------------------------------------------------------------------*/ class FlipFlop : public Node { diff --git a/source/include/signalflow/node/sequencing/impulse-sequence.h b/source/include/signalflow/node/sequencing/impulse-sequence.h index 7ea3a2db..dfaa0d56 100644 --- a/source/include/signalflow/node/sequencing/impulse-sequence.h +++ b/source/include/signalflow/node/sequencing/impulse-sequence.h @@ -4,6 +4,10 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Each time a clock or trigger is received, outputs the next value in the sequence. + * At all other times, outputs zero. + *---------------------------------------------------------------------------------*/ class ImpulseSequence : public Node { diff --git a/source/include/signalflow/node/sequencing/index.h b/source/include/signalflow/node/sequencing/index.h index 87070130..b2371afe 100644 --- a/source/include/signalflow/node/sequencing/index.h +++ b/source/include/signalflow/node/sequencing/index.h @@ -4,6 +4,9 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Outputs the value in list corresponding to index. + *---------------------------------------------------------------------------------*/ class Index : public Node { diff --git a/source/include/signalflow/node/sequencing/latch.h b/source/include/signalflow/node/sequencing/latch.h index 6e2214ea..b1f3efb9 100644 --- a/source/include/signalflow/node/sequencing/latch.h +++ b/source/include/signalflow/node/sequencing/latch.h @@ -4,6 +4,11 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * 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. + *---------------------------------------------------------------------------------*/ class Latch : public Node { diff --git a/source/include/signalflow/node/sequencing/sequence.h b/source/include/signalflow/node/sequencing/sequence.h index 02b12dce..83692cb9 100644 --- a/source/include/signalflow/node/sequencing/sequence.h +++ b/source/include/signalflow/node/sequencing/sequence.h @@ -4,6 +4,9 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Outputs the elements in sequence, incrementing position on each clock. + *---------------------------------------------------------------------------------*/ class Sequence : public Node { diff --git a/source/include/signalflow/node/stochastic/logistic.h b/source/include/signalflow/node/stochastic/logistic.h index 362a0c22..a81edb46 100644 --- a/source/include/signalflow/node/stochastic/logistic.h +++ b/source/include/signalflow/node/stochastic/logistic.h @@ -4,6 +4,10 @@ namespace signalflow { + +/**--------------------------------------------------------------------------------* + * Logistic noise. + *---------------------------------------------------------------------------------*/ class Logistic : public Node { public: diff --git a/source/include/signalflow/node/stochastic/pink-noise.h b/source/include/signalflow/node/stochastic/pink-noise.h index a0b5eefd..b7fe4b88 100644 --- a/source/include/signalflow/node/stochastic/pink-noise.h +++ b/source/include/signalflow/node/stochastic/pink-noise.h @@ -4,6 +4,10 @@ namespace signalflow { + +/**--------------------------------------------------------------------------------* + * Pink noise, with specified low/high cutoffs. + *---------------------------------------------------------------------------------*/ class PinkNoise : public StochasticNode { public: diff --git a/source/include/signalflow/node/stochastic/random-brownian.h b/source/include/signalflow/node/stochastic/random-brownian.h index f3f14e05..fe466a95 100644 --- a/source/include/signalflow/node/stochastic/random-brownian.h +++ b/source/include/signalflow/node/stochastic/random-brownian.h @@ -4,6 +4,11 @@ namespace signalflow { + +/**--------------------------------------------------------------------------------* + * Outputs Brownian noise between min/max, with a mean change of delta between samples. + * If a clock is passed, only generates a new value on a clock tick. + *---------------------------------------------------------------------------------*/ class RandomBrownian : public StochasticNode { public: diff --git a/source/include/signalflow/node/stochastic/random-choice.h b/source/include/signalflow/node/stochastic/random-choice.h index 3d15a2fd..633ebe62 100644 --- a/source/include/signalflow/node/stochastic/random-choice.h +++ b/source/include/signalflow/node/stochastic/random-choice.h @@ -4,6 +4,11 @@ namespace signalflow { + +/**--------------------------------------------------------------------------------* + * Pick a random value from the given array. + * If a clock is passed, only picks a new value on a clock tick. + *---------------------------------------------------------------------------------*/ class RandomChoice : public StochasticNode { public: diff --git a/source/include/signalflow/node/stochastic/random-coin.h b/source/include/signalflow/node/stochastic/random-coin.h index 353345f5..d0b1977d 100644 --- a/source/include/signalflow/node/stochastic/random-coin.h +++ b/source/include/signalflow/node/stochastic/random-coin.h @@ -4,6 +4,11 @@ namespace signalflow { + +/**--------------------------------------------------------------------------------* + * Flip a coin with the given probability. + * If a clock is passed, only picks a new value on a clock tick. + *---------------------------------------------------------------------------------*/ class RandomCoin : public StochasticNode { public: diff --git a/source/include/signalflow/node/stochastic/random-exponential-dist.h b/source/include/signalflow/node/stochastic/random-exponential-dist.h index bbd98ccb..ca2eb438 100644 --- a/source/include/signalflow/node/stochastic/random-exponential-dist.h +++ b/source/include/signalflow/node/stochastic/random-exponential-dist.h @@ -4,6 +4,11 @@ namespace signalflow { + +/**--------------------------------------------------------------------------------* + * Generate an random value following the exponential distribution. + * If a clock is passed, only picks a new value on a clock tick. + *---------------------------------------------------------------------------------*/ class RandomExponentialDist : public StochasticNode { public: diff --git a/source/include/signalflow/node/stochastic/random-exponential.h b/source/include/signalflow/node/stochastic/random-exponential.h index 22426280..c631bbd6 100644 --- a/source/include/signalflow/node/stochastic/random-exponential.h +++ b/source/include/signalflow/node/stochastic/random-exponential.h @@ -4,6 +4,11 @@ namespace signalflow { + +/**--------------------------------------------------------------------------------* + * Generate an random exponential value between min/max. + * If a clock is passed, only picks a new value on a clock tick. + *---------------------------------------------------------------------------------*/ class RandomExponential : public StochasticNode { public: diff --git a/source/include/signalflow/node/stochastic/random-gaussian.h b/source/include/signalflow/node/stochastic/random-gaussian.h index 7e610cf0..0b563e54 100644 --- a/source/include/signalflow/node/stochastic/random-gaussian.h +++ b/source/include/signalflow/node/stochastic/random-gaussian.h @@ -4,6 +4,11 @@ namespace signalflow { + +/**--------------------------------------------------------------------------------* + * Generate an random Gaussian value, with given mean and sigma. + * If a clock is passed, only picks a new value on a clock tick. + *---------------------------------------------------------------------------------*/ class RandomGaussian : public StochasticNode { public: diff --git a/source/include/signalflow/node/stochastic/random-impulse-sequence.h b/source/include/signalflow/node/stochastic/random-impulse-sequence.h index 5d1f1732..c41854e8 100644 --- a/source/include/signalflow/node/stochastic/random-impulse-sequence.h +++ b/source/include/signalflow/node/stochastic/random-impulse-sequence.h @@ -4,6 +4,12 @@ namespace signalflow { +/**--------------------------------------------------------------------------------* + * Generates a random sequence of 0/1 bits with the given length, and the given + * probability each each bit = 1. The position of the sequence is incremented + * on each clock signal. explore and generate are trigger inputs which cause + * the sequence to mutate and re-generate respectively. + *---------------------------------------------------------------------------------*/ class RandomImpulseSequence : public StochasticNode { diff --git a/source/include/signalflow/node/stochastic/random-impulse.h b/source/include/signalflow/node/stochastic/random-impulse.h index 505b1333..fe90c2cc 100644 --- a/source/include/signalflow/node/stochastic/random-impulse.h +++ b/source/include/signalflow/node/stochastic/random-impulse.h @@ -4,6 +4,11 @@ namespace signalflow { + +/**--------------------------------------------------------------------------------* + * Generate random impulses at the given frequency, with either uniform + * or poisson distribution. + *---------------------------------------------------------------------------------*/ class RandomImpulse : public StochasticNode { public: diff --git a/source/include/signalflow/node/stochastic/random-uniform.h b/source/include/signalflow/node/stochastic/random-uniform.h index 534604bb..3067cdde 100644 --- a/source/include/signalflow/node/stochastic/random-uniform.h +++ b/source/include/signalflow/node/stochastic/random-uniform.h @@ -4,6 +4,11 @@ namespace signalflow { + +/**--------------------------------------------------------------------------------* + * Generates a uniformly random value between min/max. + * If a clock is passed, only picks a new value on a clock tick. + *---------------------------------------------------------------------------------*/ class RandomUniform : public StochasticNode { public: diff --git a/source/include/signalflow/node/stochastic/white-noise.h b/source/include/signalflow/node/stochastic/white-noise.h index ce28b3dd..a72c8948 100644 --- a/source/include/signalflow/node/stochastic/white-noise.h +++ b/source/include/signalflow/node/stochastic/white-noise.h @@ -4,6 +4,13 @@ namespace signalflow { + +/**--------------------------------------------------------------------------------* + * Generates whitenoise between min/max. If frequency is zero, generates at + * audio rate. For frequencies lower than audio rate, interpolate applies linear + * interpolation between values, and random_interval specifies whether new + * random values should be equally-spaced or randomly-spaced. + *---------------------------------------------------------------------------------*/ class WhiteNoise : public StochasticNode { public: diff --git a/source/src/python/buffer.cpp b/source/src/python/buffer.cpp index fc2bb2ed..8cf7e4a9 100644 --- a/source/src/python/buffer.cpp +++ b/source/src/python/buffer.cpp @@ -5,7 +5,7 @@ void init_python_buffer(py::module &m) /*-------------------------------------------------------------------------------- * Buffer *-------------------------------------------------------------------------------*/ - py::class_>(m, "Buffer", "A buffer of audio samples") + py::class_>(m, "Buffer", "A buffer of audio samples, containing one or more channels.") /*-------------------------------------------------------------------------------- * Constructors *-------------------------------------------------------------------------------*/ @@ -109,14 +109,14 @@ void init_python_buffer(py::module &m) .def("load", &Buffer::load, "filename"_a) .def("save", &Buffer::save, "filename"_a); - py::class_>(m, "Buffer2D") + py::class_>(m, "Buffer2D", "Two-dimensional buffer of audio samples") .def(py::init>()) .def("get2D", &Buffer2D::get2D); - py::class_>(m, "WaveShaperBuffer") + py::class_>(m, "WaveShaperBuffer", "Sample buffer for waveshaper nodes") .def(py::init()); - py::class_>(m, "EnvelopeBuffer") + py::class_>(m, "EnvelopeBuffer", "Buffer encapsulating an audio envelope") .def(py::init()) .def(py::init()) .def(py::init()); diff --git a/source/src/python/config.cpp b/source/src/python/config.cpp index ba1c69c3..1dd5197d 100644 --- a/source/src/python/config.cpp +++ b/source/src/python/config.cpp @@ -5,7 +5,7 @@ void init_python_config(py::module &m) /*-------------------------------------------------------------------------------- * Config *-------------------------------------------------------------------------------*/ - py::class_(m, "AudioGraphConfig") + py::class_(m, "AudioGraphConfig", "Configuration options for the AudioGraph") .def(py::init<>()) .def("print", &AudioGraphConfig::print, R"pbdoc(Print the AudioGraphConfig to stdout)pbdoc") .def_property("sample_rate", &AudioGraphConfig::get_sample_rate, &AudioGraphConfig::set_sample_rate) diff --git a/source/src/python/graph.cpp b/source/src/python/graph.cpp index a0f7f511..09e33e80 100644 --- a/source/src/python/graph.cpp +++ b/source/src/python/graph.cpp @@ -5,7 +5,7 @@ void init_python_graph(py::module &m) /*-------------------------------------------------------------------------------- * Graph *-------------------------------------------------------------------------------*/ - py::class_(m, "AudioGraph") + py::class_(m, "AudioGraph", "The global audio signal processing graph") .def(py::init(), "config"_a = nullptr, "output_device"_a = nullptr, "start"_a = true) diff --git a/source/src/python/node.cpp b/source/src/python/node.cpp index 8aff70ba..5eeef90d 100644 --- a/source/src/python/node.cpp +++ b/source/src/python/node.cpp @@ -18,7 +18,7 @@ void init_python_node(py::module &m) /*-------------------------------------------------------------------------------- * Node *-------------------------------------------------------------------------------*/ - py::class_>(m, "Node") + py::class_>(m, "Node", "A single signal-processing unit in the DSP graph, a node generates audio samples, optionally acting on zero or more input nodes.") /*-------------------------------------------------------------------------------- * Critical to enable pybind11 to automatically convert from floats * to Node objects. diff --git a/source/src/python/nodes.cpp b/source/src/python/nodes.cpp index 62e8c52d..d238cae7 100644 --- a/source/src/python/nodes.cpp +++ b/source/src/python/nodes.cpp @@ -5,396 +5,396 @@ void init_python_nodes(py::module &m) /*-------------------------------------------------------------------------------- * Node subclasses *-------------------------------------------------------------------------------*/ - py::class_>(m, "AudioIn") + py::class_>(m, "AudioIn", "AudioIn") .def(py::init<>()); - py::class_>(m, "AudioOut_Abstract"); + py::class_>(m, "AudioOut_Abstract", "AudioOut_Abstract"); - py::class_>(m, "AudioOut_Dummy") + py::class_>(m, "AudioOut_Dummy", "AudioOut_Dummy") .def(py::init(), "num_channels"_a = 2, "buffer_size"_a = SIGNALFLOW_DEFAULT_BLOCK_SIZE); - py::class_>(m, "AudioOut") + py::class_>(m, "AudioOut", "AudioOut") .def(py::init(), "backend_name"_a = "", "device_name"_a = "", "sample_rate"_a = 0, "buffer_size"_a = 0); - py::class_>(m, "CrossCorrelate") + py::class_>(m, "CrossCorrelate", "CrossCorrelate") .def(py::init(), "input"_a = nullptr, "buffer"_a = nullptr, "hop_size"_a = 0); - py::class_>(m, "OnsetDetector") + py::class_>(m, "OnsetDetector", "OnsetDetector") .def(py::init(), "input"_a = 0.0, "threshold"_a = 2.0, "min_interval"_a = 0.1); - py::class_>(m, "BeatCutter") + py::class_>(m, "BeatCutter", "Cuts a buffer into segment_count segments, and stutters/jumps with the given probabilities.") .def(py::init(), "buffer"_a = nullptr, "segment_count"_a = 8, "stutter_probability"_a = 0.0, "stutter_count"_a = 1, "jump_probability"_a = 0.0, "duty_cycle"_a = 1.0, "rate"_a = 1.0, "segment_rate"_a = 1.0); - py::class_>(m, "BufferLooper") + py::class_>(m, "BufferLooper", "Read and write from a buffer concurrently, with controllable overdub.") .def(py::init(), "buffer"_a = nullptr, "input"_a = 0.0, "feedback"_a = 0.0, "loop_playback"_a = false, "loop_record"_a = false); - py::class_>(m, "BufferPlayer") + py::class_>(m, "BufferPlayer", "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.") .def(py::init(), "buffer"_a = nullptr, "rate"_a = 1.0, "loop"_a = 0, "start_time"_a = nullptr, "end_time"_a = nullptr, "clock"_a = nullptr); - py::class_>(m, "BufferRecorder") + py::class_>(m, "BufferRecorder", "Records the input to a buffer. feedback controls overdub.") .def(py::init(), "buffer"_a = nullptr, "input"_a = 0.0, "feedback"_a = 0.0, "loop"_a = false); - py::class_>(m, "FeedbackBufferReader") + py::class_>(m, "FeedbackBufferReader", "Counterpart to FeedbackBufferWriter.") .def(py::init(), "buffer"_a = nullptr); - py::class_>(m, "FeedbackBufferWriter") + py::class_>(m, "FeedbackBufferWriter", "Counterpart to FeedbackBufferReader.") .def(py::init(), "buffer"_a = nullptr, "input"_a = 0.0, "delay_time"_a = 0.1); - py::class_>(m, "Granulator") + py::class_>(m, "Granulator", "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.") .def(py::init(), "buffer"_a = nullptr, "clock"_a = 0, "pos"_a = 0, "duration"_a = 0.1, "pan"_a = 0.0, "rate"_a = 1.0, "max_grains"_a = 2048); - py::class_>(m, "SegmentPlayer") + py::class_>(m, "SegmentPlayer", "Trigger segments of a buffer at the given onset positions.") .def(py::init>(), "buffer"_a = nullptr, "onsets"_a = 0); #ifdef __APPLE__ - py::class_>(m, "MouseX") + py::class_>(m, "MouseX", "Outputs the normalised cursor X position, from 0 to 1.") .def(py::init<>()); #endif #ifdef __APPLE__ - py::class_>(m, "MouseY") + py::class_>(m, "MouseY", "Outputs the normalised cursor Y position, from 0 to 1.") .def(py::init<>()); #endif #ifdef __APPLE__ - py::class_>(m, "MouseDown") + py::class_>(m, "MouseDown", "Outputs 1 if the left mouse button is down, 0 otherwise.") .def(py::init(), "button_index"_a = 0); #endif - py::class_>(m, "ADSREnvelope") + py::class_>(m, "ADSREnvelope", "Attack-decay-sustain-release envelope. Sustain portion is held until gate is zero.") .def(py::init(), "attack"_a = 0.1, "decay"_a = 0.1, "sustain"_a = 0.5, "release"_a = 0.1, "gate"_a = 0); - py::class_>(m, "ASREnvelope") + py::class_>(m, "ASREnvelope", "Attack-sustain-release envelope.") .def(py::init(), "attack"_a = 0.1, "sustain"_a = 0.5, "release"_a = 0.1, "curve"_a = 1.0, "clock"_a = nullptr); - py::class_>(m, "DetectSilence") + py::class_>(m, "DetectSilence", "Detects blocks of silence below the threshold value. Used as an auto-free node to terminate a Patch after processing is complete.") .def(py::init(), "input"_a = nullptr, "threshold"_a = 0.00001); - py::class_>(m, "Envelope") + py::class_>(m, "Envelope", "Generic envelope constructor, given an array of levels, times and curves.") .def(py::init, std::vector, std::vector, NodeRef, bool>(), "levels"_a = std::vector(), "times"_a = std::vector(), "curves"_a = std::vector(), "clock"_a = nullptr, "loop"_a = false); - py::class_>(m, "Line") + py::class_>(m, "Line", "Line segment with the given start/end values and duration. If loop is true, repeats indefinitely. Retriggers on a clock signal.") .def(py::init(), "from"_a = 0.0, "to"_a = 1.0, "time"_a = 1.0, "loop"_a = 0, "clock"_a = nullptr); - py::class_>(m, "RectangularEnvelope") + py::class_>(m, "RectangularEnvelope", "Rectangular envelope with the given sustain duration.") .def(py::init(), "sustain_duration"_a = 1.0, "clock"_a = nullptr); - py::class_>(m, "FFTContinuousPhaseVocoder") + py::class_>(m, "FFTContinuousPhaseVocoder", "FFTContinuousPhaseVocoder") .def(py::init(), "input"_a = nullptr, "rate"_a = 1.0); #ifdef __APPLE__ - py::class_>(m, "FFTConvolve") + py::class_>(m, "FFTConvolve", "FFTConvolve") .def(py::init(), "input"_a = nullptr, "buffer"_a = nullptr); #endif - py::class_>(m, "FFT") + py::class_>(m, "FFT", "FFT") .def(py::init(), "input"_a = 0.0, "fft_size"_a = SIGNALFLOW_DEFAULT_FFT_SIZE, "hop_size"_a = SIGNALFLOW_DEFAULT_FFT_HOP_SIZE, "window_size"_a = 0, "do_window"_a = true); - py::class_>(m, "FFTFindPeaks") + py::class_>(m, "FFTFindPeaks", "FFTFindPeaks") .def(py::init(), "input"_a = 0, "prominence"_a = 1, "threshold"_a = 0.000001, "count"_a = SIGNALFLOW_MAX_CHANNELS, "interpolate"_a = true); - py::class_>(m, "IFFT") + py::class_>(m, "IFFT", "IFFT") .def(py::init(), "input"_a = nullptr, "do_window"_a = false); - py::class_>(m, "FFTLPF") + py::class_>(m, "FFTLPF", "FFTLPF") .def(py::init(), "input"_a = 0, "frequency"_a = 2000); - py::class_>(m, "FFTPhaseVocoder") + py::class_>(m, "FFTPhaseVocoder", "FFTPhaseVocoder") .def(py::init(), "input"_a = nullptr); - py::class_>(m, "FFTTonality") + py::class_>(m, "FFTTonality", "FFTTonality") .def(py::init(), "input"_a = 0, "level"_a = 0.5, "smoothing"_a = 0.9); - py::class_>(m, "Add") + py::class_>(m, "Add", "Add") .def(py::init(), "a"_a = 0, "b"_a = 0); - py::class_>(m, "AmplitudeToDecibels") + py::class_>(m, "AmplitudeToDecibels", "AmplitudeToDecibels") .def(py::init(), "a"_a = 0); - py::class_>(m, "DecibelsToAmplitude") + py::class_>(m, "DecibelsToAmplitude", "DecibelsToAmplitude") .def(py::init(), "a"_a = 0); - py::class_>(m, "ChannelArray") + py::class_>(m, "ChannelArray", "Takes an array of inputs and spreads them across multiple channels of output.") .def(py::init<>()) .def(py::init>(), "inputs"_a) .def(py::init>(), "inputs"_a) .def(py::init>(), "inputs"_a) .def(py::init>(), "inputs"_a); - py::class_>(m, "ChannelCrossfade") + py::class_>(m, "ChannelCrossfade", "Given a multichannel input, crossfades between channels based on the given position within the virtual array, producing a single-channel output.") .def(py::init(), "input"_a = nullptr, "index"_a = nullptr, "num_output_channels"_a = 1); - py::class_>(m, "ChannelMixer") + py::class_>(m, "ChannelMixer", "Downmix a multichannel input to a lower-channel output. If num_channels is greater than one, spreads the input channels across the field. If amplitude_compensation is enabled, scale down the amplitude based on the ratio of input to output channels.") .def(py::init(), "num_channels"_a = 1, "input"_a = 0, "amplitude_compensation"_a = true); - py::class_>(m, "ChannelSelect") + py::class_>(m, "ChannelSelect", "Select a subset of channels from a multichannel input, starting at offset, up to a maximum of maximum, with the given step.") .def(py::init(), "input"_a = nullptr, "offset"_a = 0, "maximum"_a = 0, "step"_a = 1); - py::class_>(m, "Equal") + py::class_>(m, "Equal", "Equal") .def(py::init(), "a"_a = 0, "b"_a = 0); - py::class_>(m, "NotEqual") + py::class_>(m, "NotEqual", "NotEqual") .def(py::init(), "a"_a = 0, "b"_a = 0); - py::class_>(m, "GreaterThan") + py::class_>(m, "GreaterThan", "GreaterThan") .def(py::init(), "a"_a = 0, "b"_a = 0); - py::class_>(m, "GreaterThanOrEqual") + py::class_>(m, "GreaterThanOrEqual", "GreaterThanOrEqual") .def(py::init(), "a"_a = 0, "b"_a = 0); - py::class_>(m, "LessThan") + py::class_>(m, "LessThan", "LessThan") .def(py::init(), "a"_a = 0, "b"_a = 0); - py::class_>(m, "LessThanOrEqual") + py::class_>(m, "LessThanOrEqual", "LessThanOrEqual") .def(py::init(), "a"_a = 0, "b"_a = 0); - py::class_>(m, "Modulo") + py::class_>(m, "Modulo", "Modulo") .def(py::init(), "a"_a = 0, "b"_a = 0); - py::class_>(m, "Abs") + py::class_>(m, "Abs", "Abs") .def(py::init(), "a"_a = 0); - py::class_>(m, "If") + py::class_>(m, "If", "If") .def(py::init(), "a"_a = 0, "value_if_true"_a = 0, "value_if_false"_a = 0); - py::class_>(m, "Divide") + py::class_>(m, "Divide", "Divide") .def(py::init(), "a"_a = 1, "b"_a = 1); - py::class_>(m, "FrequencyToMidiNote") + py::class_>(m, "FrequencyToMidiNote", "Map a frequency to a MIDI note (where 440Hz = A4 = 69), with floating-point output.") .def(py::init(), "a"_a = 0); - py::class_>(m, "MidiNoteToFrequency") + py::class_>(m, "MidiNoteToFrequency", "Map a MIDI note to a frequency (where 440Hz = A4 = 69), supporting floating-point input.") .def(py::init(), "a"_a = 0); - py::class_>(m, "Multiply") + py::class_>(m, "Multiply", "Multiply") .def(py::init(), "a"_a = 1.0, "b"_a = 1.0); - py::class_>(m, "Pow") + py::class_>(m, "Pow", "Pow") .def(py::init(), "a"_a = 0, "b"_a = 0); - py::class_>(m, "RoundToScale") + py::class_>(m, "RoundToScale", "Given a frequency input, generates a frequency output that is rounded to the nearest MIDI note. (TODO: Not very well named)") .def(py::init(), "a"_a = 0); - py::class_>(m, "Round") + py::class_>(m, "Round", "Round the input to the nearest integer value.") .def(py::init(), "a"_a = 0); - py::class_>(m, "ScaleLinExp") + py::class_>(m, "ScaleLinExp", "Scales the input from a linear range (between a and b) to an exponential range (between c and d).") .def(py::init(), "input"_a = 0, "a"_a = 0, "b"_a = 1, "c"_a = 1, "d"_a = 10); - py::class_>(m, "ScaleLinLin") + py::class_>(m, "ScaleLinLin", "Scales the input from a linear range (between a and b) to a linear range (between c and d).") .def(py::init(), "input"_a = 0, "a"_a = 0, "b"_a = 1, "c"_a = 1, "d"_a = 10); - py::class_>(m, "Subtract") + py::class_>(m, "Subtract", "Subtract") .def(py::init(), "a"_a = 0, "b"_a = 0); - py::class_>(m, "Sum") + py::class_>(m, "Sum", "Sum") .def(py::init<>()) .def(py::init>(), "inputs"_a) .def(py::init>(), "inputs"_a) .def(py::init>(), "inputs"_a) .def(py::init>(), "inputs"_a); - py::class_>(m, "Sin") + py::class_>(m, "Sin", "Sin") .def(py::init(), "a"_a = 0); - py::class_>(m, "Cos") + py::class_>(m, "Cos", "Cos") .def(py::init(), "a"_a = 0); - py::class_>(m, "Tan") + py::class_>(m, "Tan", "Tan") .def(py::init(), "a"_a = 0); - py::class_>(m, "Tanh") + py::class_>(m, "Tanh", "Tanh") .def(py::init(), "a"_a = 0); - py::class_>(m, "Constant") + py::class_>(m, "Constant", "Produces a constant value.") .def(py::init(), "value"_a = 0); - py::class_>(m, "Impulse") + py::class_>(m, "Impulse", "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.") .def(py::init(), "frequency"_a = 1.0); - py::class_>(m, "LFO") + py::class_>(m, "LFO", "LFO") .def(py::init(), "frequency"_a = 1.0, "min"_a = 0.0, "max"_a = 1.0, "phase"_a = 0.0); - py::class_>(m, "SawLFO") + py::class_>(m, "SawLFO", "Produces a sawtooth LFO, with output ranging from min to max.") .def(py::init(), "frequency"_a = 1.0, "min"_a = 0.0, "max"_a = 1.0, "phase"_a = 0.0); - py::class_>(m, "SawOscillator") + py::class_>(m, "SawOscillator", "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.") .def(py::init(), "frequency"_a = 440, "phase"_a = nullptr, "reset"_a = nullptr); - py::class_>(m, "SineLFO") + py::class_>(m, "SineLFO", "Produces a sinusoidal LFO at the given frequency and phase offset, with output ranging from min to max.") .def(py::init(), "frequency"_a = 1.0, "min"_a = 0.0, "max"_a = 1.0, "phase"_a = 0.0); - py::class_>(m, "SineOscillator") + py::class_>(m, "SineOscillator", "Produces a sine wave at the given frequency.") .def(py::init(), "frequency"_a = 440); - py::class_>(m, "SquareLFO") + py::class_>(m, "SquareLFO", "Produces a pulse wave LFO with the given frequency and pulse width, ranging from min to max, where width=0.5 is a square wave.") .def(py::init(), "frequency"_a = 1.0, "min"_a = 0.0, "max"_a = 1.0, "width"_a = 0.5, "phase"_a = 0.0); - py::class_>(m, "SquareOscillator") + py::class_>(m, "SquareOscillator", "Produces a pulse wave with the given frequency and pulse width, where width=0.5 is a square wave.") .def(py::init(), "frequency"_a = 440, "width"_a = 0.5); - py::class_>(m, "TriangleLFO") + py::class_>(m, "TriangleLFO", "Produces a triangle LFO with the given frequency, ranging from min to max.") .def(py::init(), "frequency"_a = 1.0, "min"_a = 0.0, "max"_a = 1.0, "phase"_a = 0.0); - py::class_>(m, "TriangleOscillator") + py::class_>(m, "TriangleOscillator", "TriangleOscillator") .def(py::init(), "frequency"_a = 440); - py::class_>(m, "Wavetable") + py::class_>(m, "Wavetable", "Plays the wavetable stored in buffer at the given frequency.") .def(py::init(), "buffer"_a = nullptr, "frequency"_a = 440, "phase"_a = 0, "sync"_a = 0, "phase_map"_a = nullptr); - py::class_>(m, "Wavetable2D") + py::class_>(m, "Wavetable2D", "Wavetable2D") .def(py::init(), "buffer"_a = nullptr, "frequency"_a = 440, "crossfade"_a = 0.0, "phase"_a = 0.0, "sync"_a = 0); - py::class_>(m, "Clip") + py::class_>(m, "Clip", "Clip the input to min/max.") .def(py::init(), "input"_a = nullptr, "min"_a = -1.0, "max"_a = 1.0); - py::class_>(m, "Fold") + py::class_>(m, "Fold", "Fold the input beyond min/max, reflecting the excess back.") .def(py::init(), "input"_a = nullptr, "min"_a = -1.0, "max"_a = 1.0); - py::class_>(m, "Smooth") + py::class_>(m, "Smooth", "Smooth the input with a given smoothing coefficient. When smooth = 0, applies no smoothing.") .def(py::init(), "input"_a = nullptr, "smooth"_a = 0.99); - py::class_>(m, "WetDry") + py::class_>(m, "WetDry", "Takes wet and dry inputs, and outputs a mix determined by wetness.") .def(py::init(), "dry_input"_a = nullptr, "wet_input"_a = nullptr, "wetness"_a = 0.0); - py::class_>(m, "Wrap") + py::class_>(m, "Wrap", "Wrap the input beyond min/max.") .def(py::init(), "input"_a = nullptr, "min"_a = -1.0, "max"_a = 1.0); - py::class_>(m, "AllpassDelay") + py::class_>(m, "AllpassDelay", "All-pass delay, with feedback between 0 and 1. delay_time must be less than or equal to max_delay_time.") .def(py::init(), "input"_a = 0.0, "delay_time"_a = 0.1, "feedback"_a = 0.5, "max_delay_time"_a = 0.5); - py::class_>(m, "CombDelay") + py::class_>(m, "CombDelay", "Comb delay, with feedback between 0 and 1. delay_time must be less than or equal to max_delay_time.") .def(py::init(), "input"_a = 0.0, "delay_time"_a = 0.1, "feedback"_a = 0.5, "max_delay_time"_a = 0.5); - py::class_>(m, "OneTapDelay") + py::class_>(m, "OneTapDelay", "Single-tap delay line. delay_time must be less than or equal to max_delay_time.") .def(py::init(), "input"_a = 0.0, "delay_time"_a = 0.1, "max_delay_time"_a = 0.5); - py::class_>(m, "Stutter") + py::class_>(m, "Stutter", "Stutters the input whenever a signal is received on clock. Generates stutter_count repeats, with duration stutter_time.") .def(py::init(), "input"_a = 0.0, "stutter_time"_a = 0.1, "stutter_count"_a = 1, "clock"_a = nullptr, "max_stutter_time"_a = 1.0); - py::class_>(m, "Resample") + py::class_>(m, "Resample", "Resampler and bit crusher. sample_rate is in Hz, bit_rate is an integer between 0 and 16.") .def(py::init(), "input"_a = 0, "sample_rate"_a = 44100, "bit_rate"_a = 16); - py::class_>(m, "SampleAndHold") + py::class_>(m, "SampleAndHold", "Samples and holds the input each time a clock signal is received.") .def(py::init(), "input"_a = nullptr, "clock"_a = nullptr); - py::class_>(m, "Squiz") + py::class_>(m, "Squiz", "Implementation of Dan Stowell's Squiz algorithm, a kind of downsampler.") .def(py::init(), "input"_a = 0.0, "rate"_a = 2.0, "chunk_size"_a = 1); - py::class_>(m, "WaveShaper") + py::class_>(m, "WaveShaper", "Applies wave-shaping as described in buffer.") .def(py::init(), "input"_a = 0.0, "buffer"_a = nullptr); - py::class_>(m, "Compressor") + py::class_>(m, "Compressor", "Dynamic range compression, with optional sidechain input.") .def(py::init(), "input"_a = 0.0, "threshold"_a = 0.1, "ratio"_a = 2, "attack_time"_a = 0.01, "release_time"_a = 0.1, "sidechain"_a = nullptr); - py::class_>(m, "Gate") + py::class_>(m, "Gate", "Outputs the input value when it is above the given threshold, otherwise zero.") .def(py::init(), "input"_a = 0.0, "threshold"_a = 0.1); - py::class_>(m, "Maximiser") + py::class_>(m, "Maximiser", "Gain maximiser.") .def(py::init(), "input"_a = 0.0, "ceiling"_a = 0.5, "attack_time"_a = 1.0, "release_time"_a = 1.0); - py::class_>(m, "RMS") + py::class_>(m, "RMS", "Outputs the root-mean-squared value of the input, in buffers equal to the graph's current buffer size.") .def(py::init(), "input"_a = 0.0); - py::class_>(m, "BiquadFilter") + py::class_>(m, "BiquadFilter", "Biquad filter. filter_type can be 'low_pass', 'band_pass', 'high_pass', 'notch', 'peak', 'low_shelf', 'high_shelf'. Not recommended for real-time modulation; for this, use SVFilter.") .def(py::init(), "input"_a = 0.0, "filter_type"_a = SIGNALFLOW_FILTER_TYPE_LOW_PASS, "cutoff"_a = 440, "resonance"_a = 0.0, "peak_gain"_a = 0.0) .def(py::init(), "input"_a, "filter_type"_a, "cutoff"_a = 440, "resonance"_a = 0.0, "peak_gain"_a = 0.0); - py::class_>(m, "EQ") + py::class_>(m, "EQ", "Three-band EQ.") .def(py::init(), "input"_a = 0.0, "low_gain"_a = 1.0, "mid_gain"_a = 1.0, "high_gain"_a = 1.0, "low_freq"_a = 500, "high_freq"_a = 5000); - py::class_>(m, "MoogVCF") + py::class_>(m, "MoogVCF", "Moog ladder low-pass filter.") .def(py::init(), "input"_a = 0.0, "cutoff"_a = 200.0, "resonance"_a = 0.0); - py::class_>(m, "SVFilter") + py::class_>(m, "SVFilter", "State variable filter. filter_type can be 'low_pass', 'band_pass', 'high_pass', 'notch', 'peak', 'low_shelf', 'high_shelf'.") .def(py::init(), "input"_a = 0.0, "filter_type"_a = SIGNALFLOW_FILTER_TYPE_LOW_PASS, "cutoff"_a = 440, "resonance"_a = 0.0) .def(py::init(), "input"_a, "filter_type"_a, "cutoff"_a = 440, "resonance"_a = 0.0); - py::class_>(m, "AzimuthPanner") + py::class_>(m, "AzimuthPanner", "Pan input around an equally-spaced ring of num_channels speakers. pan is the pan position from -1..+1, where 0 = centre front. width is the source's width, where 1.0 spans exactly between an adjacent pair of channels.") .def(py::init(), "num_channels"_a = 2, "input"_a = 0, "pan"_a = 0.0, "width"_a = 1.0); - py::class_>(m, "ChannelPanner") + py::class_>(m, "ChannelPanner", "Pan the input between a linear series of channels, where pan 0 = channel 0, 1 = channel 1, etc. No wrapping is applied.") .def(py::init(), "num_channels"_a = 2, "input"_a = 0, "pan"_a = 0.0, "width"_a = 1.0); - py::class_>(m, "SpatialPanner") + py::class_>(m, "SpatialPanner", "Implements a spatial panning algorithm, applied to a given SpatialEnvironment. Currently, only DBAP is supported.") .def(py::init, NodeRef, NodeRef, NodeRef, NodeRef, NodeRef, std::string>(), "env"_a = nullptr, "input"_a = 0.0, "x"_a = 0.0, "y"_a = 0.0, "z"_a = 0.0, "radius"_a = 1.0, "algorithm"_a = "dbap"); - py::class_>(m, "StereoBalance") + py::class_>(m, "StereoBalance", "Takes a stereo input and rebalances it, where 0 is unchanged, -1 is hard left, and 1 is hard right.") .def(py::init(), "input"_a = 0, "balance"_a = 0); - py::class_>(m, "StereoPanner") + py::class_>(m, "StereoPanner", "Pans a mono input to a stereo output. Pans from -1 (hard left) to +1 (hard right), with 0 = centre.") .def(py::init(), "input"_a = 0, "pan"_a = 0.0); - py::class_>(m, "StereoWidth") + py::class_>(m, "StereoWidth", "Reduces the width of a stereo signal. When width = 1, input is unchanged. When width = 0, outputs a pair of identical channels both containing L+R.") .def(py::init(), "input"_a = 0, "width"_a = 1); - py::class_>(m, "ClockDivider") + py::class_>(m, "ClockDivider", "When given a clock input (e.g., an Impulse), divides the clock by the given factor. factor must be an integer greater than or equal to 1.") .def(py::init(), "clock"_a = 0, "factor"_a = 1); - py::class_>(m, "Counter") + py::class_>(m, "Counter", "Count upwards from min, driven by clock.") .def(py::init(), "clock"_a = 0, "min"_a = 0, "max"_a = 2147483647); - py::class_>(m, "Euclidean") + py::class_>(m, "Euclidean", "Euclidean rhythm as described by Toussaint, with sequence_length (n) and num_events (k), driven by clock.") .def(py::init(), "clock"_a = 0, "sequence_length"_a = 0, "num_events"_a = 0); - py::class_>(m, "FlipFlop") + py::class_>(m, "FlipFlop", "Flips from 0/1 on each clock.") .def(py::init(), "clock"_a = 0); - py::class_>(m, "ImpulseSequence") + py::class_>(m, "ImpulseSequence", "Each time a clock or trigger is received, outputs the next value in the sequence. At all other times, outputs zero.") .def(py::init, NodeRef>(), "sequence"_a = std::vector(), "clock"_a = nullptr) .def(py::init(), "sequence"_a, "clock"_a = nullptr); - py::class_>(m, "Index") + py::class_>(m, "Index", "Outputs the value in list corresponding to index.") .def(py::init, NodeRef>(), "list"_a = 0, "index"_a = 0); - py::class_>(m, "Latch") + py::class_>(m, "Latch", "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.") .def(py::init(), "set"_a = 0, "reset"_a = 0); - py::class_>(m, "Sequence") + py::class_>(m, "Sequence", "Outputs the elements in sequence, incrementing position on each clock.") .def(py::init, NodeRef>(), "sequence"_a = std::vector(), "clock"_a = nullptr); - py::class_>(m, "Logistic") + py::class_>(m, "Logistic", "Logistic noise.") .def(py::init(), "chaos"_a = 3.7, "frequency"_a = 0.0); - py::class_>(m, "PinkNoise") + py::class_>(m, "PinkNoise", "Pink noise, with specified low/high cutoffs.") .def(py::init(), "low_cutoff"_a = 20.0, "high_cutoff"_a = 20000.0, "reset"_a = nullptr); - py::class_>(m, "RandomBrownian") + py::class_>(m, "RandomBrownian", "Outputs Brownian noise between min/max, with a mean change of delta between samples. If a clock is passed, only generates a new value on a clock tick.") .def(py::init(), "min"_a = -1.0, "max"_a = 1.0, "delta"_a = 0.01, "clock"_a = nullptr, "reset"_a = nullptr); - py::class_>(m, "RandomChoice") + py::class_>(m, "RandomChoice", "Pick a random value from the given array. If a clock is passed, only picks a new value on a clock tick.") .def(py::init, NodeRef, NodeRef>(), "values"_a = std::vector(), "clock"_a = nullptr, "reset"_a = nullptr); - py::class_>(m, "RandomCoin") + py::class_>(m, "RandomCoin", "Flip a coin with the given probability. If a clock is passed, only picks a new value on a clock tick.") .def(py::init(), "probability"_a = 0.5, "clock"_a = nullptr, "reset"_a = nullptr); - py::class_>(m, "RandomExponentialDist") + py::class_>(m, "RandomExponentialDist", "Generate an random value following the exponential distribution. If a clock is passed, only picks a new value on a clock tick.") .def(py::init(), "scale"_a = 0.0, "clock"_a = nullptr, "reset"_a = nullptr); - py::class_>(m, "RandomExponential") + py::class_>(m, "RandomExponential", "Generate an random exponential value between min/max. If a clock is passed, only picks a new value on a clock tick.") .def(py::init(), "min"_a = 0.001, "max"_a = 1.0, "clock"_a = nullptr, "reset"_a = nullptr); - py::class_>(m, "RandomGaussian") + py::class_>(m, "RandomGaussian", "Generate an random Gaussian value, with given mean and sigma. If a clock is passed, only picks a new value on a clock tick.") .def(py::init(), "mean"_a = 0.0, "sigma"_a = 0.0, "clock"_a = nullptr, "reset"_a = nullptr); - py::class_>(m, "RandomImpulseSequence") + py::class_>(m, "RandomImpulseSequence", "Generates a random sequence of 0/1 bits with the given length, and the given probability each each bit = 1. The position of the sequence is incremented on each clock signal. explore and generate are trigger inputs which cause the sequence to mutate and re-generate respectively.") .def(py::init(), "probability"_a = 0.5, "length"_a = 8, "clock"_a = nullptr, "explore"_a = nullptr, "generate"_a = nullptr, "reset"_a = nullptr); - py::class_>(m, "RandomImpulse") + py::class_>(m, "RandomImpulse", "Generate random impulses at the given frequency, with either uniform or poisson distribution.") .def(py::init(), "frequency"_a = 1.0, "distribution"_a = SIGNALFLOW_EVENT_DISTRIBUTION_UNIFORM, "reset"_a = nullptr) .def(py::init(), "frequency"_a, "distribution"_a, "reset"_a = nullptr); - py::class_>(m, "RandomUniform") + py::class_>(m, "RandomUniform", "Generates a uniformly random value between min/max. If a clock is passed, only picks a new value on a clock tick.") .def(py::init(), "min"_a = 0.0, "max"_a = 1.0, "clock"_a = nullptr, "reset"_a = nullptr); - py::class_>(m, "WhiteNoise") + py::class_>(m, "WhiteNoise", "Generates whitenoise between min/max. If frequency is zero, generates at audio rate. For frequencies lower than audio rate, interpolate applies linear interpolation between values, and random_interval specifies whether new random values should be equally-spaced or randomly-spaced.") .def(py::init(), "frequency"_a = 0.0, "min"_a = -1.0, "max"_a = 1.0, "interpolate"_a = true, "random_interval"_a = true, "reset"_a = nullptr); } diff --git a/source/src/python/patch.cpp b/source/src/python/patch.cpp index 6adc292d..3e9a26fc 100644 --- a/source/src/python/patch.cpp +++ b/source/src/python/patch.cpp @@ -5,7 +5,7 @@ void init_python_patch(py::module &m) /*-------------------------------------------------------------------------------- * Patch *-------------------------------------------------------------------------------*/ - py::class_>(m, "Patch") + py::class_>(m, "Patch", "A Patch encapsulates a connected network of nodes, analogous to a synthesizer") /*-------------------------------------------------------------------------------- * Constructors *-------------------------------------------------------------------------------*/