2019-10-04 07:29:45 +00:00
|
|
|
#ifndef MIDI2CV_PART_H
|
|
|
|
#define MIDI2CV_PART_H
|
|
|
|
|
2019-12-03 23:05:03 +00:00
|
|
|
#include <inttypes.h>
|
|
|
|
|
2019-10-14 21:51:38 +00:00
|
|
|
#define TOTAL_COLUMN_COUNT 4
|
|
|
|
|
2020-02-23 01:44:34 +00:00
|
|
|
typedef enum { MIDI_THRU_OFF = 0,
|
|
|
|
MIDI_THRU_ON = 1,
|
|
|
|
MIDI_THRU_POLYCHAIN = 2 } MIDIThruMode_t;
|
2019-10-14 21:51:38 +00:00
|
|
|
|
|
|
|
typedef enum {
|
2019-10-06 10:55:04 +00:00
|
|
|
BI_OFF = 0,
|
|
|
|
BI_PITCH_UNI,
|
2020-02-23 01:44:34 +00:00
|
|
|
BI_PITCH_BI
|
2019-10-14 21:51:38 +00:00
|
|
|
} BiOutputType_t;
|
2019-10-04 07:29:45 +00:00
|
|
|
|
2019-10-14 21:51:38 +00:00
|
|
|
typedef enum {
|
2019-10-06 10:55:04 +00:00
|
|
|
UNI_OFF = 0,
|
|
|
|
UNI_PITCH,
|
|
|
|
UNI_VELOCITY,
|
|
|
|
UNI_MODULATION,
|
|
|
|
UNI_AFTERTOUCH,
|
|
|
|
UNI_BREATH,
|
|
|
|
UNI_EXP,
|
|
|
|
UNI_GATE
|
2019-10-14 21:51:38 +00:00
|
|
|
} UniOutputType_t;
|
2019-10-04 07:29:45 +00:00
|
|
|
|
2019-10-14 21:51:38 +00:00
|
|
|
typedef enum {
|
2019-10-06 10:55:04 +00:00
|
|
|
GATE_OFF = 0,
|
|
|
|
GATE_GATE,
|
|
|
|
GATE_TRIGGER
|
2019-10-14 21:51:38 +00:00
|
|
|
} GateOutputType_t;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
VOICE_COUNT_1 = 1,
|
|
|
|
VOICE_COUNT_2 = 2,
|
|
|
|
VOICE_COUNT_3 = 3,
|
|
|
|
VOICE_COUNT_4 = 4
|
|
|
|
} PartVoiceCount_t;
|
|
|
|
|
|
|
|
typedef enum {
|
2020-02-23 01:44:34 +00:00
|
|
|
VOICE_DETAIL_S = 0,
|
|
|
|
VOICE_DETAIL_M = 1,
|
|
|
|
VOICE_DETAIL_L = 2,
|
|
|
|
VOICE_DETAIL_XL = 3
|
2019-10-14 21:51:38 +00:00
|
|
|
} PartVoiceDetail_t;
|
2019-10-04 07:29:45 +00:00
|
|
|
|
|
|
|
class Part {
|
|
|
|
public:
|
|
|
|
Part()
|
2019-10-14 21:51:38 +00:00
|
|
|
: part_voice_count(VOICE_COUNT_1)
|
|
|
|
, part_voice_detail(VOICE_DETAIL_S)
|
2019-10-04 07:29:45 +00:00
|
|
|
, midi_filter_channel_enabled(true)
|
|
|
|
, midi_filter_channel(1)
|
2019-10-06 10:55:04 +00:00
|
|
|
, midi_filter_lowest_note(0)
|
|
|
|
, midi_filter_highest_note(127)
|
2019-10-14 21:51:38 +00:00
|
|
|
, midi_thru_mode(MIDI_THRU_OFF)
|
2019-10-04 07:29:45 +00:00
|
|
|
{
|
2019-10-14 21:51:38 +00:00
|
|
|
for (int i = 0; i < TOTAL_COLUMN_COUNT; i++) {
|
2019-10-06 10:55:04 +00:00
|
|
|
output_type_row_0[i] = BI_OFF;
|
|
|
|
output_type_row_1[i] = UNI_OFF;
|
|
|
|
output_type_row_2[i] = UNI_OFF;
|
|
|
|
output_type_row_3[i] = GATE_OFF;
|
|
|
|
}
|
2019-10-04 07:29:45 +00:00
|
|
|
}
|
|
|
|
void ProcessMidiInput(/* TODO: Inputs */);
|
|
|
|
|
2019-10-14 21:51:38 +00:00
|
|
|
uint8_t RequiredColumns();
|
|
|
|
|
2019-10-04 07:29:45 +00:00
|
|
|
private:
|
2019-10-14 21:51:38 +00:00
|
|
|
PartVoiceCount_t part_voice_count;
|
|
|
|
PartVoiceDetail_t part_voice_detail;
|
2019-10-04 07:29:45 +00:00
|
|
|
bool midi_filter_channel_enabled;
|
|
|
|
uint8_t midi_filter_channel;
|
2019-10-06 10:55:04 +00:00
|
|
|
uint8_t midi_filter_lowest_note;
|
|
|
|
uint8_t midi_filter_highest_note;
|
2019-10-14 21:51:38 +00:00
|
|
|
MIDIThruMode_t midi_thru_mode;
|
|
|
|
BiOutputType_t output_type_row_0[TOTAL_COLUMN_COUNT];
|
|
|
|
UniOutputType_t output_type_row_1[TOTAL_COLUMN_COUNT];
|
|
|
|
UniOutputType_t output_type_row_2[TOTAL_COLUMN_COUNT];
|
|
|
|
GateOutputType_t output_type_row_3[TOTAL_COLUMN_COUNT];
|
2019-10-04 07:29:45 +00:00
|
|
|
};
|
|
|
|
|
2019-10-14 21:51:38 +00:00
|
|
|
extern Part parts[];
|
|
|
|
|
2019-10-04 07:29:45 +00:00
|
|
|
#endif
|