Wed Dec 07, 2016 3:57 pm
Wed Dec 07, 2016 10:21 pm
const int soundfx[8][8] = {
{1,27,90,2,7,7,3,7}, //jump <
{1,27,112,1,1,1,6,4}, // walljump <
{0,27,57,1,1,1,6,4}, // unlockdoor <
{0,9,57,1,6,8,7,8}, // land
{0,46,57,1,0,18,7,47}, // getkey <
{0,38,79,3,6,7,7,20}, // finish <
{0,30,68,3,0,0,7,5}, // click <
{0,30,55,1,7,0,7,15} //death <
};
void sfx(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
//WAVEFORM, PITCH, PMD, PMT, VMD, VMT, VOL, LENGTH
}
sfx(/*The id of the sound, for exemple "jump" is 0, land is 3...*/, /*The channel need to be in the range of 0 to 3, if you haven't modify setting.c to change the NUM_CHANNEL, you can use only the first channel (0)*/);
Thu Dec 08, 2016 8:16 am
Thu Dec 08, 2016 5:16 pm
const uint16_t player_damage_sound[] PROGMEM = {0x0045, 0x564, 0x0000};
const uint16_t revolver_sound[] PROGMEM = {0x0045, 0x7049, 0x17C, 0x784D, 0x42C, 0x0000};
const uint16_t grenade_sound[] PROGMEM = {0x0045, 0x012C, 0x0000};
const uint16_t machiegun_sound[] PROGMEM = {0x0045, 0x140, 0x8141, 0x7849, 0x788D, 0x52C, 0x0000};
const uint16_t rocket_sound[] PROGMEM = {0x8045, 0x8001, 0x8889, 0x3C5C, 0x0000};
const uint16_t blast_sound[] PROGMEM = {0x0045, 0x7849, 0x784D, 0xA28, 0x0000};
const uint16_t power_up_sound[] PROGMEM = {0x0005, 0x140, 0x150, 0x15C, 0x170, 0x180, 0x16C, 0x154, 0x160, 0x174, 0x184, 0x14C, 0x15C, 0x168, 0x17C, 0x18C, 0x0000};
const uint16_t enemy_death_sound[] PROGMEM = {0x0045, 0x184, 0x0000};
const uint16_t jump_sound[] PROGMEM = {0x0005, 0x7049, 0x884D, 0x354, 0x0000};
const uint16_t enemy_felt_sound[] PROGMEM = {0x8005, 0x8001, 0x8849, 0xF20, 0x0000};
const uint16_t shotgun_sound[] PROGMEM = {0x0045, 0x7049, 0x334, 0x0000};
const uint16_t laser_sound[] PROGMEM = {0x0005, 0x784D, 0x7849, 0x670, 0x0000};
const unsigned int club_sound[] PROGMEM = {0x8005, 0x784D, 0x7849, 0x318, 0x0000};
gb.playPattern(jumpSound, 1/*I don't know what i does...*/)
Thu Dec 08, 2016 6:04 pm
Thu Dec 08, 2016 9:17 pm
Tue Dec 13, 2016 7:37 pm
Tue Dec 13, 2016 10:04 pm
Wed Dec 14, 2016 8:57 am
Thu Dec 15, 2016 12:11 am
yawn wrote:I'll have to understand how to make music though, I'm more a chiptune composer than a coder My next game will have to feature some music
https://soundcloud.com/user-241462608/longroqd