Skip to content

Class daisy::DaisyLegio

ClassList > daisy > DaisyLegio

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...

  • #include <daisy_legio.h>

Public Types

Type Name
enum LEGIO_CONTROLS
enum LEGIO_LEDS
enum LEGIO_TOGGLE3

Public Attributes

Type Name
AnalogControl controls
Encoder encoder
GateIn gate
RgbLed leds
DaisySeed seed
Switch3 sw

Public Functions

Type Name
size_t AudioBlockSize ()
float AudioCallbackRate ()
float AudioSampleRate ()
void ChangeAudioCallback (AudioHandle::InterleavingAudioCallback cb)
void ChangeAudioCallback (AudioHandle::AudioCallback cb)
DaisyLegio ()
void DelayMs (size_t del)
bool Gate ()
float GetKnobValue (int idx)
void Init (bool boost=false)
void ProcessAllControls ()
void ProcessAnalogControls ()
void ProcessDigitalControls ()
void SetAudioBlockSize (size_t size)
void SetAudioSampleRate (SaiHandle::Config::SampleRate samplerate)
void SetLed (size_t idx, float red, float green, float blue)
void StartAdc ()
void StartAudio (AudioHandle::InterleavingAudioCallback cb)
void StartAudio (AudioHandle::AudioCallback cb)
void StopAdc ()
void StopAudio ()
void UpdateExample ()
void UpdateLeds ()
~DaisyLegio ()

Detailed Description

Author:

Eris Fairbanks, Olivia Artz Modular + Noise Engineering

Date:

June 2022

Public Types Documentation

enum LEGIO_CONTROLS

enum daisy::DaisyLegio::LEGIO_CONTROLS {
    CONTROL_PITCH,
    CONTROL_KNOB_TOP,
    CONTROL_KNOB_BOTTOM,
    CONTROL_LAST
};

enum LEGIO_LEDS

enum daisy::DaisyLegio::LEGIO_LEDS {
    LED_LEFT,
    LED_RIGHT,
    LED_LAST
};

enum LEGIO_TOGGLE3

enum daisy::DaisyLegio::LEGIO_TOGGLE3 {
    SW_LEFT,
    SW_RIGHT,
    SW_LAST
};

Public Attributes Documentation

variable controls

AnalogControl daisy::DaisyLegio::controls[CONTROL_LAST];

variable encoder

Encoder daisy::DaisyLegio::encoder;

variable gate

GateIn daisy::DaisyLegio::gate;

variable leds

RgbLed daisy::DaisyLegio::leds[LED_LAST];

variable seed

DaisySeed daisy::DaisyLegio::seed;

variable sw

Switch3 daisy::DaisyLegio::sw[SW_LAST];

Public Functions Documentation

function AudioBlockSize

size_t daisy::DaisyLegio::AudioBlockSize () 

Returns the number of samples per channel in a block of audio.


function AudioCallbackRate

float daisy::DaisyLegio::AudioCallbackRate () 

Returns the rate in Hz that the Audio callback is called


function AudioSampleRate

float daisy::DaisyLegio::AudioSampleRate () 

Returns the audio sample rate in Hz as a floating point number.


function ChangeAudioCallback [½]

void daisy::DaisyLegio::ChangeAudioCallback (
    AudioHandle::InterleavingAudioCallback cb
) 

Switch callback functions

Parameters:

  • cb New interleaved callback function.

function ChangeAudioCallback [2/2]

void daisy::DaisyLegio::ChangeAudioCallback (
    AudioHandle::AudioCallback cb
) 

Switch callback functions

Parameters:

  • cb New non-interleaved callback function.

function DaisyLegio

inline daisy::DaisyLegio::DaisyLegio () 

function DelayMs

void daisy::DaisyLegio::DelayMs (
    size_t del
) 

Wait some ms before going on.

Parameters:

  • del Delay time in ms.

function Gate

bool daisy::DaisyLegio::Gate () 

Returns true if gate in is HIGH


function GetKnobValue

float daisy::DaisyLegio::GetKnobValue (
    int idx
) 

Get Knob Value, float from 0.0f to 1.0f


function Init

void daisy::DaisyLegio::Init (
    bool boost=false
) 

Initializes the Legio, and all of its hardware.


function ProcessAllControls

inline void daisy::DaisyLegio::ProcessAllControls () 

Does what it says


function ProcessAnalogControls

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)


function ProcessDigitalControls

void daisy::DaisyLegio::ProcessDigitalControls () 

Process digital controls


function SetAudioBlockSize

void daisy::DaisyLegio::SetAudioBlockSize (
    size_t size
) 

Sets the number of samples processed per channel by the audio callback.


function SetAudioSampleRate

void daisy::DaisyLegio::SetAudioSampleRate (
    SaiHandle::Config::SampleRate samplerate
) 

Updates the Audio Sample Rate, and reinitializes. Audio must be stopped for this to work.


function SetLed

void daisy::DaisyLegio::SetLed (
    size_t idx,
    float red,
    float green,
    float blue
) 

Set an LED (idx < 4) to a color


function StartAdc

void daisy::DaisyLegio::StartAdc () 

Start analog to digital conversion.


function StartAudio [½]

void daisy::DaisyLegio::StartAudio (
    AudioHandle::InterleavingAudioCallback cb
) 

Starts the callback

Parameters:

  • cb Interleaved callback function

function StartAudio [2/2]

void daisy::DaisyLegio::StartAudio (
    AudioHandle::AudioCallback cb
) 

Starts the callback

Parameters:

  • cb Non-interleaved callback function

function StopAdc

void daisy::DaisyLegio::StopAdc () 

Stop converting ADCs


function StopAudio

void daisy::DaisyLegio::StopAudio () 

Stops the audio if it is running.


function UpdateExample

void daisy::DaisyLegio::UpdateExample () 

function UpdateLeds

void daisy::DaisyLegio::UpdateLeds () 

Update LED PWM state. Call this once per main loop update to correctly display led colors


function ~DaisyLegio

inline daisy::DaisyLegio::~DaisyLegio () 


The documentation for this class was generated from the following file external-docs/libDaisy/src/daisy_legio.h