template<uint16_t NUM_TABLE_CELLS, uint16_t UPDATE_RATE, byte N_OSCIL>
class MetaOscil< NUM_TABLE_CELLS, UPDATE_RATE, N_OSCIL >
MetaOscil is a wrapper for several Oscil.
Once constructed it will behave exactly as an Oscil except that it will automatically switch between Oscil depending on the asked frequency. This allows to produce non-aliased sounds by switching between tables with less and less harmonics as the frequency increases.
Definition at line 32 of file MetaOscil.h.
|
template<class... T> |
| MetaOscil (Oscil< NUM_TABLE_CELLS, UPDATE_RATE > *first, T *... elements) |
| Constructor Declare a MetaOscil containing any number of Oscil pointers. More...
|
|
template<typename ... T> |
void | setOscils (Oscil< NUM_TABLE_CELLS, UPDATE_RATE > *first, T... elements) |
| Set all Oscil of a MetaOscil. More...
|
|
void | setOscils () |
|
template<typename ... T> |
void | setCutoffFreqs (int first, T... elements) |
| Set all the cutoff frequencies for changing between Oscil. More...
|
|
void | setCutoffFreqs () |
|
void | setCutoffFreq (int freq, byte rank) |
| Set or change the cutoff frequency of one Oscil. More...
|
|
int8_t | next () |
| Updates the phase according to the current frequency and returns the sample at the new phase position. More...
|
|
void | setTable (const int8_t *TABLE_NAME, byte rank) |
| Change the sound table which will be played by the Oscil of rank. More...
|
|
void | setPhase (unsigned int phase) |
| Set the phase of the currently playing Oscil. More...
|
|
void | setPhaseFractional (unsigned long phase) |
| Set the phase of the currently playing Oscil in fractional format. More...
|
|
unsigned long | getPhaseFractional () |
| Get the phase of the currently playin Oscil in fractional format. More...
|
|
int8_t | phMod (Q15n16 phmod_proportion) |
| Returns the next sample given a phase modulation value. More...
|
|
void | setFreq (int frequency, bool apply=true) |
| Set the MetaOsc frequency with an unsigned int. More...
|
|
void | setFreq (float frequency) |
| Set the MetaOsc frequency with a float. More...
|
|
template<int8_t NI, int8_t NF, uint64_t RANGE> |
void | setFreq (UFix< NI, NF, RANGE > frequency) |
| Set the MetaOsc frequency with a UFix<NI,NF> fixed-point number format. More...
|
|
void | setFreq_Q24n8 (Q24n8 frequency) |
| Set the MetaOsc frequency with a Q24n8 fixed-point number format. More...
|
|
void | setFreq_Q16n16 (Q16n16 frequency) |
| Set the MetaOsc frequency with a Q16n16 fixed-point number format. More...
|
|
int8_t | atIndex (unsigned int index) |
| Returns the sample at the given table index of the current Oscil. More...
|
|
unsigned long | phaseIncFromFreq (int frequency) |
| phaseIncFromFreq() and setPhaseInc() are for saving processor time when sliding between frequencies. More...
|
|
void | setPhaseInc (unsigned long phaseinc_fractional) |
| Set a specific phase increment. More...
|
|
template<uint16_t NUM_TABLE_CELLS, uint16_t UPDATE_RATE, byte N_OSCIL>
template<typename ... T>
void MetaOscil< NUM_TABLE_CELLS, UPDATE_RATE, N_OSCIL >::setCutoffFreqs |
( |
int |
first, |
|
|
T... |
elements |
|
) |
| |
|
inline |
Set all the cutoff frequencies for changing between Oscil.
They have to be sorted in increasing values and contain at least N_OSCIL-1 values. Note that the last Oscil will be used by default for frequencies higher than the higher cutoff, hence the last value can be discarded.
- Parameters
-
first,elements... | a set of int cutoff frequencies. |
Definition at line 72 of file MetaOscil.h.
template<uint16_t NUM_TABLE_CELLS, uint16_t UPDATE_RATE, byte N_OSCIL>
template<int8_t NI, int8_t NF, uint64_t RANGE>
void MetaOscil< NUM_TABLE_CELLS, UPDATE_RATE, N_OSCIL >::setFreq |
( |
UFix< NI, NF, RANGE > |
frequency | ) |
|
|
inline |
Set the MetaOsc frequency with a UFix<NI,NF> fixed-point number format.
This falls back to using UFix<16,16> internally and is provided as a fallout for other UFix types..
- Parameters
-
frequency | to play the wave table. |
Definition at line 183 of file MetaOscil.h.