Skip to content

Class daisy::DaisyPatch

ClassList > daisy > DaisyPatch

Class that handles initializing all of the hardware specific to the Daisy Patch Board. Helper funtions are also in place to provide easy access to built-in controls and peripherals.More...

  • #include <daisy_patch.h>

Public Types

Type Name
enum Ctrl
enum GateInput

Public Attributes

Type Name
Ak4556 codec
AnalogControl controls
OledDisplay< SSD130x4WireSpi128x64Driver > display
Encoder encoder
GateIn gate_input
GPIO gate_output
MidiUartHandler midi
DaisySeed seed

Public Functions

Type Name
size_t AudioBlockSize ()
float AudioCallbackRate ()
float AudioSampleRate ()
void ChangeAudioCallback (AudioHandle::AudioCallback cb)
DaisyPatch ()
void DelayMs (size_t del)
void DisplayControls (bool invert=true)
float GetKnobValue (Ctrl k)
void Init (bool boost=false)
void ProcessAllControls ()
void ProcessAnalogControls ()
void ProcessDigitalControls ()
void SetAudioBlockSize (size_t size)
void SetAudioSampleRate (SaiHandle::Config::SampleRate samplerate)
void StartAdc ()
void StartAudio (AudioHandle::AudioCallback cb)
void StopAdc ()
void StopAudio ()
~DaisyPatch ()

Detailed Description

Author:

Stephen Hensley

Date:

November 2019

Public Types Documentation

enum Ctrl

enum daisy::DaisyPatch::Ctrl {
    CTRL_1,
    CTRL_2,
    CTRL_3,
    CTRL_4,
    CTRL_LAST
};

Enum of Ctrls to represent the four CV/Knob combos on the Patch


enum GateInput

enum daisy::DaisyPatch::GateInput {
    GATE_IN_1,
    GATE_IN_2,
    GATE_IN_LAST
};

Daisy patch gate inputs


Public Attributes Documentation

variable codec

Ak4556 daisy::DaisyPatch::codec;

Patch's second CODEC


variable controls

AnalogControl daisy::DaisyPatch::controls[CTRL_LAST];

Array of controls


variable display

OledDisplay<SSD130x4WireSpi128x64Driver> daisy::DaisyPatch::display;

&


variable encoder

Encoder daisy::DaisyPatch::encoder;

Encoder object


variable gate_input

GateIn daisy::DaisyPatch::gate_input[GATE_IN_LAST];

Gate inputs


variable gate_output

GPIO daisy::DaisyPatch::gate_output;

&


variable midi

MidiUartHandler daisy::DaisyPatch::midi;

Handles midi


variable seed

DaisySeed daisy::DaisyPatch::seed;

Seed object


Public Functions Documentation

function AudioBlockSize

size_t daisy::DaisyPatch::AudioBlockSize () 

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


function AudioCallbackRate

float daisy::DaisyPatch::AudioCallbackRate () 

Returns the rate in Hz that the Audio callback is called


function AudioSampleRate

float daisy::DaisyPatch::AudioSampleRate () 

Get sample rate


function ChangeAudioCallback

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

Switch callback functions

Parameters:

  • cb New multichannel callback function.

function DaisyPatch

inline daisy::DaisyPatch::DaisyPatch () 

Constructor


function DelayMs

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

Wait some ms before going on.

Parameters:

  • del Delay time in ms.

function DisplayControls

void daisy::DaisyPatch::DisplayControls (
    bool invert=true
) 

Control the display


function GetKnobValue

float daisy::DaisyPatch::GetKnobValue (
    Ctrl k
) 

Get value for a particular control

Parameters:

  • k Which control to get

function Init

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

Initializes the daisy seed, and patch hardware.


function ProcessAllControls

inline void daisy::DaisyPatch::ProcessAllControls () 

Process Analog and Digital Controls


function ProcessAnalogControls

void daisy::DaisyPatch::ProcessAnalogControls () 

Call at same rate as reading controls for good reads.


function ProcessDigitalControls

void daisy::DaisyPatch::ProcessDigitalControls () 

Process the digital controls


function SetAudioBlockSize

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

Audio Block size defaults to 48. Change it using this function before StartingAudio

Parameters:

  • size Audio block size.

function SetAudioSampleRate

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

Set the sample rate for the audio


function StartAdc

void daisy::DaisyPatch::StartAdc () 

Start analog to digital conversion.


function StartAudio

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

Starts the callback

Parameters:

  • cb multichannel callback function

function StopAdc

void daisy::DaisyPatch::StopAdc () 

Stops Transfering data from the ADC


function StopAudio

void daisy::DaisyPatch::StopAudio () 

Stops the audio


function ~DaisyPatch

inline daisy::DaisyPatch::~DaisyPatch () 

Destructor



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