AudioAPI reference
Class SfxParams
Namespace: MicroEngine.Audio.Retro
Assembly: MicroEngine.Audio.dll
Guide: Synthesized sound effects
Parameters for a retro sound effect (in the spirit of sfxr). Every game sound in the samples is described with one of these, so audio is original, tweakable and license-free.
public sealed record SfxParams : IEquatable<SfxParams>Inheritance
Implements
Constructors
SfxParams()
public SfxParams()Properties
Arpeggio
Optional arpeggio: frequency multipliers stepped every ArpeggioStep seconds.
public float[]? Arpeggio { get; init; }Property Value
float[]?
ArpeggioStep
Seconds each Arpeggio multiplier lasts (default 0.05).
public float ArpeggioStep { get; init; }Property Value
Attack
Seconds to rise from silence to full volume.
public float Attack { get; init; }Property Value
Crush
Bit-crush to N levels (0 disables) for crunchy hits.
public int Crush { get; init; }Property Value
Decay
Seconds to fade to silence after the sustain. The sound lasts Attack + Sustain + Decay seconds.
public float Decay { get; init; }Property Value
EndFrequency
Frequency at the end of the sound (exponential slide). Null keeps it constant.
public float? EndFrequency { get; init; }Property Value
Frequency
Start frequency in Hz.
public float Frequency { get; init; }Property Value
LowPass
Simple one-pole low-pass in Hz (0 disables). Softens harsh square/noise sounds.
public float LowPass { get; init; }Property Value
Sustain
Seconds held at full volume after the attack.
public float Sustain { get; init; }Property Value
VibratoDepth
Vibrato depth as a fraction of the frequency (0 disables; 0.02 is a light wobble).
public float VibratoDepth { get; init; }Property Value
VibratoRate
Vibrato speed in Hz (default 8).
public float VibratoRate { get; init; }Property Value
Volume
Peak amplitude, 0..1 (default 0.5).
public float Volume { get; init; }Property Value
Wave
The oscillator waveform (square by default).
public Wave Wave { get; init; }Property Value
Methods
<Clone>$()
public SfxParams <Clone>$()Returns
Equals(object?)
public override bool Equals(object? obj)Parameters
obj object?
Returns
Equals(SfxParams?)
public bool Equals(SfxParams? other)Parameters
other SfxParams?
Returns
GetHashCode()
public override int GetHashCode()Returns
ToString()
public override string ToString()Returns
Operators
operator ==(SfxParams?, SfxParams?)
public static bool operator ==(SfxParams? left, SfxParams? right)Parameters
left SfxParams?
right SfxParams?
Returns
operator !=(SfxParams?, SfxParams?)
public static bool operator !=(SfxParams? left, SfxParams? right)Parameters
left SfxParams?
right SfxParams?