Skip to content

daisy::DaisyPatch

Module: LIBDAISY / BOARDS

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

Name
enum Ctrl
enum GateInput

Public Functions

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

Public Attributes

Name
DaisySeed seed
Encoder encoder
AnalogControl[CTRL_LAST] controls
GateIn[GATE_IN_LAST] gate_input
MidiUartHandler midi
OledDisplay< SSD130x4WireSpi128x64Driver > display
dsy_gpio gate_output

Detailed Description

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

Author: Stephen Hensley

Date: November 2019

Public Types Documentation

enum Ctrl

Enumerator Value Description
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

Enumerator Value Description
GATE_IN_1
GATE_IN_2
GATE_IN_LAST <

Daisy patch gate inputs

Public Functions Documentation

function DaisyPatch

inline DaisyPatch()

Constructor


function ~DaisyPatch

inline ~DaisyPatch()

Destructor


function Init

void Init(
    bool boost =false
)

Initializes the daisy seed, and patch 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::AudioCallback cb
)

Parameters:

  • cb multichannel callback function

Starts the callback


function ChangeAudioCallback

void ChangeAudioCallback(
    AudioHandle::AudioCallback cb
)

Parameters:

  • cb New multichannel callback function.

Switch callback functions


function StopAudio

void StopAudio()

Stops the audio


function SetAudioSampleRate

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

Set the sample rate for the audio


function AudioSampleRate

float AudioSampleRate()

Get sample rate


function SetAudioBlockSize

void SetAudioBlockSize(
    size_t size
)

Parameters:

  • size Audio block size.

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


function AudioBlockSize

size_t AudioBlockSize()

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


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

Stops Transfering data from the ADC


function ProcessAnalogControls

void ProcessAnalogControls()

Call at same rate as reading controls for good reads.


function ProcessAllControls

inline void ProcessAllControls()

Process Analog and Digital Controls


function GetKnobValue

float GetKnobValue(
    Ctrl k
)

Parameters:

  • k Which control to get

Get value for a particular control


function ProcessDigitalControls

void ProcessDigitalControls()

Process the digital controls


function DisplayControls

void DisplayControls(
    bool invert =true
)

Control the display


Public Attributes Documentation

variable seed

DaisySeed seed;

Seed object

variable encoder

Encoder encoder;

Encoder object

variable controls

AnalogControl[CTRL_LAST] controls;

Array of controls

variable gate_input

GateIn[GATE_IN_LAST] gate_input;

Gate inputs

variable midi

MidiUartHandler midi;

Handles midi

variable display

OledDisplay< SSD130x4WireSpi128x64Driver > display;

&

variable gate_output

dsy_gpio gate_output;

&


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