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...
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.
#include <daisy_patch.h>
Public Types | |
| enum | Ctrl { CTRL_1 , CTRL_2 , CTRL_3 , CTRL_4 , CTRL_LAST } |
| enum | GateInput { GATE_IN_1 , GATE_IN_2 , GATE_IN_LAST } |
Public Member Functions | |
| 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) |
|
inline |
Constructor
|
inline |
Destructor
| size_t daisy::DaisyPatch::AudioBlockSize | ( | ) |
Returns the number of samples per channel in a block of audio.
| float daisy::DaisyPatch::AudioCallbackRate | ( | ) |
Returns the rate in Hz that the Audio callback is called
| float daisy::DaisyPatch::AudioSampleRate | ( | ) |
Get sample rate
| void daisy::DaisyPatch::ChangeAudioCallback | ( | AudioHandle::AudioCallback | cb | ) |
Switch callback functions
| cb | New multichannel callback function. |
| void daisy::DaisyPatch::DelayMs | ( | size_t | del | ) |
Wait some ms before going on.
| del | Delay time in ms. |
| void daisy::DaisyPatch::DisplayControls | ( | bool | invert = true | ) |
Control the display
| float daisy::DaisyPatch::GetKnobValue | ( | Ctrl | k | ) |
Get value for a particular control
| k | Which control to get |
| void daisy::DaisyPatch::Init | ( | bool | boost = false | ) |
Initializes the daisy seed, and patch hardware.
|
inline |
Process Analog and Digital Controls
| void daisy::DaisyPatch::ProcessAnalogControls | ( | ) |
Call at same rate as reading controls for good reads.
| void daisy::DaisyPatch::ProcessDigitalControls | ( | ) |
Process the digital controls
| void daisy::DaisyPatch::SetAudioBlockSize | ( | size_t | size | ) |
Audio Block size defaults to 48. Change it using this function before StartingAudio
| size | Audio block size. |
| void daisy::DaisyPatch::SetAudioSampleRate | ( | SaiHandle::Config::SampleRate | samplerate | ) |
Set the sample rate for the audio
| void daisy::DaisyPatch::StartAdc | ( | ) |
Start analog to digital conversion.
| void daisy::DaisyPatch::StartAudio | ( | AudioHandle::AudioCallback | cb | ) |
Starts the callback
| cb | multichannel callback function |
| void daisy::DaisyPatch::StopAdc | ( | ) |
Stops Transfering data from the ADC
| void daisy::DaisyPatch::StopAudio | ( | ) |
Stops the audio
| Ak4556 daisy::DaisyPatch::codec |
Patch's second CODEC
| AnalogControl daisy::DaisyPatch::controls[CTRL_LAST] |
Array of controls
| OledDisplay<SSD130x4WireSpi128x64Driver> daisy::DaisyPatch::display |
&
| GateIn daisy::DaisyPatch::gate_input[GATE_IN_LAST] |
Gate inputs
| GPIO daisy::DaisyPatch::gate_output |
&
| MidiUartHandler daisy::DaisyPatch::midi |
Handles midi
| DaisySeed daisy::DaisyPatch::seed |
Seed object