uMIDI
The swiss army knife for quick and easy developement of MIDI applications.
Functions | Variables
lookup_tables.h File Reference

Lookup tables for the uMIDI firmware. More...

#include <stdint.h>
#include <avr/pgmspace.h>
Include dependency graph for lookup_tables.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

uint16_t lookup_exp (uint8_t x)
 Looks up an exponential value in the corresponding table. More...
 
uint16_t lookup_log (uint8_t x)
 Looks up the natural log value in the corresponding table. More...
 
uint16_t lookup_sine (uint8_t x)
 Looks up a sine function value in the corresponding table. More...
 

Variables

const uint8_t lookup_table_resolution
 Resolution (y-axis) of the lookup tables in bits. More...
 
const uint16_t exp_table []
 Lookup table for an exponential function. More...
 
const uint16_t log_table []
 Lookup table for the natural logaritm function. More...
 
const uint16_t sine_table []
 Lookup table for the sine function. More...
 

Detailed Description

Lookup tables for the uMIDI firmware.

The tables are computed with the PERL script compute_lookup_tables.pl, which generates the file lookup_tables.c from scratch. The lookup tables are declared globally and used in other modules, so this is not a stand-alone module but rather a component of those modules.

Function Documentation

◆ lookup_exp()

uint16_t lookup_exp ( uint8_t  x)
inline

Looks up an exponential value in the corresponding table.

This inline function does not check array bounds!

Parameters
xindex of the value in the table
Returns
the function value

◆ lookup_log()

uint16_t lookup_log ( uint8_t  x)
inline

Looks up the natural log value in the corresponding table.

This inline function does not check array bounds!

Parameters
xindex of the value in the table
Returns
the function value

◆ lookup_sine()

uint16_t lookup_sine ( uint8_t  x)
inline

Looks up a sine function value in the corresponding table.

This inline function does not check array bounds!

Parameters
xindex of the value in the table
Returns
the function value

Variable Documentation

◆ exp_table

const uint16_t exp_table[]

Lookup table for an exponential function.

◆ log_table

const uint16_t log_table[]

Lookup table for the natural logaritm function.

◆ lookup_table_resolution

const uint8_t lookup_table_resolution

Resolution (y-axis) of the lookup tables in bits.

◆ sine_table

const uint16_t sine_table[]

Lookup table for the sine function.