libDaisy
Hardware Library for Daisy
Loading...
Searching...
No Matches
daisy::DaisyLegio Class Reference

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

Detailed Description

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

#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]
 

Member Enumeration Documentation

◆ LEGIO_CONTROLS

Enumerator
CONTROL_PITCH 
CONTROL_KNOB_TOP 
CONTROL_KNOB_BOTTOM 
CONTROL_LAST 

◆ LEGIO_LEDS

Enumerator
LED_LEFT 
LED_RIGHT 
LED_LAST 

◆ LEGIO_TOGGLE3

Enumerator
SW_LEFT 
SW_RIGHT 
SW_LAST 

Constructor & Destructor Documentation

◆ DaisyLegio()

daisy::DaisyLegio::DaisyLegio ( )
inline

◆ ~DaisyLegio()

daisy::DaisyLegio::~DaisyLegio ( )
inline

Member Function Documentation

◆ AudioBlockSize()

size_t daisy::DaisyLegio::AudioBlockSize ( )

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

◆ AudioCallbackRate()

float daisy::DaisyLegio::AudioCallbackRate ( )

Returns the rate in Hz that the Audio callback is called

◆ AudioSampleRate()

float daisy::DaisyLegio::AudioSampleRate ( )

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

◆ ChangeAudioCallback() [1/2]

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

Switch callback functions

Parameters
cbNew non-interleaved callback function.

◆ ChangeAudioCallback() [2/2]

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

Switch callback functions

Parameters
cbNew interleaved callback function.

◆ DelayMs()

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

Wait some ms before going on.

Parameters
delDelay time in ms.

◆ Gate()

bool daisy::DaisyLegio::Gate ( )

Returns true if gate in is HIGH

◆ GetKnobValue()

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

Get Knob Value, float from 0.0f to 1.0f

◆ Init()

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

Initializes the Legio, and all of its hardware.

◆ ProcessAllControls()

void daisy::DaisyLegio::ProcessAllControls ( )
inline

Does what it says

◆ 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)

◆ ProcessDigitalControls()

void daisy::DaisyLegio::ProcessDigitalControls ( )

Process digital controls

◆ SetAudioBlockSize()

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

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

◆ SetAudioSampleRate()

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

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

◆ SetLed()

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

Set an LED (idx < 4) to a color

◆ StartAdc()

void daisy::DaisyLegio::StartAdc ( )

Start analog to digital conversion.

◆ StartAudio() [1/2]

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

Starts the callback

Parameters
cbNon-interleaved callback function

◆ StartAudio() [2/2]

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

Starts the callback

Parameters
cbInterleaved callback function

◆ StopAdc()

void daisy::DaisyLegio::StopAdc ( )

Stop converting ADCs

◆ StopAudio()

void daisy::DaisyLegio::StopAudio ( )

Stops the audio if it is running.

◆ UpdateExample()

void daisy::DaisyLegio::UpdateExample ( )

◆ UpdateLeds()

void daisy::DaisyLegio::UpdateLeds ( )

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

Member Data Documentation

◆ controls

AnalogControl daisy::DaisyLegio::controls[CONTROL_LAST]

◆ encoder

Encoder daisy::DaisyLegio::encoder

◆ gate

GateIn daisy::DaisyLegio::gate

◆ leds

RgbLed daisy::DaisyLegio::leds[LED_LAST]

◆ seed

DaisySeed daisy::DaisyLegio::seed

◆ sw

Switch3 daisy::DaisyLegio::sw[SW_LAST]

The documentation for this class was generated from the following file: