How to make Custom Lenghts for Songs. [music.bnk way]

How to Make Music Mods pt2
by Alex Davis
Welcome to se second part of the 'How to make music mods' tutorial, this time we're going to make custom lenghts for our music mods, before we start we need our music.bnk, u can get it by extracting everything but if u dont have it i can give you one here, its clean isnt modified so don't worry, try to make a copy oof it and modify the copy not the original one, k ?., lets begin then.
What we going to need
- music.bnk
- 010 Editor (32 bits / 64 bits)
- audio editor
- a notepad to write some important stuff
- patiente and enthusiasm
Ok, now that we have the neccesary lets begin our modding!, now ill tell u the pros and the cons of making a md like this, the pros is that we can have songs with custom lenghts, our mods cant last as far as we can, and it doesnt sound glitchy and also we can mod the 'broken songs', and welp... the cons are that, if we mod just 1 song from our music.bnk we will have to modify it again if we want to add another mod so if u make a single mod with a music bnk it ma collide with other ones, this way of making mods its more personal than public, i mean u can do this for your own mods, cuz it can cause trouble in forums, but we will make compatible mods soon.
first of all we need to do the same as we did in the first tutorial but not respecting the original lenght, remember were making custom lenghts, so ill go directly to the point, here i have a mod that is customized by me, and we will use it for the exmaple of this tutorial.
now i have all my wav files ready to mod (im modding black yellow moebius) and every file is with custom lenght , the lenght i want.

now we will open 010 editor and open it with our clean music.bnk ( its prefferable to make a copy of the file and modify the copy)
now lets start modifyn the files one by one, lets start with 119305510.wav. we copy the name and we search it in the 010 editor (ctrl+f) and select UnsignedInt (32)

we will find 4 things,

mostly of the looping tracks contain 4 ocurrences, but the ones that doesnt loop dont, in this case, this track does looping, and we have to look for the first result and it will take us here and automatically will select 4 bites, we have to pay attention to the 12 bites in total that we are going to see here...

the first 4 bytes selected are the id or name of the file, the next 4 are the offsets of the files and the other 4 bites are the bytes that we going to need to replace, make sure u write these information, u have to see the information in the Unsigned iNT box, it should be
first 4 bites 119305510
second 4 bitres 91040
third 4 bites 5144
if you dont know where they are just look at the pic where its located the Unsigned box, andcompare to what a write above, now its nice to write this information, each looping track has this thing of offsets and bytes, so per mod u may do this twice or three times, there are exceptions..
now that we know that the file 119305510 has an offset of 91040 and 5144 bytes lets begin modyfing the bytes.
now we have t convert our wavs to stream files and when we are done we have to open in a new tab in 010 editr the stream file of the track were editing, in this case 119305510.stream, and it will open a new tab with a lot of bytes
NOTE: YOU HAVE TO OPEN THE STREAM FILES, NO THE WAV FILES.
once its done lets go to the music.bnk tab and find (Text (t)) 'data', and select the first data u find, the upper cased one, when u are done with that just select the RIFF byte down below, cjust click once the 52

and type CTRL+G and there is gpoing to be a new box open where u can goto a byte, here u have to put the offset of the track plus the symbol '+' before the offset, like this '+91040' that means that the bytes of the track are located 91040 bytes forward, and were going to 91040 bytes forward, if u dont put the + symbol were going to the 91040th byte, and we dont want that, its kinda messy, once we pushed enter were goingo to find another RIFF
we just leave the musisc.bnk there and we move to the stream file, once were in the stream file in 010 editr we will find another RIFF with a lot of bytes, and i u remember, the track has 5144 bytes, so we have to select 5144 bytes of the stream file, we can go to the byte number 5144 (ctrl+g > 5144) and select from the byte 5144 to the start of everything, if u have a doubt of how many bytes have u selected down below in the program it tells u how many byte u ahve select, once we have 5144 selected we copy it (ctrl+c), go to music.bnk and select from the riff that we were in, 5144 bytes, you will notice that once you reach 5144 you will encounter another riff, thats the bytes of another track, now that its replaced lets move on in modifyng the lenght...
dont worry guys, the hard part its done...
now, lets find our id again with ctrl+f (UnsigendInt (32)) 119305510 and go to the las ocurrence. u will see that the last 3 ocurrences are closer to each other, now, we have to look in the right part of the bytes something like this
HÖ»[

we have to select 8 bytes after that symbol, we dont have to modify the HÖ»[, as u can see we have to modify A6 AA AA AA F4 F8 E8 40, and now u may wondering, how ?, when u select those 8 bytes if you check the DOUBLE box in the inspector table it will be 51143.64xxxxx, thats the loop point or duration in miliseconds, now, lets check out how many time does our119305510 file last. (i use audacity to check precise timing) (here u have to use the wav files) once i selected everything audacity tells me that the track lasts 13 seconds with 707 miliseconds, and that in miliseconds is
13707 miliseconds, and we have to replace 13707 with 51143.64xxxx, by just double clicking the double box and modifying it and the bytes will bve modified to 00 00 00 00 80 C5 CA 40, (depends on the files ure modifyng),
NOW were not done yet we have to do the same thing two times more, u see aabove the A6 AA AA AA F4 F8 E8 40 ?, YES, there is another 8 bites with the same name, i mean the 8 bytes are repeated above the ones that we modified, lets modify it again replacing the lenght in the double box, now, we have to modify one last thing. the third bytes are always closer to the 3 ocurrences (the light blue selected bytes) u have to look which byte correpond to the one we have to modify, mostly of the ends in 40 01, but u can check one by one and in the double box will show u number, look for the byte when u find 51143.64xxxx... GOTCHA, i found it was the first AA , do you see it ? here!

u have to replace them again in the double box by putting the time in miliseconds again,
U have to do this with all the tracks of the song, some of them may not need the byte-replacement process, but once u do u it u will get practice and do it faster, once everything its ok, save the music.bnk in
PAYDAY2/assets/mod_overrides/Yourmodname/soundbanks
or
PAYDAY2/assets/mod_overrides/folderformusicbnk exclusively/soundbanks
once u've done that try your mod and you will see that evyerthing runs ok, no glitches, and custom lenght for your music mods!; any doubt just comment down below.
Replies

I'm sorry to bother you, but I have a problem with customization of the track. As you wrote in this forum, we need to find the bytes of a given track in music.bnk. I'm going to do a mod that replaces the Hard Time. Found, and are shown only three things or like the picture. There should be four. Maybe I do something wrong? :(
PAYDAY2/assets/mod_overrides/Yourmodname/soundbanks
or
PAYDAY2/assets/mod_overrides/folderformusicbnk exclusively/soundbanks
No no no no no, please don't ever do that.
Think about that. 2 music mods both modify the music.bnk, which one does it load? Pick the first and the second breaks, pick the second and the first breaks.
Any modifying of the music.bnk should be done with a script and installed with the bundle modder. Last I checked the bundle modder automatically condenses scripts into one music.bnk file so it supports all music mods at once.
Really you shouldn't install these as overrides at all. Any new music added in by an update will just be silence until you update all music mods since the music.bnk doesn't contain any entries for the new song. Installing it as a pdmod means it'll get removed automatically do nobody gets confused.