CSL 5.2

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

Macros | Functions
Test_Envelopes.cpp File Reference
`#include "Test_Support.cpp"`

Go to the source code of this file.

## Macros
#define | USE_TEST_MAIN
#define | BASE_FREQ 440.0
| FM using 2 oscs and 2 ADSRs.

## Functions
void | testGliss ()
| Apply a glissando to a sine with a LineSegment.
void | testSwell ()
| test an amplitude swell
void | testARSin ()
| AM and FM using the dynamic scale and frequency inputs.
void | testARSin2 ()
| Do the same using the Envelope as an effect.
void | testFrequencyEnv ()
| Test an envelope applied to frequency.
void | testAMFMEnvs ()
| Test an envelope applied to frequency & scale.
void | testADSR2 ()
| Demonstrate an ADSR.
void | testADSR_FM ()
void | testRandFreqEnv ()
| test the rand env as the freq of a SOS
UnitGenerator * | createRandFreqEnvPatch (float dur)
| Function to create and answer a RandFreqEnv UGen patch.
void | test50RandFreqEnv ()
| set up 50 RandFreqEnv patches
void | testEnvScale ()
| test the use of scaling
void | testFancy_FM ()
| FM with vibrato (with AR-envelope), attack chiff (filtered noise with AR-envelope), and random freq. drift and ampl. swell envelopes.
void | testComplexEnvelope ()
| Make an envelope from scratch by adding breakpoints.
UnitGenerator * | sosNote (float dur, float frq, float amp)
void | testManyRandSOS ()
void | runTests ()

## Macro Definition Documentation

#define USE_TEST_MAIN

Definition at line 10 of file Test_Envelopes.cpp.

#define BASE_FREQ 440.0

FM using 2 oscs and 2 ADSRs.

Definition at line 138 of file Test_Envelopes.cpp.

Referenced by testADSR_FM(), and testFancy_FM().

## Function Documentation

void testGliss | ( |  | ) |

Apply a glissando to a sine with a LineSegment.

Definition at line 20 of file Test_Envelopes.cpp.

References csl::LineSegment::dump(), kExpon, kLine, csl::logMsg(), Osc, and runTest().

void testSwell | ( |  | ) |

test an amplitude swell

Definition at line 40 of file Test_Envelopes.cpp.

References csl::logMsg(), Osc, and runTest().

void testARSin | ( |  | ) |

AM and FM using the dynamic scale and frequency inputs.

Definition at line 52 of file Test_Envelopes.cpp.

References csl::logMsg(), Osc, runTest(), and csl::Envelope::trigger().

void testARSin2 | ( |  | ) |

Do the same using the Envelope as an effect.

Definition at line 66 of file Test_Envelopes.cpp.

References csl::logMsg(), Osc, runTest(), csl::Scalable::setScale(), and csl::Envelope::trigger().

void testFrequencyEnv | ( |  | ) |

Test an envelope applied to frequency.

Definition at line 78 of file Test_Envelopes.cpp.

References csl::Envelope::dump(), csl::logMsg(), Osc, runTest(), and csl::Envelope::trigger().

void testAMFMEnvs | ( |  | ) |

Test an envelope applied to frequency & scale.

Definition at line 95 of file Test_Envelopes.cpp.

References csl::logMsg(), Osc, runTest(), and csl::Envelope::trigger().

void testADSR2 | ( |  | ) |

Demonstrate an ADSR.

Definition at line 114 of file Test_Envelopes.cpp.

References csl::logMsg(), Osc, runTest(), and csl::Envelope::trigger().

void testADSR_FM | ( |  | ) |

Definition at line 141 of file Test_Envelopes.cpp.

References BASE_FREQ, csl::logMsg(), Osc, runTest(), csl::Scalable::setScale(), and csl::Envelope::trigger().

void testRandFreqEnv | ( |  | ) |

test the rand env as the freq of a SOS

Definition at line 165 of file Test_Envelopes.cpp.

References csl::CompOrCacheOscillator::createCache(), kFrequency, csl::logMsg(), runTest(), csl::Phased::setFrequency(), csl::Scalable::setScale(), and csl::Envelope::trigger().

UnitGenerator* createRandFreqEnvPatch | ( | float | dur | ) |

Function to create and answer a RandFreqEnv UGen patch.

Function to create and answer a RandFreqEnv UGen patch this is in test envelopes.

Definition at line 182 of file Test_Envelopes.cpp.

References CSL_PI, csl::fRandM(), Osc, and csl::Scalable::setScale().

Referenced by test50RandFreqEnv(), and testDynamicMixer().

void test50RandFreqEnv | ( |  | ) |

set up 50 RandFreqEnv patches

Definition at line 196 of file Test_Envelopes.cpp.

References csl::Mixer::addInput(), createRandFreqEnvPatch(), csl::Mixer::deleteInputs(), csl::logMsg(), and runTest().

void testEnvScale | ( |  | ) |

test the use of scaling

Definition at line 214 of file Test_Envelopes.cpp.

References csl::logMsg(), Osc, runTest(), csl::Scalable::setScale(), and csl::Envelope::trigger().

void testFancy_FM | ( |  | ) |

FM with vibrato (with AR-envelope), attack chiff (filtered noise with AR-envelope), and random freq. drift and ampl. swell envelopes.

Definition at line 229 of file Test_Envelopes.cpp.

References BASE_FREQ, BW_BAND_PASS, kExpon, csl::logMsg(), Osc, runTest(), csl::Freeverb::setRoomSize(), csl::Scalable::setScale(), and csl::Envelope::trigger().

Referenced by runTests().

void testComplexEnvelope | ( |  | ) |

Make an envelope from scratch by adding breakpoints.

Definition at line 272 of file Test_Envelopes.cpp.

References csl::Envelope::addBreakpoint(), csl::CompOrCacheOscillator::createCache(), csl::Envelope::dump(), csl::fRand1(), csl::fRandM(), csl::fRandZ(), kFrequency, csl::logMsg(), runTest(), csl::Scalable::setScale(), and csl::Envelope::trigger().

UnitGenerator* sosNote | ( | float | dur,
|  | float | frq,
|  | float | amp
| ) |  |

Definition at line 294 of file Test_Envelopes.cpp.

References csl::Envelope::addBreakpoint(), csl::SumOfSines::addPartial(), csl::CompOrCacheOscillator::createCache(), CSL_TWOPI, csl::fRand1(), csl::fRandM(), csl::fRandZ(), csl::Scalable::setScale(), and csl::Envelope::trigger().

Referenced by testManyRandSOS().

void testManyRandSOS | ( |  | ) |

Definition at line 313 of file Test_Envelopes.cpp.

References csl::Mixer::addInput(), csl::Mixer::deleteInputs(), csl::fRandM(), csl::logMsg(), runTest(), and sosNote().

void runTests | ( |  | ) |

Definition at line 331 of file Test_Envelopes.cpp.

References testFancy_FM().