Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 5 additions & 25 deletions docs/godot.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# AMY in Godot

AMY works as a [GDExtension](https://docs.godotengine.org/en/stable/tutorials/scripting/gdextension/index.html) addon for Godot 4.3+, with support for both **native** (macOS, Linux, Windows) and **web** exports.
The AMY synthesizer engine works as a [GDExtension](https://docs.godotengine.org/en/stable/tutorials/scripting/gdextension/index.html) addon for Godot 4.3+, with support for both **native** (macOS, Linux, Windows) and **web** exports.

On native platforms, AMY runs as a C library via GDExtension and routes audio through Godot's `AudioStreamGenerator`. On web, AMY runs its own WASM module with AudioWorklet and the GDScript wrapper sends wire messages via `JavaScriptBridge`.

Expand Down Expand Up @@ -73,39 +73,18 @@ func _ready():

### 4. Configure AMY (optional)

Set config properties on the `Amy` node **before** adding it to the tree:
Set [config properties](api.md) on the `Amy` node **before** adding it to the tree:

```gdscript
var amy: Amy

func _ready():
amy = Amy.new()
amy.startup_bleep = false
amy.reverb = false
amy.echo = false
amy.max_oscs = 64
amy.default_synths = true
add_child(amy) # config is applied when AMY starts in _ready()
```

**Available config properties:**

| Property | Type | Default | Description |
|----------|------|---------|-------------|
| `chorus` | bool | `true` | Enable chorus effect |
| `reverb` | bool | `true` | Enable reverb effect |
| `echo` | bool | `true` | Enable echo/delay effect |
| `default_synths` | bool | `false` | Load default GM synth patches on startup |
| `partials` | bool | `true` | Enable partial synthesis |
| `custom` | bool | `true` | Enable custom oscillator type |
| `startup_bleep` | bool | `false` | Play a short bleep on startup |
| `audio_in` | bool | `false` | Enable audio input |
| `max_oscs` | int | `180` | Maximum number of oscillators |
| `max_voices` | int | `64` | Maximum number of voices |
| `max_synths` | int | `64` | Maximum number of synths |

These properties are also visible in the Godot inspector when you use `Amy` as a scene node.

## Web Export

AMY works on web exports. The native GDExtension isn't used on web — instead, AMY's pre-built WASM module runs via JavaScript and the `Amy` class automatically switches to using `JavaScriptBridge`.
Expand Down Expand Up @@ -140,7 +119,7 @@ AMY works on web exports. The native GDExtension isn't used on web — instead,
YourGame.pck # packed game assets
YourGame.audio.worklet.js # Godot audio worklet
YourGame.audio.position.worklet.js # Godot audio position worklet
enable-threads.js # COOP/COEP service worker
enable-threads.js # COOP/COEP service worker for AudioWorklet support
web_audio/ # AMY audio engine
amy.js
amy.wasm
Expand All @@ -150,7 +129,8 @@ AMY works on web exports. The native GDExtension isn't used on web — instead,
enable-threads.js
```

6. **Serve with a web server** (e.g. `python3 -m http.server`). The included `enable-threads.js` service worker handles the required COOP/COEP headers for AudioWorklet support. The first page load may auto-reload once.
Or run locally: `python3 -m http.server` from your `dist` folder and go to `localhost:8000`.


## How It Works

Expand Down
Loading