Switch to full style
Advice on general approaches or feasibility and discussions about game design
Post a reply

[SOLVED ]How can I change the gamebuino startup sound?

Fri Feb 06, 2015 2:47 pm

If I wanted to change the sound the gamebuino makes when it boots up, how could I do it?
Last edited by oddcore on Tue Feb 10, 2015 3:32 pm, edited 1 time in total.

Re: How can I change the gamebuino startup sound?

Sun Feb 08, 2015 3:56 pm

You can change it in libraries/Gamebuino/Gameubuino.cpp, it's the variable
Code:
const uint16_t startupSound[] PROGMEM = {0x0005,0x3089,0x208,0x238,0x7849,0x1468,0x0000};

You will have to re-compile all your games if you want them to use the modified start-up sound though.

Edit : It's in Gamebuino.cpp, not Sound.cpp

Re: How can I change the gamebuino startup sound?

Sun Feb 08, 2015 5:39 pm

Thanks for replying! Just to clarify, I wanted to change the sound the gamebuino makes when you turn it on, not when each game starts. With that in mind, if I do change the Sound.cpp, what do I do then? because it doesn't seem to belong on the SD card, so after I change it, how to I put it on the gamebuino?

Re: How can I change the gamebuino startup sound?

Mon Feb 09, 2015 12:09 am

Could it be in Loader.HEX?

Re: How can I change the gamebuino startup sound?

Mon Feb 09, 2015 7:00 am

I don't think so, I think Loader.hex is launched when you press the C button to go back to the games menu, and, while the startup sound is again played then, I doubt the process would be to change Loader.hex and put that on SD. Sound.cpp sounds more promising, but again, I don't think it would be uploaded on the SD card, as the gamebuino makes that sound with or without the SD card. The problem is I don't know how to load it on the gamebuino if not with the SD, even if I did change the .cpp file.

Re: How can I change the gamebuino startup sound?

Mon Feb 09, 2015 12:49 pm

I see what you are saying. Think of it this way: The gamebuino keeps one game (that includes settings and loader) in its internal memory at a time. If you press C and "exit" the game, loader is loaded into memory and the game is removed. Sound.cpp is a library file in the Arduino IDE. When you compile a HEX file, it takes the code you wrote, AND all of the necessary libraries that your code uses, and writes it to the HEX file. So, if you change the sound in sound.cpp, any game that you compile from that point on that uses sound.cpp, will be compiled with the new sound.cpp.

I'm not 100% sure, but I think i'm at least partially correct.

Re: How can I change the gamebuino startup sound?

Mon Feb 09, 2015 2:36 pm

Wait a second, does this mean that I could change the Start screen in the same fashion?

Re: How can I change the gamebuino startup sound?

Mon Feb 09, 2015 2:56 pm

rodot wrote:You can change it in libraries/Gamebuino/Sound.cpp, it's the variable
Code:
const uint16_t startupSound[] PROGMEM = {0x0005,0x3089,0x208,0x238,0x7849,0x1468,0x0000};

You will have to re-compile all your games if you want them to use the modified start-up sound though.


Why can I not find this line in Sound.cpp?
EDIT: Found it in Gamebuino.cpp, is that it? What do I do after I change it?

Re: How can I change the gamebuino startup sound?

Mon Feb 09, 2015 8:10 pm

1. Take the game's source folder and put it into a folder labeled "Arduino". It should be in your documents or whatever it is.
2. Open the Arduino IDE/Program.
3. Go to File/Open.
4. Click on the name of the game's source folder.
5. Click the big "Verify" button and wait.
6. When it is done, go to the compilation folder (If you haven't set it, then the console will tell you where it is) and take the .HEX .
7. You know what to do from here (PLAY THE GAME).

Re: How can I change the gamebuino startup sound?

Mon Feb 09, 2015 10:00 pm

Well, that's how to edit a game file and put it on the SD card ( which is what you meant by "take the .hex, I assume " ). But seeing as Gameduino.cpp is not a game and also, I want to change the sound that plays on gameduino's power on, instead of the sound at the start of a game, is that really what I need to do? Unless you're telling me that editing the Gameduino.cpp and putting it on the SD will do that? in that case, what happens when I don't have the SD on?
See why I get confused? :oops:
Post a reply