Class that handles initializing all of the hardware specific to the Virt Iter Legio hardware.
Helper funtions are also in place to provide easy access to built-in controls and peripherals.
More...
Class that handles initializing all of the hardware specific to the Virt Iter Legio hardware.
Helper funtions are also in place to provide easy access to built-in controls and peripherals.
#include <daisy_legio.h>
Public Types | |
enum | LEGIO_LEDS { LED_LEFT , LED_RIGHT , LED_LAST } |
enum | LEGIO_CONTROLS { CONTROL_PITCH , CONTROL_KNOB_TOP , CONTROL_KNOB_BOTTOM , CONTROL_LAST } |
enum | LEGIO_TOGGLE3 { SW_LEFT , SW_RIGHT , SW_LAST } |
Public Member Functions | |
DaisyLegio () | |
~DaisyLegio () | |
void | Init (bool boost=false) |
void | DelayMs (size_t del) |
void | StartAudio (AudioHandle::InterleavingAudioCallback cb) |
void | StartAudio (AudioHandle::AudioCallback cb) |
void | ChangeAudioCallback (AudioHandle::InterleavingAudioCallback cb) |
void | ChangeAudioCallback (AudioHandle::AudioCallback cb) |
void | StopAudio () |
void | SetAudioBlockSize (size_t size) |
size_t | AudioBlockSize () |
void | SetAudioSampleRate (SaiHandle::Config::SampleRate samplerate) |
float | AudioSampleRate () |
float | AudioCallbackRate () |
void | StartAdc () |
void | StopAdc () |
void | ProcessDigitalControls () |
void | ProcessAnalogControls () |
void | ProcessAllControls () |
bool | Gate () |
void | SetLed (size_t idx, float red, float green, float blue) |
float | GetKnobValue (int idx) |
void | UpdateLeds () |
void | UpdateExample () |
Public Attributes | |
DaisySeed | seed |
Encoder | encoder |
GateIn | gate |
RgbLed | leds [LED_LAST] |
AnalogControl | controls [CONTROL_LAST] |
Switch3 | sw [SW_LAST] |
|
inline |
|
inline |
size_t daisy::DaisyLegio::AudioBlockSize | ( | ) |
Returns the number of samples per channel in a block of audio.
float daisy::DaisyLegio::AudioCallbackRate | ( | ) |
Returns the rate in Hz that the Audio callback is called
float daisy::DaisyLegio::AudioSampleRate | ( | ) |
Returns the audio sample rate in Hz as a floating point number.
void daisy::DaisyLegio::ChangeAudioCallback | ( | AudioHandle::AudioCallback | cb | ) |
Switch callback functions
cb | New non-interleaved callback function. |
void daisy::DaisyLegio::ChangeAudioCallback | ( | AudioHandle::InterleavingAudioCallback | cb | ) |
Switch callback functions
cb | New interleaved callback function. |
Wait some ms before going on.
del | Delay time in ms. |
bool daisy::DaisyLegio::Gate | ( | ) |
Returns true if gate in is HIGH
|
inline |
Does what it says
void daisy::DaisyLegio::ProcessAnalogControls | ( | ) |
Normalize ADC CV input. Call this once per main loop update to normalize CV input to range (0.0f, 1.0f)
void daisy::DaisyLegio::ProcessDigitalControls | ( | ) |
Process digital controls
Sets the number of samples processed per channel by the audio callback.
void daisy::DaisyLegio::SetAudioSampleRate | ( | SaiHandle::Config::SampleRate | samplerate | ) |
Updates the Audio Sample Rate, and reinitializes. Audio must be stopped for this to work.
Set an LED (idx < 4) to a color
void daisy::DaisyLegio::StartAdc | ( | ) |
Start analog to digital conversion.
void daisy::DaisyLegio::StartAudio | ( | AudioHandle::AudioCallback | cb | ) |
Starts the callback
cb | Non-interleaved callback function |
void daisy::DaisyLegio::StartAudio | ( | AudioHandle::InterleavingAudioCallback | cb | ) |
Starts the callback
cb | Interleaved callback function |
void daisy::DaisyLegio::StopAdc | ( | ) |
Stop converting ADCs
void daisy::DaisyLegio::StopAudio | ( | ) |
Stops the audio if it is running.
void daisy::DaisyLegio::UpdateExample | ( | ) |
void daisy::DaisyLegio::UpdateLeds | ( | ) |
Update LED PWM state. Call this once per main loop update to correctly display led colors
AnalogControl daisy::DaisyLegio::controls[CONTROL_LAST] |
Encoder daisy::DaisyLegio::encoder |
GateIn daisy::DaisyLegio::gate |
DaisySeed daisy::DaisyLegio::seed |