AudioAPI reference
Class Instrument
Namespace: MicroEngine.Audio.Retro
Assembly: MicroEngine.Audio.dll
Guide: Synthesized sound effects
A tracker-style voice: waveform plus an ADSR envelope (seconds, sustain level 0..1).
public sealed record Instrument : IEquatable<Instrument>Inheritance
Implements
Constructors
Instrument(Wave, float, float, float, float, float, float, float, float, float)
A tracker-style voice: waveform plus an ADSR envelope (seconds, sustain level 0..1).
public Instrument(Wave Wave, float Volume = 0.3, float Attack = 0.005, float Decay = 0.08, float SustainLevel = 0.6, float Release = 0.06, float Pan = 0.5, float VibratoDepth = 0, float VibratoRate = 5, float LowPass = 0)Parameters
Wave Wave
Volume float
Attack float
Decay float
SustainLevel float
Release float
Pan float
VibratoDepth float
VibratoRate float
LowPass float
Fields
Bass
A round triangle wave, for bass lines.
public static readonly Instrument BassField Value
Bell
A sine with a long decay, for chimes.
public static readonly Instrument BellField Value
Lead
A bright 25% pulse with light vibrato, for melodies.
public static readonly Instrument LeadField Value
Pad
A soft, filtered saw with slow attack and release, for chords.
public static readonly Instrument PadField Value
Pluck
A short, filtered square, for arpeggios and accompaniment.
public static readonly Instrument PluckField Value
Properties
Attack
public float Attack { get; init; }Property Value
Decay
public float Decay { get; init; }Property Value
LowPass
public float LowPass { get; init; }Property Value
Pan
public float Pan { get; init; }Property Value
Release
public float Release { get; init; }Property Value
SustainLevel
public float SustainLevel { get; init; }Property Value
VibratoDepth
public float VibratoDepth { get; init; }Property Value
VibratoRate
public float VibratoRate { get; init; }Property Value
Volume
public float Volume { get; init; }Property Value
Wave
public Wave Wave { get; init; }Property Value
Methods
<Clone>$()
public Instrument <Clone>$()Returns
Deconstruct(out Wave, out float, out float, out float, out float, out float, out float, out float, out float, out float)
public void Deconstruct(out Wave Wave, out float Volume, out float Attack, out float Decay, out float SustainLevel, out float Release, out float Pan, out float VibratoDepth, out float VibratoRate, out float LowPass)Parameters
Wave Wave
Volume float
Attack float
Decay float
SustainLevel float
Release float
Pan float
VibratoDepth float
VibratoRate float
LowPass float
Equals(object?)
public override bool Equals(object? obj)Parameters
obj object?
Returns
Equals(Instrument?)
public bool Equals(Instrument? other)Parameters
other Instrument?
Returns
GetHashCode()
public override int GetHashCode()Returns
ToString()
public override string ToString()Returns
Operators
operator ==(Instrument?, Instrument?)
public static bool operator ==(Instrument? left, Instrument? right)Parameters
left Instrument?
right Instrument?
Returns
operator !=(Instrument?, Instrument?)
public static bool operator !=(Instrument? left, Instrument? right)Parameters
left Instrument?
right Instrument?