-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathhw.h
38 lines (30 loc) · 890 Bytes
/
hw.h
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
38
#pragma once
#include "daisy_versio.h"
namespace wreath
{
using namespace daisy;
// The minimum difference in parameter value to be registered.
constexpr float kMinValueDelta{0.003f};
// The minimum difference in parameter value to be considered picked up.
constexpr float kMinPickupValueDelta{0.01f};
// The trigger threshold value.
constexpr float kTriggerThres{0.3f};
DaisyVersio hw;
Parameter knobs[DaisyVersio::KNOB_LAST]{};
inline void InitHw()
{
hw.Init(true);
hw.StartAdc();
for (short i = 0; i < DaisyVersio::KNOB_LAST; i++)
{
hw.knobs[i].SetCoeff(1.f); // No slew;
knobs[i].Init(hw.knobs[i], 0.0f, 1.0f, Parameter::LINEAR);
}
}
inline void ProcessControls()
{
hw.ProcessAllControls();
hw.tap.Debounce();
hw.UpdateLeds();
}
}