Skip to content

Commit

Permalink
Dynamic Music Update (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmunoz502 authored Oct 6, 2024
1 parent db639bf commit a59ca27
Show file tree
Hide file tree
Showing 31 changed files with 549 additions and 165 deletions.
39 changes: 25 additions & 14 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
## Project License(s)
## Project License(s) (Mixes)

Mixed (see various licenses listed in this file)
See various licenses listed in this file.

See details of individual licenses in their respective *.txt files (see project files).

TLDR: Code (*.gd files) are licensed under MIT, but assets (shaders, music, art, writing) are licensed under various CC licenses by respective creators.



## Code License (MIT)

- all files except those listed alongside another license (see licenses listed below, in this file "LICENSE") are licensed under MIT License (https://mit-license.org/)
- all files except those listed alongside another license (see licenses listed below), are licensed under MIT License (https://mit-license.org/)

MIT License

Copyright (c) 2024 by (GitHub Contributors): @TinyTakinTeller, @alexmunoz502, @mielifica, @BurkeZerk, @AlexTheAbyssalNovelist, @debris, @Reed-lzy
Copyright (c) 2024 by (https://github.com/TinyTakinTeller/GodotProjectZero/graphs/contributors)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -32,8 +36,13 @@ SOFTWARE.



## Godot License
- https://godotengine.org/license/
## Addons License(s)

SEE VARIOUS LICENSES CONTAINED WITHIN RESPECTIVE DIRECTORIES UNDER "addons/" :
- res://addons/resources_spreadsheet_view/ | (https://godotengine.org/asset-library/asset/1479) licensed under MIT License (https://opensource.org/license/mit)
- res://addons/gdLinter/ | (https://godotengine.org/asset-library/asset/2520) licensed under MIT License (https://opensource.org/license/mit)
- res://addons/format_on_save/ | (https://godotengine.org/asset-library/asset/2340) licensed under MIT License (https://opensource.org/license/mit)
- res://addons/BulletUpHell/ (https://github.com/Dark-Peace/BulletUpHell) licensed under MIT License (https://opensource.org/license/mit)



Expand All @@ -50,27 +59,25 @@ SEE VARIOUS LICENSES CONTAINED WITHIN RESPECTIVE DIRECTORIES UNDER "resources/"



## Assets License(s)
## Audio License(s)

SEE VARIOUS LICENSES CONTAINED WITHIN RESPECTIVE DIRECTORIES UNDER "assets/" :
- audio music track "To The Death" (to_the_death.mp3) by junipersona licensed under Pixabay (https://pixabay.com/service/license-summary/)
- audio music track "Corpse Rot" (corpse_rot.mp3) by UNIVERSFIELD licensed under CC-BY-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0/)
- audio music track "Criminal District" (criminal_district.mp3) by UNIVERSFIELD licensed under CC-BY-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0/)
- audio music tracks ["Forest Song 1", "20 Axes to a Bed", "There's a Strong Chill in the Air", "Lacrimosa (Requiem Abridged)"] by BurkeZerk licensed under CC-BY-NC-SA 4.0 (https://creativecommons.org/licenses/by-nc-sa/4.0/)
audio music tracks ["axes_arr_mstr_loop.mp3", "forest_arr_mstr_loop.mp3", "strong_chill_arr_mstr_loop.mp3", "lacrimosa_arr_mstr_loop.mp3"] by Skyler licensed under CC-BY-NC-SA 4.0 (https://creativecommons.org/licenses/by-nc-sa/4.0/)
- audio SFX sounds "Indie Friendly Sounds Survival" & "Indie Friendly Sounds RPG Sounds Pack" by Place Holder Assets licensed under "for-purchasing-individuals" (contact creator for licensing)
- audio SFX sound "Keyboard Typing" by Trollarch2 licensed under CC0 (https://creativecommons.org/public-domain/cc0/)
- audio SFX sound "Short, definite fart" by ycbcr licensed under CC0 (https://creativecommons.org/public-domain/cc0/)
- audio "heartbeat-80bpm.wav" by loudernoises licensed under CC0 (https://creativecommons.org/public-domain/cc0/)
- art "res://assets/image/" : Placeholders / WIP



## Addons License(s)
## Art License(s)

SEE VARIOUS LICENSES CONTAINED WITHIN RESPECTIVE DIRECTORIES UNDER "addons/" :
- res://addons/resources_spreadsheet_view/ | (https://godotengine.org/asset-library/asset/1479) licensed under MIT License (https://opensource.org/license/mit)
- res://addons/gdLinter/ | (https://godotengine.org/asset-library/asset/2520) licensed under MIT License (https://opensource.org/license/mit)
- res://addons/format_on_save/ | (https://godotengine.org/asset-library/asset/2340) licensed under MIT License (https://opensource.org/license/mit)
- res://addons/BulletUpHell/ (https://github.com/Dark-Peace/BulletUpHell) licensed under MIT License (https://opensource.org/license/mit)
- image "res://assets/image/soul/soul_16_16.png" licensed under "all rights reserved" by TinyTakinTeller
- other images "res://assets/image/" were created by TinyTakinTeller, but from templates by generative AI



Expand All @@ -79,3 +86,7 @@ SEE VARIOUS LICENSES CONTAINED WITHIN RESPECTIVE DIRECTORIES UNDER "addons/" :
- res://global/const/locale/locale_en.gd by Abyssal_Novelist, Reed, TinyTakinTeller licensed under CC-BY-NC-SA 4.0 (https://creativecommons.org/licenses/by-nc-sa/4.0/)



## Godot License(s)

- https://godotengine.org/license/
Binary file removed assets/audio/20 Axes Arr MSTR.mp3
Binary file not shown.
Binary file removed assets/audio/Forest Arr MSTR.mp3
Binary file not shown.
Binary file removed assets/audio/Lacrimosa Arr MSTR.mp3
Binary file not shown.
Binary file removed assets/audio/Strong Chill Arr MSTR.mp3
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
All of the recordings in this directory are the exclusive copyrighted work of the composer Joseph Philip Burke,
also known under the names "Joe Burke" and "BurkeZerk" and is licensed for use under the CC BY-NC-SA 4.0 license terms.
(https://creativecommons.org/licenses/by-nc-sa/4.0/) Joseph Burke reserves the right to license to any entity more permissive
(https://creativecommons.org/licenses/by-nc-sa/4.0/). Joseph Burke reserves the right to license to any entity more permissive
rights than this license for the works licensed under it in the future. All songs were composed by Joseph Burke,
except where otherwise noted, and he owns all compositions he has written, and all those compositions are licensed
under the same license as the recordings.
Expand Down
File renamed without changes.
19 changes: 19 additions & 0 deletions assets/audio/skyler_newsome/axes_arr_mstr_loop.mp3.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[remap]

importer="mp3"
type="AudioStreamMP3"
uid="uid://boao20b74vwfi"
path="res://.godot/imported/axes_arr_mstr_loop.mp3-ea6304ae84abeb62a6ba70fc3513524d.mp3str"

[deps]

source_file="res://assets/audio/skyler_newsome/axes_arr_mstr_loop.mp3"
dest_files=["res://.godot/imported/axes_arr_mstr_loop.mp3-ea6304ae84abeb62a6ba70fc3513524d.mp3str"]

[params]

loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4
File renamed without changes.
19 changes: 19 additions & 0 deletions assets/audio/skyler_newsome/forest_arr_mstr_loop.mp3.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[remap]

importer="mp3"
type="AudioStreamMP3"
uid="uid://tksoficve1me"
path="res://.godot/imported/forest_arr_mstr_loop.mp3-40d0a76195693e552dfb18bf348c6dab.mp3str"

[deps]

source_file="res://assets/audio/skyler_newsome/forest_arr_mstr_loop.mp3"
dest_files=["res://.godot/imported/forest_arr_mstr_loop.mp3-40d0a76195693e552dfb18bf348c6dab.mp3str"]

[params]

loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4
File renamed without changes.
19 changes: 19 additions & 0 deletions assets/audio/skyler_newsome/lacrimosa_arr_mstr_loop.mp3.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[remap]

importer="mp3"
type="AudioStreamMP3"
uid="uid://ckapo5gkwp0wk"
path="res://.godot/imported/lacrimosa_arr_mstr_loop.mp3-c3a092e97928ba5f1e474339bdb1eb70.mp3str"

[deps]

source_file="res://assets/audio/skyler_newsome/lacrimosa_arr_mstr_loop.mp3"
dest_files=["res://.godot/imported/lacrimosa_arr_mstr_loop.mp3-c3a092e97928ba5f1e474339bdb1eb70.mp3str"]

[params]

loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4
16 changes: 16 additions & 0 deletions assets/audio/skyler_newsome/license_CC_BY_NC_SA_4_0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
All of the recordings in this directory are the exclusive copyrighted work of the composer Skyler Newsome,
also known under the names "Skyler" and "circlesinthesky" and is licensed for use under the CC BY-NC-SA 4.0 license terms.
(https://creativecommons.org/licenses/by-nc-sa/4.0/). Skyler Newsome reserves the right to license to any entity more permissive
rights than this license for the works licensed under it in the future. All songs were composed by Skyler Newsome,
except where otherwise noted, and he owns all compositions he has written, and all those compositions are licensed
under the same license as the recordings.

Note, these works are based on Joseph Philip Burke works (see directory joseph_philip_burke), who granted the rights to do so.

Works currently licensed in this directory under this license:
* "axes_arr_mstr_loop.mp3"
* "forest_arr_mstr_loop.mp3"
* "strong_chill_arr_mstr_loop.mp3"
* "lacrimosa_arr_mstr_loop.mp3" [Originally Composed by W.A. Mozart, Public Domain Composition]

Last License Update: 10/1/2024 (mmddYYYY)
File renamed without changes.
19 changes: 19 additions & 0 deletions assets/audio/skyler_newsome/strong_chill_arr_mstr_loop.mp3.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[remap]

importer="mp3"
type="AudioStreamMP3"
uid="uid://b8g4auk7xg3qw"
path="res://.godot/imported/strong_chill_arr_mstr_loop.mp3-9a1fc4122351442f45621e4a6e3409d2.mp3str"

[deps]

source_file="res://assets/audio/skyler_newsome/strong_chill_arr_mstr_loop.mp3"
dest_files=["res://.godot/imported/strong_chill_arr_mstr_loop.mp3-9a1fc4122351442f45621e4a6e3409d2.mp3str"]

[params]

loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4
65 changes: 36 additions & 29 deletions global/autoload/audio/audio.gd
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,30 @@ extends Node
default_sfx_pitch_variance = clampf(value, 0.0, 1.0)

var _track: int = 0
var _current_audio_player: AudioPlayer

@onready var sfx_queue: AudioQueue = %SfxQueue
@onready var sfx_map: Node = %SfxMap
@onready var music_tracks: Node = %MusicTracks

@onready var music_track_2_heart: MusicTrack = %MusicTrack2Heart
@onready var music_tracks: Node = %Music

@onready var heartbeat_ambience: AudioPlayer = %Heartbeat

###############
## overrides ##
###############


func _input(event: InputEvent) -> void:
if event.is_action_pressed("swap_music_next"):
swap_crossfade_music_next()


func _ready() -> void:
_initalize()
_connect_signals()
for audio_player: AudioPlayer in music_tracks.get_children():
audio_player.finished.connect(_on_music_track_finished)


#############
Expand All @@ -28,7 +37,9 @@ func _ready() -> void:


func _initalize() -> void:
music_tracks.get_child(_track).fade_in()
_track = randi() % music_tracks.get_child_count()
_current_audio_player = music_tracks.get_child(_track)
_current_audio_player.fade_in()


#############
Expand All @@ -37,26 +48,19 @@ func _initalize() -> void:


func swap_crossfade_music_next() -> void:
var track: int = (_track + 1) % music_tracks.get_child_count()
swap_crossfade_music_new(track, null)

_track = (_track + 1) % music_tracks.get_child_count()
swap_crossfade_audio(music_tracks.get_child(_track))
if Game.PARAMS_DEBUG["debug_logs"]:
prints("track", _track)

func swap_crossfade_music(track: int) -> void:
swap_crossfade_music_new(track, null)


func swap_crossfade_music_new(track: int, song_stream: AudioStream) -> void:
if _track == track:
func swap_crossfade_audio(audio_player: AudioPlayer) -> void:
if _current_audio_player == audio_player:
return

var music_track_next: MusicTrack = music_tracks.get_child(track)
var music_track_previous: MusicTrack = music_tracks.get_child(_track)
_track = track

music_track_previous.fade_out()
music_track_next.fade_in()
if song_stream != null:
music_track_next.swap(song_stream)
_current_audio_player.fade_out()
_current_audio_player = audio_player
_current_audio_player.fade_in()


func play_sfx(
Expand Down Expand Up @@ -94,27 +98,30 @@ func _connect_signals() -> void:


func _on_tab_changed(tab_data: TabData) -> void:
if tab_data.id == DarknessScreen.TAB_DATA_ID:
Audio.swap_crossfade_music(1)
elif tab_data.id == StarwayScreen.TAB_DATA_ID:
Audio.swap_crossfade_music(2)
if tab_data.id == StarwayScreen.TAB_DATA_ID:
swap_crossfade_audio(heartbeat_ambience)
elif tab_data.id == "unknown":
Audio.swap_crossfade_music(3)
_current_audio_player.fade_out()
else:
Audio.swap_crossfade_music(0)
var music_player: AudioPlayer = music_tracks.get_child(_track)
swap_crossfade_audio(music_player)


func _on_music_track_finished() -> void:
swap_crossfade_music_next()


func _on_heart_click() -> void:
music_track_2_heart.audio_stream_player.pitch_scale = 2.0
heartbeat_ambience.idle_track.pitch_scale = 2.0


func _on_heart_unclick() -> void:
music_track_2_heart.audio_stream_player.pitch_scale = 1.0
heartbeat_ambience.idle_track.pitch_scale = 1.0


func _on_prestige_condition_pass(_infinity_count: int) -> void:
Audio.swap_crossfade_music(3)
_current_audio_player.fade_out()


func _on_soul() -> void:
Audio.swap_crossfade_music(3)
_current_audio_player.fade_out()
53 changes: 37 additions & 16 deletions global/autoload/audio/audio.tscn
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
[gd_scene load_steps=8 format=3 uid="uid://bp61l7vkkscuw"]
[gd_scene load_steps=14 format=3 uid="uid://bp61l7vkkscuw"]

[ext_resource type="Script" path="res://global/autoload/audio/audio.gd" id="1_7i6rq"]
[ext_resource type="PackedScene" uid="uid://f1stqtkpi6rl" path="res://global/autoload/audio/audio_queue/audio_queue.tscn" id="2_bb4fe"]
[ext_resource type="PackedScene" uid="uid://bu2l4l0jhesyw" path="res://global/autoload/audio/sfx_map/sfx_map.tscn" id="3_4nox4"]
[ext_resource type="PackedScene" uid="uid://bg37hs706yk1o" path="res://global/autoload/audio/music_track/music_track.tscn" id="3_kqvc4"]
[ext_resource type="AudioStream" uid="uid://blrw2u3jb1fbm" path="res://assets/audio/freemusicarchive_org/universfield/criminal_district/criminal_district.mp3" id="5_8j73o"]
[ext_resource type="AudioStream" uid="uid://b44xi3ebx4ju3" path="res://assets/audio/freemusicarchive_org/universfield/corpse_rot/corpse_rot.mp3" id="6_jxnmc"]
[ext_resource type="AudioStream" uid="uid://cjg7wv1kxy1ye" path="res://assets/audio/freesound_org/heartbeat_80bpm/loudernoises_heartbeat_80bpm.wav" id="7_uympl"]
[ext_resource type="PackedScene" uid="uid://cragwwd3j3bqt" path="res://global/autoload/audio/audio_player/audio_player.tscn" id="4_gols3"]
[ext_resource type="Resource" uid="uid://d1yl7vrmvavit" path="res://resources/songs/axes_to_a_bed.tres" id="5_gma2y"]
[ext_resource type="AudioStream" uid="uid://cjg7wv1kxy1ye" path="res://assets/audio/freesound_org/heartbeat_80bpm/loudernoises_heartbeat_80bpm.wav" id="5_s525l"]
[ext_resource type="AudioStream" uid="uid://tksoficve1me" path="res://assets/audio/skyler_newsome/forest_arr_mstr_loop.mp3" id="6_egdi5"]
[ext_resource type="AudioStream" uid="uid://b5ad2ujlpx4s8" path="res://assets/audio/joseph_philip_burke/forest_song_compressed.mp3" id="7_ompd1"]
[ext_resource type="Script" path="res://resources/songs/song.gd" id="8_tgyec"]
[ext_resource type="AudioStream" uid="uid://b44xi3ebx4ju3" path="res://assets/audio/freemusicarchive_org/universfield/corpse_rot/corpse_rot.mp3" id="9_86iap"]
[ext_resource type="AudioStream" uid="uid://blrw2u3jb1fbm" path="res://assets/audio/freemusicarchive_org/universfield/criminal_district/criminal_district.mp3" id="10_5odgy"]

[sub_resource type="Resource" id="Resource_gc3pj"]
script = ExtResource("8_tgyec")
idle_audio_stream = ExtResource("7_ompd1")
combat_audio_stream = ExtResource("6_egdi5")

[sub_resource type="Resource" id="Resource_e4642"]
script = ExtResource("8_tgyec")
idle_audio_stream = ExtResource("10_5odgy")
combat_audio_stream = ExtResource("9_86iap")

[node name="Audio" type="Node"]
script = ExtResource("1_7i6rq")
Expand All @@ -18,19 +32,26 @@ stream_player_count = 16
[node name="SfxMap" parent="SfxQueue" instance=ExtResource("3_4nox4")]
unique_name_in_owner = true

[node name="MusicTracks" type="Node" parent="."]
[node name="Music" type="Node" parent="."]
unique_name_in_owner = true

[node name="MusicTrack0Main" parent="MusicTracks" instance=ExtResource("3_kqvc4")]
audio_stream = ExtResource("5_8j73o")
max_volume = 3.0
[node name="20AxesToABed" parent="Music" instance=ExtResource("4_gols3")]
default_audio = ExtResource("5_gma2y")
max_volume_combat = 0.333

[node name="MusicTrack1Darkness" parent="MusicTracks" instance=ExtResource("3_kqvc4")]
audio_stream = ExtResource("6_jxnmc")
[node name="ForestSong" parent="Music" instance=ExtResource("4_gols3")]
default_audio = SubResource("Resource_gc3pj")
max_volume_combat = 0.4

[node name="MusicTrack2Heart" parent="MusicTracks" instance=ExtResource("3_kqvc4")]
unique_name_in_owner = true
audio_stream = ExtResource("7_uympl")
max_volume = 1.25
[node name="Universfield" parent="Music" instance=ExtResource("4_gols3")]
default_audio = SubResource("Resource_e4642")
max_volume_idle = 3.0

[node name="Ambience" type="Node" parent="."]

[node name="MusicTrack3None" parent="MusicTracks" instance=ExtResource("3_kqvc4")]
[node name="Heartbeat" parent="Ambience" instance=ExtResource("4_gols3")]
unique_name_in_owner = true
default_audio = ExtResource("5_s525l")
max_volume_idle = 1.25
max_volume_combat = 1.25
is_looping = true
Loading

0 comments on commit a59ca27

Please sign in to comment.