Ok, brief explanation on how to do it, but then you're on your own. Create a file that is a 1 bar loop. Convert it to 8 bit unsigned mono and 32768 samples long. Hint on the last part, making it exactly 1 second long and then converting it to 32678 Hz sample rate should at least get you close. You might need to manually trim or add a couple of samples with a hex editor. If you're adding samples, repeat the last sample value in the file or so. (Who ever said this was supposed to easy?)
Run the following Python script. It will convert the file you've created to the 4-bit format the Gameboy so much craves and create a new ROM with your sample.def fourbit(x): return ord(x) & 0xf0 def fatconv(fn): f = open(fn + ".raw", "rb") x = f.read() f.close() if len(x) != 32768: print "File should be 32768 samples long, yo. 8-bit unsigned mono is where it's at, dawg. Raw with no header. (That's what bshe said.)" return g = open("amenizer.gb", "rb") gb = g.read(16384) g.close() y=map(fourbit,x) y=zip(y[0::2],y[1::2]) #f = open(fn + "-conv.bin", "wb") g = open(fn + "-rom.gb", "wb") g.write(gb) for i in y: #f.write(chr(i[0] | i[1]>>4)) g.write(chr(i[0] | i[1]>>4)) f.close() fatconv("filenamehere")
However, the final version of this application, when it comes out, will surely blow your minds. Just a prediction.
First off, thanks for taking the time to post this. Now, let's assume I have a basic knowledge of snakes, and even less for coding. Did a bit of reading last night, and pretty sure I can figure out how to cast this spell. Only questions I have, quite probably dumb ones, in the incantation above, the part that mentions 'dawg's' and stuff; should I leave that as is, or am I supposed to add my own 'something' to this line, eye of newt, tongue of frog, etc? Also, at the bottom 'filenamehere'; is this where I would put the name I want the file to have when it is created, or the name of my audio sample?
Are there any other fields above that I need to change or anything? Last but not least, do I put this in a folder with my sample and just start chanting the above passage and a rom appears?
Looking forward to further investigating the black arts of rom creation and the arcane knowledge held within.
Last edited by Infinity Curve (Mar 11, 2013 1:09 pm)