Synth.cpp
 All Data Structures Namespaces Files Functions Variables Macros
Macros | Functions | Variables
synth.cpp File Reference
#include <stdio.h>
#include <math.h>
#include "synth.h"
Include dependency graph for synth.cpp:

Go to the source code of this file.

Macros

#define GOAL   (0.95 * (1 << 28))
 
#define BIGGER   (1.5819767 * (1 << 28))
 
#define RARE   500
 
#define NOT_TOO_SMALL(x)   MAX(x, 0.01)
 
#define KEYDOWN_HYSTERESIS   10
 

Functions

void use_read_key (uint8_t(*rk)(uint32_t))
 
void use_synth (uint8_t i)
 
ISynthget_synth (void)
 
void use_synth_array (ISynth **s, uint8_t _num_synths)
 
float small_random ()
 
uint8_t play_tune (uint32_t *tune, uint32_t msecs)
 
void assertion (int cond, const char *strcond, const char *file, const int line)
 

Variables

ISynth ** _synth_ary = NULL
 
ISynth_synth = NULL
 
uint8_t num_synths = 0
 
uint8_t(* _read_key )(uint32_t) = NULL
 
static int tune_pointer = 0
 

Macro Definition Documentation

#define BIGGER   (1.5819767 * (1 << 28))

Definition at line 11 of file synth.cpp.

Referenced by ADSR::rare_step().

#define GOAL   (0.95 * (1 << 28))

Definition at line 8 of file synth.cpp.

Referenced by ADSR::rare_step(), and ADSR::setS().

#define KEYDOWN_HYSTERESIS   10

Definition at line 17 of file synth.cpp.

Referenced by Key::check().

#define NOT_TOO_SMALL (   x)    MAX(x, 0.01)

Definition at line 15 of file synth.cpp.

Referenced by ADSR::setA(), ADSR::setD(), and ADSR::setR().

#define RARE   500

Definition at line 13 of file synth.cpp.

Referenced by ADSR::rare_step(), and ADSR::step().

Function Documentation

void assertion ( int  cond,
const char *  strcond,
const char *  file,
const int  line 
)

Definition at line 86 of file synth.cpp.

ISynth* get_synth ( void  )

Definition at line 34 of file synth.cpp.

Referenced by loop(), play_tune(), and timer_interrupt().

Here is the caller graph for this function:

uint8_t play_tune ( uint32_t *  tune,
uint32_t  msecs 
)

Definition at line 51 of file synth.cpp.

Referenced by loop(), and main().

Here is the call graph for this function:

Here is the caller graph for this function:

float small_random ( )

Definition at line 45 of file synth.cpp.

Referenced by NoisyVoice::setfreq().

Here is the caller graph for this function:

void use_read_key ( uint8_t(*)(uint32_t)  rk)

Definition at line 24 of file synth.cpp.

void use_synth ( uint8_t  i)

Definition at line 29 of file synth.cpp.

Referenced by FunctionKey::keydown(), main(), play_tune(), and setup().

Here is the caller graph for this function:

void use_synth_array ( ISynth **  s,
uint8_t  _num_synths 
)

Definition at line 39 of file synth.cpp.

Referenced by main(), and setup().

Here is the caller graph for this function:

Variable Documentation

uint8_t(* _read_key)(uint32_t) = NULL

Definition at line 22 of file synth.cpp.

Referenced by Key::check(), and use_read_key().

ISynth* _synth = NULL

Definition at line 20 of file synth.cpp.

Referenced by get_synth().

ISynth** _synth_ary = NULL

Definition at line 19 of file synth.cpp.

uint8_t num_synths = 0

Definition at line 21 of file synth.cpp.

Referenced by use_synth(), and use_synth_array().

int tune_pointer = 0
static

Definition at line 49 of file synth.cpp.