12 #define USE_TEST_MAIN // use the main() function in test_support.h
32 vox.setFrequency(gliss);
35 logMsg(
"playing swept sin with line segment...");
46 logMsg(
"playing simple sin...");
51 logMsg(
"playing sin-as-phased...");
56 logMsg(
"playing sin-as-scaled...");
67 Sine sine(freq, ampl);
68 logMsg(
"playing computed sin...");
75 Osc wav(freq, ampl, 0.0, 0.0);
76 logMsg(
"playing wavetable sin...");
82 logMsg(
"playing sawtooth...");
88 logMsg(
"playing square...");
104 logMsg(
"playing quiet sin1 (setScale)...");
106 logMsg(
"quiet sin done.");
110 MulOp mul(sineOsc2, 0.4);
111 logMsg(
"playing quiet sin2 (MulOp)...");
114 logMsg(
"quiet sin done.");
119 MulOp mul2(sineOsc3, var);
120 logMsg(
"playing quiet sin3 (StaticVar)...");
122 logMsg(
"quiet sin done.");
128 #define TABLE_SIZE 128
132 float * ptr = & sineTable[0];
139 Buffer oscBuff(1, TABLE_SIZE);
144 logMsg(
"playing truncating wavetable...");
149 logMsg(
"playing interpolating wavetable...");
158 Osc AMmod(6, 0.3, 0.4);
162 logMsg(
"Simple AM/FM sin Examples");
164 logMsg(
"playing AM sin...");
169 Osc FMmod(4, 40, 220);
170 osc2.setFrequency(FMmod);
173 logMsg(
"playing FM sin...");
182 Osc AMmod(6, 0.2, 0.8);
183 Osc FMmod(110, 10, 110);
185 osc.setFrequency(FMmod);
186 logMsg(
"Dumping AM/FM sin...");
189 logMsg(
"Playing AM/FM sin...");
191 logMsg(
"AM/FM sin done.\n");
201 logMsg(
"Sum of sines Examples");
203 logMsg(
"playing uncached sum of sines...");
205 logMsg(
"sum of sines done.\n");
209 logMsg(
"playing cached sum of sines...");
211 logMsg(
"sum of sines done.\n");
222 logMsg(
"Sum of sines 1/f");
224 logMsg(
"sum of sines done.\n");
233 logMsg(
"playing sum of sines loop...");
234 for (
unsigned i = 3; i < 11; i++) {
239 logMsg(
"sum of sines done.");
248 1.2, 0.1, 3.0, 1.34, 0.02, 4.0);
252 logMsg(
"playing uncached sum of sines...");
254 logMsg(
"sum of sines done.");
260 SoundFile fi(CGestalt::dataFolder() +
"oo_table.aiff");
262 logMsg(
"Loading sound file %s = %d frames @ %d Hz", fi.path().c_str(), fi.duration(), fi.playbackRate());
264 Buffer oscBuff(1, fi.duration());
265 oscBuff.
setBuffer(0, fi.mWavetable.monoBuffer(0));
266 oscBuff.mAreBuffersAllocated =
true;
268 logMsg(
"playing wavetable from file...");
280 SHARCLibrary::loadDefault();
287 ADSR adsr(2, 0.04, 0.1, 0.6, 1.0);
289 logMsg(
"playing SHARC sum of sines...");
299 SHARCLibrary::loadDefault();
325 logMsg(
"playing SHARC vector synth...");
356 "Sweep test",
testSweep,
"Test a sine with swept freq and volume swell",
358 "Standard waveforms",
testBasicWaves,
"Demonstrate the standard wave forms",
359 "Scaled sine",
testScaledSin,
"Play a scaled-quiet sine wave",
361 "AM/FM sines",
testAMFMSin,
"Play an AM and FM sine wave",
362 "Dump AM/FM sines",
dumpAMFMSin,
"Dump the graph of the AM/FM sine",
369 "SHARC SOS",
test_SHARC,
"Load/print the SHARC timbre database, play example",
370 "Vector SHARC",
test_SHARC2,
"Show vector cross-fade of SHARC spectra",