Compare commits
12 Commits
Author | SHA1 | Date |
---|---|---|
|
6b19b06e48 | 9 months ago |
|
c3de155e43 | 9 months ago |
![]() |
f6245bf01d | 9 months ago |
![]() |
2faf4657dc | 9 months ago |
![]() |
23b1cf4ca3 | 9 months ago |
![]() |
e59a2d1dc7 | 9 months ago |
![]() |
6b6dfd5122 | 9 months ago |
![]() |
4e84419b6c | 9 months ago |
![]() |
e0b3c69417 | 9 months ago |
![]() |
db14196b73 | 9 months ago |
![]() |
85afddf5f4 | 9 months ago |
![]() |
6eb4111a77 | 9 months ago |
28 changed files with 104 additions and 316 deletions
After Width: | Height: | Size: 828 KiB |
@ -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 (;;) {} |
|||
} |
@ -0,0 +1,30 @@ |
|||
#ifndef HECK_DAISY_TYPES_HH |
|||
#define HECK_DAISY_TYPES_HH |
|||
|
|||
#include <cstdint> |
|||
#include "daisy_seed.h" |
|||
#include "daisysp.h" |
|||
|
|||
namespace Heck { |
|||
|
|||
// Types
|
|||
using u8 = uint8_t; |
|||
using u16 = uint16_t; |
|||
using u32 = uint32_t; |
|||
using u64 = uint64_t; |
|||
|
|||
using i8 = int8_t; |
|||
using i16 = int16_t; |
|||
using i32 = int32_t; |
|||
using i64 = int64_t; |
|||
|
|||
using f32 = float; |
|||
using f64 = double; |
|||
|
|||
// namespace aliases
|
|||
namespace ld = daisy; |
|||
namespace dsp = daisysp; |
|||
} // namespace Heck
|
|||
|
|||
|
|||
#endif |
Loading…
Reference in new issue