Skip to content

daisy::DaisyLegio

Module: LIBDAISY / BOARDS

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

Name
enum LEGIO_LEDS
enum LEGIO_CONTROLS
enum LEGIO_TOGGLE3

Public Functions

Name
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

Name
DaisySeed seed
Encoder encoder
GateIn gate
RgbLed[LED_LAST] leds
AnalogControl[CONTROL_LAST] controls
Switch3[SW_LAST] sw

Detailed Description

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

Author: Eris Fairbanks, Olivia Artz Modular + Noise Engineering

Date: June 2022

Public Types Documentation

enum LEGIO_LEDS

Enumerator Value Description
LED_LEFT
LED_RIGHT
LED_LAST

enum LEGIO_CONTROLS

Enumerator Value Description
CONTROL_PITCH
CONTROL_KNOB_TOP
CONTROL_KNOB_BOTTOM
CONTROL_LAST

enum LEGIO_TOGGLE3

Enumerator Value Description
SW_LEFT
SW_RIGHT
SW_LAST

Public Functions Documentation

function DaisyLegio

inline DaisyLegio()

function ~DaisyLegio

inline ~DaisyLegio()

function Init

void Init(
    bool boost =false
)

Initializes the Legio, and all of its hardware.


function DelayMs

void DelayMs(
    size_t del
)

Parameters:

  • del Delay time in ms.

Wait some ms before going on.


function StartAudio

void StartAudio(
    AudioHandle::InterleavingAudioCallback cb
)

Parameters:

  • cb Interleaved callback function

Starts the callback


function StartAudio

void StartAudio(
    AudioHandle::AudioCallback cb
)

Parameters:

  • cb Non-interleaved callback function

Starts the callback


function ChangeAudioCallback

void ChangeAudioCallback(
    AudioHandle::InterleavingAudioCallback cb
)

Parameters:

  • cb New interleaved callback function.

Switch callback functions


function ChangeAudioCallback

void ChangeAudioCallback(
    AudioHandle::AudioCallback cb
)

Parameters:

  • cb New non-interleaved callback function.

Switch callback functions


function StopAudio

void StopAudio()

Stops the audio if it is running.


function SetAudioBlockSize

void SetAudioBlockSize(
    size_t size
)

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


function AudioBlockSize

size_t AudioBlockSize()

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


function SetAudioSampleRate

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

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


function AudioSampleRate

float AudioSampleRate()

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


function AudioCallbackRate

float AudioCallbackRate()

Returns the rate in Hz that the Audio callback is called


function StartAdc

void StartAdc()

Start analog to digital conversion.


function StopAdc

void StopAdc()

Stop converting ADCs


function ProcessDigitalControls

void ProcessDigitalControls()

Process digital controls


function ProcessAnalogControls

void ProcessAnalogControls()

Normalize ADC CV input. Call this once per main loop update to normalize CV input to range (0.0f, 1.0f)


function ProcessAllControls

inline void ProcessAllControls()

Does what it says


function Gate

bool Gate()

Returns true if gate in is HIGH


function SetLed

void SetLed(
    size_t idx,
    float red,
    float green,
    float blue
)

Set an LED (idx < 4) to a color


function GetKnobValue

float GetKnobValue(
    int idx
)

Get Knob Value, float from 0.0f to 1.0f


function UpdateLeds

void UpdateLeds()

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


function UpdateExample

void UpdateExample()

Public Attributes Documentation

variable seed

DaisySeed seed;

variable encoder

Encoder encoder;

variable gate

GateIn gate;

variable leds

RgbLed[LED_LAST] leds;

variable controls

AnalogControl[CONTROL_LAST] controls;

variable sw

Switch3[SW_LAST] sw;

Updated on 2024-01-03 at 19:41:01 +0000