10 #define USE_TEST_MAIN // use the main() function in test_support.h
24 vox.setFrequency(line);
26 logMsg(
"playing gliss sin with linear segment...");
32 vox.setFrequency(line2);
33 logMsg(
"playing gliss sin with exponential segment...");
45 logMsg(
"playing swell sin with line segment...");
54 AR a_env(2, 0.6, 1.0);
58 logMsg(
"playing AR sin...");
68 AR a_env(2, 0.2, 1.0);
70 logMsg(
"playing AR sin 2...");
80 Envelope env(3, 0, 220, 0.7, 280, 1.3, 180, 2.0, 200, 3, 100);
85 vox.setFrequency(env);
87 logMsg(
"playing sin with BP envelope on frequency");
97 Envelope env(3, 0, 100, 0.7, 180, 1.3, 180, 2.0, 200, 3, 140);
98 Envelope env2(3, 0.0, 0, 1.0, 1, 2.5, 0, 2.75, 1, 3, 0);
99 vox.setFrequency(env);
101 logMsg(
"playing sin with BP envelopes on frequency & scale");
115 float duration = 3.0;
120 ADSR adsr(duration, attack, decay, sustain, release);
123 logMsg(
"playing sharp ADSR envelope.");
128 ADSR adsr2(duration, 0.5, 0, 1, 0.5);
130 logMsg(
"playing gradual ADSR envelope.");
138 #define BASE_FREQ 440.0
142 ADSR a_env(3, 0.1, 0.1, 0.5, 1);
143 ADSR i_env(3, 1.5, 0, 1, 0.4);
153 car.setFrequency(mod);
157 logMsg(
"playing ADSR FM\n");
173 logMsg(
"playing random gliss...");
188 vox->setFrequency(*f_env);
189 vox->setScale(*a_env);
200 for (
unsigned i = 0; i < 50; i++)
203 logMsg(
"playing mix of 50 random gliss oscs...");
217 vox.setFrequency(line);
218 ADSR a_env(2, 0.6, 0.1, 0.3, 1);
220 logMsg(
"playing env as VCA...");
232 ADSR a_env(3, 0.04, 0.2, 0.5, 1);
233 ADSR i_env(3, 1.0, 0, 1, 1.0);
236 ADSR mChiffEnv(3, 0.01, 0.01, 0.0, 2);
242 mVibrato.setScale(mVibEnv);
247 car.setOffset(mChFilter);
251 mod.setOffset(mVibrato);
252 car.setFrequency(mod);
264 logMsg(
"playing Fancy FM\n");
286 logMsg(
"playing mix of 50 random SOS oscs...");
296 for (
int i = 0; i < 30; i++)
316 for (
unsigned i = 0; i < 100; i++)
318 logMsg(
"playing mix of 100 random-env SOS oscs...");
350 "Glissando test",
testGliss,
"Demonstrate a glissando function",
351 "Swell on aqmplitude",
testSwell,
"Make an amplitude swell",
352 "Frequency envelope",
testFrequencyEnv,
"Play a note with a frequency envelope",
353 "AR sine",
testARSin,
"Play an AR (attack/release) amplitude envelope",
355 "AM/FM envelopes",
testAMFMEnvs,
"Test AM and FM envelopes",
356 "ADSR 2",
testADSR2,
"Play an ADSR (attack/decay/sustain/release)",
357 "ADSR FM",
testADSR_FM,
"Dual-envelope FM example",
358 "Rand Freq envelope",
testRandFreqEnv,
"Play a random-walk frequency envelope",
359 "50 Rand F/A envs",
test50RandFreqEnv,
"Test 50 random frequency envelope players",
363 "Many random SOS",
testManyRandSOS,
"Layer many SumOfSines instruments with envelopes",