daisy::DaisyPetal¶
Helpers and hardware definitions for daisy petal.
#include <daisy_petal.h>
Public Types¶
Name | |
---|---|
enum | Sw |
enum | Knob |
enum | RingLed |
enum | FootswitchLed |
Public Functions¶
Name | |
---|---|
DaisyPetal() | |
~DaisyPetal() | |
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 | 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(Knob k) |
float | GetExpression() |
void | ProcessDigitalControls() |
void | ClearLeds() |
void | UpdateLeds() |
void | SetRingLed(RingLed idx, float r, float g, float b) |
void | SetFootswitchLed(FootswitchLed idx, float bright) |
Public Attributes¶
Name | |
---|---|
DaisySeed | seed |
Encoder | encoder |
AnalogControl[KNOB_LAST] | knob |
AnalogControl | expression |
Switch[SW_LAST] | switches |
RgbLed[8] | ring_led |
Led[4] | footswitch_led |
Public Types Documentation¶
enum Sw¶
Enumerator | Value | Description |
---|---|---|
SW_1 | Footswitch | |
SW_2 | Footswitch | |
SW_3 | Footswitch | |
SW_4 | Footswitch | |
SW_5 | Toggle | |
SW_6 | Toggle | |
SW_7 | Toggle | |
SW_LAST | Last enum item |
Switches
enum Knob¶
Enumerator | Value | Description |
---|---|---|
KNOB_1 | & | |
KNOB_2 | & | |
KNOB_3 | & | |
KNOB_4 | & | |
KNOB_5 | & | |
KNOB_6 | & | |
KNOB_LAST | & |
Knobs
enum RingLed¶
Enumerator | Value | Description |
---|---|---|
RING_LED_1 | & | |
RING_LED_2 | & | |
RING_LED_3 | & | |
RING_LED_4 | & | |
RING_LED_5 | & | |
RING_LED_6 | & | |
RING_LED_7 | & | |
RING_LED_8 | & | |
RING_LED_LAST | & |
Leds in ringled
enum FootswitchLed¶
Enumerator | Value | Description |
---|---|---|
FOOTSWITCH_LED_1 | & | |
FOOTSWITCH_LED_2 | & | |
FOOTSWITCH_LED_3 | & | |
FOOTSWITCH_LED_4 | & | |
FOOTSWITCH_LED_LAST | & |
footswitch leds
Public Functions Documentation¶
function DaisyPetal¶
Constructor
function ~DaisyPetal¶
Destructor
function Init¶
Initialize daisy petal
function DelayMs¶
Parameters:
- del Delay time in ms.
Wait before moving on.
function StartAudio¶
Parameters:
- cb Interleaved callback function
Starts the callback
function StartAudio¶
Parameters:
- cb multichannel callback function
Starts the callback
function ChangeAudioCallback¶
Parameters:
- cb New interleaved callback function.
Switch callback functions
function ChangeAudioCallback¶
Parameters:
- cb New multichannel callback function.
Switch callback functions
function StopAudio¶
Stops the audio if it is running.
function SetAudioSampleRate¶
Updates the Audio Sample Rate, and reinitializes. Audio must be stopped for this to work.
function AudioSampleRate¶
Returns the audio sample rate in Hz as a floating point number.
function SetAudioBlockSize¶
Parameters:
- size Audio block size
Sets the number of samples processed per channel by the audio callback.
function AudioBlockSize¶
Returns the number of samples per channel in a block of audio.
function AudioCallbackRate¶
Returns the rate in Hz that the Audio callback is called
function StartAdc¶
Start analog to digital conversion.
function StopAdc¶
Stops Transfering data from the ADC
function ProcessAnalogControls¶
Call at the same frequency as controls are read for stable readings.
function ProcessAllControls¶
Process Analog and Digital Controls
function GetKnobValue¶
Parameters:
- k Which knob to get
Return: Floating point knob position.
Get value per knob.
function GetExpression¶
&
function ProcessDigitalControls¶
Process digital controls
function ClearLeds¶
Turn all leds off
function UpdateLeds¶
Update Leds to values you had set.
function SetRingLed¶
Parameters:
- idx Index to set
- r Red value
- g Green value
- b Blue value
Set ring LED colors
function SetFootswitchLed¶
Parameters:
- idx Led Index
- bright Brightness
Set footswitch LED
Public Attributes Documentation¶
variable seed¶
&
variable encoder¶
&
variable knob¶
&
variable expression¶
&
variable switches¶
< &
variable ring_led¶
&
variable footswitch_led¶
&
Updated on 2024-01-03 at 19:41:01 +0000