mirror of
https://github.com/thestk/stk
synced 2026-02-01 07:16:15 +00:00
Version 4.0
This commit is contained in:
committed by
Stephen Sinclair
parent
3f126af4e5
commit
81475b04c5
@@ -1,24 +1,65 @@
|
||||
/******************************************/
|
||||
/* Singing Voice Synthesis Subclass */
|
||||
/* of Algorithm 6 (TX81Z) Subclass of */
|
||||
/* 4 Operator FM Synth */
|
||||
/* by Perry R. Cook, 1996 */
|
||||
/******************************************/
|
||||
/***************************************************/
|
||||
/*! \class FMVoices
|
||||
\brief STK singing FM synthesis instrument.
|
||||
|
||||
#if !defined(__FMVoices_h)
|
||||
#define __FMVoices_h
|
||||
This class implements 3 carriers and a common
|
||||
modulator, also referred to as algorithm 6 of
|
||||
the TX81Z.
|
||||
|
||||
#include "FM4Alg6.h"
|
||||
\code
|
||||
Algorithm 6 is :
|
||||
/->1 -\
|
||||
4-|-->2 - +-> Out
|
||||
\->3 -/
|
||||
\endcode
|
||||
|
||||
class FMVoices : public FM4Alg6
|
||||
Control Change Numbers:
|
||||
- Vowel = 2
|
||||
- Spectral Tilt = 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 - 2002.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
#if !defined(__FMVOICES_H)
|
||||
#define __FMVOICES_H
|
||||
|
||||
#include "FM.h"
|
||||
|
||||
class FMVoices : public FM
|
||||
{
|
||||
protected:
|
||||
int currentVowel;
|
||||
public:
|
||||
FMVoices();
|
||||
virtual void setFreq(MY_FLOAT frequency);
|
||||
virtual void noteOn(MY_FLOAT freq, MY_FLOAT amp);
|
||||
virtual void controlChange(int number, MY_FLOAT value);
|
||||
public:
|
||||
//! Class constructor.
|
||||
FMVoices();
|
||||
|
||||
//! Class destructor.
|
||||
~FMVoices();
|
||||
|
||||
//! Set instrument parameters for a particular frequency.
|
||||
virtual void setFrequency(MY_FLOAT frequency);
|
||||
|
||||
//! Start a note with the given frequency and amplitude.
|
||||
void noteOn(MY_FLOAT frequency, MY_FLOAT amplitude);
|
||||
|
||||
//! Compute one output sample.
|
||||
MY_FLOAT tick();
|
||||
|
||||
//! Perform the control change specified by \e number and \e value (0.0 - 128.0).
|
||||
virtual void controlChange(int number, MY_FLOAT value);
|
||||
|
||||
protected:
|
||||
int currentVowel;
|
||||
MY_FLOAT tilt[3];
|
||||
MY_FLOAT mods[3];
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user