#include <Audio.h>
// sawtooth .......rev up sound....
const int16_t tooth_saw[256] = {
0,
-13440,
-26250,
-26040,
-25830,
-25620,
-25410,
-25200,
-24990,
-24780,
-24570,
-24360,
-24150,
-23940,
-23730,
-23520,
-23310,
-23100,
-22890,
-22680,
-22470,
-22260,
-22050,
-21840,
-21630,
-21420,
-21210,
-21000,
-20790,
-20580,
-20370,
-20160,
-19950,
-19740,
-19530,
-19320,
-19110,
-18900,
-18690,
-18480,
-18270,
-18060,
-17850,
-17640,
-17430,
-17220,
-17010,
-16800,
-16590,
-16380,
-16170,
-15960,
-15750,
-15540,
-15330,
-15120,
-14910,
-14700,
-14490,
-14280,
-14070,
-13860,
-13650,
-13440,
-13230,
-13020,
-12810,
-12600,
-12390,
-12180,
-11970,
-11760,
-11550,
-11340,
-11130,
-10920,
-10710,
-10500,
-10290,
-10080,
-9870,
-9660,
-9450,
-9240,
-9030,
-8820,
-8610,
-8400,
-8190,
-7980,
-7770,
-7560,
-7350,
-7140,
-6930,
-6720,
-6510,
-6300,
-6090,
-5880,
-5670,
-5460,
-5250,
-5040,
-4830,
-4620,
-4410,
-4200,
-3990,
-3780,
-3570,
-3360,
-3150,
-2940,
-2730,
-2520,
-2310,
-2100,
-1890,
-1680,
-1470,
-1260,
-1050,
-840,
-630,
-420,
-210,
0,
210,
420,
630,
840,
1050,
1260,
1470,
1680,
1890,
2100,
2310,
2520,
2730,
2940,
3150,
3360,
3570,
3780,
3990,
4200,
4410,
4620,
4830,
5040,
5250,
5460,
5670,
5880,
6090,
6300,
6510,
6720,
6930,
7140,
7350,
7560,
7770,
7980,
8190,
8400,
8610,
8820,
9030,
9240,
9450,
9660,
9870,
10080,
10290,
10500,
10710,
10920,
11130,
11340,
11550,
11760,
11970,
12180,
12390,
12600,
12810,
13020,
13230,
13440,
13650,
13860,
14070,
14280,
14490,
14700,
14910,
15120,
15330,
15540,
15750,
15960,
16170,
16380,
16590,
16800,
17010,
17220,
17430,
17640,
17850,
18060,
18270,
18480,
18690,
18900,
19110,
19320,
19530,
19740,
19950,
20160,
20370,
20580,
20790,
21000,
21210,
21420,
21630,
21840,
22050,
22260,
22470,
22680,
22890,
23100,
23310,
23520,
23730,
23940,
24150,
24360,
24570,
24780,
24990,
25200,
25410,
25620,
25830,
26040,
26250,
26460,
13440,
0
};
// GUItool: begin automatically generated code
AudioSynthWaveformDc dc1; //xy=131,185
AudioSynthWaveformModulated waveformMod1; //xy=385,239
AudioSynthWaveform waveform1; //xy=385,239
AudioOutputAnalog dac1; //xy=582,240
AudioConnection patchCord2(dc1, 0, waveformMod1, 0);
AudioConnection patchCord3(waveformMod1, 0, dac1, 0);
// AudioConnection patchCord3(waveform1, 0, dac1, 0);
// GUItool: end automatically generated code
void setup() {
AudioMemory(30);
// this bit for waveformMod object both freq steps and dc control steps xxxxxxxxxxxxxxxxxx
waveformMod1.begin(0.0, 0, WAVEFORM_ARBITRARY);
waveformMod1.arbitraryWaveform(tooth_saw, 1200);
waveformMod1.amplitude(0.8);
waveformMod1.frequency(500);
waveformMod1.frequencyModulation(2); // octaves
// xxxxxxxxxxxxxxxxxxxxxxxxx
// this bit for waveform only freq steps xxxxxxxxxxxxxxxxxxx
// waveform1.begin(0.0, 0, WAVEFORM_ARBITRARY);
// waveform1.arbitraryWaveform(tooth_saw, 1200);
// waveform1.amplitude(0.8);
// waveform1.frequency(500);
// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
dc1.amplitude(0.0);
} // end setup
void loop()
{
// dc1.amplitude(0);
// for (int i=100; i <= 1000; i++) // inc through range of freqs
// {
// waveformMod1.frequency(i); // for using with waveformMod freq range
// waveform1.frequency(i); // for using with waveform freq range
// delay(100); // needs time to do it at each step
// }
for (float i= -0.5; i <= 0.5; ) // inc dc source val to control freq Mod
{
dc1.amplitude(i);
delay(100); // needs time to do it at each step
i = i+0.01;
}
} // end of loop