CsoundUnity 4.0.0-alpha.3
Loading...
Searching...
No Matches
Csound.Unity.Utilities.MonoBehaviours Namespace Reference

Classes

class  AudioDisplay
 Visualises audio data as a waveform or frequency spectrum using a LineRenderer. More...
class  AudioOutputRecorder
 Records what Unity finally plays, every channel of it, into a WAV file. More...
class  CopyFilesToPersistentDataPath
 Copies files from Resources or StreamingAssets into Application.persistentDataPath so that Csound can find them via Environment Variables (e.g. SFDIR, SSDIR, SADIR). More...
class  CsoundUnityDoppler
 Writes the geometry between this object and the AudioListener into Csound channels, so an orchestra can produce its own Doppler shift and its own propagation delay. More...
class  CsoundUnityNativeAudioInputMonitor
 On-screen panel for CsoundUnityNativeAudioInput: which device is open, whether anything is arriving, an input meter, and a list to switch device without leaving play mode. More...
class  TableLoader
 Loads audio samples from an AudioClip into a Csound table. More...
class  URLButton
 Opens a URL in the system browser. Wire OpenURL to a Button's onClick and type the address in the inspector, so a scene can carry a clickable credit or documentation link without a script of its own. More...
class  WaveformDrawer
 Read samples from an AudioClip, draw its waveform in a RawImage, and use an Image as a progress bar. More...

Enumerations

enum  AudioDisplayMode {
  AudioListener , AudioSource , CsoundUnityOutput , CsoundUnityAudioChannel ,
  RawSamples , RawSamplesSpectrum
}
 Defines the audio source used by AudioDisplay to retrieve signal data. Modes ending in "Spectrum" perform FFT and display the frequency spectrum. All other modes display the raw waveform. More...
enum  SpectrumWeighting { Flat , Quadratic }
 Per-bin weighting curve applied in spectrum modes only. More...

Enumeration Type Documentation

◆ AudioDisplayMode

Defines the audio source used by AudioDisplay to retrieve signal data. Modes ending in "Spectrum" perform FFT and display the frequency spectrum. All other modes display the raw waveform.

Enumerator
AudioListener 

Reads spectrum data from the scene's AudioListener using Unity's native FFT. Shows the frequency spectrum of the entire scene's mixed audio output. No additional setup required.

AudioSource 

Reads spectrum data from an AudioSource using Unity's native FFT. Works correctly only when the AudioSource is playing a real AudioClip.

Limitation: does NOT reflect audio injected via OnAudioFilterRead — GetSpectrumData reads the clip's source signal, not the post-filter output. Use RawSamplesSpectrum if audio is injected via OnAudioFilterRead.

Assign the AudioSource in the inspector, or leave empty to use the one on this GameObject.

CsoundUnityOutput 

Reads raw samples from the CsoundUnity.OutputBuffer property and displays them as a waveform (no FFT). The buffer size equals ksmps.

Requires updateOutputBuffer to be enabled on the CsoundUnity component.

Assign the CsoundUnity instance in the inspector.

CsoundUnityAudioChannel 

Reads raw samples from a named CsoundUnity audio channel (written in Csound with chnseta) and displays them as a waveform (no FFT). Buffer size equals ksmps.

Assign the CsoundUnity instance and the channel name in the inspector.

RawSamples 

Displays samples provided externally via AudioDisplay.SetSamples as a waveform (no FFT). Call SetSamples every frame with fresh data.

RawSamplesSpectrum 

Computes the frequency spectrum via FFT on samples provided externally via AudioDisplay.SetSamples, then displays the result.

This is the correct mode when audio is injected via OnAudioFilterRead: split L/R channels in OnAudioFilterRead, call SetSamples each frame, and the display will show the per-instrument spectrum efficiently.

Input length must be a power of 2. FFT update rate is configurable via AudioDisplay._fftUpdateRate to trade refresh rate for performance.

◆ SpectrumWeighting

Per-bin weighting curve applied in spectrum modes only.

Enumerator
Flat 

No per-bin weighting — the FFT magnitude is used as-is.

Quadratic 

Multiply each bin by (1 + i²) — emphasises high-frequency bins to compensate for their naturally lower energy in FFT spectra.