Hardware support class for the Qu-Bit Aurora This should be created, and intitialized at the beginning of any program before running anything else. More...
Hardware support class for the Qu-Bit Aurora This should be created, and intitialized at the beginning of any program before running anything else.
If you've used the Daisy Seed, etc. before this object takes the place of the core "DaisySeed" or other board support objects.
#include <aurora.h>
Public Member Functions | |
Hardware () | |
Empty Constructor Call Init from main to initialize. More... | |
~Hardware () | |
Empty Destructor This object should span the life of the program. More... | |
void | Init (bool boost=true) |
Initialize the hardware. Call this function at the start of main() More... | |
void | StartAudio (daisy::AudioHandle::AudioCallback cb) |
Starts a specified audio callback Data is non-interleaved (i.e. {{L0, L1, ... , LN},{R0, R1, ... , RN}}) More... | |
void | ChangeAudioCallback (daisy::AudioHandle::AudioCallback cb) |
Changes current callback to a new non-interleaved callback. More... | |
void | StartAudio (daisy::AudioHandle::InterleavingAudioCallback cb) |
Starts a specified Interleaving audio callback. More... | |
void | ChangeAudioCallback (daisy::AudioHandle::InterleavingAudioCallback cb) |
Changes current callback to a new interleaved callback. More... | |
void | StartLowPriorityCallback (daisy::TimerHandle::PeriodElapsedCallback cb, uint32_t target_freq, void *data=nullptr) |
void | ChangeSampleRate (int sr) |
Updates the samplerate to one of the allowed target samplerates. This function stops the audio completely, and will cause clicks. More... | |
void | StopAudio () |
Stops Audio. More... | |
void | SetAudioSampleRate (daisy::SaiHandle::Config::SampleRate samplerate) |
sets the audio sample rate. Audio must be stopped for this to work properly More... | |
void | SetAudioSampleRate (int samplerate) |
sets the audio sample rate. Audio must be stopped for this to work properly More... | |
float | AudioSampleRate () |
returns the sample rate in Hz of the audio engine More... | |
void | SetAudioBlockSize (size_t blocksize) |
sets the number of samples to process in each audio callback More... | |
size_t | AudioBlockSize () |
returns the number of samples to process in each audio callback More... | |
float | AudioCallbackRate () const |
returns the rate in Hz that the audio callback gets called More... | |
void | SetTestLed (bool state) |
sets the state of the LED on the daisy itself More... | |
void | ClearLeds () |
sets all RGB LEDs to off state This can be called from the top of wherever LEDs are periodically set or within the UI framework's Canvas descriptor via the clearFunction_ function. More... | |
void | WriteLeds () |
Writes the state of all LEDs to the hardware This can be called from a fixed interval in the main loop, or within the UI framework's Canvas descriptor via the flushFunction_ function. More... | |
void | SetLed (Leds idx, float r, float g, float b) |
Sets the RGB value of a given LED. More... | |
void | SetLed (Leds idx, daisy::Color c) |
Sets the Color value of an LED. More... | |
void | ProcessAllControls () |
filters and debounces all control This should be run once per audio callback. More... | |
void | ProcessDigitalControls () |
filters and debounces digital controls (switches) This is called from ProcessAllControls, and should be run once per audio callback More... | |
void | ProcessAnalogControls () |
filters all analog controls (knobs and CVs) This is called from ProcessAllControls, and should be run once per audio callback More... | |
float | GetKnobValue (int ctrl) const |
returns a 0-1 value for the given knob control More... | |
const daisy::Switch & | GetButton (int idx) const |
returns a reference to a given momentary switch Example Usage: bool state = hw.GetButton(SW_FREEZE).Pressed(); More... | |
bool | GetGateTrig (int idx) |
returns true if the gate input just went high This is expected to be checked only once per audio callback More... | |
bool | GetGateState (int idx) |
returns true if the gate input is currently high More... | |
void | UpdateHidRates () |
Update HidRates for new Callback rate when samplerate/blocksize change. More... | |
void | PrepareMedia (daisy::USBHostHandle::ConnectCallback connect_cb=nullptr, daisy::USBHostHandle::DisconnectCallback disconnect_cb=nullptr, daisy::USBHostHandle::ClassActiveCallback class_active_cb=nullptr, daisy::USBHostHandle::ErrorCallback error_cb=nullptr, void *userdata=nullptr) |
starts the mounting process for USB Drive use if it is present More... | |
float | GetWarpVoct () |
Return a MIDI note number value from -60 to 60 corresponding to the -5V to 5V input range of the Warp CV input. More... | |
float | GetCvValue (int cv_idx) |
gets calibrated offset-adjusted CV Value from the hardware. More... | |
void | DelayMs (size_t del) |
delay function; same as System::Delay(), and should not be called from any interrupt callbacks (LowPriorityCallback/AudioCallback). More... | |
void | CalibrateV1 (float v1) |
called during a customized calibration UI to record the 1V value More... | |
void | CalibrateV3 (float v3) |
called during a customized calibration UI to record the 3V value and set that calibraiton has completed and can be saved. More... | |
void | SetWarpCalData (float scale, float offset) |
Sets the calibration data for 1V/Octave over Warp CV typically set after reading stored data from external memory. More... | |
void | GetWarpCalData (float &scale, float &offset) |
Gets the current calibration data for 1V/Octave over Warp CV typically used to prepare data for storing after successful calibration. More... | |
void | SetCvOffsetData (float *data) |
Sets the cv offset from an externally array of data. More... | |
void | GetCvOffsetData (float *data) |
Fills an array with the offset data currently being used. More... | |
bool | ReadyToSaveCal () const |
Checks to see if calibration has been completed and needs to be saved. More... | |
void | ClearSaveCalFlag () |
signal the cal-save flag to clear once calibration data has been written to ext. flash memory More... | |
Public Attributes | |
daisy::AnalogControl | cv [CV_LAST] |
daisy::Switch | switches [SW_LAST] |
daisy::GateIn | gates [GATE_LAST] |
daisy::AnalogControl | controls [KNOB_LAST] |
daisy::DaisySeed | seed |
|
inline |
Empty Constructor Call Init
from main to initialize.
|
inline |
Empty Destructor This object should span the life of the program.
|
inline |
returns the number of samples to process in each audio callback
|
inline |
returns the rate in Hz that the audio callback gets called
|
inline |
returns the sample rate in Hz of the audio engine
|
inline |
called during a customized calibration UI to record the 1V value
|
inline |
called during a customized calibration UI to record the 3V value and set that calibraiton has completed and can be saved.
|
inline |
Changes current callback to a new non-interleaved callback.
|
inline |
Changes current callback to a new interleaved callback.
|
inline |
Updates the samplerate to one of the allowed target samplerates. This function stops the audio completely, and will cause clicks.
sr | target samplerate in Hz. Allowed values are 16000, 32000, 48000, 96000 any other value will fallback to 48kHz |
|
inline |
sets all RGB LEDs to off state This can be called from the top of wherever LEDs are periodically set or within the UI framework's Canvas descriptor via the clearFunction_ function.
|
inline |
signal the cal-save flag to clear once calibration data has been written to ext. flash memory
|
inline |
delay function; same as System::Delay(), and should not be called from any interrupt callbacks (LowPriorityCallback/AudioCallback).
del | number of milliseconds to delay |
|
inline |
returns a reference to a given momentary switch Example Usage: bool state = hw.GetButton(SW_FREEZE).Pressed();
idx | one of the Switches enum values |
|
inline |
Fills an array with the offset data currently being used.
|
inline |
gets calibrated offset-adjusted CV Value from the hardware.
cv_idx | index of the CV to read from. |
|
inline |
returns true if the gate input is currently high
idx | one of the Gates enum values |
|
inline |
returns true if the gate input just went high This is expected to be checked only once per audio callback
idx | one of the Gates enum values |
|
inline |
returns a 0-1 value for the given knob control
ctrl | knob index to read from. Should be one of ControlKnob (i.e. KNOB_TIME) |
|
inline |
Gets the current calibration data for 1V/Octave over Warp CV typically used to prepare data for storing after successful calibration.
|
inline |
Return a MIDI note number value from -60 to 60 corresponding to the -5V to 5V input range of the Warp CV input.
|
inline |
Initialize the hardware. Call this function at the start of main()
boost | true sets the processor to run at the maximum 480MHz, false sets the processor to run at 400MHz. Defaults to true (480MHz). |
|
inline |
starts the mounting process for USB Drive use if it is present
To access files from a USB drive: the connect, class_active, and disconnect callbacks can be used to update an external state machine that can be used to trigger interactions with the filesystem.
This process should be done within the main() while loop, and usb.Process()
should be called once per loop.
Initialize hardware and set user callbacks
Prepare FatFS – fmount will defer until first attempt to read/write
|
inline |
filters and debounces all control This should be run once per audio callback.
|
inline |
filters all analog controls (knobs and CVs) This is called from ProcessAllControls, and should be run once per audio callback
|
inline |
filters and debounces digital controls (switches) This is called from ProcessAllControls, and should be run once per audio callback
|
inline |
Checks to see if calibration has been completed and needs to be saved.
|
inline |
sets the number of samples to process in each audio callback
|
inline |
sets the audio sample rate. Audio must be stopped for this to work properly
samplerate | target samplerate in in daisy::SaiHandle::Config::SampleRate |
|
inline |
sets the audio sample rate. Audio must be stopped for this to work properly
samplerate | target samplerate in Hz. Allowed values are 16000, 32000, 48000, 96000 any other value will fallback to 48kHz |
|
inline |
Sets the cv offset from an externally array of data.
|
inline |
Sets the Color value of an LED.
idx | LED index (on of Leds enum above) |
c | Color object containing desired RGB values |
|
inline |
Sets the RGB value of a given LED.
idx | LED index (one of Leds enum above) |
r | 0- 1 red value |
g | 0- 1 green value |
b | 0- 1 blue value |
|
inline |
sets the state of the LED on the daisy itself
|
inline |
Sets the calibration data for 1V/Octave over Warp CV typically set after reading stored data from external memory.
|
inline |
Starts a specified audio callback Data is non-interleaved (i.e. {{L0, L1, ... , LN},{R0, R1, ... , RN}})
|
inline |
Starts a specified Interleaving audio callback.
|
inline |
This starts up a callback that is on the lowest priority interrupt level This provides an area for non-background tasks that should interrupt low level activity like diskio.
cb | callback to take place at target frequency |
target_freq | freq in hz that the callback should take place. |
data | any data to send through callback; this defaults to nullptr |
Start Audio
|
inline |
Stops Audio.
|
inline |
Update HidRates for new Callback rate when samplerate/blocksize change.
|
inline |
Writes the state of all LEDs to the hardware This can be called from a fixed interval in the main loop, or within the UI framework's Canvas descriptor via the flushFunction_ function.
daisy::AnalogControl aurora::Hardware::controls[KNOB_LAST] |
Array of knob controls
daisy::AnalogControl aurora::Hardware::cv[CV_LAST] |
Array of CV inputs
daisy::GateIn aurora::Hardware::gates[GATE_LAST] |
Array of gate inputs
daisy::DaisySeed aurora::Hardware::seed |
Daisy Seed base object
daisy::Switch aurora::Hardware::switches[SW_LAST] |
Array of momentary switches