Synthesizer modules and supporting functions. More...
#include <stdlib.h>#include <stdint.h>

Go to the source code of this file.
Data Structures | |
| class | IVoice |
| class | ISynth |
| class | Queue |
| class | Synth |
| class | ADSR |
| class | Filter |
| class | Oscillator |
| class | Key |
Macros | |
| #define | __ARM 1 |
| #define | SAMPLING_RATE 40000 |
| #define | DT (1.0 / SAMPLING_RATE) |
| #define | ASSERT(cond) assertion(cond, #cond, __FILE__, __LINE__) |
| #define | BUFSIZE 1024 |
| #define | MIN(x, y) (((x) < (y)) ? (x) : (y)) |
| #define | MAX(x, y) (((x) > (y)) ? (x) : (y)) |
Functions | |
| void | assertion (int cond, const char *strcond, const char *file, const int line) |
| float | small_random () |
| uint8_t | play_tune (uint32_t *tune, uint32_t msecs) |
| int32_t | clip (int32_t x) |
| void | use_read_key (uint8_t(*rk)(uint32_t)) |
| void | use_synth_array (ISynth **s, uint8_t _num_synths) |
| ISynth * | get_synth (void) |
| void | use_synth (uint8_t i) |
Synthesizer modules and supporting functions.
Values that would be voltages in an analog synthesizer are 12 bits in most cases. You can think of unsigned quantities (0 to 4095) as having voltages ranging from 0 volts to 1 volt, and signed quantities (-2048 to 2047) as a range of -0.5 volt to +0.5 volt.
Definition in file synth.h.
| #define ASSERT | ( | cond | ) | assertion(cond, #cond, __FILE__, __LINE__) |
Definition at line 27 of file synth.h.
Referenced by Synth::get_12_bit_value(), Synth::get_next_available_voice(), main(), and test1().
| #define BUFSIZE 1024 |
Buffer for the Queue class. This MUST be a power of 2.
Definition at line 36 of file synth.h.
Referenced by Queue::full(), Queue::read(), Queue::size(), and Queue::write().
| #define DT (1.0 / SAMPLING_RATE) |
Definition at line 25 of file synth.h.
Referenced by ADSR::rare_step(), Filter::setF(), and setup().
| #define MAX | ( | x, | |
| y | |||
| ) | (((x) > (y)) ? (x) : (y)) |
| #define MIN | ( | x, | |
| y | |||
| ) | (((x) < (y)) ? (x) : (y)) |
| #define SAMPLING_RATE 40000 |
Definition at line 24 of file synth.h.
Referenced by main(), and Oscillator::setfreq().
| void assertion | ( | int | cond, |
| const char * | strcond, | ||
| const char * | file, | ||
| const int | line | ||
| ) |
|
inline |
Definition at line 41 of file synth.h.
Referenced by Filter::step().

| ISynth* get_synth | ( | void | ) |
Definition at line 34 of file synth.cpp.
Referenced by loop(), play_tune(), and timer_interrupt().

| uint8_t play_tune | ( | uint32_t * | tune, |
| uint32_t | msecs | ||
| ) |
| float small_random | ( | ) |
Definition at line 45 of file synth.cpp.
Referenced by NoisyVoice::setfreq().

| void use_synth | ( | uint8_t | i | ) |
Definition at line 29 of file synth.cpp.
Referenced by FunctionKey::keydown(), main(), play_tune(), and setup().

1.8.6