Language…
9 users online: autisticsceptile1993, CrazyPencilDawg, DanMario24YT, howardadam1126, iamtheratio, kurtistrydiz, Rhubarb44230, Saela, TheOrangeToad - Guests: 276 - Bots: 312
Users: 64,795 (2,378 active)
Latest user: mathew

AddMusikK - Custom samples are silent

Hello,

I'm composing some music with AddmusikK, and I'm experimenting with inserting custom samples.

I have a WAV file containing a sound (some percussion), I want to insert. I use snesbrr to convert it to brr:
Code
snesbrr.exe -e sample.wav sample.brr


I put this brr file into "AddmusikK/music/custom/samples/sample.brr" (my soundtrack is in "AddmusikK/music/custom/song.txt") and I also put a copy of the brr file into "AddmusicK/samples/sample.brr" (I'm not sure yet where it needs to be or if I really need copies or so, I'm confused).

My first issue was that the brr file has an invalid length: the file size minus 2 shall be a multiple of 9. I used a hex editor and padded some zeroes at the end of the file, now it's accepting my sample. This is my setup in my song.txt:

Code
#amk2

#SPC
{
  ...
}

#samples
{
  #optimized
  "sample.brr"
}

#instruments
{
  ... ; some custom instruments using @8, @13, n1F etc.
  "sample.brr" $8F $E0 $00 $03 $00 ; @39
}

#0

  @39 o4 c1 c1 c1 c1


I convert this to an SPC file using:
Code
AddmusikK.exe -norom custom/song.txt
. Playing the SPC file in my audio player, I hear anything but my custom sample. Any ideas what it is caused by? Is there some tutorial for AddmusikK + snesbrr, showing how exactly to insert custom samples?

UPDATE: I replaced my brr file with one from a soundtrack from this website and it works. Looks like something is wrong with the wav -> brr conversion :/
Originally posted by Super Maks 64
I don't think that $E) is a valid hex number, it probably should be $E0 (shift+0 is ')' ).

Yeah, it was just a typo while posting it here. There's actually $E0 in my file, otherwise AddmusikK would have shown me some error messages ;)
By reading your posts, it sounds like you didn't insert the loop header properly. I don't use Snesbrr so I don't know how it handles loops, so perhaps it can do this automatically if set up right. Padding the end of the file with zeroes will mess up playback though.

In AddmusicK, every BRR file you throw at it must have a two-byte loop header at the beginning. Even files that are not meant to loop must have this header. For unlooped samples, I put 00 00 as my header. Any two bytes will work but I use those. If the file is meant to have a loop point, you have to calculate a two-byte address that will be the header. There's a tutorial here on how to do that (it's not hard), but it's buried somewhere and it took me a long time to find it first time. You can try searching for one here, or I also wrote a little program to calculate an address which I can post if you want.

I'd also not mind looking at your BRR to test things, if you want to upload it someplace.
Make more of less, that way you won't make less of more!
Originally posted by musicalman
By reading your posts, it sounds like you didn't insert the loop header properly. I don't use Snesbrr so I don't know how it handles loops, so perhaps it can do this automatically if set up right. Padding the end of the file with zeroes will mess up playback though.

In AddmusicK, every BRR file you throw at it must have a two-byte loop header at the beginning. Even files that are not meant to loop must have this header. For unlooped samples, I put 00 00 as my header. Any two bytes will work but I use those. If the file is meant to have a loop point, you have to calculate a two-byte address that will be the header. There's a tutorial here on how to do that (it's not hard), but it's buried somewhere and it took me a long time to find it first time. You can try searching for one here, or I also wrote a little program to calculate an address which I can post if you want.

I'd also not mind looking at your BRR to test things, if you want to upload it someplace.

Thank you really much. My sample does not loop, and according to the calculation on the brr's file size, 2 bytes were missing. The trick here is, to prepend two zero bytes to the file, what I did was appending.

I don't know yet if this will be the same for all samples I'm gonna try to create or if I sometimes need to prepend more or less bytes.
No, you should only have to add two bytes to the beginning. The size of the file doesn't matter. If you add two bytes to a file and AddmusicK says it is invalid, something went wrong.
Make more of less, that way you won't make less of more!