SoundAlbum ​
Inherits: DatabaseResource < Resource
A collection of tracks that play one after the other: the music of a world, a zone or a weather, or the music of a fight. An album is a database kind (Audio > Music Albums) of two kinds, Music and Combat Music. It says in which order the tracks play (in order, shuffled so every track plays before one repeats, truly random, or by the weight of each track), the time between two tracks, whether the album starts again when it is over, and how the tracks fade. A world, a zone, a weather and an encounter choose an album through a SoundSource. See docs: Audio > Music Albums.
Properties ​
AlbumKind | album_kind | AlbumKind.MUSIC |
PlayOrder | play_order | PlayOrder.SHUFFLE |
Array[AlbumTrack] | tracks | [] |
float | gap_min | 0.0 |
float | gap_max | 0.0 |
bool | loop_album | true |
float | volume_db | 0.0 |
float | fade_seconds | -1.0 |
bool | restart_each_fight | true |
Methods ​
PackedStringArray | get_paths() |
AlbumCursor | make_cursor( rng: RandomNumberGenerator ) |
float | roll_gap( rng: RandomNumberGenerator ) |
PackedStringArray | validate() |
Enumerations ​
enum AlbumKind ​
The two kinds of album: the pickers show the albums of the kind they need
- MUSIC =
0 - COMBAT =
1
enum PlayOrder ​
How the next track is chosen
- IN_ORDER =
0 - SHUFFLE =
1 - TRUE_RANDOM =
2 - WEIGHTED =
3
Property descriptions ​
AlbumKind album_kind = AlbumKind.MUSIC ​
Music (the music of a place) or Combat Music (the music of a fight)
PlayOrder play_order = PlayOrder.SHUFFLE ​
In order: the list from the top. Shuffle: every track plays once, in a new random order, before any plays again. True random: any track, the same one may come twice in a row. Weighted: any track, by its weight
Array[AlbumTrack] tracks = [] ​
The tracks
float gap_min = 0.0 ​
The silence between two tracks, in seconds (a random time between the two; 0 = the next track follows at once)
float gap_max = 0.0 ​
No description yet.
bool loop_album = true ​
When every track has played, start again (on) or stop (off: the music of the place below takes over)
float volume_db = 0.0 ​
How loud the album is (dB)
float fade_seconds = -1.0 ​
The seconds one track fades into the next, and the seconds the album takes to come in (-1 = the project's default)
bool restart_each_fight = true ​
Combat music only: the combat music plays from the beginning each fight (on) or goes on where it was (off)
Method descriptions ​
PackedStringArray get_paths() ​
The files of the album (the ones that have a path)
AlbumCursor make_cursor( rng: RandomNumberGenerator ) ​
A cursor that picks the tracks of this album one by one
float roll_gap( rng: RandomNumberGenerator ) ​
The silence before the next track, picked now (seconds)
PackedStringArray validate() ​
The warnings of this album (shown by the editor)