From ed7e7ff8d086ebfb6115ce094910480a8bd03e36 Mon Sep 17 00:00:00 2001 From: kevinstadler Date: Tue, 26 Sep 2023 14:45:46 +0200 Subject: [PATCH] Fix web reference documentation --- src/processing/sound/Analyzer.java | 2 +- src/processing/sound/BeatDetector.java | 7 +++---- src/processing/sound/FFT.java | 17 +++++++++-------- src/processing/sound/Filter.java | 9 ++++++--- src/processing/sound/PitchDetector.java | 12 +++++------- src/processing/sound/SoundObject.java | 4 ++-- 6 files changed, 26 insertions(+), 25 deletions(-) diff --git a/src/processing/sound/Analyzer.java b/src/processing/sound/Analyzer.java index be10189..0d885ab 100644 --- a/src/processing/sound/Analyzer.java +++ b/src/processing/sound/Analyzer.java @@ -8,7 +8,7 @@ * Common superclass of all audio analysis classes * @webref Analysis */ -abstract class Analyzer { +public abstract class Analyzer { protected SoundObject input; diff --git a/src/processing/sound/BeatDetector.java b/src/processing/sound/BeatDetector.java index 0c4ced1..5fb2331 100644 --- a/src/processing/sound/BeatDetector.java +++ b/src/processing/sound/BeatDetector.java @@ -43,14 +43,13 @@ protected void setInput(UnitOutputPort input) { } /** - * Returns whether or not the current moment of audio contains a beat or not. - * A "beat" is defined as a spike in the energy of the audio signal — it may + * Returns true if the current moment of the audio signal + * contains a beat, false otherwise.
+ * A "beat" is defined as a spike in the energy of the audio signal - it may * or may not coincide exactly with a musical beat. * * @webref Analysis:BeatDetector * @webBrief Returns whether or not the current moment of audio contains a beat or not. - * - * @return True if the audio signal currently contains a beat, false otherwise. */ public boolean isBeat() { return this.detector.current.getValue() == 1; diff --git a/src/processing/sound/FFT.java b/src/processing/sound/FFT.java index 032e547..0527760 100644 --- a/src/processing/sound/FFT.java +++ b/src/processing/sound/FFT.java @@ -26,9 +26,9 @@ public FFT(PApplet parent) { * @param parent * typically use "this" * @param bands - * number of frequency bands for the FFT as an integer (default 512). - * This parameter needs to be a power of 2 (e.g. 16, 32, 64, 128, - * ...). + * number of frequency bands for the FFT as an integer. This + * parameter needs to be a power of 2 (e.g. 16, 32, 64, 128, + * ...). The default is 512. */ public FFT(PApplet parent, int bands) { super(parent); @@ -59,7 +59,7 @@ public float[] analyze() { } /** - * Calculates the current frequency spectrum from the input source and returns + * Calculates the current frequency spectrum of the input source and returns * it as an array with as many elements as frequency bands. * * @param value @@ -68,7 +68,8 @@ public float[] analyze() { * @return The current frequency spectrum of the input source. The array has as * many elements as this FFT analyzer's number of frequency bands. * @webref Analysis:FFT - * @webBrief Calculates the current frequency spectrum and returns it as an array with as many elements as frequency bands. + * @webBrief Calculates the current frequency spectrum of the audio input + * signal. **/ public float[] analyze(float[] value) { if (this.input == null) { @@ -79,8 +80,8 @@ public float[] analyze(float[] value) { } /** - * Calculates the frequency spectrum of the given sample and returns an array of magnitudes, one - * for each frequency band. + * Calculates the frequency spectrum of the given audio sample and returns an + * array of magnitudes, one for each frequency band. * * This version is intended to be used in non-real time processing, particularly when you are * creating an animation in non-real time and want to get the FFT for a particular chunk of an audio sample. @@ -95,7 +96,7 @@ public float[] analyze(float[] value) { * @return The current frequency spectrum of the input source. The array has as * many elements as this FFT analyzer's number of frequency bands. * @webref Analysis:FFT - * @webBrief Calculates the frequency spectrum of the given sample, returning an array of magnitudes. + * @webBrief Calculates the frequency spectrum of the given audio sample. **/ public float[] analyzeSample(float[] sample, int numBands) { float[] target = new float[numBands]; diff --git a/src/processing/sound/Filter.java b/src/processing/sound/Filter.java index c1602fb..0b67844 100644 --- a/src/processing/sound/Filter.java +++ b/src/processing/sound/Filter.java @@ -5,8 +5,11 @@ import processing.core.PApplet; -// common superclass for JSyn filters that have a 'Q' unitport -abstract class Filter extends Effect { +/** + * Common superclass for JSyn filters that have a 'Q' unitport + * @webref Effects:Filter + */ +public abstract class Filter extends Effect { public Filter(PApplet parent) { super(parent); @@ -14,7 +17,7 @@ public Filter(PApplet parent) { /** * Sets the resonance (or 'Q factor') of this filter. Increasing Q increases - * the Resonance of the filter at its cutoff frequency. Defaults to 1. + * the resonance of the filter at its cutoff frequency. Defaults to 1. * @webref Effects:Filter * @webBrief Sets the resonance (or 'Q factor') of this filter. * @param q the desired Q factor, a value between 0.1 and 10 diff --git a/src/processing/sound/PitchDetector.java b/src/processing/sound/PitchDetector.java index 4108fd7..b6673d8 100644 --- a/src/processing/sound/PitchDetector.java +++ b/src/processing/sound/PitchDetector.java @@ -7,11 +7,11 @@ /** * Detects the pitch (also known as the 'fundamental frequency') of a sound * signal. For complex signals this is not a trivial task, so the analyzer only - * returns a frequency measurement (measured in Hertz, or 'Hz') when its - * measurement exceeds a 'confidence level' that can be specified by the user. + * returns a frequency measurement (measured in Hertz) when its measurement + * exceeds a 'confidence level' that can be specified by the user. * + * @webref Analysis:PitchDetector * @webBrief Detects the fundamental frequency of a sound signal - * @webref */ public class PitchDetector extends Analyzer { private final com.jsyn.unitgen.PitchDetector detector; @@ -19,9 +19,7 @@ public class PitchDetector extends Analyzer { private float minimumConfidence = 0.8f; /** - * Creates a new PitchDetector object. - * - * @param parent Typically "this" + * @param parent typically "this" * @param minimumConfidence the minimum confidence level required for * frequency measurements, between 0 (accept all measurements, no matter how * unreliable) to 1 (only accept perfect measurements). Defaults to 0.8. @@ -56,6 +54,7 @@ public float analyze() { * Returns an estimate of the current pitch (or 'fundamental frequency') of * the input sound signal, in Hertz. If the confidence in the current * measurement does not exceed the minimum confidence, this method returns 0. + * @webref Analysis:PitchDetector * @webBrief Detect the fundamental frequency of the input sound signal. * @param minimumConfidence the minimum confidence level required for * frequency measurements, between 0 (accept all measurements, no matter how @@ -63,7 +62,6 @@ public float analyze() { * confidence level specified when this PitchDetector was created. * @param target a float array of length 2 that will be filled with the * frequency and confidence in that frequency measurement - * @webref */ public float analyze(float minimumConfidence) { return (float) (this.detector.confidence.getValue() >= minimumConfidence ? this.detector.frequency.getValue() : 0.0); diff --git a/src/processing/sound/SoundObject.java b/src/processing/sound/SoundObject.java index ec02e03..59945ff 100644 --- a/src/processing/sound/SoundObject.java +++ b/src/processing/sound/SoundObject.java @@ -55,7 +55,7 @@ public void add(float add) { * @param amp * A float value between 0.0 (complete silence) and 1.0 (full volume) * controlling the amplitude/volume of this sound. - * @webref SoundObject:SoundObject + * @webref SoundObject **/ public void amp(float amp) { if (Engine.checkAmp(amp)) { @@ -82,7 +82,7 @@ public boolean isPlaying() { * @param pos * The panoramic position of this sound unit as a float from -1.0 * (left) to 1.0 (right). - * @webref SoundObject:SoundObject + * @webref SoundObject **/ public void pan(float pos) { if (this.circuit.processor == null) {