The Binding of Isaac: Rebirth

The Binding of Isaac: Rebirth

What's That Song?
Add support for mods that use jukebox (also add support for variant music tracks)
after finding this mod I did a bit of experimenting, with the idea that it shouldn't matter whether someone is using this mod or Jukebox or whether the soundtrack mod uses the WhatsThatSongAPI:AddSoundtrack function or the AddTitlesToJukebox function.

I got it working on my end and will be updating the soundtrack menu and jukebox mods.

Basically this update would automatically add support for every soundtrack mod that uses jukebox, rather than the mods needing to be updated to support Whats that song? or you having to manually add more track lists.

The updates I made to this mod are as follows, no pressure to implement these updates and obviously feel free to implement things in a different way than I did
(you can show code on steam using the [code] ... [/code] tags)



In the PopulateMusicIDs function I added a check for the new soundtrack menu feature that allows multiple different versions of a track type
trackID = Isaac.GetMusicIdByName(st .. " " .. musicTable.TrackTypes[ii]) local variants = (Isaac.GetMusicIdByName(st .. " " .. musicTable.TrackTypes[ii] .. " 2") > 0) --check if soundtrack has multiple different tracks for the same track type if variants and trackID < 0 then trackID = Isaac.GetMusicIdByName(st .. " " .. musicTable.TrackTypes[ii] .. " 1") end -- Resolve referred soundtrack IDs if type(v) == "string" and v:sub(1, 1) == "[" and v:sub(-1, -1) == "]" then local resolvedSoundtrack = nil for idx, soundtrack in pairs(musicTable.Soundtracks) do if v:sub(2, -2) == soundtrack then resolvedSoundtrack = soundtrack break end end if resolvedSoundtrack ~= nil and musicTable.SoundtrackTitles[resolvedSoundtrack][ii] ~= nil then musicIDs[trackID] = musicTable.SoundtrackTitles[resolvedSoundtrack][ii] or fallbackID else musicIDs[trackID] = musicTable.SoundtrackTitles.Rebirth[ii] end else if variants then --load the different variants for this track type for iii=1, #musicTable.SoundtrackTitles[st][ii] do trackID = Isaac.GetMusicIdByName(st .. " " .. musicTable.TrackTypes[ii] .. " " .. iii) musicIDs[trackID] = musicTable.SoundtrackTitles[st][ii][iii] end else musicIDs[trackID] = musicTable.SoundtrackTitles[st][ii] or fallbackID end end

At the post_render function I added a check that lets Whats that song? know if the soundtrack menu is playing a song that doesn't get returned by GetCurrentMusicID
WhatsThatSong:AddCallback(ModCallbacks.MC_POST_RENDER, function() musicID = musicManager:GetCurrentMusicID() --if soundtrack menu is using layer/jingle to play something that won't show up on GetCurrentMusicID if JukeBoxTrackOverride and JukeBoxTrackOverride > 0 then musicID = JukeBoxTrackOverride end

and finally if a soundtrack mod is using jukebox to add its title list, this mod can grab the list
--get track titles from mod with jukebox function if Titles == nil then Titles = true end function AddTitlesToJukebox(tableid, name, displayname, soundtrack) WhatsThatSongAPI:AddSoundtrack(name, soundtrack) end
Last edited by ☢ Nato Potato ☢; 15 Aug, 2024 @ 10:41pm
< >
Showing 1-4 of 4 comments
also wouldn't hurt to copy the built in track titles from the jukebox titles.lua list into your 'tablehell' file
AceHand  [developer] 17 Aug, 2024 @ 9:20am 
Hey, and WOW! This is exceedingly amazing, to put simply. I'll be sure to implement these features posthaste. Thanks!

P.S. Big fan of your work. Thank you for taking an interest, and keep doing what you do :)
Oh, just realised this doesn't check if a song imported from jukebox list is a jingle or not, could result in jingles showing up as a currently playing track

should be easy fix though since track order is always the same, in the populate function check if ii is one of the jingle indexes, if it is just import "" and skip to the next one instead of reading the list entry
Last edited by ☢ Nato Potato ☢; 18 Aug, 2024 @ 2:21am
AceHand  [developer] 18 Aug, 2024 @ 12:38pm 
Good catch, that had completely slipped my mind as well. It'll be fixed soon!
Last edited by AceHand; 18 Aug, 2024 @ 1:31pm
< >
Showing 1-4 of 4 comments
Per page: 1530 50