If you like it, I'd be happy to recieve some comments and donations on Paypal to yoda@yodasvideoarcade.com
Controls:
UP/DOWN to move cursor up and down (flashing on the left side)
LEFT/RIGHT to change the slider-value in the line of the cursor.
A to play the sound.
B to change the waveform (square / noise, shown in the top-left corner)
How to implement the sounds?
Very easy. Take this code at the end of your source:
- Code: Select all
void playsoundfx(int fxno, int channel) {
gb.sound.command(0,soundfx[fxno][6],0,channel); // set volume
gb.sound.command(1,soundfx[fxno][0],0,channel); // set waveform
gb.sound.command(2,soundfx[fxno][5],-soundfx[fxno][4],channel); // set volume slide
gb.sound.command(3,soundfx[fxno][3],soundfx[fxno][2]-58,channel); // set pitch slide
gb.sound.playNote(soundfx[fxno][1],soundfx[fxno][7],channel); // play note
}
Then put this in the beginning of your code, where you define your variables:
- Code: Select all
const int soundfx[3][8] = {
{1,2,3,4,5,6,7,8}, // sound 0
{1,2,3,4,5,6,7,8}, // sound 1
{1,2,3,4,5,6,7,8}, // sound 2
};
Each line of 8 numbers represents one sound. Of course you have to change the "3" in the definition-line to the number of sounds you're using, and add/delete lines so it matches. Change the numbers 1-8 to what the editor shows you on screen:
- The first number is the value next to the waveform (either 0 or 1).
- The other numbers are on the right side, top to bottom.
Then, if you want to play a sound in your game, just call
- Code: Select all
playsoundfx(number,channel);
... where "number" is the sound-number (0, 1, 2 etc.) and "channel" is the playing channel. "0" is the first channel. If you didn't change your settings.c, you can only use one channel. To use more than one channel, change it in your settings.c to 4 sound channels, as I did in the new Asterocks and Invaders.
What are the parameters?
Basic sound and pitch:
- Waveform is the basic-waveform of your sound, either square or noise. Switch with B-button.
- Slider next to the waveform is the basic-pitch of your sound. Left is low, right is high.
Modulation of the pitch:
- PMD means pitch modulation depth. The exact middle of the slider is no modulation. On the left is downward, right is upward.
- PMT means pitch modulation time. 0 is no pitch-modulation. 1 is very quick, 2 is slower etc.
Modulation of the volume:
- VMD means volume modulation depth. 0 on the left is no modulation, 1 is volume gets lower, 2 is volume gets lower faster etc.
- VMT means volume modulation time. 0 is no modulation. 1 is fastest modulation.
Generals:
- VOL is the general volume of the sound (0 to 7, 0 is silent).
- LEN is the length of the sound (0 is nothing, higher values are longer) in 1/20secs.
- MEM is the memory-location. The editor holds 13 sounds at a time. Don't forget to write them down, since you can't save them.
You can use the MEM locations to try how different sounds for your game go together.