From bdc42428f12f0638c32eb0ad24063087e8d8f5ee Mon Sep 17 00:00:00 2001 From: Daniel Jones Date: Thu, 9 Nov 2023 08:53:31 +0000 Subject: [PATCH] Update Node documentation --- source/src/python/nodes.cpp | 66 ++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/source/src/python/nodes.cpp b/source/src/python/nodes.cpp index d238cae7..201f42e0 100644 --- a/source/src/python/nodes.cpp +++ b/source/src/python/nodes.cpp @@ -16,10 +16,10 @@ void init_python_nodes(py::module &m) 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", "CrossCorrelate") + py::class_>(m, "CrossCorrelate", "Outputs the cross-correlation of the input signal with the given buffer. If hop_size is zero, calculates the cross-correlation every sample.") .def(py::init(), "input"_a = nullptr, "buffer"_a = nullptr, "hop_size"_a = 0); - py::class_>(m, "OnsetDetector", "OnsetDetector") + py::class_>(m, "OnsetDetector", "Simple time-domain onset detector. Outputs an impulse when an onset is detected in the input. Maintains short-time and long-time averages. An onset is registered when the short-time average is threshold x the long-time average. min_interval is the minimum interval between onsets, in seconds.") .def(py::init(), "input"_a = 0.0, "threshold"_a = 2.0, "min_interval"_a = 0.1); py::class_>(m, "BeatCutter", "Cuts a buffer into segment_count segments, and stutters/jumps with the given probabilities.") @@ -48,21 +48,21 @@ void init_python_nodes(py::module &m) #ifdef __APPLE__ - py::class_>(m, "MouseX", "Outputs the normalised cursor X position, from 0 to 1.") + py::class_>(m, "MouseX", "Outputs the normalised cursor X position, from 0 to 1. Currently only supported on macOS.") .def(py::init<>()); #endif #ifdef __APPLE__ - py::class_>(m, "MouseY", "Outputs the normalised cursor Y position, from 0 to 1.") + py::class_>(m, "MouseY", "Outputs the normalised cursor Y position, from 0 to 1. Currently only supported on macOS.") .def(py::init<>()); #endif #ifdef __APPLE__ - py::class_>(m, "MouseDown", "Outputs 1 if the left mouse button is down, 0 otherwise.") + py::class_>(m, "MouseDown", "Outputs 1 if the left mouse button is down, 0 otherwise. Currently only supported on macOS.") .def(py::init(), "button_index"_a = 0); #endif @@ -85,38 +85,38 @@ void init_python_nodes(py::module &m) 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", "FFTContinuousPhaseVocoder") + py::class_>(m, "FFTContinuousPhaseVocoder", "Continuous phase vocoder. Requires an FFT* input.") .def(py::init(), "input"_a = nullptr, "rate"_a = 1.0); #ifdef __APPLE__ - py::class_>(m, "FFTConvolve", "FFTConvolve") + py::class_>(m, "FFTConvolve", "Frequency-domain convolution, using overlap-add. Useful for convolution reverb, with the input buffer containing an impulse response. Requires an FFT* input.") .def(py::init(), "input"_a = nullptr, "buffer"_a = nullptr); #endif - py::class_>(m, "FFT", "FFT") + py::class_>(m, "FFT", "Fast Fourier Transform. Takes a time-domain input, and generates a frequency-domain (FFT) output.") .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", "FFTFindPeaks") + py::class_>(m, "FFTFindPeaks", "Find peaks in the FFT magnitude spectrum. Requires an FFT* input.") .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", "IFFT") + py::class_>(m, "IFFT", "Inverse Fast Fourier Transform. Requires an FFT* input, generates a time-domain output.") .def(py::init(), "input"_a = nullptr, "do_window"_a = false); - py::class_>(m, "FFTLPF", "FFTLPF") + py::class_>(m, "FFTLPF", "FFT-based brick wall low pass filter. Requires an FFT* input.") .def(py::init(), "input"_a = 0, "frequency"_a = 2000); - py::class_>(m, "FFTPhaseVocoder", "FFTPhaseVocoder") + py::class_>(m, "FFTPhaseVocoder", "Phase vocoder. Requires an FFT* input.") .def(py::init(), "input"_a = nullptr); - py::class_>(m, "FFTTonality", "FFTTonality") + py::class_>(m, "FFTTonality", "Tonality filter. Requires an FFT* input.") .def(py::init(), "input"_a = 0, "level"_a = 0.5, "smoothing"_a = 0.9); - py::class_>(m, "Add", "Add") + py::class_>(m, "Add", "Add each sample of a to each sample of b. Can also be written as a + b") .def(py::init(), "a"_a = 0, "b"_a = 0); - py::class_>(m, "AmplitudeToDecibels", "AmplitudeToDecibels") + py::class_>(m, "AmplitudeToDecibels", "Map a linear amplitude value to decibels.") .def(py::init(), "a"_a = 0); py::class_>(m, "DecibelsToAmplitude", "DecibelsToAmplitude") @@ -138,34 +138,34 @@ void init_python_nodes(py::module &m) 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", "Equal") + py::class_>(m, "Equal", "Compares the output of a to the output of b. Outputs 1 when equal, 0 otherwise. Can also be written as a == b") .def(py::init(), "a"_a = 0, "b"_a = 0); - py::class_>(m, "NotEqual", "NotEqual") + py::class_>(m, "NotEqual", "Compares the output of a to the output of b. Outputs 0 when equal, 1 otherwise. Can also be written as a != b") .def(py::init(), "a"_a = 0, "b"_a = 0); - py::class_>(m, "GreaterThan", "GreaterThan") + py::class_>(m, "GreaterThan", "Compares the output of a to the output of b. Outputs 1 when a > b, 0 otherwise. Can also be written as a > b") .def(py::init(), "a"_a = 0, "b"_a = 0); - py::class_>(m, "GreaterThanOrEqual", "GreaterThanOrEqual") + py::class_>(m, "GreaterThanOrEqual", "Compares the output of a to the output of b. Outputs 1 when a >= b, 0 otherwise. Can also be written as a >= b") .def(py::init(), "a"_a = 0, "b"_a = 0); - py::class_>(m, "LessThan", "LessThan") + py::class_>(m, "LessThan", "Compares the output of a to the output of b. Outputs 1 when a < b, 0 otherwise. Can also be written as a < b") .def(py::init(), "a"_a = 0, "b"_a = 0); - py::class_>(m, "LessThanOrEqual", "LessThanOrEqual") + py::class_>(m, "LessThanOrEqual", "Compares the output of a to the output of b. Outputs 1 when a <= b, 0 otherwise. Can also be written as a <= b") .def(py::init(), "a"_a = 0, "b"_a = 0); - py::class_>(m, "Modulo", "Modulo") + py::class_>(m, "Modulo", "Outputs the value of a modulo b, per sample. Supports fractional values. Can also be written as a % b") .def(py::init(), "a"_a = 0, "b"_a = 0); - py::class_>(m, "Abs", "Abs") + py::class_>(m, "Abs", "Outputs the absolute value of a, per sample. Can also be written as abs(a)") .def(py::init(), "a"_a = 0); - py::class_>(m, "If", "If") + py::class_>(m, "If", "Outputs value_if_true for each non-zero value of a, value_if_false for all other values.") .def(py::init(), "a"_a = 0, "value_if_true"_a = 0, "value_if_false"_a = 0); - py::class_>(m, "Divide", "Divide") + py::class_>(m, "Divide", "Divide each sample of a by each sample of b. Can also be written as a / b") .def(py::init(), "a"_a = 1, "b"_a = 1); py::class_>(m, "FrequencyToMidiNote", "Map a frequency to a MIDI note (where 440Hz = A4 = 69), with floating-point output.") @@ -174,10 +174,10 @@ void init_python_nodes(py::module &m) 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", "Multiply") + py::class_>(m, "Multiply", "Multiply each sample of a by each sample of b. Can also be written as a * b") .def(py::init(), "a"_a = 1.0, "b"_a = 1.0); - py::class_>(m, "Pow", "Pow") + py::class_>(m, "Pow", "Outputs a to the power of b, per sample. Can also be written as a ** b") .def(py::init(), "a"_a = 0, "b"_a = 0); 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)") @@ -192,26 +192,26 @@ void init_python_nodes(py::module &m) 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", "Subtract") + py::class_>(m, "Subtract", "Subtract each sample of b from each sample of a. Can also be written as a - b") .def(py::init(), "a"_a = 0, "b"_a = 0); - py::class_>(m, "Sum", "Sum") + py::class_>(m, "Sum", "Sums the output of all of the input nodes, by sample.") .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", "Sin") + py::class_>(m, "Sin", "Outputs sin(a), per sample.") .def(py::init(), "a"_a = 0); - py::class_>(m, "Cos", "Cos") + py::class_>(m, "Cos", "Outputs cos(a), per sample.") .def(py::init(), "a"_a = 0); - py::class_>(m, "Tan", "Tan") + py::class_>(m, "Tan", "Outputs tan(a), per sample.") .def(py::init(), "a"_a = 0); - py::class_>(m, "Tanh", "Tanh") + py::class_>(m, "Tanh", "Outputs tanh(a), per sample. Can be used as a soft clipper.") .def(py::init(), "a"_a = 0); py::class_>(m, "Constant", "Produces a constant value.")