Audio Context
Create procedural audio.
Authors and contributors to this experimental extension: aliustaoglu.
Warning
This is an extension made by a community member and it only got through a light review by the GDevelop extension team. As such, we can't guarantee it meets all the quality standards of fully reviewed extensions.
This extension enables you to create your own sounds in real time without using any wav, mp3 or ogg files. It procedurally creates sounds using the Web Audio API and AudioContext.
The Web Audio API provides a powerful and versatile system for controlling audio on the Web, allowing developers to choose audio sources, add effects to audio, create audio visualizations, apply spatial effects (such as panning) and much more.
This extension can easily create chiptunes.
Tip
Learn how to install new extensions by following a step-by-step guide.
Actions
Add detune to a synth
Add detune on top of the main frequency to get cool synth effects.
See parameters
- Parameter 1 (string): Synth name
- Parameter 2 (🔢 Number): Detune value in chips
Technical note: parameters 0, 3 are internal parameters handled by GDevelop.
Add multiple detunes to a synth
Add comma separated detune values to a synth.
See parameters
- Parameter 1 (string): Synth name
- Parameter 2 (string): Comma separated detune values
Technical note: parameters 0, 3 are internal parameters handled by GDevelop.
Add/update filter
Add or update biquad filter.
See parameters
- Parameter 1 (string): Synth name
- Parameter 2 (🔤 String): Filter type (one of: "lowpass", "highpass", "bandpass", "lowshelf", "highshelf", "peaking", "notch", "allpass")
- Parameter 3 (🔢 Number): Frequency [0-20,000]
- Parameter 4 (🔢 Number): Quality factor [0-100]
- Parameter 5 (🔢 Number): Gain value
Technical note: parameters 0, 6 are internal parameters handled by GDevelop.
Create chord
Create a new chord.
See parameters
- Parameter 1 (string): Chord name (imaginary or real)
- Parameter 2 (string): Comma separated notes including octave eg. "C#4, Eb4, G4"
Technical note: parameters 0, 3 are internal parameters handled by GDevelop.
Create an Audio Context
Create a new audio context (In most cases you only need one context and reuse it with the name).
See parameters
- Parameter 1 (string): Context name
Technical note: parameters 0, 2 are internal parameters handled by GDevelop.
Create/update synth
Create or update synth with attack, decay, sustain, release gain and apply filters.
See parameters
- Parameter 1 (string): Name of the synth
- Parameter 2 (string): Context name
- Parameter 3 (🔤 String): Wave type (one of: "sine", "square", "triangle", "sawtooth")
- Parameter 4 (🔢 Number): Attack value
- Parameter 5 (🔢 Number): Decay value
- Parameter 6 (🔢 Number): Sustain value
- Parameter 7 (🔢 Number): Release value
Technical note: parameters 0, 8 are internal parameters handled by GDevelop.
Play chord
Play an existing chord on a synth.
See parameters
- Parameter 1 (string): Chord name
- Parameter 2 (string): Synth name to play the chord on
- Parameter 3 (🔢 Number): Duration
Technical note: parameters 0, 4 are internal parameters handled by GDevelop.
Play note
Play a note a synth you've created before.
See parameters
- Parameter 1 (string): Synth name
- Parameter 2 (🔤 String): Note name (one of: "C", "C#", "Db", "D", "D#", "Eb", "E", "F", "F#", "Gb", "G", "G#", "Ab", "A", "A#", "Bb", "B")
- Parameter 3 (🔢 Number): Octave (0-8)
- Parameter 4 (🔢 Number): Note duration (-1 to play until stopped manually)
Technical note: parameters 0, 5 are internal parameters handled by GDevelop.
Conditions
Context exists
Check if the context already created.
See parameters
- Parameter 1 (string): Context name
Technical note: parameters 0, 2 are internal parameters handled by GDevelop.
Expressions
Expression | Description | |
---|---|---|
AudioContext::ChordNameByIndex(number) |
Get chord name by index. | |
🔢 Number | Chord index | |
AudioContext::NumberOfChords() |
Number of chords (For looping). |
This page is an auto-generated reference page about the Audio Context extension, made by the community of GDevelop, the open-source, cross-platform game engine designed for everyone. Learn more about all GDevelop community-made extensions here.