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.
54 lines
1019 B
54 lines
1019 B
#include "types.hh"
|
|
|
|
namespace Heck {
|
|
namespace Constants {
|
|
}
|
|
|
|
ld::DaisySeed hw{};
|
|
dsp::Oscillator osc{};
|
|
|
|
void AudioCallback(
|
|
ld::AudioHandle::InterleavingInputBuffer in,
|
|
ld::AudioHandle::InterleavingOutputBuffer out,
|
|
size_t size)
|
|
{
|
|
float osc_out;
|
|
osc.SetFreq(1000);
|
|
|
|
for (size_t i = 0; i < size; i += 2) {
|
|
osc.SetAmp(1.0);
|
|
osc_out = osc.Process();
|
|
osc_out *= 0.005;
|
|
out[i] = osc_out;
|
|
out[i + 1] = osc_out;
|
|
}
|
|
}
|
|
|
|
void init()
|
|
{
|
|
hw.Configure();
|
|
hw.Init();
|
|
hw.SetAudioBlockSize(4);
|
|
float samplerate = hw.AudioSampleRate();
|
|
|
|
osc.Init(samplerate);
|
|
osc.SetWaveform(osc.WAVE_SIN);
|
|
osc.SetAmp(1.f);
|
|
osc.SetFreq(1000);
|
|
|
|
hw.StartAudio(AudioCallback);
|
|
}
|
|
|
|
void mainloop()
|
|
{
|
|
for (;;) {}
|
|
}
|
|
} // namespace Heck
|
|
|
|
|
|
int main(void)
|
|
{
|
|
Heck::init();
|
|
Heck::mainloop();
|
|
return 0;
|
|
}
|
|
|