CSL 5.2

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

- File List
- File Members

Macros | Functions
Test_Oscillators.cpp File Reference
`#include "Test_Support.cpp"`
`#include "SoundFileL.h"`
`#include "SimpleSines.h"`
`#include <SHARC.h>`

Go to the source code of this file.

## Macros
#define | USE_TEST_MAIN
#define | TABLE_SIZE 128
| Test truncating and interpolating wavetable osc with a small wavetable (these should sound different because of the truncation error in the first tone)

## Functions
void | testSweep ()
| Apply a glissando and swell to a sine oscillator with LineSegments.
void | testSimpleSines ()
| Simplest sine wave tests using the tutorial example classes.
void | testBasicWaves ()
| Test/demonstrate the basic waveform oscillators.
void | testScaledSin ()
| Scaled sine wave – 3 methods: with a MulOp and using the Sine's scale input.
void | testWavetableInterpolation ()
void | testAMFMSin ()
| AM and FM using the dynamic scale and frequency inputs.
void | dumpAMFMSin ()
| use the dumpTest call to dump the whole graph
void | testSumOfSinesCached ()
| Play a sum of sines waveform – cached harmonic overtone series.
void | testSumOfSines1F ()
| Play a sum of sines waveform – 1/f + noise.
void | testSumOfSinesSteps ()
void | testSumOfSinesNonCached ()
| Now test an uncached inharmonic series constructor format 3 = list of (freq/amp/phase) for (not-necessarily-harmonic) overtones Since it's a non-harmonic overtone series in this example, we can't cache a wavetable.
void | testWaveTableFromFile ()
| Load an oscillator's wave table from a file – a single cycle of the vowel "oo" from the word "moon".
void | test_SHARC ()
| Test loading the SHARC samples.
void | test_SHARC2 ()
| test vector SHARC - load 3 spectra into SOS oscillators and cross-fade
void | runTests ()

## Macro Definition Documentation

#define USE_TEST_MAIN

Definition at line 12 of file Test_Oscillators.cpp.

#define TABLE_SIZE 128

Test truncating and interpolating wavetable osc with a small wavetable (these should sound different because of the truncation error in the first tone)

Definition at line 128 of file Test_Oscillators.cpp.

Referenced by testWavetableInterpolation().

## Function Documentation

void testSweep | ( |  | ) |

Apply a glissando and swell to a sine oscillator with LineSegments.

Definition at line 28 of file Test_Oscillators.cpp.

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

void testSimpleSines | ( |  | ) |

Simplest sine wave tests using the tutorial example classes.

Definition at line 42 of file Test_Oscillators.cpp.

References csl::SineAsPhased::dump(), csl::SineAsScaled::dump(), csl::UnitGenerator::dump(), csl::logMsg(), and runTest().

Referenced by runTests().

void testBasicWaves | ( |  | ) |

Test/demonstrate the basic waveform oscillators.

Definition at line 63 of file Test_Oscillators.cpp.

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

void testScaledSin | ( |  | ) |

Scaled sine wave – 3 methods: with a MulOp and using the Sine's scale input.

Definition at line 101 of file Test_Oscillators.cpp.

References csl::BinaryOp::dump(), csl::logMsg(), Osc, runTest(), and csl::sleepMsec().

void testWavetableInterpolation | ( |  | ) |

Definition at line 130 of file Test_Oscillators.cpp.

References CSL_TWOPI, kLinear, csl::logMsg(), csl::Buffer::mAreBuffersAllocated, Osc, runTest(), csl::Buffer::setBuffer(), csl::sleepMsec(), and TABLE_SIZE.

void testAMFMSin | ( |  | ) |

AM and FM using the dynamic scale and frequency inputs.

Definition at line 156 of file Test_Oscillators.cpp.

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

void dumpAMFMSin | ( |  | ) |

use the dumpTest call to dump the whole graph

Definition at line 180 of file Test_Oscillators.cpp.

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

void testSumOfSinesCached | ( |  | ) |

Play a sum of sines waveform – cached harmonic overtone series.

Definition at line 196 of file Test_Oscillators.cpp.

References csl::CompOrCacheOscillator::createCache(), csl::SumOfSines::dump(), kFrequency, csl::logMsg(), runTest(), csl::Phased::setFrequency(), csl::Scalable::setScale(), and csl::sleepMsec().

void testSumOfSines1F | ( |  | ) |

Play a sum of sines waveform – 1/f + noise.

Definition at line 216 of file Test_Oscillators.cpp.

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

void testSumOfSinesSteps | ( |  | ) |

Definition at line 229 of file Test_Oscillators.cpp.

References csl::SumOfSines::addPartial(), kFrequency, csl::logMsg(), runTest(), csl::Phased::setFrequency(), and csl::Scalable::setScale().

void testSumOfSinesNonCached | ( |  | ) |

Now test an uncached inharmonic series constructor format 3 = list of (freq/amp/phase) for (not-necessarily-harmonic) overtones Since it's a non-harmonic overtone series in this example, we can't cache a wavetable.

Definition at line 246 of file Test_Oscillators.cpp.

References kFreqAmpPhase, csl::logMsg(), runTest(), csl::Phased::setFrequency(), and csl::Scalable::setScale().

void testWaveTableFromFile | ( |  | ) |

Load an oscillator's wave table from a file – a single cycle of the vowel "oo" from the word "moon".

Definition at line 259 of file Test_Oscillators.cpp.

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

void test_SHARC | ( |  | ) |

Test loading the SHARC samples.

Definition at line 279 of file Test_Oscillators.cpp.

References csl::SHARCInstrument::_spectra, csl::SHARCLibrary::dump(), csl::SHARCLibrary::instrument_named(), csl::logMsg(), runTest(), csl::Phased::setFrequency(), csl::Scalable::setScale(), and csl::Envelope::trigger().

void test_SHARC2 | ( |  | ) |

test vector SHARC - load 3 spectra into SOS oscillators and cross-fade

Definition at line 297 of file Test_Oscillators.cpp.

References csl::Mixer::addInput(), csl::logMsg(), runTest(), csl::Phased::setFrequency(), csl::Freeverb::setRoomSize(), csl::Scalable::setScale(), csl::SHARCLibrary::spectrum(), csl::LineSegment::trigger(), and csl::Envelope::trigger().

void runTests | ( |  | ) |

Definition at line 338 of file Test_Oscillators.cpp.

References testSimpleSines().