In a Game

Everything is in the GlowingRifts.SoundGraph namespace.

🔊 SoundGraph Source

Add Component > GlowingRifts > SoundGraph Source adds the component and an AudioSource. It behaves like an AudioSource: playOnAwake, Play(), Stop(), Pause(), UnPause(), isPlaying, and the AudioSource’s volume, 3D settings and mixer output all apply.

The Inspector lists the graph’s exposed properties. Edit one to override the graph’s value on that object. In Play Mode it shows live values with a Fire button for triggers.

🧑‍💻 From Code

using GlowingRifts.SoundGraph;
using UnityEngine;

public class Weather : MonoBehaviour
{
    [SerializeField] SoundGraphSource source;
    [Range(0, 1)] public float rain;

    void Update() => source.SetFloat("Density", rain);

    public void Thunder() => source.SetTrigger("Thunder");
}
MethodDoes
SetFloat(name, value)Sets a Float property
SetVector2(name, value)Sets a Vector 2 property
SetBool(name, value)Sets a Bool property
SetTrigger(name)Fires a Trigger property
SetClip(name, clip)Swaps an Audio Clip property
SetMidiClip(name, clip)Swaps a MIDI Clip property
SetParameter("node.input", value)Sets any unwired node input

Tip

Prefer Blackboard properties for anything a game changes. They are named, ranged and smoothed.

🎚️ UI and Events

GlowingRifts > SoundGraph Property names one exposed property of a SoundGraph Source, so UnityEvents can drive it with no code. Wire a Slider’s On Value Changed to SetFloat, a Toggle to SetBool and a Button to Fire.

🎬 Animation and Timeline

Float and Bool properties can be keyed in the Animation window or Timeline. Press record and move a value in the SoundGraph Source’s Properties section. Curves show as Slot N (the value’s tooltip names its slot). The first 16 Float and Bool properties are animatable.

🌐 Platforms

SoundGraph runs in the Editor and in Windows, macOS, Linux and WebGL builds. On WebGL only the AudioSource’s volume and mute apply, and Microphone nodes are silent.

🔩 Limits

LimitValue
Nodes128
Wires256
Polyphonic voices8
Audio clips16