-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathrepetita.cpp
48 lines (37 loc) · 834 Bytes
/
repetita.cpp
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
39
40
41
42
43
44
45
46
47
48
#include "repetita.h"
#include "ui.h"
#include <cstring>
using namespace wreath;
void AudioCallback(AudioHandle::InputBuffer in, AudioHandle::OutputBuffer out, size_t size)
{
ProcessControls();
ProcessUi();
for (size_t i = 0; i < size; i++)
{
float leftIn{IN_L[i]};
float rightIn{IN_R[i]};
float leftOut{};
float rightOut{};
looper.Process(leftIn, rightIn, leftOut, rightOut);
OUT_L[i] = leftOut;
OUT_R[i] = rightOut;
}
}
int main(void)
{
InitHw();
StereoLooper::Conf conf
{
StereoLooper::Mode::MONO,
Movement::NORMAL,
Direction::FORWARD,
rate: 1.0f
};
looper.Init(hw.AudioSampleRate(), conf);
InitUi();
hw.StartAudio(AudioCallback);
while (1)
{
ProcessStorage();
}
}