You've already forked Eurorack
mirror of
https://github.com/Fihdi/Eurorack.git
synced 2026-04-16 16:26:07 +00:00
50 lines
2.0 KiB
C++
50 lines
2.0 KiB
C++
#include "daisy_seed.h"
|
|
#include "../PTAL/hardwares/Hardware.h"
|
|
|
|
|
|
using namespace daisy;
|
|
|
|
//▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
|
|
Hardware hardware;
|
|
|
|
|
|
//▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
|
|
static void AudioCallback (
|
|
daisy::AudioHandle::InputBuffer in,
|
|
daisy::AudioHandle::OutputBuffer out,
|
|
size_t size) {
|
|
|
|
// Clear buffer
|
|
memset(out[0], 0, size * sizeof(float));
|
|
memset(out[1], 0, size * sizeof(float));
|
|
}
|
|
|
|
|
|
//▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
|
|
int main (void) {
|
|
// initializations
|
|
hardware.Init();
|
|
|
|
//▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
|
|
// Setup audio callback
|
|
hardware.daisy.SetAudioSampleRate(SaiHandle::Config::SampleRate::SAI_48KHZ);
|
|
hardware.daisy.SetAudioBlockSize(32);
|
|
hardware.daisy.StartAudio(AudioCallback);
|
|
|
|
|
|
//▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
|
|
while (true) {
|
|
hardware.Update();
|
|
|
|
if (hardware.cvInput.changed) {
|
|
hardware.led.SetPwm(hardware.cvInput.value);
|
|
}
|
|
|
|
if (hardware.gatePlay->risingEdge) {
|
|
hardware.led.SetFlash();
|
|
}
|
|
|
|
// TODO: test encoder
|
|
}
|
|
}
|