|
uMIDI
The swiss army knife for quick and easy developement of MIDI applications.
|
Expression pedal implementation. More...
#include <stdbool.h>#include <string.h>#include <avr/eeprom.h>#include "lib/adc.h"#include "lib/leds.h"#include "lib/math.h"#include "lib/midi.h"#include "lib/usb.h"#include "config.h"#include "expression.h"
Functions | |
| static void | send_enable_message (bool enable) |
| Send a MIDI note on/off message. More... | |
| bool | exec_cal (const char *command) |
| Handler for the serial command 'cal'. More... | |
| bool | exec_echo (const char *command) |
| Handler for the serial command 'echo'. More... | |
| bool | exec_mute (const char *command) |
| Handler for the serial command 'mute'. More... | |
| void | handle_enable_switch (void) |
| A background task that handles the enable switch. More... | |
| void | init_expression_module (void) |
| Initializes the expression module. More... | |
| void | trigger_expression_conversion (void) |
| Triggers an ADC conversion of the expression pedal input. More... | |
| void | update_expression_value (uint16_t adc_value) |
| Updates the stored expression value. More... | |
Variables | |
| static uint8_t | current_expression_value = 0 |
| The latest known expression value. More... | |
| static bool | echo = false |
| Status variable for expression value console echo. More... | |
| static bool | switch_state = false |
| uint16_t | adc_offset = 0 |
| uint16_t adc_offset_eemem | EEMEM |
| static uint8_t | mute_enabled |
Expression pedal implementation.
| bool exec_cal | ( | const char * | command | ) |
Handler for the serial command 'cal'.
| bool exec_echo | ( | const char * | command | ) |
Handler for the serial command 'echo'.
| bool exec_mute | ( | const char * | command | ) |
Handler for the serial command 'mute'.
| void handle_enable_switch | ( | void | ) |
A background task that handles the enable switch.
This task polls the enable switch input. If the input changed, a MIDI note on / off message is transmitted.
| void init_expression_module | ( | void | ) |
Initializes the expression module.
Reads calibration values from EEPROM.
|
static |
Send a MIDI note on/off message.
| enable | true sends "note on"; false sends "note off" |
| void trigger_expression_conversion | ( | void | ) |
Triggers an ADC conversion of the expression pedal input.
| void update_expression_value | ( | uint16_t | new_value | ) |
Updates the stored expression value.
If the value changed, the new value is sent as a MIDI control change message for controller #69 (Waldorf Blofeld's F1 Cutoff).
| uint16_t adc_offset = 0 |
|
static |
The latest known expression value.
|
static |
Status variable for expression value console echo.
| uint8_t mute_enabled_eemem EEMEM |
|
static |
|
static |
1.8.13