About the Base Code (Limitations)
Maybe the most important thing you will have to learn: Code is strict. You cannot have a letter xut of place in code. An extra period can cause the entire app to fail until you correct your error. Don’t complain to other coders about it not working. They know all about it. If code is correct, it will work. If you find your app is broken (because you have errors somewhere), you will often have to go back to square one (the basic app code) if you didn’t save yourself a safe-point that worked. Frequent safe-points are advised.
To hack your app without understanding of code, you can edit the config file. We’ll look at the things you can do at this level first.
Example of a working button in the config file (you can refer to this as you read):
This button is played by KeyQ, and it’s name (which is not displayed on the screen, by the way) is KeyQ. It’s color is #6A287E. On the screen, it shows the label “Q” above it. When you hold this button, it will play again and again, and will play overtop of its previous play if you click it twice quickly. The sound the button plays is located in the “sounds” folder, and is called “drum-bass001” and it is an mp3 file.
LIMITATIONS of the code:
Every button needs its own name (whether it is to be controlled by a key on your keyboard or not). You can name it anything you want, but it must have a name, and the name cannot be the same as any other name. If you name it with a keyname, that key will control the button. If you name it with anything that is not a keyname, no key will control the button.
The code allows you to assign a sound/button to the keys of your keyboard, but not every key on your keyboard.
Here are the keys you can assign:
Here are the names of the keys which you can assign:
(Note: there are names here that don’t work when assigned to keys, usually because when you use a browser to play the app, the browser assigns functions to some keys. Stick to the keys outlined in red above and you should be fine.)
You can assign colors to your buttons (including RGBA).
You can have your buttons display a word if you want (leave blank between two single quotation marks if you don’t want a word). Note that the word will stretch the key size out, which might make formatting your buttons difficult.
Playmode (button functionality)
You can make the buttons do different things: play just once, play over and over again. Cut off when they are clicked a second time. Play over the last sound when they are clicked again.
The language used for this is:
- ‘play-over’ does not restart on touch. sounds overlap
- ‘hold-to-play’ plays infinetly only while holding. stops on release.
- ‘hold-to-play-over’ plays infinetly only while holding. fades out for overlap
You must assign a sound to a button, and that sound must be in the place you tell the config file to find it. If it isn’t there, the app will not work. You must enter the file location in the correct way, so it’s best to start by putting your new sound file in the same place as the file your app already can find, then changing the name in the config, then testing it, then deleting the old file (you don’t have to delete any files, though, you can leave as many as you want in the folder unused).