Page 1 of 2

FX Synth - make sound effects easily!

PostPosted: Wed Aug 13, 2014 4:08 pm
by yodasvideoarcade
Here's my sound-effects editor. You can use it to create nice sounding effects for your games in a very simple way. And the best: You can edit the sounds directly on your gamebuino and listen to the actual sounds while editing!

Image

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.

Re: FX Synth - make sound effects easily!

PostPosted: Wed Aug 13, 2014 4:19 pm
by Skyrunner65
An editor on the Gamebuino? Genius!

Re: FX Synth - make sound effects easily!

PostPosted: Wed Aug 13, 2014 4:59 pm
by Jolly
That's so cool. :O
LSDJ for Gamebuino. :D

Re: FX Synth - make sound effects easily!

PostPosted: Wed Aug 13, 2014 6:53 pm
by erico
That looks great!

Re: FX Synth - make sound effects easily!

PostPosted: Wed Aug 13, 2014 9:19 pm
by jonnection
I gotta be honest with you.

Could have used a little bit more cowbell.

http://vimeo.com/91715361

Sorry, I meant PROGMEM. :lol:

Re: FX Synth - make sound effects easily!

PostPosted: Fri Aug 15, 2014 6:58 pm
by Joff
Great application Yoda, this was much needed, thanks!

I used it to create sound FXs with my newly released game:

http://gamebuino.com/forum/viewtopic.php?f=17&t=1025

Re: FX Synth - make sound effects easily!

PostPosted: Sat Aug 23, 2014 12:42 pm
by SpikeSpiegel
Hello,

First, thanks for your work, your games are awesomes (invaders, paqman...) and fxsynth is very usefull. But i have some troubles to implement some sounds in my games (BlockBuino, ShootBuino, SnakeAbcBuino).
Ingame some sounds aren't rendering like they are in fxsynth.

So, this is what i have done:
Declare 4 channels in settings.c:
Code: Select all
#define NUM_CHANNELS 4


Game sounds declaration:
Code: Select all
const int soundfx[4][8] =
{
  {0,34,75,1,0,1,7,11}, // LINE_COMPLETED
  {0,33,53,1,0,5,7,3},  // ROTATE
  {0,30,34,10,0,1,7,25} // GAME_OVER
};


For rendering, i am using your method:
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
}


GAME_OVER and LINE_COMPLETED are not rendered correctly. Do i miss something ?
(Framerate is by default 20)

Thanks.

Re: FX Synth - make sound effects easily!

PostPosted: Sun Aug 24, 2014 6:15 pm
by rodot
To make sound effects you should use gb.sound.playPattern

gb.sound.command and gb.sound.playNote are not meant to be used like that.
See the reference page to see the existing functions, sound page to understand how sound works (and why you should use patterns), and download page to get the sound composer (aka tracker).

Re: FX Synth - make sound effects easily!

PostPosted: Tue Aug 26, 2014 11:18 pm
by DFX2KX
Oh, hey, this is neat!

Might use it for music more then sound effects, but it at least gives me a sense of what's going on.

Re: FX Synth - make sound effects easily!

PostPosted: Wed Sep 03, 2014 3:21 pm
by yodasvideoarcade
For me, the tracker doesn't work, it gives me an error after launch.

But if it works, and especially if there's other sounds/music going on at the same time, this sound-fx player may not be working properly, since the music-system can also influence the values.

When the tracker works for me, I will try to adjust the editor accordingly, so it uses the pattern-system for playing the effects.