uMIDI
The swiss army knife for quick and easy developement of MIDI applications.
|
Implementation of mathematical functions. More...
Functions | |
void | init_linear_from_midi (struct linear_range *const config) |
Initializes a linear function to map from MIDI values to an arbitrary integer range. More... | |
void | init_linear_to_midi (struct linear_range *config) |
Initializes a linear function to map from an arbitrary integer range to MIDI values. More... | |
uint16_t | linear_from_midi (const struct linear_range *const config, midi_value_t midi_value) |
Yields an integer in the configured range that corresponds to the given MIDI value. More... | |
midi_value_t | linear_to_midi (const struct linear_range *config, uint16_t input) |
Yields the MIDI value [0,127] from a given integer in the configured range. More... | |
Implementation of mathematical functions.
void init_linear_from_midi | ( | struct linear_range * | config | ) |
Initializes a linear function to map from MIDI values to an arbitrary integer range.
config | the configuration of the linear function to initialize |
void init_linear_to_midi | ( | struct linear_range * | config | ) |
Initializes a linear function to map from an arbitrary integer range to MIDI values.
config | the configuration of the linear function to initialize |
uint16_t linear_from_midi | ( | const struct linear_range * | config, |
midi_value_t | midi_value | ||
) |
Yields an integer in the configured range that corresponds to the given MIDI value.
config | the configuration of the linear function |
midi_value | the MIDI value to convert [0,127] |
midi_value_t linear_to_midi | ( | const struct linear_range * | config, |
uint16_t | input | ||
) |
Yields the MIDI value [0,127] from a given integer in the configured range.
config | the configuration of the linear function |
input | the integer to convert to a MIDI value |