SoundAsset#
A Sound datablock as the game plays it: its source files (shipped as imported) and settings. The files are decoded when the Sound is made; one that cannot be decoded is listed in Errors and plays silence.
public sealed class SoundAssetMembers: Effects · Errors · Id · Modulation · Name · Seconds · Settings · SoundAsset · Sources · Velocity · Zones
Effects#
public EffectChain? Effects { get; init; }The effect chain every note of this Sound plays through, per voice (null: none).
Errors#
public IReadOnlyList<string> Errors { get; }Why a source could not be decoded, or that the Sound has nothing to play (empty when all is well).
Id#
public string Id { get; }Modulation#
public ModulationChain? Modulation { get; init; }The modulation chain every note of this Sound plays through (null: a plain voice).
Name#
public string Name { get; }Seconds#
public double Seconds { get; }Length in seconds of the first playable variation (0 when none plays).
Settings#
public SoundSettings Settings { get; }SoundAsset#
public SoundAsset(string id, string name, SoundSettings settings, IReadOnlyList<byte[]> sources);Sources#
public IReadOnlyList<byte[]> Sources { get; }The imported files, as they ship in a game package. Several are variations: each play picks one.
Velocity#
public static int Velocity(Note note);A note's velocity (1 to 127) from its volume: the inverse of the General MIDI curve gain = (velocity / 127)², so 0 dB is 127 and -12 dB is about 64.
Zones#
public IReadOnlyList<SoundZone> Zones { get; init; }Initial value: []
Keyzones (empty: the Sound's own file over every note, at its root note).
Related types#
EffectChain · ModulationChain · Note · SoundSettings · SoundZone
Source#
- SoundAsset.cs