
2 changed files with 0 additions and 67 deletions
@ -1,16 +0,0 @@ |
|||||
#include "daisy_seed.h" |
|
||||
|
|
||||
using namespace daisy; |
|
||||
|
|
||||
static DaisySeed hw{}; |
|
||||
|
|
||||
int main() |
|
||||
{ |
|
||||
hw.Init(); |
|
||||
while (true) { |
|
||||
hw.SetLed(true); |
|
||||
hw.DelayMs(100); |
|
||||
hw.SetLed(false); |
|
||||
hw.DelayMs(500); |
|
||||
} |
|
||||
} |
|
@ -1,51 +0,0 @@ |
|||||
#include "daisy_seed.h" |
|
||||
#include "daisysp.h" |
|
||||
|
|
||||
// Use the daisy namespace to prevent having to type
|
|
||||
// daisy:: before all libdaisy functions
|
|
||||
using namespace daisy; |
|
||||
using namespace daisysp; |
|
||||
|
|
||||
// Declare a DaisySeed object called hardware
|
|
||||
DaisySeed hardware; |
|
||||
Oscillator osc; |
|
||||
|
|
||||
void AudioCallback( |
|
||||
AudioHandle::InterleavingInputBuffer in, |
|
||||
AudioHandle::InterleavingOutputBuffer out, |
|
||||
size_t size) |
|
||||
{ |
|
||||
float osc_out; |
|
||||
|
|
||||
//Convert floating point knob to midi (0-127)
|
|
||||
//Then convert midi to freq. in Hz
|
|
||||
osc.SetFreq(1000); |
|
||||
|
|
||||
//Fill the block with samples
|
|
||||
for (size_t i = 0; i < size; i += 2) { |
|
||||
osc.SetAmp(1.0); |
|
||||
osc_out = osc.Process(); |
|
||||
osc_out *= 0.1; |
|
||||
out[i] = osc_out; |
|
||||
out[i + 1] = osc_out; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
|
|
||||
int main(void) |
|
||||
{ |
|
||||
hardware.Configure(); |
|
||||
hardware.Init(); |
|
||||
hardware.SetAudioBlockSize(4); |
|
||||
|
|
||||
float samplerate = hardware.AudioSampleRate(); |
|
||||
|
|
||||
osc.Init(samplerate); |
|
||||
osc.SetWaveform(osc.WAVE_SIN); |
|
||||
osc.SetAmp(1.f); |
|
||||
osc.SetFreq(1000); |
|
||||
|
|
||||
hardware.StartAudio(AudioCallback); |
|
||||
|
|
||||
for (;;) {} |
|
||||
} |
|
Loading…
Reference in new issue