The Synthesis ToolKit in C++ (STK)

Home Information Classes Download Usage Mail List Requirements Links FAQ Tutorial

# stk::FM Class Reference

STK abstract FM synthesis base class. More...

`#include <FM.h>`

Inheritance diagram for stk::FM:

List of all members.

## Public Member Functions
| FM (unsigned int operators=4)
| Class constructor, taking the number of wave/envelope operators to control.
virtual | ~FM (void)
| Class destructor.
void | clear (void)
| Reset and clear all wave and envelope states.
void | loadWaves (const char **filenames)
| Load the rawwave filenames in waves.
virtual void | setFrequency (StkFloat frequency)
| Set instrument parameters for a particular frequency.
void | setRatio (unsigned int waveIndex, StkFloat ratio)
| Set the frequency ratio for the specified wave.
void | setGain (unsigned int waveIndex, StkFloat gain)
| Set the gain for the specified wave.
void | setModulationSpeed (StkFloat mSpeed)
| Set the modulation speed in Hz.
void | setModulationDepth (StkFloat mDepth)
| Set the modulation depth.
void | setControl1 (StkFloat cVal)
| Set the value of control1.
void | setControl2 (StkFloat cVal)
| Set the value of control1.
void | keyOn (void)
| Start envelopes toward "on" targets.
void | keyOff (void)
| Start envelopes toward "off" targets.
void | noteOff (StkFloat amplitude)
| Stop a note with the given amplitude (speed of decay).
virtual void | controlChange (int number, StkFloat value)
| Perform the control change specified by number and value (0.0 - 128.0).
virtual StkFloat | tick (unsigned int)=0
| Compute and return one output sample.
virtual StkFrames & | tick (StkFrames &frames, unsigned int channel=0)=0
| Fill a channel of the StkFrames object with computed outputs.

## Detailed Description

STK abstract FM synthesis base class.

This class controls an arbitrary number of waves and envelopes, determined via a constructor argument.

Control Change Numbers:

- Control One = 2
- Control Two = 4
- LFO Speed = 11
- LFO Depth = 1
- ADSR 2 & 4 Target = 128

The basic Chowning/Stanford FM patent expired in 1995, but there exist follow-on patents, mostly assigned to Yamaha. If you are of the type who should worry about this (making money) worry away.

by Perry R. Cook and Gary P. Scavone, 1995-2012.

## Constructor & Destructor Documentation

stk::FM::FM | ( | unsigned int | operators = `4` | ) |

Class constructor, taking the number of wave/envelope operators to control.

An StkError will be thrown if the rawwave path is incorrectly set.

## Member Function Documentation

virtual StkFrames& stk::FM::tick | ( | StkFrames & | frames,
|  | unsigned int | channel = `0` |
| ) |  |  | `[pure virtual]`

Fill a channel of the StkFrames object with computed outputs.

The `channel` argument must be less than the number of channels in the StkFrames argument (the first channel is specified by 0). However, range checking is only performed if _STK_DEBUG_ is defined during compilation, in which case an out-of-range value will trigger an StkError exception.

Implements stk::Instrmnt.

Implemented in stk::BeeThree, stk::FMVoices, stk::HevyMetl, stk::PercFlut, stk::Rhodey, stk::TubeBell, and stk::Wurley.

The documentation for this class was generated from the following file:

- FM.h

The Synthesis ToolKit in C++ (STK)
©1995-2012 Perry R. Cook and Gary P. Scavone. All Rights Reserved.