diff --git a/hosts/daisy/include/lichen-medium-device.hpp b/hosts/daisy/include/lichen-medium-device.hpp index 44eebe1..b9820a1 100644 --- a/hosts/daisy/include/lichen-medium-device.hpp +++ b/hosts/daisy/include/lichen-medium-device.hpp @@ -44,45 +44,20 @@ namespace medium { // These pins are ordered based on the panel: // knobs first in labelled order, then CV jacks in labelled order. - /* static ADCChannelSpec ADC_CHANNEL_SPECS[NUM_ADC_CHANNELS] = { - // Freq Knob/POT_2_CV_7/Pin C8 - Unipolar - {patchsm::PIN_CV_7, UNI_TO_BIPOLAR}, - // Reso Knob/CV_IN_5/Pin C6 - {patchsm::PIN_CV_5, UNI_TO_BIPOLAR}, - // Gain Knob/POT_1_CV_6/Pin C7 - {patchsm::PIN_CV_6, UNI_TO_BIPOLAR}, - // Knob four/POT_4_CV_9/Pin A2 - {patchsm::PIN_ADC_9, NO_NORMALIZATION}, - // Knob five/POT_5_CV_10/Pin A3 - {patchsm::PIN_ADC_10, NO_NORMALIZATION}, - - // Shape CV/CV_IN_1/Pin C5 - {patchsm::PIN_CV_1, NO_NORMALIZATION}, - // Frequency CV/CV_IN_2/Pin C4 - {patchsm::PIN_CV_2, NO_NORMALIZATION}, - // Reso CV/CV_IN_3/Pin C3 - {patchsm::PIN_CV_3, NO_NORMALIZATION}, - // Gain CV/CV_IN_4/Pin C2 - {patchsm::PIN_CV_4, NO_NORMALIZATION}, - // Skew CV/POT_3_CV_8/Pin C9 - {patchsm::PIN_CV_5, NO_NORMALIZATION} - }; - */ - static dsy_gpio_pin ADC_PINS[NUM_ADC_CHANNELS] = { - patchsm::PIN_CV_5, // Knob one/POT_CV_1/Pin C8 - patchsm::PIN_CV_6, // Knob two/POT_CV_2/Pin C9 - patchsm::PIN_ADC_9, // Knob three/POT_CV_3/Pin A2 - patchsm::PIN_ADC_11, // Knob four/POT_CV_4/Pin A3 - patchsm::PIN_ADC_10, // Knob five/POT_CV_5/Pin D9 - patchsm::PIN_ADC_12, // Knob six/POT_CV_6/Pin D8 - - patchsm::PIN_CV_1, // CV1 ("seven")/CV_IN_1/Pin C5 - patchsm::PIN_CV_2, // CV2 ("eight")/CV_IN_2Pin C4 - patchsm::PIN_CV_3, // CV3 ("nine")/CV_IN_3/Pin C3 - patchsm::PIN_CV_7, // CV6 ("ten")/CV_IN_6/Pin C7 - patchsm::PIN_CV_8, // CV5 ("eleven")/CV_IN_5/Pin C6 - patchsm::PIN_CV_4 // CV4 ("twelve")/CV_IN_4/Pin C2 + {patchsm::PIN_CV_5, INVERT}, // Knob one/POT_CV_1/Pin C8 + {patchsm::PIN_CV_6, INVERT}, // Knob two/POT_CV_2/Pin C9 + {patchsm::PIN_ADC_9, BI_TO_UNIPOLAR}, // Knob three/POT_CV_3/Pin A2 + {patchsm::PIN_ADC_11, BI_TO_UNIPOLAR}, // Knob four/POT_CV_4/Pin A3 + {patchsm::PIN_ADC_10, BI_TO_UNIPOLAR}, // Knob five/POT_CV_5/Pin D9 + {patchsm::PIN_ADC_12, BI_TO_UNIPOLAR}, // Knob six/POT_CV_6/Pin D8 + + {patchsm::PIN_CV_1, INVERT}, // CV1 ("seven")/CV_IN_1/Pin C5 + {patchsm::PIN_CV_2, INVERT}, // CV2 ("eight")/CV_IN_2Pin C4 + {patchsm::PIN_CV_3, INVERT}, // CV3 ("nine")/CV_IN_3/Pin C3 + {patchsm::PIN_CV_7, INVERT}, // CV6 ("ten")/CV_IN_6/Pin C7 + {patchsm::PIN_CV_8, INVERT}, // CV5 ("eleven")/CV_IN_5/Pin C6 + {patchsm::PIN_CV_4, INVERT} // CV4 ("twelve")/CV_IN_4/Pin C2 }; static const size_t NUM_GATES = 1; @@ -109,15 +84,15 @@ namespace medium { class MediumDevice { public: patchsm::PatchSMBoard board; - ADCController adcController; + ADCController adcController; GateInput gates[NUM_GATES]; InputBank gateBank; TriSwitch triSwitches[NUM_TRISWITCHES]; InputBank switchBank; Toggle buttons[NUM_BUTTONS]; InputBank buttonBank; - AnalogOutput dacChannels[NUM_DAC_CHANNELS]; - OutputBank dacOutputBank; + DMAAnalogOutput dacChannels[NUM_DAC_CHANNELS]; + OutputBank dacOutputBank; struct sig_host_HardwareInterface hardware; static void onEvaluateSignals(size_t size, @@ -165,7 +140,7 @@ namespace medium { } void InitADCController() { - adcController.Init(&board.adc, ADC_PINS); + adcController.Init(&board.adc, ADC_CHANNEL_SPECS); } void InitDAC() {