You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
799 B
41 lines
799 B
#include "daisy_seed.h"
|
|
#include "daisysp.h"
|
|
|
|
namespace ld = daisy;
|
|
namespace dsp = daisysp;
|
|
|
|
ld::DaisySeed seed{};
|
|
dsp::Oscillator osc_l{};
|
|
dsp::Oscillator osc_r{};
|
|
|
|
void AudioCallback(
|
|
ld::AudioHandle::InputBuffer in,
|
|
ld::AudioHandle::OutputBuffer out,
|
|
size_t size)
|
|
{
|
|
float osc_out{};
|
|
for (size_t i = 0; i < size; i++) {
|
|
out[0][i] = osc_l.Process() * 0.005;
|
|
out[1][i] = osc_r.Process() * 0.005;
|
|
}
|
|
}
|
|
|
|
int main(void)
|
|
{
|
|
// system init
|
|
seed.Configure();
|
|
seed.Init();
|
|
seed.SetAudioBlockSize(4);
|
|
float samplerate = seed.AudioSampleRate();
|
|
|
|
// application init
|
|
osc_l.Init(samplerate);
|
|
osc_l.SetFreq(300);
|
|
|
|
osc_r.Init(samplerate);
|
|
osc_r.SetFreq(400);
|
|
|
|
// system main
|
|
seed.StartAudio(AudioCallback);
|
|
return 0;
|
|
}
|
|
|