First of all, you need a Wiiscrubber, and a backup of your disk. open it in wiiscrubber and browse to the sound folder and extract the "wii_mj2d_sound.brsar" file. Open this file in a hex editor. now find the brstm you want to replace in wiiscrubber under stream folder in the sound folder. I'm going to use the "BGM_MAP_W5.32.brstm" (background music for world 5 map)
You have to remember the sting that is like the one highlighted here:
http://i68.servimg.com/u/f68/15/08/00/25/112.jpg. now in the hex editor search for "BGM_MAP_W5.32.brstm" (or whatever file you chose to replace). when you find it, the string that you saw in wiiscrubber should be near it (
http://i68.servimg.com/u/f68/15/08/00/25/210.jpg). Now back in wiiscrubber, replace the original .brstm with the custom one (in my case n_Rainbow32_n.brstm from mario kart wii, because it was the first brstm I found on my PC). After that go back to the brstm in wiiscrubber, you should notice the string has changed (
http://i68.servimg.com/u/f68/15/08/00/25/310.jpg) now back in the Hex editor, change the old string to the new one (
http://i68.servimg.com/u/f68/15/08/00/25/410.jpg). repeat this for all your .brstms now save the edited file with the Hex editor and use wii scrubber or Riivolution, or whatever to replace the original, and all the music, with your edited ones. The music should loop fine, and there is no limit to the size of the file