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

Class that handles initializing all of the hardware specific to the Desmodus Versio 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 Desmodus Versio hardware.
Helper funtions are also in place to provide easy access to built-in controls and peripherals.

Author
Ankoor Apte, Noise Engineering
Date
October 2020

#include <daisy_versio.h>

Public Types

enum  AV_LEDS {
  LED_0 , LED_1 , LED_2 , LED_3 ,
  LED_LAST
}
 
enum  AV_KNOBS {
  KNOB_0 , KNOB_1 , KNOB_2 , KNOB_3 ,
  KNOB_4 , KNOB_5 , KNOB_6 , KNOB_LAST
}
 
enum  AV_TOGGLE3 { SW_0 , SW_1 , SW_LAST }
 

Public Member Functions

 DaisyVersio ()
 
 ~DaisyVersio ()
 
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 ProcessAnalogControls ()
 
void ProcessAllControls ()
 
bool SwitchPressed ()
 
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
 
RgbLed leds [LED_LAST]
 
AnalogControl knobs [KNOB_LAST]
 
Switch tap
 
GateIn gate
 
Switch3 sw [SW_LAST]
 

Member Enumeration Documentation

◆ AV_KNOBS

Enumerator
KNOB_0 
KNOB_1 
KNOB_2 
KNOB_3 
KNOB_4 
KNOB_5 
KNOB_6 
KNOB_LAST 

◆ AV_LEDS

Enumerator
LED_0 
LED_1 
LED_2 
LED_3 
LED_LAST 

◆ AV_TOGGLE3

Enumerator
SW_0 
SW_1 
SW_LAST 

Constructor & Destructor Documentation

◆ DaisyVersio()

daisy::DaisyVersio::DaisyVersio ( )
inline

◆ ~DaisyVersio()

daisy::DaisyVersio::~DaisyVersio ( )
inline

Member Function Documentation

◆ AudioBlockSize()

size_t daisy::DaisyVersio::AudioBlockSize ( )

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

◆ AudioCallbackRate()

float daisy::DaisyVersio::AudioCallbackRate ( )

Returns the rate in Hz that the Audio callback is called

◆ AudioSampleRate()

float daisy::DaisyVersio::AudioSampleRate ( )

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

◆ ChangeAudioCallback() [1/2]

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

Switch callback functions

Parameters
cbNew non-interleaved callback function.

◆ ChangeAudioCallback() [2/2]

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

Switch callback functions

Parameters
cbNew interleaved callback function.

◆ DelayMs()

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

Wait some ms before going on.

Parameters
delDelay time in ms.

◆ Gate()

bool daisy::DaisyVersio::Gate ( )

Returns true if gate in is HIGH

◆ GetKnobValue()

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

Get Knob Value, float from 0.0f to 1.0f

◆ Init()

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

Initializes the Versio, and all of its hardware.

◆ ProcessAllControls()

void daisy::DaisyVersio::ProcessAllControls ( )
inline

Does what it says

◆ ProcessAnalogControls()

void daisy::DaisyVersio::ProcessAnalogControls ( )

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

◆ SetAudioBlockSize()

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

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

◆ SetAudioSampleRate()

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

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

◆ SetLed()

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

Set an LED (idx < 4) to a color

◆ StartAdc()

void daisy::DaisyVersio::StartAdc ( )

Start analog to digital conversion.

◆ StartAudio() [1/2]

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

Starts the callback

Parameters
cbNon-interleaved callback function

◆ StartAudio() [2/2]

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

Starts the callback

Parameters
cbInterleaved callback function

◆ StopAdc()

void daisy::DaisyVersio::StopAdc ( )

Stop converting ADCs

◆ StopAudio()

void daisy::DaisyVersio::StopAudio ( )

Stops the audio if it is running.

◆ SwitchPressed()

bool daisy::DaisyVersio::SwitchPressed ( )

Returns true if momentary switch is pressed

◆ UpdateExample()

void daisy::DaisyVersio::UpdateExample ( )

◆ UpdateLeds()

void daisy::DaisyVersio::UpdateLeds ( )

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

Member Data Documentation

◆ gate

GateIn daisy::DaisyVersio::gate

◆ knobs

AnalogControl daisy::DaisyVersio::knobs[KNOB_LAST]

◆ leds

RgbLed daisy::DaisyVersio::leds[LED_LAST]

◆ seed

DaisySeed daisy::DaisyVersio::seed

◆ sw

Switch3 daisy::DaisyVersio::sw[SW_LAST]

◆ tap

Switch daisy::DaisyVersio::tap

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