diff --git a/code/_globalvars/lists/ambience.dm b/code/_globalvars/lists/ambience.dm index dce250e381f9..438b959441e6 100644 --- a/code/_globalvars/lists/ambience.dm +++ b/code/_globalvars/lists/ambience.dm @@ -120,7 +120,7 @@ GLOBAL_LIST_INIT(space_ambience,list( 'sound/ambience/ambispace4.ogg', 'sound/ambience/ambispace5.ogg', 'sound/ambience/ambispace6.ogg', - 'sound/ambience/title2.ogg', + 'sound/music/lobby_music/title2.ogg', )) GLOBAL_LIST_INIT(maint_ambience,list( diff --git a/code/_onclick/hud/new_player.dm b/code/_onclick/hud/new_player.dm index 1eeaf40604ab..221d4474b3ee 100644 --- a/code/_onclick/hud/new_player.dm +++ b/code/_onclick/hud/new_player.dm @@ -617,10 +617,6 @@ INITIALIZE_IMMEDIATE(/atom/movable/screen/lobby_music) mouse_opacity = MOUSE_OPACITY_TRANSPARENT plane = SPLASHSCREEN_PLANE screen_loc = "LEFT+0.25,TOP-0.25" - /// World time when the current song started playing for this player - var/start_time - /// World time when the current song will stop playing for this player - var/end_time /atom/movable/screen/lobby_music/New(loc, datum/hud/our_hud, ...) src.hud = our_hud @@ -631,27 +627,34 @@ INITIALIZE_IMMEDIATE(/atom/movable/screen/lobby_music) if(hud?.mymob?.client?.prefs?.read_preference(/datum/preference/numeric/volume/sound_lobby_volume) <= 0) alpha = 0 // we still need to init it incase they turn it back on +#define MUSIC_MAPTEXT(for_step) "[SStitle.music_maptext]
[MAPTEXT("\u25B6 [time2text(max(10, world.time + for_step - start_time), "mm:ss", NO_TIMEZONE)] / [time2text(max(100, SSticker.login_length), "mm:ss", 0)]")]" + /atom/movable/screen/lobby_music/proc/start_tracking() + // cancel active animations animate(src) - alpha = 255 - start_time = world.time - end_time = start_time + SSticker.login_length - START_PROCESSING(SSlobby_music_player, src) - update_maptext() - -/atom/movable/screen/lobby_music/process(seconds_per_tick) - update_maptext() - if(world.time >= end_time) - animate(src, alpha = 0, time = 5 SECONDS) - return PROCESS_KILL + + var/start_time = world.time + var/end_time = start_time + SSticker.login_length + + // adds an animation step every 1 second + // (we use animates here so world init won't slow it down.) + // a 1 second buffer is added to the end time, just in case we run into weird rounding issues + // (start time = 1231, end time = 1300 would mean we skip the last 0.9 seconds of the song, as the last step would be 9.) + for(var/i in 0 to (end_time - start_time + 1 SECONDS) step (1 SECONDS)) + if(i + start_time > end_time) + break // we didn't need that 1 second buffer after all + + animate(src, + time = 1 SECONDS, + maptext = MUSIC_MAPTEXT(i), + alpha = 255, + flags = ANIMATION_CONTINUE, + ) + // cap off the animation with a text fade + animate(src, time = 5 SECONDS, alpha = 0, flags = ANIMATION_CONTINUE) /atom/movable/screen/lobby_music/proc/cancel_tracking() - STOP_PROCESSING(SSlobby_music_player, src) + // interrupt any active antimations and then fade out the text animate(src, alpha = 0, time = 1 SECONDS) -/atom/movable/screen/lobby_music/proc/update_maptext() - maptext = "[SStitle.music_maptext]
[MAPTEXT("\u25B6 [time2text(max(10, min(world.time - start_time, SSticker.login_length)), "mm:ss", NO_TIMEZONE)] / [time2text(max(100, SSticker.login_length), "mm:ss", 0)]s")]" - -/atom/movable/screen/lobby_music/Destroy() - STOP_PROCESSING(SSlobby_music_player, src) - return ..() +#undef MUSIC_MAPTEXT diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index 896153e0d099..227aaaa6b8b9 100644 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -906,11 +906,27 @@ SUBSYSTEM_DEF(ticker) return login_music = new_music - login_length = rustg_sound_length(new_music) || 1500 // default to 2.5 minutes if we can't get the length - var/list/music_file_components = splittext(new_music, "/") - var/music_file_name = length(music_file_components) && music_file_components[length(music_file_components)] || new_music - var/list/music_name_components = splittext(music_file_name, "+") - var/music_name = length(music_name_components) && music_name_components[length(music_name_components)] || music_file_name + + var/music_name + // consult track datums for information + for(var/datum/track/preset/existing_track as anything in subtypesof(/datum/track/preset)) + if(new_music != "[existing_track::song_path]") + continue + music_name = existing_track::song_name + login_length = existing_track::song_length + break + + // if no track is found: get sound length programatically + if(!login_length) + login_length = rustg_sound_length(new_music) || (2.5 MINUTES) // default to 2.5 minutes if we can't get the length + + // if no track is found: get the name from the file path + if(!music_name) + var/list/music_file_components = splittext(new_music, "/") + var/music_file_name = length(music_file_components) && music_file_components[length(music_file_components)] || new_music + var/list/music_name_components = splittext(music_file_name, "+") + music_name = length(music_name_components) && music_name_components[length(music_name_components)] || music_file_name + SStitle.update_music_text(music_name) #undef ROUND_START_MUSIC_LIST diff --git a/code/datums/components/jukebox.dm b/code/datums/components/jukebox.dm index 4fd6d0b205c8..88c47dd8d1b7 100644 --- a/code/datums/components/jukebox.dm +++ b/code/datums/components/jukebox.dm @@ -401,33 +401,75 @@ /// Used to determine time between effects when played var/song_beat = 0 -// Default track supplied for testing and also because it's a banger +// Default track supplied for testing. And also because title3 is a banger /datum/track/default - song_path = 'sound/ambience/title3.ogg' - song_name = "Tintin on the Moon" - song_length = 3 MINUTES + 52 SECONDS - song_beat = 1 SECONDS + song_path = /datum/track/preset/title_three::song_path + song_name = /datum/track/preset/title_three::song_name + song_length = /datum/track/preset/title_three::song_length + song_beat = /datum/track/preset/title_three::song_beat /datum/track/preset/title_zero - song_path = 'sound/ambience/title0.ogg' + song_path = 'sound/music/lobby_music/title0.ogg' song_name = "Endless Space" song_length = 3 MINUTES + 33 SECONDS song_beat = 2 SECONDS /datum/track/preset/title_one - song_path = 'sound/ambience/title1.mod' + song_path = 'sound/music/lobby_music/title1.mod' song_name = "Flip Flap" song_length = 2 MINUTES + 31 SECONDS song_beat = 1 SECONDS /datum/track/preset/title_two - song_path = 'sound/ambience/title2.ogg' + song_path = 'sound/music/lobby_music/title2.ogg' song_name = "Robocop" song_length = 1 MINUTES + 58 SECONDS song_beat = 4 SECONDS /datum/track/preset/title_three - song_path = 'sound/ambience/title3.ogg' + song_path = 'sound/music/lobby_music/title3.ogg' song_name = "Tintin on the Moon" song_length = 3 MINUTES + 52 SECONDS song_beat = 1 SECONDS + +/datum/track/preset/monument + song_path = 'sound/music/lobby_music/monument.ogg' + song_name = "Monument" + song_length = 5 MINUTES + 24 SECONDS + song_beat = 1 SECONDS + +/datum/track/preset/rimward_cruise + song_path = 'sound/music/lobby_music/rimward_cruise.ogg' + song_name = "Rimward Cruise" + song_length = 3 MINUTES + 52 SECONDS // somehow the same length as title3 + song_beat = 1 SECONDS + +/datum/track/preset/traitor + song_path = 'sound/music/lobby_music/traitor.ogg' + song_name = "Absconditus" + song_length = 5 MINUTES + 30 SECONDS + song_beat = 2 SECONDS + +/datum/track/preset/pwmur + song_path = 'sound/music/lobby_music/pwmur.ogg' + song_name = "Plasma Will Make Us Rich" // cheeky rename from Phoron + song_length = 2 MINUTES + 14 SECONDS + song_beat = 1 SECONDS + +/datum/track/preset/moonshine + song_path = 'sound/music/lobby_music/moonshine.ogg' + song_name = "Moonshine" + song_length = 3 MINUTES + 37 SECONDS + song_beat = 1 SECONDS + +/datum/track/preset/burning + song_path = 'sound/music/lobby_music/burning.ogg' + song_name = "Burning" + song_length = 2 MINUTES + 32 SECONDS + song_beat = 1 SECONDS + +/datum/track/preset/daydream + song_path = 'sound/music/lobby_music/daydream.ogg' + song_name = "Daydream" + song_length = 2 MINUTES + 38 SECONDS + song_beat = 1 SECONDS diff --git a/code/game/area/areas/ruins/lavaland.dm b/code/game/area/areas/ruins/lavaland.dm index 8a95cf2ba006..ed74cd6c3a76 100644 --- a/code/game/area/areas/ruins/lavaland.dm +++ b/code/game/area/areas/ruins/lavaland.dm @@ -8,7 +8,7 @@ /area/ruin/powered/clownplanet name = "\improper Clown Biodome" - ambientsounds = list('sound/ambience/clown.ogg') + ambientsounds = list('sound/music/lobby_music/clown.ogg') /area/ruin/unpowered/gaia name = "\improper Patch of Eden" diff --git a/code/game/area/areas/ruins/space.dm b/code/game/area/areas/ruins/space.dm index f0bd865c2097..46a4f403789d 100644 --- a/code/game/area/areas/ruins/space.dm +++ b/code/game/area/areas/ruins/space.dm @@ -592,7 +592,7 @@ // The planet of the clowns /area/ruin/space/has_grav/powered/clownplanet name = "\improper Clown Planet" - ambientsounds = list('sound/ambience/clown.ogg') + ambientsounds = list('sound/music/lobby_music/clown.ogg') //DERELICT SULACO /area/ruin/space/has_grav/derelictsulaco diff --git a/code/game/sound.dm b/code/game/sound.dm index 97b51660741b..d412ec2b2437 100644 --- a/code/game/sound.dm +++ b/code/game/sound.dm @@ -207,7 +207,7 @@ set waitfor = FALSE UNTIL(SSticker.login_music) //wait for SSticker init to set the login music - var/volume = prefs.read_preference(/datum/preference/numeric/volume/sound_lobby_volume) * volume_multiplier + var/volume = prefs.read_preference(/datum/preference/numeric/volume/sound_lobby_volume) * 0.5 * volume_multiplier if(volume > 0 && !CONFIG_GET(flag/disallow_title_music)) SEND_SOUND(src, sound(SSticker.login_music, repeat = 0, wait = 0, volume = volume, channel = CHANNEL_LOBBYMUSIC)) // MAD JAMS for(var/atom/movable/screen/lobby_music/text in mob.hud_used?.static_inventory) diff --git a/code/modules/client/preferences/sounds.dm b/code/modules/client/preferences/sounds.dm index 3fdf1c8ff9fa..c6eb409875b9 100644 --- a/code/modules/client/preferences/sounds.dm +++ b/code/modules/client/preferences/sounds.dm @@ -4,7 +4,7 @@ maximum = 100 /datum/preference/numeric/volume/create_default_value() - return maximum + return maximum / 2 /// Controls ambience volume /datum/preference/numeric/volume/sound_ambience_volume diff --git a/code/modules/holiday/holidays.dm b/code/modules/holiday/holidays.dm index 59399e9adbcc..cee8099b7c93 100644 --- a/code/modules/holiday/holidays.dm +++ b/code/modules/holiday/holidays.dm @@ -257,7 +257,7 @@ /datum/holiday/april_fools/celebrate() . = ..() SSjob.set_overflow_role(/datum/job/clown) - SSticker.set_lobby_music('sound/ambience/clown.ogg', TRUE) // NON-MODULE CHANGE + SSticker.set_lobby_music('sound/music/lobby_music/clown.ogg', TRUE) // NON-MODULE CHANGE for(var/i in GLOB.new_player_list) var/mob/dead/new_player/P = i if(P.client) diff --git a/sound/ambience/license.txt b/sound/ambience/license.txt index 607dd6628e79..04b7e2e3d87e 100644 --- a/sound/ambience/license.txt +++ b/sound/ambience/license.txt @@ -4,10 +4,6 @@ ambidet2.ogg is Night on the Docks, Piano by Kevin Macleod. It has been licensed It has been cropped for use ingame, and also fades in. aurora_caelus.ogg is Music for Manatees, by Kevin Macleod. It has been licensed under CC-BY 3.0 license. It has been cropped for use ingame, and also fades out. -title0.ogg is Endless Space by Solus. It has been licensed under CC-BY 3.0 license. Source file downloaded from https://www.newgrounds.com/audio/listen/74946 -title1.mod is Flip-Flap created by Jakub "AceMan" Szeląg and taken from http://aminet.net/package/mods/xceed/Flipflap -title2.ogg is Robocop Theme (gameboy) remixed by Eric Schumacker -title3.ogg is Tintin On The Moon remixed by Cuboos https://tgstation13.org/phpBB/viewtopic.php?f=10&t=2157 (assumed CC under allowing it to be submitted to the github, see thread) VoidsEmbrace.ogg is Chopin - Waltz in C Sharp Minor (Op. 64 No. 2). It is in public domain. diff --git a/sound/music/lobby_music/burning.ogg b/sound/music/lobby_music/burning.ogg new file mode 100644 index 000000000000..6d0899d1c3ff Binary files /dev/null and b/sound/music/lobby_music/burning.ogg differ diff --git a/sound/ambience/clown.ogg b/sound/music/lobby_music/clown.ogg similarity index 100% rename from sound/ambience/clown.ogg rename to sound/music/lobby_music/clown.ogg diff --git a/sound/music/lobby_music/daydream.ogg b/sound/music/lobby_music/daydream.ogg new file mode 100644 index 000000000000..6b61908c00a0 Binary files /dev/null and b/sound/music/lobby_music/daydream.ogg differ diff --git a/sound/music/lobby_music/license.txt b/sound/music/lobby_music/license.txt new file mode 100644 index 000000000000..2f5ad09ac107 --- /dev/null +++ b/sound/music/lobby_music/license.txt @@ -0,0 +1,23 @@ +title0.ogg is Endless Space by Solus. It has been licensed under CC-BY 3.0 license. Source file downloaded from https://www.newgrounds.com/audio/listen/74946 + +title1.mod is Flip-Flap created by Jakub "AceMan" Szeląg and taken from http://aminet.net/package/mods/xceed/Flipflap + +title2.ogg is Robocop Theme (gameboy) remixed by Eric Schumacker + +title3.ogg is Tintin On The Moon remixed by Cuboos https://tgstation13.org/phpBB/viewtopic.php?f=10&t=2157 (assumed CC under allowing it to be submitted to the github, see thread) + +traitor.ogg is Absconditus by Zhay Tee, licensed by CC-BY NC SA 3.0: https://bandcamp.zhaytee.net/track/absconditus + +clown.ogg attribution unknown + +monument.ogg is Monument by Six Umbrellas, licensed by CC-BY SA 4.0: https://sixumbrellas.bandcamp.com/album/the-psychedelic-and + +rimward_cruise.ogg is Rimward Cruise by Mikazu, licensed by CC-BY SA 3.0: https://soundcloud.com/mikazu-1/baystation-12-rimward-cruise + +pwmur.ogg is Phoron Will Make Us Rich by Sunbeamstress, licensed by CC-BY NC SA 3.0: https://soundcloud.com/sunbeamstress/phoron-will-make-us-rich + +moonshine.ogg is Moonshine by mcbalaam, licensed licensed by CC-BY: (originally from the /tg/ discord) + +daydream.ogg attribution unknown + +burning.ogg attribution unknown diff --git a/sound/music/lobby_music/monument.ogg b/sound/music/lobby_music/monument.ogg new file mode 100644 index 000000000000..5d3ec5c451d4 Binary files /dev/null and b/sound/music/lobby_music/monument.ogg differ diff --git a/sound/music/lobby_music/moonshine.ogg b/sound/music/lobby_music/moonshine.ogg new file mode 100644 index 000000000000..4c6a26649840 Binary files /dev/null and b/sound/music/lobby_music/moonshine.ogg differ diff --git a/sound/music/lobby_music/pwmur.ogg b/sound/music/lobby_music/pwmur.ogg new file mode 100644 index 000000000000..7bea1c330be1 Binary files /dev/null and b/sound/music/lobby_music/pwmur.ogg differ diff --git a/sound/music/lobby_music/rimward_cruise.ogg b/sound/music/lobby_music/rimward_cruise.ogg new file mode 100644 index 000000000000..479039ea5b6b Binary files /dev/null and b/sound/music/lobby_music/rimward_cruise.ogg differ diff --git a/sound/ambience/title0.ogg b/sound/music/lobby_music/title0.ogg similarity index 100% rename from sound/ambience/title0.ogg rename to sound/music/lobby_music/title0.ogg diff --git a/sound/ambience/title1.mod b/sound/music/lobby_music/title1.mod similarity index 100% rename from sound/ambience/title1.mod rename to sound/music/lobby_music/title1.mod diff --git a/sound/ambience/title2.ogg b/sound/music/lobby_music/title2.ogg similarity index 100% rename from sound/ambience/title2.ogg rename to sound/music/lobby_music/title2.ogg diff --git a/sound/ambience/title3.ogg b/sound/music/lobby_music/title3.ogg similarity index 100% rename from sound/ambience/title3.ogg rename to sound/music/lobby_music/title3.ogg diff --git a/sound/music/lobby_music/traitor.ogg b/sound/music/lobby_music/traitor.ogg new file mode 100644 index 000000000000..ae15de2fb21a Binary files /dev/null and b/sound/music/lobby_music/traitor.ogg differ diff --git a/strings/round_start_sounds.txt b/strings/round_start_sounds.txt index 7b95d564c993..c34d878cb74e 100644 --- a/strings/round_start_sounds.txt +++ b/strings/round_start_sounds.txt @@ -1,5 +1,10 @@ -sound/ambience/title0.ogg -sound/ambience/title1.mod -sound/ambience/title2.ogg -sound/ambience/title3.ogg -sound/ambience/clown.ogg +sound/music/lobby_music/burning.ogg +sound/music/lobby_music/daydream.ogg +sound/music/lobby_music/monument.ogg +sound/music/lobby_music/pwmur.ogg +sound/music/lobby_music/rimward_cruise.ogg +sound/music/lobby_music/title0.ogg +sound/music/lobby_music/title1.mod +sound/music/lobby_music/title2.ogg +sound/music/lobby_music/title3.ogg +sound/music/lobby_music/traitor.ogg