Skip to content

Commit

Permalink
Fix web reference documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinstadler committed Sep 26, 2023
1 parent 26b8a1b commit ed7e7ff
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/processing/sound/Analyzer.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Common superclass of all audio analysis classes
* @webref Analysis
*/
abstract class Analyzer {
public abstract class Analyzer {

protected SoundObject input;

Expand Down
7 changes: 3 additions & 4 deletions src/processing/sound/BeatDetector.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 <code>true</code> if the current moment of the audio signal
* contains a beat, <code>false</code> otherwise.<br />
* 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;
Expand Down
17 changes: 9 additions & 8 deletions src/processing/sound/FFT.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand All @@ -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) {
Expand All @@ -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.
Expand All @@ -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];
Expand Down
9 changes: 6 additions & 3 deletions src/processing/sound/Filter.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,19 @@

import processing.core.PApplet;

// common superclass for JSyn filters that have a 'Q' unitport
abstract class Filter<E extends FilterBiquadCommon> extends Effect<E> {
/**
* Common superclass for JSyn filters that have a 'Q' unitport
* @webref Effects:Filter
*/
public abstract class Filter<E extends FilterBiquadCommon> extends Effect<E> {

public Filter(PApplet parent) {
super(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
Expand Down
12 changes: 5 additions & 7 deletions src/processing/sound/PitchDetector.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,19 @@
/**
* 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;

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.
Expand Down Expand Up @@ -56,14 +54,14 @@ 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
* unreliable) to 1 (only accept perfect measurements). If omitted, uses the
* 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);
Expand Down
4 changes: 2 additions & 2 deletions src/processing/sound/SoundObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -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) {
Expand Down

0 comments on commit ed7e7ff

Please sign in to comment.