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):

 

workingbuttonThis 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:

 

Keyname

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:

useablekeys

Here are the names of the keys which you can assign:

‘Digit1’
‘Digit2’
‘Digit3’
‘Digit4’
‘Digit5’
‘Digit6’
‘Digit7’
‘Digit8’
‘Digit9’
‘Digit0’
‘Minus’
‘Equal’
‘KeyQ’
‘KeyW’
‘KeyE’
‘KeyR’
‘KeyT’
‘KeyY’
‘KeyU’
‘KeyI’
‘KeyO’
‘KeyP’
‘BracketLeft’
‘BracketRight’
‘KeyA’
‘KeyS’
‘KeyD’
‘KeyF’
‘KeyG’
‘KeyH’
‘KeyJ’
‘KeyK’
‘KeyL’
‘Semicolon’
‘Quote’
‘KeyZ’
‘KeyX’
‘KeyC’
‘KeyV’
‘KeyB’
‘KeyN’
‘KeyM’
‘Comma’
‘Period’
‘Slash’
‘Escape’
‘Enter’
‘Backspace’
‘ArrowLeft’
‘Space’
‘ShiftLeft’

(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.)

Colors

You can assign colors to your buttons (including RGBA).

Label

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

URL

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).

 

 

File Naming Conventions for Samples

The convention is soundtype-001-addendum.

For example:

skindrum-001-ascendingsound
skindrum-002-ascendingsoundshorterversion

Most important note: each sound gets its own number, even if its a version of another sound.

This makes it easy to:

  1. Find skindrum sounds
  2. Not confuse sounds because each one has its own number, regardless of the addendum
  3. Add supplementary notes about the sound without disorganizing the filing system

 

Sometimes though, you can’t stay in sequence with your names. For example, you already have 28 skindrum sounds, and now you want to make a short version of one of them. Best method:

skindrum-001-ascendingsound
skindrum-001-X001-ascendingsoundshortenedlateron

Here, X stands for “child sound.” Using X will keep these files after your parent sound, because X follows other letters and file displays are usually arranged alphabetically.

Example of what it looks like in a folder (in this case, digeridoo and drum sounds). Notice “drum1.” Wouldn’t it be nice if that file had kept with convention?

BPM sample file namig system