SatieLang is a Domain Specific Language (DSL) for generative and event-based audio scripting in Unity. Define complex audio behaviors with simple, declarative syntax.
You need Unity 6000.1.1f1. Download from:
- Unity Hub: Search for 6000.1.1f1 in "Install Editor"
- Unity Download Archive: https://unity.com/releases/editor/archive
SatieLang uses API keys for AI-powered features. Setup is simple:
- Copy
Assets/APIKeys.cs.exampletoAssets/APIKeys.cs - Add your API keys:
public static class APIKeys
{
public const string ANTHROPIC = "sk-ant-api03-..."; // Required for AI code generation
public const string OPENAI = "sk-proj-..."; // Required for speech input
public const string ELEVENLABS = "sk_..."; // Required for audio generation
public const string GOOGLE = ""; // Optional
}Get your keys from:
- Anthropic: console.anthropic.com/settings/keys
- OpenAI: platform.openai.com/api-keys
- ElevenLabs: elevenlabs.io/api
The APIKeys.cs file is gitignored so your keys stay private.
Alternative: Set environment variables with the SATIE_API_KEY_ prefix:
export SATIE_API_KEY_ANTHROPIC="sk-ant-..."
export SATIE_API_KEY_OPENAI="sk-proj-..."
export SATIE_API_KEY_ELEVENLABS="sk_..."Environment variables take priority over the file.
- Open the project in Unity
- Navigate to
Assets > Tutorialfolder - Open the "Hello World" scene
- Press Play
- Right-click in the Project window
- Select Create > Satie Script (.sat)
- Rename and edit your script
- Create an empty GameObject in your scene
- Add the SatieRuntime component
- Assign your
.satscript to theScript Filefield
# One-shot sound (plays once)
oneshot "explosion"
volume 0.9
# Looping sound (plays continuously)
loop "ambient"
volume 0.5
Use to to create ranges:
loop "footsteps" every 0.5to1.5
volume 0.6to0.9 # Random volume
pitch 0.9to1.1 # Random pitch
Animate parameters over time:
loop "engine"
volume goto(0and0.8 as inquad in 2) # Fade in
pitch gobetween(0.5and2.0 as linear in 3) # Oscillate
Easing functions: linear, inquad, outquad, inoutquad, incubic, outcubic, inoutcubic
5 * loop "bird_chirp"
volume 0.3to0.6
pitch 0.8to1.3
loop "ambient"
start 2.0 # Delay start
volume goto(0and0.8 in 2) # Fade in over 2 seconds
end 10 fade 2 # End at 10s with 2s fade out
Apply properties to multiple sounds:
group background
volume 0.5
loop "layer1"
volume goto(0and0.5 in 1)
loop "layer2"
volume goto(0and0.5 in 2)
endgroup
loop "flying_sound"
move fly speed 1 # Random 3D movement
visual trail # Visual effect
oneshot "static_sound"
move x 10 y 5 z -10 # Fixed position
# This is a comment
loop "music" # Inline comment
volume 0.5
| Feature | Example |
|---|---|
| Loop | loop "ambient" |
| One-shot | oneshot "click" |
| Repeat | oneshot "beep" every 2to5 |
| Volume | volume 0.8 or volume 0.5to1.0 |
| Pitch | pitch 0.9to1.1 |
| Start delay | start 2.0 |
| End with fade | end 10 fade 2 |
| Fade in | volume goto(0and0.8 in 2) |
| Interpolate | goto(0and1 as inquad in 2) |
| Oscillate | gobetween(0.5and2 as linear in 3) |
| Multiple | 3 * loop "rain" |
| Group | group intro |
For a complete tutorial, see SatieLang Tutorial.