Aurora-SDK
Development Reference for Aurora-SDK
aurora.h
Go to the documentation of this file.
1
2#pragma once
3#ifndef AURORA_HW_H
4#define AURORA_HW_H
5
6#include "daisy_seed.h"
7#include "fatfs.h"
8
9#define DTCMRAM __attribute__((section(".dtcmram_bss")))
10#define D2RAM __attribute__((section(".d2_bss")))
11#define D2RAM2 __attribute__((section(".d2r2_bss")))
12#define ITCMRAM __attribute__((section(".itcmram_bss")))
13
14namespace aurora
15{
16
20static constexpr int kMaxBlockSize = 96;
21
25static daisy::LedDriverPca9685<2, true>::DmaBuffer DMA_BUFFER_MEM_SECTION
26 led_dma_buffer_a,
27 led_dma_buffer_b;
28
33daisy::USBHostHandle usb;
34
39daisy::FatFSInterface fatfs_interface;
40
46{
54};
55
61{
69};
70
76{
81};
82
88{
92};
93
94
99enum Leds
100{
113};
114
120{
124
127 {
128 if(warp_scale != rhs.warp_scale)
129 {
130 return false;
131 }
132 else if(warp_offset != rhs.warp_offset)
133 {
134 return false;
135 }
136 else
137 {
138 for(int i = 0; i < CV_LAST; i++)
139 {
140 if(cv_offset[i] != rhs.cv_offset[i])
141 return false;
142 }
143 }
144 return true;
145 }
146
148 bool operator!=(const CalibrationData &rhs) { return !operator==(rhs); }
149};
150
159{
160 public:
165
170
178 void Init(bool boost = true)
179 {
180 seed.Init(boost);
181 hw_version = GetBoardRevision();
182 ConfigureAudio();
183 ConfigureControls();
184 ConfigureLeds();
185 seed.adc.Start();
186 SetAudioSampleRate(daisy::SaiHandle::Config::SampleRate::SAI_48KHZ);
189
190 cal_save_flag_ = false;
191 for(int i = 0; i < CV_LAST; i++)
192 {
193 cv_offsets_[i] = 0.f;
194 }
195 LoadCalibrationData();
196 }
197
202 void StartAudio(daisy::AudioHandle::AudioCallback cb)
203 {
204 current_cb_ = cb;
205 seed.StartAudio(cb);
206 }
207
209 void ChangeAudioCallback(daisy::AudioHandle::AudioCallback cb)
210 {
211 current_cb_ = cb;
212 seed.ChangeAudioCallback(cb);
213 }
214
216 void StartAudio(daisy::AudioHandle::InterleavingAudioCallback cb)
217 {
218 seed.StartAudio(cb);
219 }
220
222 void ChangeAudioCallback(daisy::AudioHandle::InterleavingAudioCallback cb)
223 {
224 seed.ChangeAudioCallback(cb);
225 }
226
235 void StartLowPriorityCallback(daisy::TimerHandle::PeriodElapsedCallback cb,
236 uint32_t target_freq,
237 void *data = nullptr)
238 {
239 daisy::TimerHandle::Config timcfg;
240 timcfg.periph = daisy::TimerHandle::Config::Peripheral::TIM_5;
241 timcfg.dir = daisy::TimerHandle::Config::CounterDir::UP;
242 auto tim_base_freq = daisy::System::GetPClk2Freq();
243 auto tim_target_freq = target_freq;
244 auto tim_period = tim_base_freq / tim_target_freq;
245 timcfg.period = tim_period;
246 timcfg.enable_irq = true;
247 tim5_handle.Init(timcfg);
248 tim5_handle.SetCallback(cb, data);
250 tim5_handle.Start();
251 }
252
259 void ChangeSampleRate(int sr)
260 {
261 daisy::SaiHandle::Config::SampleRate srval;
262 size_t new_blocksize = 96;
263 switch(sr)
264 {
265 case 16000:
266 srval = daisy::SaiHandle::Config::SampleRate::SAI_16KHZ;
267 break;
268 case 32000:
269 srval = daisy::SaiHandle::Config::SampleRate::SAI_32KHZ;
270 break;
271 case 48000:
272 srval = daisy::SaiHandle::Config::SampleRate::SAI_48KHZ;
273 break;
274 case 96000:
275 srval = daisy::SaiHandle::Config::SampleRate::SAI_96KHZ;
276 new_blocksize = 48;
277 break;
278 default:
279 srval = daisy::SaiHandle::Config::SampleRate::SAI_48KHZ;
280 break;
281 }
282 seed.StopAudio();
283 seed.SetAudioSampleRate(srval);
284 seed.SetAudioBlockSize(new_blocksize);
285 seed.StartAudio(current_cb_);
286 }
287
289 void StopAudio() { seed.StopAudio(); }
290
294 void SetAudioSampleRate(daisy::SaiHandle::Config::SampleRate samplerate)
295 {
296 seed.SetAudioSampleRate(samplerate);
297 }
298
303 void SetAudioSampleRate(int samplerate)
304 {
305 daisy::SaiHandle::Config::SampleRate srval;
306 switch(samplerate)
307 {
308 case 16000:
309 srval = daisy::SaiHandle::Config::SampleRate::SAI_16KHZ;
310 break;
311 case 32000:
312 srval = daisy::SaiHandle::Config::SampleRate::SAI_32KHZ;
313 break;
314 case 48000:
315 srval = daisy::SaiHandle::Config::SampleRate::SAI_48KHZ;
316 break;
317 case 96000:
318 srval = daisy::SaiHandle::Config::SampleRate::SAI_96KHZ;
319 break;
320 default:
321 srval = daisy::SaiHandle::Config::SampleRate::SAI_48KHZ;
322 break;
323 }
324 seed.SetAudioSampleRate(srval);
325 }
326
328 float AudioSampleRate() { return seed.audio_handle.GetSampleRate(); }
329
331 void SetAudioBlockSize(size_t blocksize)
332 {
333 seed.SetAudioBlockSize(blocksize);
334 }
335
337 size_t AudioBlockSize() { return seed.AudioBlockSize(); }
338
340 float AudioCallbackRate() const { return seed.AudioCallbackRate(); }
341
343 void SetTestLed(bool state) { seed.SetLed(state); }
344
351 {
352 for(int i = 0; i < LED_LAST; i++)
353 {
354 SetLed((Leds)i, 0.0f, 0.0f, 0.0f);
355 }
356 }
357
363 void WriteLeds() { led_driver_.SwapBuffersAndTransmit(); }
364
371 void SetLed(Leds idx, float r, float g, float b)
372 {
373 LedIdx led = LedMap[idx];
374 if(led.r != -1)
375 led_driver_.SetLed(led.r, r);
376 led_driver_.SetLed(led.g, g);
377 led_driver_.SetLed(led.b, b);
378 }
379
384 void SetLed(Leds idx, daisy::Color c)
385 {
386 SetLed(idx, c.Red(), c.Green(), c.Blue());
387 }
388
393 {
396 }
397
402 {
403 for(int i = 0; i < SW_LAST; i++)
404 {
405 switches[i].Debounce();
406 }
407 }
408
413 {
414 for(int i = 0; i < KNOB_LAST; i++)
415 {
416 controls[i].Process();
417 }
418
419 for(int i = 0; i < CV_LAST; i++)
420 {
421 cv[i].Process();
422 }
423 }
427 inline float GetKnobValue(int ctrl) const { return controls[ctrl].Value(); }
428
434 inline const daisy::Switch &GetButton(int idx) const
435 {
436 return switches[idx];
437 }
438
444 inline bool GetGateTrig(int idx) { return gates[idx].Trig(); }
445
449 inline bool GetGateState(int idx) { return gates[idx].State(); }
450
453 {
454 for(int i = 0; i < CV_LAST; i++)
455 {
456 cv[i].SetSampleRate(AudioCallbackRate());
457 }
458 for(int i = 0; i < KNOB_LAST; i++)
459 {
460 controls[i].SetSampleRate(AudioCallbackRate());
461 }
462 for(int i = 0; i < SW_LAST; i++)
463 {
464 switches[i].SetUpdateRate(AudioCallbackRate());
465 }
466 }
467
478 daisy::USBHostHandle::ConnectCallback connect_cb = nullptr,
479 daisy::USBHostHandle::DisconnectCallback disconnect_cb = nullptr,
480 daisy::USBHostHandle::ClassActiveCallback class_active_cb = nullptr,
481 daisy::USBHostHandle::ErrorCallback error_cb = nullptr,
482 void *userdata = nullptr)
483 {
485 daisy::USBHostHandle::Config usbcfg;
486 usbcfg.connect_callback = connect_cb;
487 usbcfg.disconnect_callback = disconnect_cb;
488 usbcfg.class_active_callback = class_active_cb;
489 usbcfg.error_callback = error_cb;
490 usbcfg.userdata = userdata;
491 usb.Init(usbcfg);
492
494 daisy::FatFSInterface::Config fsi_cfg;
495 fsi_cfg.media = daisy::FatFSInterface::Config::MEDIA_USB;
496 fatfs_interface.Init(fsi_cfg);
497 f_mount(&fatfs_interface.GetUSBFileSystem(),
498 fatfs_interface.GetUSBPath(),
499 0);
500 }
501
505 inline float GetWarpVoct()
506 {
507 return voct_cal.ProcessInput(cv[CV_WARP].Value());
508 }
509
516 inline float GetCvValue(int cv_idx)
517 {
518 if(cv_idx != CV_WARP)
519 return cv[cv_idx].Value() - cv_offsets_[cv_idx];
520 else
521 return cv[cv_idx].Value();
522 }
523
529 void DelayMs(size_t del) { seed.DelayMs(del); }
530
532 inline void CalibrateV1(float v1) { warp_v1_ = v1; }
533
537 inline void CalibrateV3(float v3)
538 {
539 warp_v3_ = v3;
540 voct_cal.Record(warp_v1_, warp_v3_);
541 cal_save_flag_ = true;
542 }
543
547 inline void SetWarpCalData(float scale, float offset)
548 {
549 voct_cal.SetData(scale, offset);
550 }
551
555 inline void GetWarpCalData(float &scale, float &offset)
556 {
557 voct_cal.GetData(scale, offset);
558 }
559
561 inline void SetCvOffsetData(float *data)
562 {
563 for(int i = 0; i < CV_LAST; i++)
564 {
565 cv_offsets_[i] = data[i];
566 }
567 }
568
570 inline void GetCvOffsetData(float *data)
571 {
572 for(int i = 0; i < CV_LAST; i++)
573 {
574 data[i] = cv_offsets_[i];
575 }
576 }
577
579 inline bool ReadyToSaveCal() const { return cal_save_flag_; }
580
582 inline void ClearSaveCalFlag() { cal_save_flag_ = false; }
583
585 daisy::AnalogControl cv[CV_LAST];
586
588 daisy::Switch switches[SW_LAST];
589
591 daisy::GateIn gates[GATE_LAST];
592
594 daisy::AnalogControl controls[KNOB_LAST];
595
597 daisy::DaisySeed seed;
598
599 private:
605 static constexpr uint32_t kCalibrationDataOffset = 4096;
606
608 struct LedIdx
609 {
610 int8_t r;
611 int8_t g;
612 int8_t b;
613 };
614
616 const LedIdx LedMap[LED_LAST] = {{0, 1, 2},
617 {3, 4, 5},
618 {6, 7, 8},
619 {9, 10, 11},
620 {16, 17, 18},
621 {12, 13, 14},
622 {22, 23, 24},
623 {28, 29, 30},
624 {-1, 20, 21},
625 {-1, 26, 27},
626 {-1, 19, 25}};
627
629 enum class HardwareVersion
630 {
631 REV3,
632 REV4,
633 };
634
635
637 daisy::LedDriverPca9685<2, true> led_driver_;
638
640 daisy::AudioHandle::AudioCallback current_cb_;
641
642 daisy::TimerHandle tim5_handle;
643 daisy::I2CHandle i2c;
644 daisy::Pcm3060 codec;
645
646 HardwareVersion hw_version;
647
649 float warp_v1_, warp_v3_;
650 daisy::VoctCalibration voct_cal;
651 float cv_offsets_[CV_LAST];
652
653 bool cal_save_flag_;
654
655
656 void ConfigureAudio()
657 {
659 if(hw_version == HardwareVersion::REV3)
660 {
661 daisy::I2CHandle::Config codec_i2c_config;
662 codec_i2c_config.periph
663 = daisy::I2CHandle::Config::Peripheral::I2C_1;
664 codec_i2c_config.pin_config = {seed.GetPin(11), seed.GetPin(12)};
665 codec_i2c_config.speed
666 = daisy::I2CHandle::Config::Speed::I2C_400KHZ;
667 codec_i2c_config.mode = daisy::I2CHandle::Config::Mode::I2C_MASTER;
668
669 i2c.Init(codec_i2c_config);
670 codec.Init(i2c);
671
672 daisy::SaiHandle::Config sai_cfg;
673 sai_cfg.periph = daisy::SaiHandle::Config::Peripheral::SAI_2;
674 sai_cfg.sr = daisy::SaiHandle::Config::SampleRate::SAI_48KHZ;
675 sai_cfg.bit_depth = daisy::SaiHandle::Config::BitDepth::SAI_24BIT;
676 sai_cfg.a_sync = daisy::SaiHandle::Config::Sync::SLAVE;
677 sai_cfg.b_sync = daisy::SaiHandle::Config::Sync::MASTER;
678 sai_cfg.a_dir = daisy::SaiHandle::Config::Direction::RECEIVE;
679 sai_cfg.b_dir = daisy::SaiHandle::Config::Direction::TRANSMIT;
680 sai_cfg.pin_config.fs = seed.GetPin(27);
681 sai_cfg.pin_config.mclk = seed.GetPin(24);
682 sai_cfg.pin_config.sck = seed.GetPin(28);
683 sai_cfg.pin_config.sa = seed.GetPin(26);
684 sai_cfg.pin_config.sb = seed.GetPin(25);
685 // Then Initialize
686 daisy::SaiHandle sai_2_handle;
687 sai_2_handle.Init(sai_cfg);
688 daisy::AudioHandle::Config audio_cfg;
689 audio_cfg.blocksize = 48;
690 audio_cfg.samplerate
691 = daisy::SaiHandle::Config::SampleRate::SAI_48KHZ;
692 audio_cfg.postgain = 1.0f;
693 seed.audio_handle.Init(audio_cfg, sai_2_handle);
694 }
695 else
696 {
698 daisy::GPIO deemp;
699 daisy::Pin deemp_pin(daisy::PORTB, 11);
700 deemp.Init(deemp_pin, daisy::GPIO::Mode::OUTPUT);
701 deemp.Write(0);
703 seed.audio_handle.SetOutputCompensation(0.8785f);
704 }
705 }
706
707 // pots,switches, gates, CV
708 void ConfigureControls()
709 {
710 if(hw_version == HardwareVersion::REV3)
711 {
712 // ===== CV and Pots (adc) =====
713 daisy::AdcChannelConfig cfg[CV_LAST + 1];
714
715 for(int i = 0; i < CV_LAST; i++)
716 {
717 cfg[i].InitSingle(seed.GetPin(17 + i));
718 }
719 cfg[CV_LAST].InitMux(seed.GetPin(16),
720 6,
721 seed.GetPin(7),
722 seed.GetPin(8),
723 seed.GetPin(9));
724 seed.adc.Init(cfg, CV_LAST + 1);
725
726 // init cv as bipolar analog controls
727 for(size_t i = 0; i < CV_LAST; i++)
728 {
729 cv[i].InitBipolarCv(seed.adc.GetPtr(i), AudioCallbackRate());
730 }
731
732 // init pots as analog controls
733 for(size_t i = 0; i < KNOB_LAST; i++)
734 {
735 controls[i].Init(seed.adc.GetMuxPtr(CV_LAST, i),
737 }
738
739 // ===== gates =====
740 dsy_gpio_pin pin;
741 pin = seed.GetPin(23);
742 gates[GATE_FREEZE].Init(&pin);
743 }
744 else
745 {
747 daisy::AdcChannelConfig cfg[CV_LAST + KNOB_LAST];
749 cfg[CV_LAST + KNOB_TIME].InitSingle(daisy::seed::A0);
750 cfg[CV_LAST + KNOB_REFLECT].InitSingle(daisy::seed::A1);
751 cfg[CV_ATMOSPHERE].InitSingle(daisy::seed::A2);
752 cfg[CV_TIME].InitSingle(daisy::seed::A3);
753 cfg[CV_MIX].InitSingle(daisy::seed::A4);
754 cfg[CV_REFLECT].InitSingle(daisy::seed::A5);
755 cfg[CV_BLUR].InitSingle(daisy::seed::A6);
756 cfg[CV_WARP].InitSingle(daisy::seed::A7);
757 cfg[CV_LAST + KNOB_MIX].InitSingle(daisy::seed::A8);
758 cfg[CV_LAST + KNOB_WARP].InitSingle(daisy::seed::A9);
759 cfg[CV_LAST + KNOB_ATMOSPHERE].InitSingle(daisy::seed::A10);
760 cfg[CV_LAST + KNOB_BLUR].InitSingle(daisy::seed::A11);
761 seed.adc.Init(cfg, CV_LAST + KNOB_LAST);
762
763 for(size_t i = 0; i < CV_LAST; i++)
764 {
765 cv[i].InitBipolarCv(seed.adc.GetPtr(i), AudioCallbackRate());
766 }
767 // init pots as analog controls with offset to last CV for ptr
768 for(size_t i = 0; i < KNOB_LAST; i++)
769 {
770 controls[i].Init(seed.adc.GetPtr(CV_LAST + i),
772 }
773 dsy_gpio_pin freeze_pin = daisy::seed::D26;
774 gates[GATE_FREEZE].Init(&freeze_pin);
775 }
776 // And anything generic to both versions
777 // ===== switches =====
778 switches[SW_FREEZE].Init(seed.GetPin(1), AudioCallbackRate());
779 switches[SW_REVERSE].Init(seed.GetPin(10), AudioCallbackRate());
780 switches[SW_SHIFT].Init(seed.GetPin(13), AudioCallbackRate());
781
782 dsy_gpio_pin revpin = seed.GetPin(14);
783 gates[GATE_REVERSE].Init(&revpin);
784 }
785
786 void ConfigureLeds()
787 {
788 // reinit i2c at 1MHz
789 daisy::I2CHandle::Config codec_i2c_config;
790 codec_i2c_config.periph = daisy::I2CHandle::Config::Peripheral::I2C_1;
791 codec_i2c_config.pin_config = {seed.GetPin(11), seed.GetPin(12)};
792 codec_i2c_config.speed = daisy::I2CHandle::Config::Speed::I2C_1MHZ;
793 codec_i2c_config.mode = daisy::I2CHandle::Config::Mode::I2C_MASTER;
794 i2c.Init(codec_i2c_config);
795
796 // init driver
797 led_driver_.Init(i2c, {0x00, 0x01}, led_dma_buffer_a, led_dma_buffer_b);
798
799 ClearLeds();
800 WriteLeds();
801 }
802
803 HardwareVersion GetBoardRevision()
804 {
805 daisy::GPIO version_gpio;
806 version_gpio.Init(daisy::seed::D2,
807 daisy::GPIO::Mode::INPUT,
808 daisy::GPIO::Pull::PULLUP);
810 auto pinstate = version_gpio.Read();
811 version_gpio.DeInit();
812 if(pinstate)
813 return HardwareVersion::REV3;
814 else
815 return HardwareVersion::REV4;
816 }
817
819 void LoadCalibrationData()
820 {
821 daisy::PersistentStorage<CalibrationData> cal_storage(seed.qspi);
822 CalibrationData default_cal;
823 cal_storage.Init(default_cal, kCalibrationDataOffset);
824 auto &cal_data = cal_storage.GetSettings();
825 SetWarpCalData(cal_data.warp_scale, cal_data.warp_offset);
826 SetCvOffsetData(cal_data.cv_offset);
827 }
828};
829
830} // namespace aurora
831
832#endif
Hardware support class for the Qu-Bit Aurora This should be created, and intitialized at the beginnin...
Definition: aurora.h:159
void ClearLeds()
sets all RGB LEDs to off state This can be called from the top of wherever LEDs are periodically set ...
Definition: aurora.h:350
daisy::Switch switches[SW_LAST]
Definition: aurora.h:588
void ProcessAnalogControls()
filters all analog controls (knobs and CVs) This is called from ProcessAllControls,...
Definition: aurora.h:412
void SetAudioSampleRate(int samplerate)
sets the audio sample rate. Audio must be stopped for this to work properly
Definition: aurora.h:303
void StartAudio(daisy::AudioHandle::AudioCallback cb)
Starts a specified audio callback Data is non-interleaved (i.e. {{L0, L1, ... , LN},...
Definition: aurora.h:202
void StopAudio()
Stops Audio.
Definition: aurora.h:289
void UpdateHidRates()
Update HidRates for new Callback rate when samplerate/blocksize change.
Definition: aurora.h:452
float GetKnobValue(int ctrl) const
returns a 0-1 value for the given knob control
Definition: aurora.h:427
void ChangeAudioCallback(daisy::AudioHandle::InterleavingAudioCallback cb)
Changes current callback to a new interleaved callback.
Definition: aurora.h:222
bool ReadyToSaveCal() const
Checks to see if calibration has been completed and needs to be saved.
Definition: aurora.h:579
Hardware()
Empty Constructor Call Init from main to initialize.
Definition: aurora.h:164
void CalibrateV1(float v1)
called during a customized calibration UI to record the 1V value
Definition: aurora.h:532
float AudioCallbackRate() const
returns the rate in Hz that the audio callback gets called
Definition: aurora.h:340
~Hardware()
Empty Destructor This object should span the life of the program.
Definition: aurora.h:169
void SetTestLed(bool state)
sets the state of the LED on the daisy itself
Definition: aurora.h:343
void GetWarpCalData(float &scale, float &offset)
Gets the current calibration data for 1V/Octave over Warp CV typically used to prepare data for stori...
Definition: aurora.h:555
void StartAudio(daisy::AudioHandle::InterleavingAudioCallback cb)
Starts a specified Interleaving audio callback.
Definition: aurora.h:216
void ProcessAllControls()
filters and debounces all control This should be run once per audio callback.
Definition: aurora.h:392
const daisy::Switch & GetButton(int idx) const
returns a reference to a given momentary switch Example Usage: bool state = hw.GetButton(SW_FREEZE)....
Definition: aurora.h:434
size_t AudioBlockSize()
returns the number of samples to process in each audio callback
Definition: aurora.h:337
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
Definition: aurora.h:477
void SetLed(Leds idx, daisy::Color c)
Sets the Color value of an LED.
Definition: aurora.h:384
bool GetGateTrig(int idx)
returns true if the gate input just went high This is expected to be checked only once per audio call...
Definition: aurora.h:444
void ClearSaveCalFlag()
signal the cal-save flag to clear once calibration data has been written to ext. flash memory
Definition: aurora.h:582
void ChangeSampleRate(int sr)
Updates the samplerate to one of the allowed target samplerates. This function stops the audio comple...
Definition: aurora.h:259
void SetWarpCalData(float scale, float offset)
Sets the calibration data for 1V/Octave over Warp CV typically set after reading stored data from ext...
Definition: aurora.h:547
float GetCvValue(int cv_idx)
gets calibrated offset-adjusted CV Value from the hardware.
Definition: aurora.h:516
void SetAudioBlockSize(size_t blocksize)
sets the number of samples to process in each audio callback
Definition: aurora.h:331
void GetCvOffsetData(float *data)
Fills an array with the offset data currently being used.
Definition: aurora.h:570
bool GetGateState(int idx)
returns true if the gate input is currently high
Definition: aurora.h:449
void WriteLeds()
Writes the state of all LEDs to the hardware This can be called from a fixed interval in the main loo...
Definition: aurora.h:363
void DelayMs(size_t del)
delay function; same as System::Delay(), and should not be called from any interrupt callbacks (LowPr...
Definition: aurora.h:529
void StartLowPriorityCallback(daisy::TimerHandle::PeriodElapsedCallback cb, uint32_t target_freq, void *data=nullptr)
Definition: aurora.h:235
daisy::AnalogControl controls[KNOB_LAST]
Definition: aurora.h:594
daisy::DaisySeed seed
Definition: aurora.h:597
daisy::AnalogControl cv[CV_LAST]
Definition: aurora.h:585
float AudioSampleRate()
returns the sample rate in Hz of the audio engine
Definition: aurora.h:328
void ProcessDigitalControls()
filters and debounces digital controls (switches) This is called from ProcessAllControls,...
Definition: aurora.h:401
float GetWarpVoct()
Return a MIDI note number value from -60 to 60 corresponding to the -5V to 5V input range of the Warp...
Definition: aurora.h:505
void SetLed(Leds idx, float r, float g, float b)
Sets the RGB value of a given LED.
Definition: aurora.h:371
void SetCvOffsetData(float *data)
Sets the cv offset from an externally array of data.
Definition: aurora.h:561
void Init(bool boost=true)
Initialize the hardware. Call this function at the start of main()
Definition: aurora.h:178
void ChangeAudioCallback(daisy::AudioHandle::AudioCallback cb)
Changes current callback to a new non-interleaved callback.
Definition: aurora.h:209
void CalibrateV3(float v3)
called during a customized calibration UI to record the 3V value and set that calibraiton has complet...
Definition: aurora.h:537
daisy::GateIn gates[GATE_LAST]
Definition: aurora.h:591
void SetAudioSampleRate(daisy::SaiHandle::Config::SampleRate samplerate)
sets the audio sample rate. Audio must be stopped for this to work properly
Definition: aurora.h:294
Definition: aurora.h:15
daisy::FatFSInterface fatfs_interface
global accessor to the FatFS interface. This is left global so that it is guaranteed to be within the...
Definition: aurora.h:39
Leds
indexed accessors for RGB LEDs Example usage: hw.SetLed(LED_FREEZE, 0.f, 0.f, 1.f);
Definition: aurora.h:100
@ LED_5
Definition: aurora.h:107
@ LED_BOT_2
Definition: aurora.h:110
@ LED_1
Definition: aurora.h:103
@ LED_BOT_3
Definition: aurora.h:111
@ LED_REVERSE
Definition: aurora.h:101
@ LED_6
Definition: aurora.h:108
@ LED_BOT_1
Definition: aurora.h:109
@ LED_LAST
Definition: aurora.h:112
@ LED_2
Definition: aurora.h:104
@ LED_FREEZE
Definition: aurora.h:102
@ LED_4
Definition: aurora.h:106
@ LED_3
Definition: aurora.h:105
ControlCVs
indexed accessors for CV controls Example usage: float val = hw.GetCvValue(CV_ATMOSPHERE);
Definition: aurora.h:61
@ CV_ATMOSPHERE
Definition: aurora.h:62
@ CV_MIX
Definition: aurora.h:64
@ CV_BLUR
Definition: aurora.h:66
@ CV_LAST
Definition: aurora.h:68
@ CV_REFLECT
Definition: aurora.h:65
@ CV_WARP
Definition: aurora.h:67
@ CV_TIME
Definition: aurora.h:63
Switches
indexed accessors for momentary switches Example usage: bool state = hw.GetSwitch(SW_FREEZE)....
Definition: aurora.h:76
@ SW_REVERSE
Definition: aurora.h:78
@ SW_SHIFT
Definition: aurora.h:79
@ SW_FREEZE
Definition: aurora.h:77
@ SW_LAST
Definition: aurora.h:80
daisy::USBHostHandle usb
global USB host handle accessor This is left global so that it is guaranteed to be within the AXI SRA...
Definition: aurora.h:33
Gates
indexed accessors for momentary switches Example usage: bool trig = hw.GetGateTrig(GATE_FREEZE);
Definition: aurora.h:88
@ GATE_REVERSE
Definition: aurora.h:90
@ GATE_LAST
Definition: aurora.h:91
@ GATE_FREEZE
Definition: aurora.h:89
ControlKnobs
indexed accessors for knob controls Example usage: float val = hw.GetKnobValue(KNOB_TIME);
Definition: aurora.h:46
@ KNOB_WARP
Definition: aurora.h:52
@ KNOB_ATMOSPHERE
Definition: aurora.h:50
@ KNOB_BLUR
Definition: aurora.h:51
@ KNOB_LAST
Definition: aurora.h:53
@ KNOB_MIX
Definition: aurora.h:49
@ KNOB_REFLECT
Definition: aurora.h:48
@ KNOB_TIME
Definition: aurora.h:47
Calibration data container for Aurora This data is calibrated from the Qu-Bit default Aurora firmware...
Definition: aurora.h:120
float warp_offset
Definition: aurora.h:122
bool operator==(const CalibrationData &rhs)
checks sameness
Definition: aurora.h:126
CalibrationData()
Definition: aurora.h:121
float warp_scale
Definition: aurora.h:122
bool operator!=(const CalibrationData &rhs)
Not equal operator.
Definition: aurora.h:148
float cv_offset[CV_LAST]
Definition: aurora.h:123