How to add a sound effects in Tone function? Please help!!!

Hi admin

How to add a sound effects in Tone function? is there a header file?=]

Please help!!!

is there a header file?

Sure it - Tone.h.

Make sure that you understand what the Tone functions do before you start messing around. Make sure that you understand the limitations, too.

Thank you paul,

Yes I understand the function of Tone and the pitches.h. but is there a way to put some sound effects such as reverb or chorus for the output =], because its only output like midi sound...=]

Again thank you paul :slight_smile:

Yes I understand the function of Tone and the pitches.h. but is there a way to put some sound effects such as reverb or chorus for the output

Apparently, then, you don't understand the Tone library. It is designed to play single notes - of a single frequency. Reverb and other sound effects don't work real well when you can only play a single frequency, do they?

Yeah thanks :slight_smile:
how about the soundbank.gm? hmmm i believe all sound comming on pitches are in soundbank.gm, or can i change the sounds? instead a beep or midi sound?

It might be possible to use the samples stored in soundbank.gm, but you'd have to write a digital to analogue sketch to do it. This link Arduino sketch for high frequency precision sine wave tone sound synthesis | Adrian Freed might be of interest to you.

Thank you very much dxw00d :slight_smile:

IS there a demo for this code? :slight_smile: I am new coding in sound effects
what is this for? :relaxed: =( hmmm i think it represent wave? is there a way to ouput that in speakers? :slight_smile:

int8_t sintable[LUTsize] PROGMEM = { // already biased with +127
023.
127,130,133,136,139,143,146,149,152,155,158,161,164,167,170,173,
024.
176,179,182,184,187,190,193,195,198,200,203,205,208,210,213,215,
025.
217,219,221,224,226,228,229,231,233,235,236,238,239,241,242,244,
026.
245,246,247,248,249,250,251,251,252,253,253,254,254,254,254,254,
027.
255,254,254,254,254,254,253,253,252,251,251,250,249,248,247,246,
028.
245,244,242,241,239,238,236,235,233,231,229,228,226,224,221,219,
029.
217,215,213,210,208,205,203,200,198,195,193,190,187,184,182,179,
030.
176,173,170,167,164,161,158,155,152,149,146,143,139,136,133,130,
031.
127,124,121,118,115,111,108,105,102,99,96,93,90,87,84,81,
032.
78,75,72,70,67,64,61,59,56,54,51,49,46,44,41,39,
033.
37,35,33,30,28,26,25,23,21,19,18,16,15,13,12,10,
034.
9,8,7,6,5,4,3,3,2,1,1,0,0,0,0,0,
035.
0,0,0,0,0,0,1,1,2,3,3,4,5,6,7,8,
036.
9,10,12,13,15,16,18,19,21,23,25,26,28,30,33,35,
037.
37,39,41,44,46,49,51,54,56,59,61,64,67,70,72,75,
038.
78,81,84,87,90,93,96,99,102,105,108,111,115,118,121,124};
039.

int8_t triangletable[LUTsize] PROGMEM = {
042.
0x00,0x02,0x04,0x06,0x08,0x0a,0x0c,0x0e,0x10,0x12,0x14,0x16,0x18,0x1a,0x1c,0x1e,
043.
0x20,0x22,0x24,0x26,0x28,0x2a,0x2c,0x2e,0x30,0x32,0x34,0x36,0x38,0x3a,0x3c,0x3e,
044.
0x40,0x42,0x44,0x46,0x48,0x4a,0x4c,0x4e,0x50,0x52,0x54,0x56,0x58,0x5a,0x5c,0x5e,
045.
0x60,0x62,0x64,0x66,0x68,0x6a,0x6c,0x6e,0x70,0x72,0x74,0x76,0x78,0x7a,0x7c,0x7e,
046.
0x80,0x82,0x84,0x86,0x88,0x8a,0x8c,0x8e,0x90,0x92,0x94,0x96,0x98,0x9a,0x9c,0x9e,
047.
0xa0,0xa2,0xa4,0xa6,0xa8,0xaa,0xac,0xae,0xb0,0xb2,0xb4,0xb6,0xb8,0xba,0xbc,0xbe,
048.
0xc0,0xc2,0xc4,0xc6,0xc8,0xca,0xcc,0xce,0xd0,0xd2,0xd4,0xd6,0xd8,0xda,0xdc,0xde,
049.
0xe0,0xe2,0xe4,0xe6,0xe8,0xea,0xec,0xee,0xf0,0xf2,0xf4,0xf6,0xf8,0xfa,0xfc,0xfe,
050.
0xff,0xfd,0xfb,0xf9,0xf7,0xf5,0xf3,0xf1,0xef,0xed,0xeb,0xe9,0xe7,0xe5,0xe3,0xe1,
051.
0xdf,0xdd,0xdb,0xd9,0xd7,0xd5,0xd3,0xd1,0xcf,0xcd,0xcb,0xc9,0xc7,0xc5,0xc3,0xc1,
052.
0xbf,0xbd,0xbb,0xb9,0xb7,0xb5,0xb3,0xb1,0xaf,0xad,0xab,0xa9,0xa7,0xa5,0xa3,0xa1,
053.
0x9f,0x9d,0x9b,0x99,0x97,0x95,0x93,0x91,0x8f,0x8d,0x8b,0x89,0x87,0x85,0x83,0x81,
054.
0x7f,0x7d,0x7b,0x79,0x77,0x75,0x73,0x71,0x6f,0x6d,0x6b,0x69,0x67,0x65,0x63,0x61,
055.
0x5f,0x5d,0x5b,0x59,0x57,0x55,0x53,0x51,0x4f,0x4d,0x4b,0x49,0x47,0x45,0x43,0x41,
056.
0x3f,0x3d,0x3b,0x39,0x37,0x35,0x33,0x31,0x2f,0x2d,0x2b,0x29,0x27,0x25,0x23,0x21,
057.
0x1f,0x1d,0x1b,0x19,0x17,0x15,0x13,0x11,0x0f,0x0d,0x0b,0x09,0x07,0x05,0x03,0x01,
058.

};
060.

I haven't tried it myself, but according to the code, it outputs on pin 3. The look up tables are to generate sine and triangle waves.

You might want to look at the Ronin 802 synth shield (roninsynth.org) if you want to do more complex synthesis and sound generation.