-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathModuleKitSelect.cpp
More file actions
37 lines (27 loc) · 897 Bytes
/
ModuleKitSelect.cpp
File metadata and controls
37 lines (27 loc) · 897 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "Arduino.h"
#include "ModuleKitSelect.h"
#include "Defines.h"
ModuleKitSelect::ModuleKitSelect()
{
// Initialize all inputs
this->kit_selection_input = NULL;
// Instantiate all outputs
kick_output = new ModuleOutput(this);
snare_output = new ModuleOutput(this);
hihat_output = new ModuleOutput(this);
// The outputs of ModuleKitSelect should not
// be mapped by the receiving module, which is
// usually ModuleSamplePlayer
kick_output->no_output_conversion = true;
snare_output->no_output_conversion = true;
hihat_output->no_output_conversion = true;
}
uint16_t ModuleKitSelect::compute()
{
// Read inputs
uint8_t kit_selection = this->readInput(kit_selection_input, 0, 3);
this->kick_output->value = kits[kit_selection][0];
this->snare_output->value = kits[kit_selection][1];
this->hihat_output->value = kits[kit_selection][2];
return(0);
}