From 26d80f644e98fe9bf287641622a836e021e904ff Mon Sep 17 00:00:00 2001 From: Christoffer Meier Date: Wed, 16 Dec 2020 14:20:14 +0100 Subject: [PATCH 1/3] Fix erroneous include path for stmlib_utils_random.h --- software/src/extern/stmlib_utils_random.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/software/src/extern/stmlib_utils_random.cpp b/software/src/extern/stmlib_utils_random.cpp index c4a7e2625..376eeeecf 100644 --- a/software/src/extern/stmlib_utils_random.cpp +++ b/software/src/extern/stmlib_utils_random.cpp @@ -27,7 +27,7 @@ // Random number generator. // #include "stmlib/utils/random.h" -#include "utils/stmlib_utils_random.h" +#include "stmlib_utils_random.h" namespace stmlib { From 545b868fcb7a8db5820fb4e652a9366cb43d8ab0 Mon Sep 17 00:00:00 2001 From: chlirre Date: Wed, 6 Jan 2021 20:15:32 +0100 Subject: [PATCH 2/3] Use older compiler as per instructions at https://ornament-and-cri.me/firmware/ --- software/platformio.ini | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/software/platformio.ini b/software/platformio.ini index 13f94da09..d2408f76a 100644 --- a/software/platformio.ini +++ b/software/platformio.ini @@ -10,8 +10,11 @@ [env:teensy31] platform = teensy +platform_packages = toolchain-gccarmnoneeabi@1.40804 board = teensy31 framework = arduino -upload_protocol = teensy-gui +upload_protocol = teensy-cli board_build.f_cpu = 120000000L -build_flags = -D USB_MIDI +build_flags = -D USB_MIDI_SERIAL -std=gnu++11 -Ofast +build_unflags = -std=gnu++14 + From 103d30ff9ddfac784ab19e3e8a44791b45c10b57 Mon Sep 17 00:00:00 2001 From: chlirre Date: Thu, 7 Jan 2021 19:32:43 +0100 Subject: [PATCH 3/3] .ino -> .cpp/h --- software/platformio.ini | 2 +- software/src/{APP_Backup.ino => APP_Backup.h} | 8 + software/src/{APP_ENIGMA.ino => APP_ENIGMA.h} | 9 + .../{APP_HEMISPHERE.ino => APP_HEMISPHERE.h} | 10 +- software/src/{APP_MIDI.ino => APP_MIDI.h} | 15 +- ..._NeuralNetwork.ino => APP_NeuralNetwork.h} | 11 + .../src/{APP_PONGGAME.ino => APP_PONGGAME.h} | 4 + ...{APP_SCALEEDITOR.ino => APP_SCALEEDITOR.h} | 3 + .../src/{APP_SETTINGS.ino => APP_SETTINGS.h} | 5 + ...TTIMELINE.ino => APP_THEDARKESTTIMELINE.h} | 13 + ...AVEFORMEDITOR.ino => APP_WAVEFORMEDITOR.h} | 6 + software/src/{HEM_ADEG.ino => HEM_ADEG.h} | 9 + software/src/{HEM_ADSREG.ino => HEM_ADSREG.h} | 9 + software/src/{HEM_ASR.ino => HEM_ASR.h} | 9 + ..._AnnularFusion.ino => HEM_AnnularFusion.h} | 9 + ...enuateOffset.ino => HEM_AttenuateOffset.h} | 9 + software/src/{HEM_Binary.ino => HEM_Binary.h} | 8 + .../{HEM_BootsNCat.ino => HEM_BootsNCat.h} | 7 + .../src/{HEM_Brancher.ino => HEM_Brancher.h} | 9 + software/src/{HEM_Burst.ino => HEM_Burst.h} | 4 + .../src/{HEM_CVRecV2.ino => HEM_CVRecV2.h} | 3 + .../{HEM_Calculate.ino => HEM_Calculate.h} | 4 + .../{HEM_Carpeggio.ino => HEM_Carpeggio.h} | 3 + ...EM_ClockDivider.ino => HEM_ClockDivider.h} | 4 + .../{HEM_ClockSetup.ino => HEM_ClockSetup.h} | 4 + .../{HEM_ClockSkip.ino => HEM_ClockSkip.h} | 4 + .../src/{HEM_Compare.ino => HEM_Compare.h} | 4 + .../{HEM_DrCrusher.ino => HEM_DrCrusher.h} | 4 + .../{HEM_DualQuant.ino => HEM_DualQuant.h} | 4 + .../src/{HEM_EnigmaJr.ino => HEM_EnigmaJr.h} | 3 + .../{HEM_EnvFollow.ino => HEM_EnvFollow.h} | 4 + .../{HEM_GateDelay.ino => HEM_GateDelay.h} | 4 + .../src/{HEM_GatedVCA.ino => HEM_GatedVCA.h} | 4 + .../src/{HEM_LoFiPCM.ino => HEM_LoFiPCM.h} | 4 + software/src/{HEM_Logic.ino => HEM_Logic.h} | 4 + .../{HEM_LowerRenz.ino => HEM_LowerRenz.h} | 3 + .../{HEM_Metronome.ino => HEM_Metronome.h} | 4 + .../src/{HEM_MixerBal.ino => HEM_MixerBal.h} | 4 + .../{HEM_Palimpsest.ino => HEM_Palimpsest.h} | 4 + .../{HEM_RunglBook.ino => HEM_RunglBook.h} | 4 + .../{HEM_ScaleDuet.ino => HEM_ScaleDuet.h} | 3 + .../src/{HEM_Schmitt.ino => HEM_Schmitt.h} | 4 + software/src/{HEM_Scope.ino => HEM_Scope.h} | 4 + .../{HEM_Sequence5.ino => HEM_Sequence5.h} | 3 + .../{HEM_ShiftGate.ino => HEM_ShiftGate.h} | 5 + .../src/{HEM_Shuffle.ino => HEM_Shuffle.h} | 4 + .../{HEM_SkewedLFO.ino => HEM_SkewedLFO.h} | 4 + software/src/{HEM_Slew.ino => HEM_Slew.h} | 4 + .../src/{HEM_Squanch.ino => HEM_Squanch.h} | 3 + software/src/{HEM_Switch.ino => HEM_Switch.h} | 4 + .../src/{HEM_TLNeuron.ino => HEM_TLNeuron.h} | 0 software/src/{HEM_TM.ino => HEM_TM.h} | 3 + .../src/{HEM_Trending.ino => HEM_Trending.h} | 4 + .../src/{HEM_TrigSeq.ino => HEM_TrigSeq.h} | 4 + .../{HEM_TrigSeq16.ino => HEM_TrigSeq16.h} | 4 + software/src/{HEM_Tuner.ino => HEM_Tuner.h} | 6 + .../src/{HEM_VectorEG.ino => HEM_VectorEG.h} | 8 + .../{HEM_VectorLFO.ino => HEM_VectorLFO.h} | 3 + .../{HEM_VectorMod.ino => HEM_VectorMod.h} | 3 + ...{HEM_VectorMorph.ino => HEM_VectorMorph.h} | 3 + .../src/{HEM_Voltage.ino => HEM_Voltage.h} | 4 + .../src/{HEM_hMIDIIn.ino => HEM_hMIDIIn.h} | 12 + .../src/{HEM_hMIDIOut.ino => HEM_hMIDIOut.h} | 6 + software/src/HemisphereApplet.h | 9 + software/src/{main.ino => Main.cpp} | 6 +- software/src/{OC_apps.ino => OC_apps.cpp} | 15 + ...{OC_calibration.ino => OC_calibration.cpp} | 290 +++++++++--------- software/src/OC_calibration.h | 2 + software/src/OC_ui.h | 2 + software/src/UI/ui_encoder.h | 1 + software/src/UI/ui_events.h | 41 +-- software/src/hemisphere_config.h | 52 ++++ 72 files changed, 584 insertions(+), 167 deletions(-) rename software/src/{APP_Backup.ino => APP_Backup.h} (96%) rename software/src/{APP_ENIGMA.ino => APP_ENIGMA.h} (99%) rename software/src/{APP_HEMISPHERE.ino => APP_HEMISPHERE.h} (99%) rename software/src/{APP_MIDI.ino => APP_MIDI.h} (98%) rename software/src/{APP_NeuralNetwork.ino => APP_NeuralNetwork.h} (98%) rename software/src/{APP_PONGGAME.ino => APP_PONGGAME.h} (99%) rename software/src/{APP_SCALEEDITOR.ino => APP_SCALEEDITOR.h} (99%) rename software/src/{APP_SETTINGS.ino => APP_SETTINGS.h} (98%) rename software/src/{APP_THEDARKESTTIMELINE.ino => APP_THEDARKESTTIMELINE.h} (98%) rename software/src/{APP_WAVEFORMEDITOR.ino => APP_WAVEFORMEDITOR.h} (99%) rename software/src/{HEM_ADEG.ino => HEM_ADEG.h} (98%) rename software/src/{HEM_ADSREG.ino => HEM_ADSREG.h} (98%) rename software/src/{HEM_ASR.ino => HEM_ASR.h} (97%) rename software/src/{HEM_AnnularFusion.ino => HEM_AnnularFusion.h} (98%) rename software/src/{HEM_AttenuateOffset.ino => HEM_AttenuateOffset.h} (97%) rename software/src/{HEM_Binary.ino => HEM_Binary.h} (97%) rename software/src/{HEM_BootsNCat.ino => HEM_BootsNCat.h} (98%) rename software/src/{HEM_Brancher.ino => HEM_Brancher.h} (97%) rename software/src/{HEM_Burst.ino => HEM_Burst.h} (99%) rename software/src/{HEM_CVRecV2.ino => HEM_CVRecV2.h} (99%) rename software/src/{HEM_Calculate.ino => HEM_Calculate.h} (98%) rename software/src/{HEM_Carpeggio.ino => HEM_Carpeggio.h} (99%) rename software/src/{HEM_ClockDivider.ino => HEM_ClockDivider.h} (98%) rename software/src/{HEM_ClockSetup.ino => HEM_ClockSetup.h} (98%) rename software/src/{HEM_ClockSkip.ino => HEM_ClockSkip.h} (98%) rename software/src/{HEM_Compare.ino => HEM_Compare.h} (98%) rename software/src/{HEM_DrCrusher.ino => HEM_DrCrusher.h} (98%) rename software/src/{HEM_DualQuant.ino => HEM_DualQuant.h} (98%) rename software/src/{HEM_EnigmaJr.ino => HEM_EnigmaJr.h} (99%) rename software/src/{HEM_EnvFollow.ino => HEM_EnvFollow.h} (98%) rename software/src/{HEM_GateDelay.ino => HEM_GateDelay.h} (98%) rename software/src/{HEM_GatedVCA.ino => HEM_GatedVCA.h} (98%) rename software/src/{HEM_LoFiPCM.ino => HEM_LoFiPCM.h} (98%) rename software/src/{HEM_Logic.ino => HEM_Logic.h} (98%) rename software/src/{HEM_LowerRenz.ino => HEM_LowerRenz.h} (98%) rename software/src/{HEM_Metronome.ino => HEM_Metronome.h} (98%) rename software/src/{HEM_MixerBal.ino => HEM_MixerBal.h} (98%) rename software/src/{HEM_Palimpsest.ino => HEM_Palimpsest.h} (99%) rename software/src/{HEM_RunglBook.ino => HEM_RunglBook.h} (98%) rename software/src/{HEM_ScaleDuet.ino => HEM_ScaleDuet.h} (98%) rename software/src/{HEM_Schmitt.ino => HEM_Schmitt.h} (98%) rename software/src/{HEM_Scope.ino => HEM_Scope.h} (98%) rename software/src/{HEM_Sequence5.ino => HEM_Sequence5.h} (98%) rename software/src/{HEM_ShiftGate.ino => HEM_ShiftGate.h} (98%) rename software/src/{HEM_Shuffle.ino => HEM_Shuffle.h} (98%) rename software/src/{HEM_SkewedLFO.ino => HEM_SkewedLFO.h} (98%) rename software/src/{HEM_Slew.ino => HEM_Slew.h} (98%) rename software/src/{HEM_Squanch.ino => HEM_Squanch.h} (98%) rename software/src/{HEM_Switch.ino => HEM_Switch.h} (98%) rename software/src/{HEM_TLNeuron.ino => HEM_TLNeuron.h} (100%) rename software/src/{HEM_TM.ino => HEM_TM.h} (99%) rename software/src/{HEM_Trending.ino => HEM_Trending.h} (99%) rename software/src/{HEM_TrigSeq.ino => HEM_TrigSeq.h} (98%) rename software/src/{HEM_TrigSeq16.ino => HEM_TrigSeq16.h} (98%) rename software/src/{HEM_Tuner.ino => HEM_Tuner.h} (98%) rename software/src/{HEM_VectorEG.ino => HEM_VectorEG.h} (98%) rename software/src/{HEM_VectorLFO.ino => HEM_VectorLFO.h} (99%) rename software/src/{HEM_VectorMod.ino => HEM_VectorMod.h} (98%) rename software/src/{HEM_VectorMorph.ino => HEM_VectorMorph.h} (99%) rename software/src/{HEM_Voltage.ino => HEM_Voltage.h} (98%) rename software/src/{HEM_hMIDIIn.ino => HEM_hMIDIIn.h} (98%) rename software/src/{HEM_hMIDIOut.ino => HEM_hMIDIOut.h} (98%) rename software/src/{main.ino => Main.cpp} (98%) rename software/src/{OC_apps.ino => OC_apps.cpp} (97%) rename software/src/{OC_calibration.ino => OC_calibration.cpp} (95%) diff --git a/software/platformio.ini b/software/platformio.ini index d2408f76a..7ffa9943e 100644 --- a/software/platformio.ini +++ b/software/platformio.ini @@ -15,6 +15,6 @@ board = teensy31 framework = arduino upload_protocol = teensy-cli board_build.f_cpu = 120000000L -build_flags = -D USB_MIDI_SERIAL -std=gnu++11 -Ofast +build_flags = -D USB_MIDI_SERIAL -std=gnu++11 -O2 build_unflags = -std=gnu++14 diff --git a/software/src/APP_Backup.ino b/software/src/APP_Backup.h similarity index 96% rename from software/src/APP_Backup.ino rename to software/src/APP_Backup.h index d8c427d2c..7267348c9 100644 --- a/software/src/APP_Backup.ino +++ b/software/src/APP_Backup.h @@ -18,6 +18,14 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include +#include +#include +#include "OC_config.h" +#include "OC_apps.h" +#include "OC_ui.h" +#include "src/drivers/display.h" #include "HSMIDI.h" class Backup: public SystemExclusiveHandler { diff --git a/software/src/APP_ENIGMA.ino b/software/src/APP_ENIGMA.h similarity index 99% rename from software/src/APP_ENIGMA.ino rename to software/src/APP_ENIGMA.h index d85ad100a..ce9fcb390 100644 --- a/software/src/APP_ENIGMA.ino +++ b/software/src/APP_ENIGMA.h @@ -18,8 +18,17 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include +#include +#include +#include "OC_config.h" +#include "OC_apps.h" +#include "OC_ui.h" +#include "src/drivers/display.h" #include "OC_strings.h" #include "HSApplication.h" + #include "HSMIDI.h" #include "enigma/TuringMachine.h" #include "enigma/TuringMachineState.h" diff --git a/software/src/APP_HEMISPHERE.ino b/software/src/APP_HEMISPHERE.h similarity index 99% rename from software/src/APP_HEMISPHERE.ino rename to software/src/APP_HEMISPHERE.h index 068a2b18c..cccce717b 100644 --- a/software/src/APP_HEMISPHERE.ino +++ b/software/src/APP_HEMISPHERE.h @@ -18,12 +18,18 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#ifndef _HEM_APP_HEMISPHERE_H_ +#define _HEM_APP_HEMISPHERE_H_ + #include "OC_DAC.h" #include "OC_digital_inputs.h" #include "OC_visualfx.h" +#include "OC_apps.h" +#include "OC_ui.h" + +#include "HEM_ClockSetup.h" #include "OC_patterns.h" #include "src/drivers/FreqMeasure/OC_FreqMeasure.h" -namespace menu = OC::menu; #include "hemisphere_config.h" #include "HemisphereApplet.h" @@ -400,3 +406,5 @@ void HEMISPHERE_handleButtonEvent(const UI::Event &event) { void HEMISPHERE_handleEncoderEvent(const UI::Event &event) { manager.DelegateEncoderMovement(event); } + +#endif \ No newline at end of file diff --git a/software/src/APP_MIDI.ino b/software/src/APP_MIDI.h similarity index 98% rename from software/src/APP_MIDI.ino rename to software/src/APP_MIDI.h index af937b426..474f994fd 100644 --- a/software/src/APP_MIDI.ino +++ b/software/src/APP_MIDI.h @@ -22,6 +22,15 @@ // See https://www.pjrc.com/teensy/td_midi.html +#include +#include +#include +#include "OC_config.h" +#include "OC_apps.h" +#include "OC_menus.h" +#include "OC_ui.h" +#include "src/drivers/display.h" +#include "util/util_settings.h" #include "HSApplication.h" #include "HSMIDI.h" @@ -192,7 +201,7 @@ struct CaptainMIDILog { class CaptainMIDI : public SystemExclusiveHandler, public HSApplication, public settings::SettingsBase { public: - menu::ScreenCursor cursor; + OC::menu::ScreenCursor cursor; void Start() { screen = 0; @@ -417,8 +426,8 @@ class CaptainMIDI : public SystemExclusiveHandler, public HSApplication, gfxPrint(get_setup_number() + 1); // Iterate through the current range of settings - menu::SettingsList settings_list(cursor); - menu::SettingsListItem list_item; + OC::menu::SettingsList settings_list(cursor); + OC::menu::SettingsListItem list_item; while (settings_list.available()) { bool suppress = 0; // Don't show the setting if it's not relevant diff --git a/software/src/APP_NeuralNetwork.ino b/software/src/APP_NeuralNetwork.h similarity index 98% rename from software/src/APP_NeuralNetwork.ino rename to software/src/APP_NeuralNetwork.h index 24d95f5cd..215dca55b 100644 --- a/software/src/APP_NeuralNetwork.ino +++ b/software/src/APP_NeuralNetwork.h @@ -18,8 +18,19 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include +#include +#include +#include "OC_config.h" +#include "OC_apps.h" +#include "OC_menus.h" +#include "OC_ui.h" +#include "src/drivers/display.h" +#include "util/util_settings.h" #include "HSApplication.h" #include "HSMIDI.h" +#include #include "neuralnet/LogicGate.h" // 9 sets of 24 bytes allocated for storage diff --git a/software/src/APP_PONGGAME.ino b/software/src/APP_PONGGAME.h similarity index 99% rename from software/src/APP_PONGGAME.ino rename to software/src/APP_PONGGAME.h index f7e300b7f..81e5e9cc4 100644 --- a/software/src/APP_PONGGAME.ino +++ b/software/src/APP_PONGGAME.h @@ -20,6 +20,10 @@ // // CV-controllable Pong game +#include +#include "OC_config.h" +#include "OC_apps.h" +#include "OC_ui.h" #include "OC_DAC.h" #include "OC_ADC.h" #include "OC_digital_inputs.h" diff --git a/software/src/APP_SCALEEDITOR.ino b/software/src/APP_SCALEEDITOR.h similarity index 99% rename from software/src/APP_SCALEEDITOR.ino rename to software/src/APP_SCALEEDITOR.h index 81a34a92e..646300cb8 100644 --- a/software/src/APP_SCALEEDITOR.ino +++ b/software/src/APP_SCALEEDITOR.h @@ -18,6 +18,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include "OC_apps.h" +#include "OC_ui.h" #include "braids_quantizer.h" #include "braids_quantizer_scales.h" #include "OC_scales.h" diff --git a/software/src/APP_SETTINGS.ino b/software/src/APP_SETTINGS.h similarity index 98% rename from software/src/APP_SETTINGS.ino rename to software/src/APP_SETTINGS.h index 1a076a5e9..d6eb76e05 100644 --- a/software/src/APP_SETTINGS.ino +++ b/software/src/APP_SETTINGS.h @@ -18,6 +18,11 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include +#include "OC_apps.h" +#include "OC_version.h" +#include "OC_ui.h" #include "HSApplication.h" // Bitmap representation of QR code for access to http://www.beigemaze.com/hs, which diff --git a/software/src/APP_THEDARKESTTIMELINE.ino b/software/src/APP_THEDARKESTTIMELINE.h similarity index 98% rename from software/src/APP_THEDARKESTTIMELINE.ino rename to software/src/APP_THEDARKESTTIMELINE.h index a3f91bf9c..9f39da18b 100644 --- a/software/src/APP_THEDARKESTTIMELINE.ino +++ b/software/src/APP_THEDARKESTTIMELINE.h @@ -22,6 +22,19 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include +#include +#include "OC_core.h" +#include "OC_config.h" +#include "OC_apps.h" +#include "OC_patterns.h" +#include "OC_strings.h" +#include "OC_menus.h" +#include "OC_ui.h" +#include "src/drivers/display.h" + +#include "HemisphereApplet.h" #include "util/util_settings.h" #include "OC_DAC.h" #include "braids_quantizer.h" diff --git a/software/src/APP_WAVEFORMEDITOR.ino b/software/src/APP_WAVEFORMEDITOR.h similarity index 99% rename from software/src/APP_WAVEFORMEDITOR.ino rename to software/src/APP_WAVEFORMEDITOR.h index dc7d12a55..8825c0050 100644 --- a/software/src/APP_WAVEFORMEDITOR.ino +++ b/software/src/APP_WAVEFORMEDITOR.h @@ -18,6 +18,12 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include "OC_apps.h" +#include "OC_strings.h" +#include "OC_ui.h" +#include "UI/ui_events.h" + #include "HSApplication.h" #include "HSMIDI.h" #include "vector_osc/HSVectorOscillator.h" diff --git a/software/src/HEM_ADEG.ino b/software/src/HEM_ADEG.h similarity index 98% rename from software/src/HEM_ADEG.ino rename to software/src/HEM_ADEG.h index 3549cd27c..5fb861eef 100644 --- a/software/src/HEM_ADEG.ino +++ b/software/src/HEM_ADEG.h @@ -18,9 +18,16 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#ifndef _HEM_ADEG_H_ +#define _HEM_ADEG_H_ + #define HEM_ADEG_MAX_VALUE 255 #define HEM_ADEG_MAX_TICKS 33333 +#include +#include "OC_core.h" +#include "HemisphereApplet.h" + class ADEG : public HemisphereApplet { public: @@ -185,3 +192,5 @@ void ADEG_OnEncoderMove(bool hemisphere, int direction) {ADEG_instance[hemispher void ADEG_ToggleHelpScreen(bool hemisphere) {ADEG_instance[hemisphere].HelpScreen();} uint32_t ADEG_OnDataRequest(bool hemisphere) {return ADEG_instance[hemisphere].OnDataRequest();} void ADEG_OnDataReceive(bool hemisphere, uint32_t data) {ADEG_instance[hemisphere].OnDataReceive(data);} + +#endif \ No newline at end of file diff --git a/software/src/HEM_ADSREG.ino b/software/src/HEM_ADSREG.h similarity index 98% rename from software/src/HEM_ADSREG.ino rename to software/src/HEM_ADSREG.h index 5922ed9b4..dd9acd30d 100644 --- a/software/src/HEM_ADSREG.ino +++ b/software/src/HEM_ADSREG.h @@ -18,6 +18,13 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#ifndef _HEM_ADSREG_H_ +#define _HEM_ADSREG_H_ + +#include +#include "OC_core.h" +#include "HemisphereApplet.h" + #define HEM_EG_ATTACK 0 #define HEM_EG_DECAY 1 #define HEM_EG_SUSTAIN 2 @@ -303,3 +310,5 @@ uint32_t ADSREG_OnDataRequest(bool hemisphere) { void ADSREG_OnDataReceive(bool hemisphere, uint32_t data) { ADSREG_instance[hemisphere].OnDataReceive(data); } + +#endif \ No newline at end of file diff --git a/software/src/HEM_ASR.ino b/software/src/HEM_ASR.h similarity index 97% rename from software/src/HEM_ASR.ino rename to software/src/HEM_ASR.h index e4bf9753d..0ff821798 100644 --- a/software/src/HEM_ASR.ino +++ b/software/src/HEM_ASR.h @@ -20,6 +20,13 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#ifndef _HEM_ASR_H_ +#define _HEM_ASR_H_ + +#include +#include "OC_core.h" +#include "OC_scales.h" +#include "HemisphereApplet.h" #include "HSRingBufferManager.h" // Singleton Ring Buffer manager class ASR : public HemisphereApplet { @@ -157,3 +164,5 @@ void ASR_OnEncoderMove(bool hemisphere, int direction) {ASR_instance[hemisphere] void ASR_ToggleHelpScreen(bool hemisphere) {ASR_instance[hemisphere].HelpScreen();} uint32_t ASR_OnDataRequest(bool hemisphere) {return ASR_instance[hemisphere].OnDataRequest();} void ASR_OnDataReceive(bool hemisphere, uint32_t data) {ASR_instance[hemisphere].OnDataReceive(data);} + +#endif \ No newline at end of file diff --git a/software/src/HEM_AnnularFusion.ino b/software/src/HEM_AnnularFusion.h similarity index 98% rename from software/src/HEM_AnnularFusion.ino rename to software/src/HEM_AnnularFusion.h index f4671d2d5..322411cba 100644 --- a/software/src/HEM_AnnularFusion.ino +++ b/software/src/HEM_AnnularFusion.h @@ -20,7 +20,14 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#ifndef _HEM_AF_STEP_COORD_H_ +#define _HEM_AF_STEP_COORD_H_ + +#include +#include "OC_core.h" +#include "HemisphereApplet.h" #include "bjorklund.h" + #define AF_DISPLAY_TIMEOUT 330000 struct AFStepCoord { @@ -283,3 +290,5 @@ uint32_t AnnularFusion_OnDataRequest(bool hemisphere) { void AnnularFusion_OnDataReceive(bool hemisphere, uint32_t data) { AnnularFusion_instance[hemisphere].OnDataReceive(data); } + +#endif \ No newline at end of file diff --git a/software/src/HEM_AttenuateOffset.ino b/software/src/HEM_AttenuateOffset.h similarity index 97% rename from software/src/HEM_AttenuateOffset.ino rename to software/src/HEM_AttenuateOffset.h index 2d70eee26..39e1d4531 100644 --- a/software/src/HEM_AttenuateOffset.ino +++ b/software/src/HEM_AttenuateOffset.h @@ -18,6 +18,13 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#ifndef _HEM_ATTOFF_H_ +#define _HEM_ATTOFF_H_ + +#include +#include "OC_core.h" +#include "HemisphereApplet.h" + #define ATTENOFF_INCREMENTS 128 class AttenuateOffset : public HemisphereApplet { @@ -131,3 +138,5 @@ void AttenuateOffset_OnEncoderMove(bool hemisphere, int direction) {AttenuateOff void AttenuateOffset_ToggleHelpScreen(bool hemisphere) {AttenuateOffset_instance[hemisphere].HelpScreen();} uint32_t AttenuateOffset_OnDataRequest(bool hemisphere) {return AttenuateOffset_instance[hemisphere].OnDataRequest();} void AttenuateOffset_OnDataReceive(bool hemisphere, uint32_t data) {AttenuateOffset_instance[hemisphere].OnDataReceive(data);} + +#endif \ No newline at end of file diff --git a/software/src/HEM_Binary.ino b/software/src/HEM_Binary.h similarity index 97% rename from software/src/HEM_Binary.ino rename to software/src/HEM_Binary.h index c53c15639..5542348cc 100644 --- a/software/src/HEM_Binary.ino +++ b/software/src/HEM_Binary.h @@ -18,6 +18,12 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#ifndef _HEM_BIN_H_ +#define _HEM_BIN_H_ + +#include +#include "OC_core.h" +#include "HemisphereApplet.h" #include "SegmentDisplay.h" class Binary : public HemisphereApplet { @@ -139,3 +145,5 @@ uint32_t Binary_OnDataRequest(bool hemisphere) { void Binary_OnDataReceive(bool hemisphere, uint32_t data) { Binary_instance[hemisphere].OnDataReceive(data); } + +#endif \ No newline at end of file diff --git a/software/src/HEM_BootsNCat.ino b/software/src/HEM_BootsNCat.h similarity index 98% rename from software/src/HEM_BootsNCat.ino rename to software/src/HEM_BootsNCat.h index 44462c815..291de47fa 100644 --- a/software/src/HEM_BootsNCat.ino +++ b/software/src/HEM_BootsNCat.h @@ -17,7 +17,12 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#ifndef _HEM_BOOTSNCAT_H_ +#define _HEM_BOOTSNCAT_H_ +#include +#include "OC_core.h" +#include "HemisphereApplet.h" #include "vector_osc/HSVectorOscillator.h" #include "vector_osc/WaveformManager.h" @@ -221,3 +226,5 @@ void BootsNCat_OnEncoderMove(bool hemisphere, int direction) {BootsNCat_instance void BootsNCat_ToggleHelpScreen(bool hemisphere) {BootsNCat_instance[hemisphere].HelpScreen();} uint32_t BootsNCat_OnDataRequest(bool hemisphere) {return BootsNCat_instance[hemisphere].OnDataRequest();} void BootsNCat_OnDataReceive(bool hemisphere, uint32_t data) {BootsNCat_instance[hemisphere].OnDataReceive(data);} + +#endif \ No newline at end of file diff --git a/software/src/HEM_Brancher.ino b/software/src/HEM_Brancher.h similarity index 97% rename from software/src/HEM_Brancher.ino rename to software/src/HEM_Brancher.h index 806747023..70e091cf3 100644 --- a/software/src/HEM_Brancher.ino +++ b/software/src/HEM_Brancher.h @@ -18,6 +18,13 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#ifndef _HEM_BRANCHER_H_ +#define _HEM_BRANCHER_H_ + +#include +#include "OC_core.h" +#include "HemisphereApplet.h" + class Brancher : public HemisphereApplet { public: @@ -138,3 +145,5 @@ uint32_t Brancher_OnDataRequest(bool hemisphere) { void Brancher_OnDataReceive(bool hemisphere, uint32_t data) { Brancher_instance[hemisphere].OnDataReceive(data); } + +#endif diff --git a/software/src/HEM_Burst.ino b/software/src/HEM_Burst.h similarity index 99% rename from software/src/HEM_Burst.ino rename to software/src/HEM_Burst.h index 5d43ebb54..142eff5ca 100644 --- a/software/src/HEM_Burst.ino +++ b/software/src/HEM_Burst.h @@ -18,6 +18,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include "OC_core.h" +#include "HemisphereApplet.h" + #define HEM_BURST_NUMBER_MAX 12 #define HEM_BURST_SPACING_MAX 500 #define HEM_BURST_SPACING_MIN 8 diff --git a/software/src/HEM_CVRecV2.ino b/software/src/HEM_CVRecV2.h similarity index 99% rename from software/src/HEM_CVRecV2.ino rename to software/src/HEM_CVRecV2.h index 8e52206a4..b7c91bfa3 100644 --- a/software/src/HEM_CVRecV2.ino +++ b/software/src/HEM_CVRecV2.h @@ -18,6 +18,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include "OC_core.h" +#include "HemisphereApplet.h" #include "SegmentDisplay.h" #define CVREC_MAX_STEP 384 diff --git a/software/src/HEM_Calculate.ino b/software/src/HEM_Calculate.h similarity index 98% rename from software/src/HEM_Calculate.ino rename to software/src/HEM_Calculate.h index b193f095a..5bd5d3caa 100644 --- a/software/src/HEM_Calculate.ino +++ b/software/src/HEM_Calculate.h @@ -18,6 +18,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include "OC_core.h" +#include "HemisphereApplet.h" + // Arithmetic functions and typedef to function pointer #define HEMISPHERE_NUMBER_OF_CALC 7 int hem_MIN(int v1, int v2) {return (v1 < v2) ? v1 : v2;} diff --git a/software/src/HEM_Carpeggio.ino b/software/src/HEM_Carpeggio.h similarity index 99% rename from software/src/HEM_Carpeggio.ino rename to software/src/HEM_Carpeggio.h index 9e037ac30..88fe054ec 100644 --- a/software/src/HEM_Carpeggio.ino +++ b/software/src/HEM_Carpeggio.h @@ -20,6 +20,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include "OC_core.h" +#include "HemisphereApplet.h" #include "hem_arp_chord.h" #include "HSMIDI.h" #define HEM_CARPEGGIO_ANIMATION_SPEED 500 diff --git a/software/src/HEM_ClockDivider.ino b/software/src/HEM_ClockDivider.h similarity index 98% rename from software/src/HEM_ClockDivider.ino rename to software/src/HEM_ClockDivider.h index 0fa360db2..79ef6d16a 100644 --- a/software/src/HEM_ClockDivider.ino +++ b/software/src/HEM_ClockDivider.h @@ -18,6 +18,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include "OC_core.h" +#include "HemisphereApplet.h" + #define HEM_CLOCKDIV_MAX 8 class ClockDivider : public HemisphereApplet { diff --git a/software/src/HEM_ClockSetup.ino b/software/src/HEM_ClockSetup.h similarity index 98% rename from software/src/HEM_ClockSetup.ino rename to software/src/HEM_ClockSetup.h index b51097d73..689a70204 100644 --- a/software/src/HEM_ClockSetup.ino +++ b/software/src/HEM_ClockSetup.h @@ -18,6 +18,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include "OC_core.h" +#include "HemisphereApplet.h" + class ClockSetup : public HemisphereApplet { public: diff --git a/software/src/HEM_ClockSkip.ino b/software/src/HEM_ClockSkip.h similarity index 98% rename from software/src/HEM_ClockSkip.ino rename to software/src/HEM_ClockSkip.h index 975f4d839..0cb2c7ec4 100644 --- a/software/src/HEM_ClockSkip.ino +++ b/software/src/HEM_ClockSkip.h @@ -18,6 +18,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include "OC_core.h" +#include "HemisphereApplet.h" + class ClockSkip : public HemisphereApplet { public: diff --git a/software/src/HEM_Compare.ino b/software/src/HEM_Compare.h similarity index 98% rename from software/src/HEM_Compare.ino rename to software/src/HEM_Compare.h index 29a1eec1d..9010a70cb 100644 --- a/software/src/HEM_Compare.ino +++ b/software/src/HEM_Compare.h @@ -18,6 +18,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include "OC_core.h" +#include "HemisphereApplet.h" + #define HEM_COMPARE_MAX_VALUE 255 class Compare : public HemisphereApplet { diff --git a/software/src/HEM_DrCrusher.ino b/software/src/HEM_DrCrusher.h similarity index 98% rename from software/src/HEM_DrCrusher.ino rename to software/src/HEM_DrCrusher.h index e4b554a0c..9d505bede 100644 --- a/software/src/HEM_DrCrusher.ino +++ b/software/src/HEM_DrCrusher.h @@ -18,6 +18,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include "OC_core.h" +#include "HemisphereApplet.h" + const char* const crusher_rate[8] = { "16.7", "8.3", "5.6", "4.2", "3.3", "2.1", "1", ".5" }; diff --git a/software/src/HEM_DualQuant.ino b/software/src/HEM_DualQuant.h similarity index 98% rename from software/src/HEM_DualQuant.ino rename to software/src/HEM_DualQuant.h index 70c387835..cdcbdf438 100644 --- a/software/src/HEM_DualQuant.ino +++ b/software/src/HEM_DualQuant.h @@ -20,6 +20,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include "OC_core.h" +#include "HemisphereApplet.h" +#include "OC_strings.h" #include "braids_quantizer.h" #include "braids_quantizer_scales.h" #include "OC_scales.h" diff --git a/software/src/HEM_EnigmaJr.ino b/software/src/HEM_EnigmaJr.h similarity index 99% rename from software/src/HEM_EnigmaJr.ino rename to software/src/HEM_EnigmaJr.h index a93a530c7..8773c73e7 100644 --- a/software/src/HEM_EnigmaJr.ino +++ b/software/src/HEM_EnigmaJr.h @@ -22,6 +22,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include "OC_core.h" +#include "HemisphereApplet.h" #include "braids_quantizer.h" #include "braids_quantizer_scales.h" #include "OC_scales.h" diff --git a/software/src/HEM_EnvFollow.ino b/software/src/HEM_EnvFollow.h similarity index 98% rename from software/src/HEM_EnvFollow.ino rename to software/src/HEM_EnvFollow.h index dc4b1b1c1..86307cb71 100644 --- a/software/src/HEM_EnvFollow.ino +++ b/software/src/HEM_EnvFollow.h @@ -18,6 +18,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include "OC_core.h" +#include "HemisphereApplet.h" + #define HEM_ENV_FOLLOWER_SAMPLES 166 class EnvFollow : public HemisphereApplet { diff --git a/software/src/HEM_GateDelay.ino b/software/src/HEM_GateDelay.h similarity index 98% rename from software/src/HEM_GateDelay.ino rename to software/src/HEM_GateDelay.h index 8a0b0da5a..6c07653df 100644 --- a/software/src/HEM_GateDelay.ino +++ b/software/src/HEM_GateDelay.h @@ -18,6 +18,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include "OC_core.h" +#include "HemisphereApplet.h" + class GateDelay : public HemisphereApplet { public: diff --git a/software/src/HEM_GatedVCA.ino b/software/src/HEM_GatedVCA.h similarity index 98% rename from software/src/HEM_GatedVCA.ino rename to software/src/HEM_GatedVCA.h index fe673c20f..a706c8643 100644 --- a/software/src/HEM_GatedVCA.ino +++ b/software/src/HEM_GatedVCA.h @@ -18,6 +18,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include "OC_core.h" +#include "HemisphereApplet.h" + class GatedVCA : public HemisphereApplet { public: diff --git a/software/src/HEM_LoFiPCM.ino b/software/src/HEM_LoFiPCM.h similarity index 98% rename from software/src/HEM_LoFiPCM.ino rename to software/src/HEM_LoFiPCM.h index 70503b74f..c0a160c5d 100644 --- a/software/src/HEM_LoFiPCM.ino +++ b/software/src/HEM_LoFiPCM.h @@ -18,6 +18,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include "OC_core.h" +#include "HemisphereApplet.h" + #define HEM_LOFI_PCM_BUFFER_SIZE 2048 #define HEM_LOFI_PCM_SPEED 8 #define LOFI_PCM2CV(S) ((uint32_t)S << 8) - 32767; diff --git a/software/src/HEM_Logic.ino b/software/src/HEM_Logic.h similarity index 98% rename from software/src/HEM_Logic.ino rename to software/src/HEM_Logic.h index 24f6bc282..b84d3b9d1 100644 --- a/software/src/HEM_Logic.ino +++ b/software/src/HEM_Logic.h @@ -18,6 +18,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include "OC_core.h" +#include "HemisphereApplet.h" + // Logical gate functions and typedef to function pointer #define HEMISPHERE_NUMBER_OF_LOGIC 7 bool hem_AND(bool s1, bool s2) {return s1 & s2;} diff --git a/software/src/HEM_LowerRenz.ino b/software/src/HEM_LowerRenz.h similarity index 98% rename from software/src/HEM_LowerRenz.ino rename to software/src/HEM_LowerRenz.h index 6be42c263..f0154f36c 100644 --- a/software/src/HEM_LowerRenz.ino +++ b/software/src/HEM_LowerRenz.h @@ -21,6 +21,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include "OC_core.h" +#include "HemisphereApplet.h" #include "streams_lorenz_generator.h" #include "util/util_math.h" #include "HSLorenzGeneratorManager.h" // Singleton Lorenz manager diff --git a/software/src/HEM_Metronome.ino b/software/src/HEM_Metronome.h similarity index 98% rename from software/src/HEM_Metronome.ino rename to software/src/HEM_Metronome.h index fc2881727..4f2d72f17 100644 --- a/software/src/HEM_Metronome.ino +++ b/software/src/HEM_Metronome.h @@ -18,6 +18,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include "OC_core.h" +#include "HemisphereApplet.h" + class Metronome : public HemisphereApplet { public: diff --git a/software/src/HEM_MixerBal.ino b/software/src/HEM_MixerBal.h similarity index 98% rename from software/src/HEM_MixerBal.ino rename to software/src/HEM_MixerBal.h index 3671134bd..1b105acbe 100644 --- a/software/src/HEM_MixerBal.ino +++ b/software/src/HEM_MixerBal.h @@ -18,6 +18,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include "OC_core.h" +#include "HemisphereApplet.h" + #define MIXER_MAX_VALUE 255 class MixerBal : public HemisphereApplet { diff --git a/software/src/HEM_Palimpsest.ino b/software/src/HEM_Palimpsest.h similarity index 99% rename from software/src/HEM_Palimpsest.ino rename to software/src/HEM_Palimpsest.h index be5aa0ae3..8302a5185 100644 --- a/software/src/HEM_Palimpsest.ino +++ b/software/src/HEM_Palimpsest.h @@ -18,6 +18,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include "OC_core.h" +#include "HemisphereApplet.h" + #define HEM_PALIMPSEST_MAX_VALUE 100 class Palimpsest : public HemisphereApplet { diff --git a/software/src/HEM_RunglBook.ino b/software/src/HEM_RunglBook.h similarity index 98% rename from software/src/HEM_RunglBook.ino rename to software/src/HEM_RunglBook.h index f3709a846..f4be071fd 100644 --- a/software/src/HEM_RunglBook.ino +++ b/software/src/HEM_RunglBook.h @@ -18,6 +18,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include "OC_core.h" +#include "HemisphereApplet.h" + class RunglBook : public HemisphereApplet { public: diff --git a/software/src/HEM_ScaleDuet.ino b/software/src/HEM_ScaleDuet.h similarity index 98% rename from software/src/HEM_ScaleDuet.ino rename to software/src/HEM_ScaleDuet.h index ea6f9c200..755de7203 100644 --- a/software/src/HEM_ScaleDuet.ino +++ b/software/src/HEM_ScaleDuet.h @@ -20,6 +20,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include "OC_core.h" +#include "HemisphereApplet.h" #include "braids_quantizer.h" #include "braids_quantizer_scales.h" #include "OC_scales.h" diff --git a/software/src/HEM_Schmitt.ino b/software/src/HEM_Schmitt.h similarity index 98% rename from software/src/HEM_Schmitt.ino rename to software/src/HEM_Schmitt.h index 005511311..77d25f5e3 100644 --- a/software/src/HEM_Schmitt.ino +++ b/software/src/HEM_Schmitt.h @@ -18,6 +18,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include "OC_core.h" +#include "HemisphereApplet.h" + #define SCHMITT_FLASH_SPEED 4000 class Schmitt : public HemisphereApplet { diff --git a/software/src/HEM_Scope.ino b/software/src/HEM_Scope.h similarity index 98% rename from software/src/HEM_Scope.ino rename to software/src/HEM_Scope.h index f5a12ac8a..c2115b12e 100644 --- a/software/src/HEM_Scope.ino +++ b/software/src/HEM_Scope.h @@ -18,6 +18,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include "OC_core.h" +#include "HemisphereApplet.h" + const uint8_t HEM_PPQN_VALUES[] = {1, 2, 4, 8, 16, 24}; class Scope : public HemisphereApplet { diff --git a/software/src/HEM_Sequence5.ino b/software/src/HEM_Sequence5.h similarity index 98% rename from software/src/HEM_Sequence5.ino rename to software/src/HEM_Sequence5.h index b954744a0..f3ca50234 100644 --- a/software/src/HEM_Sequence5.ino +++ b/software/src/HEM_Sequence5.h @@ -18,6 +18,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include "OC_core.h" +#include "HemisphereApplet.h" #include "HSMIDI.h" class Sequence5 : public HemisphereApplet { diff --git a/software/src/HEM_ShiftGate.ino b/software/src/HEM_ShiftGate.h similarity index 98% rename from software/src/HEM_ShiftGate.ino rename to software/src/HEM_ShiftGate.h index 6c76337cf..b3fbd8640 100644 --- a/software/src/HEM_ShiftGate.ino +++ b/software/src/HEM_ShiftGate.h @@ -1,3 +1,8 @@ + +#include +#include "OC_core.h" +#include "HemisphereApplet.h" + class ShiftGate : public HemisphereApplet { public: diff --git a/software/src/HEM_Shuffle.ino b/software/src/HEM_Shuffle.h similarity index 98% rename from software/src/HEM_Shuffle.ino rename to software/src/HEM_Shuffle.h index 4e77ea9c6..ad46a55b3 100644 --- a/software/src/HEM_Shuffle.ino +++ b/software/src/HEM_Shuffle.h @@ -18,6 +18,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include "OC_core.h" +#include "HemisphereApplet.h" + class Shuffle : public HemisphereApplet { public: diff --git a/software/src/HEM_SkewedLFO.ino b/software/src/HEM_SkewedLFO.h similarity index 98% rename from software/src/HEM_SkewedLFO.ino rename to software/src/HEM_SkewedLFO.h index 417c619fe..2bdd740e5 100644 --- a/software/src/HEM_SkewedLFO.ino +++ b/software/src/HEM_SkewedLFO.h @@ -18,6 +18,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include "OC_core.h" +#include "HemisphereApplet.h" + #define HEM_LFO_HIGH 40000 #define HEM_LFO_LOW 800 #define HEM_LFO_MAX_VALUE 120 diff --git a/software/src/HEM_Slew.ino b/software/src/HEM_Slew.h similarity index 98% rename from software/src/HEM_Slew.ino rename to software/src/HEM_Slew.h index 4eec08822..698686c44 100644 --- a/software/src/HEM_Slew.ino +++ b/software/src/HEM_Slew.h @@ -18,6 +18,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include "OC_core.h" +#include "HemisphereApplet.h" + #define HEM_SLEW_MAX_VALUE 200 #define HEM_SLEW_MAX_TICKS 64000 diff --git a/software/src/HEM_Squanch.ino b/software/src/HEM_Squanch.h similarity index 98% rename from software/src/HEM_Squanch.ino rename to software/src/HEM_Squanch.h index 353e36752..d315a4e18 100644 --- a/software/src/HEM_Squanch.ino +++ b/software/src/HEM_Squanch.h @@ -20,6 +20,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include "OC_core.h" +#include "HemisphereApplet.h" #include "braids_quantizer.h" #include "braids_quantizer_scales.h" #include "OC_scales.h" diff --git a/software/src/HEM_Switch.ino b/software/src/HEM_Switch.h similarity index 98% rename from software/src/HEM_Switch.ino rename to software/src/HEM_Switch.h index a739f8f97..3d103bee9 100644 --- a/software/src/HEM_Switch.ino +++ b/software/src/HEM_Switch.h @@ -18,6 +18,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include "OC_core.h" +#include "HemisphereApplet.h" + class Switch : public HemisphereApplet { public: diff --git a/software/src/HEM_TLNeuron.ino b/software/src/HEM_TLNeuron.h similarity index 100% rename from software/src/HEM_TLNeuron.ino rename to software/src/HEM_TLNeuron.h diff --git a/software/src/HEM_TM.ino b/software/src/HEM_TM.h similarity index 99% rename from software/src/HEM_TM.ino rename to software/src/HEM_TM.h index 3f54284c0..caa159c79 100644 --- a/software/src/HEM_TM.ino +++ b/software/src/HEM_TM.h @@ -27,6 +27,9 @@ * Thanks to Jon Wheeler for the CV length and probability updates */ +#include +#include "OC_core.h" +#include "HemisphereApplet.h" #include "braids_quantizer.h" #include "braids_quantizer_scales.h" #include "OC_scales.h" diff --git a/software/src/HEM_Trending.ino b/software/src/HEM_Trending.h similarity index 99% rename from software/src/HEM_Trending.ino rename to software/src/HEM_Trending.h index 9b7da3f04..87ca5b250 100644 --- a/software/src/HEM_Trending.ino +++ b/software/src/HEM_Trending.h @@ -18,6 +18,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include "OC_core.h" +#include "HemisphereApplet.h" + #define TRENDING_MAX_SENS 124 const char* const Trending_assignments[6] = { diff --git a/software/src/HEM_TrigSeq.ino b/software/src/HEM_TrigSeq.h similarity index 98% rename from software/src/HEM_TrigSeq.ino rename to software/src/HEM_TrigSeq.h index d91a9eefd..eac2c7721 100644 --- a/software/src/HEM_TrigSeq.ino +++ b/software/src/HEM_TrigSeq.h @@ -18,6 +18,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include "OC_core.h" +#include "HemisphereApplet.h" + class TrigSeq : public HemisphereApplet { public: diff --git a/software/src/HEM_TrigSeq16.ino b/software/src/HEM_TrigSeq16.h similarity index 98% rename from software/src/HEM_TrigSeq16.ino rename to software/src/HEM_TrigSeq16.h index 839b51dc0..0826bdd11 100644 --- a/software/src/HEM_TrigSeq16.ino +++ b/software/src/HEM_TrigSeq16.h @@ -18,6 +18,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include "OC_core.h" +#include "HemisphereApplet.h" + class TrigSeq16 : public HemisphereApplet { public: diff --git a/software/src/HEM_Tuner.ino b/software/src/HEM_Tuner.h similarity index 98% rename from software/src/HEM_Tuner.ino rename to software/src/HEM_Tuner.h index 6c42bd9b0..3fd18333a 100644 --- a/software/src/HEM_Tuner.ino +++ b/software/src/HEM_Tuner.h @@ -26,6 +26,12 @@ // hemisphere. So there are various checks for the FLIP_180 compile-time option // in this code. +#include +#include "OC_core.h" +#include "OC_strings.h" +#include "HemisphereApplet.h" +#include "src/drivers/FreqMeasure/OC_FreqMeasure.h" + static constexpr double HEM_TUNER_AaboveMidCtoC0 = 0.03716272234383494188492; class Tuner : public HemisphereApplet { diff --git a/software/src/HEM_VectorEG.ino b/software/src/HEM_VectorEG.h similarity index 98% rename from software/src/HEM_VectorEG.ino rename to software/src/HEM_VectorEG.h index 138c30d9d..e6d2e58e2 100644 --- a/software/src/HEM_VectorEG.ino +++ b/software/src/HEM_VectorEG.h @@ -18,6 +18,12 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#ifndef _HEM_VECTOR_EG_H_ +#define _HEM_VECTOR_EG_H_ + +#include +#include "OC_core.h" +#include "HemisphereApplet.h" #include "vector_osc/HSVectorOscillator.h" #include "vector_osc/WaveformManager.h" @@ -197,3 +203,5 @@ void VectorEG_OnEncoderMove(bool hemisphere, int direction) {VectorEG_instance[h void VectorEG_ToggleHelpScreen(bool hemisphere) {VectorEG_instance[hemisphere].HelpScreen();} uint32_t VectorEG_OnDataRequest(bool hemisphere) {return VectorEG_instance[hemisphere].OnDataRequest();} void VectorEG_OnDataReceive(bool hemisphere, uint32_t data) {VectorEG_instance[hemisphere].OnDataReceive(data);} + +#endif \ No newline at end of file diff --git a/software/src/HEM_VectorLFO.ino b/software/src/HEM_VectorLFO.h similarity index 99% rename from software/src/HEM_VectorLFO.ino rename to software/src/HEM_VectorLFO.h index edeb03dde..4da7f438b 100644 --- a/software/src/HEM_VectorLFO.ino +++ b/software/src/HEM_VectorLFO.h @@ -18,6 +18,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include "OC_core.h" +#include "HemisphereApplet.h" #include "vector_osc/HSVectorOscillator.h" #include "vector_osc/WaveformManager.h" diff --git a/software/src/HEM_VectorMod.ino b/software/src/HEM_VectorMod.h similarity index 98% rename from software/src/HEM_VectorMod.ino rename to software/src/HEM_VectorMod.h index b4c55fe45..c191b2bbe 100644 --- a/software/src/HEM_VectorMod.ino +++ b/software/src/HEM_VectorMod.h @@ -18,6 +18,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include "OC_core.h" +#include "HemisphereApplet.h" #include "vector_osc/HSVectorOscillator.h" #include "vector_osc/WaveformManager.h" diff --git a/software/src/HEM_VectorMorph.ino b/software/src/HEM_VectorMorph.h similarity index 99% rename from software/src/HEM_VectorMorph.ino rename to software/src/HEM_VectorMorph.h index db021801d..724fbf9cd 100644 --- a/software/src/HEM_VectorMorph.ino +++ b/software/src/HEM_VectorMorph.h @@ -18,6 +18,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include "OC_core.h" +#include "HemisphereApplet.h" #include "vector_osc/HSVectorOscillator.h" #include "vector_osc/WaveformManager.h" diff --git a/software/src/HEM_Voltage.ino b/software/src/HEM_Voltage.h similarity index 98% rename from software/src/HEM_Voltage.ino rename to software/src/HEM_Voltage.h index 326d1cc61..4ac562f03 100644 --- a/software/src/HEM_Voltage.ino +++ b/software/src/HEM_Voltage.h @@ -18,6 +18,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include +#include "OC_core.h" +#include "HemisphereApplet.h" + #define VOLTAGE_INCREMENTS 128 class Voltage : public HemisphereApplet { diff --git a/software/src/HEM_hMIDIIn.ino b/software/src/HEM_hMIDIIn.h similarity index 98% rename from software/src/HEM_hMIDIIn.ino rename to software/src/HEM_hMIDIIn.h index 49f9541d8..8ff0e0501 100644 --- a/software/src/HEM_hMIDIIn.ino +++ b/software/src/HEM_hMIDIIn.h @@ -20,6 +20,16 @@ // See https://www.pjrc.com/teensy/td_midi.html +#ifndef _HEM_H_MIDI_IN_H_ +#define _HEM_H_MIDI_IN_H_ + +#include +#include "OC_core.h" +#include "HemisphereApplet.h" +#include "APP_HEMISPHERE.h" + +void ReceiveManagerSysEx(); + #define HEM_MIDI_CLOCK_DIVISOR 12 #define HEM_MIDI_NOTE_ON 1 @@ -356,3 +366,5 @@ uint32_t hMIDIIn_OnDataRequest(bool hemisphere) { void hMIDIIn_OnDataReceive(bool hemisphere, uint32_t data) { hMIDIIn_instance[hemisphere].OnDataReceive(data); } + +#endif // _HEM_H_MIDI_IN_H_ \ No newline at end of file diff --git a/software/src/HEM_hMIDIOut.ino b/software/src/HEM_hMIDIOut.h similarity index 98% rename from software/src/HEM_hMIDIOut.ino rename to software/src/HEM_hMIDIOut.h index 553db0f14..b0c66add7 100644 --- a/software/src/HEM_hMIDIOut.ino +++ b/software/src/HEM_hMIDIOut.h @@ -20,6 +20,12 @@ // See https://www.pjrc.com/teensy/td_midi.html +#include +#include "OC_core.h" +#include "HemisphereApplet.h" +#include "HSMIDI.h" +#include "HEM_hMIDIIn.h" + // The functions available for each output #define HEM_MIDI_CC_IN 0 #define HEM_MIDI_AT_IN 1 diff --git a/software/src/HemisphereApplet.h b/software/src/HemisphereApplet.h index 0a64d681d..e8b506ed5 100644 --- a/software/src/HemisphereApplet.h +++ b/software/src/HemisphereApplet.h @@ -25,6 +25,13 @@ //// Hemisphere Applet Base Class //////////////////////////////////////////////////////////////////////////////// +#ifndef _HEM_APPLET_H_ +#define _HEM_APPLET_H_ + +#include "OC_digital_inputs.h" +#include "OC_DAC.h" +#include "OC_ADC.h" +#include "src/drivers/FreqMeasure/OC_FreqMeasure.h" #include "HSicons.h" #include "HSClockManager.h" @@ -470,3 +477,5 @@ class HemisphereApplet { bool changed_cv[2]; // Has the input changed by more than 1/8 semitone since the last read? int last_cv[2]; // For change detection }; + +#endif // _HEM_APPLET_H_ \ No newline at end of file diff --git a/software/src/main.ino b/software/src/Main.cpp similarity index 98% rename from software/src/main.ino rename to software/src/Main.cpp index 8b2401937..827502069 100644 --- a/software/src/main.ino +++ b/software/src/Main.cpp @@ -101,6 +101,9 @@ void FASTRUN CORE_timer_ISR() { void setup() { delay(50); + Serial.begin(9600); + delay(500); + SERIAL_PRINTLN("* Hello..."); NVIC_SET_PRIORITY(IRQ_PORTB, 0); // TR1 = 0 = PTB16 SPI_init(); SERIAL_PRINTLN("* O&C BOOTING..."); @@ -108,7 +111,7 @@ void setup() { OC::DEBUG::Init(); OC::DigitalInputs::Init(); - delay(400); + delay(400); < OC::ADC::Init(&OC::calibration_data.adc); // Yes, it's using the calibration_data before it's loaded... OC::DAC::Init(&OC::calibration_data.dac); @@ -200,4 +203,3 @@ void FASTRUN loop() { } } - diff --git a/software/src/OC_apps.ino b/software/src/OC_apps.cpp similarity index 97% rename from software/src/OC_apps.ino rename to software/src/OC_apps.cpp index e4093e2ce..a0cd82d33 100644 --- a/software/src/OC_apps.ino +++ b/software/src/OC_apps.cpp @@ -21,8 +21,23 @@ // SOFTWARE. #include "OC_apps.h" +#include "OC_menus.h" +#include "OC_config.h" #include "OC_digital_inputs.h" #include "OC_autotune.h" +#include "util/util_pagestorage.h" +#include "util/EEPROMStorage.h" + +#include "APP_HEMISPHERE.h" +#include "APP_MIDI.h" +#include "APP_THEDARKESTTIMELINE.h" +#include "APP_ENIGMA.h" +#include "APP_NeuralNetwork.h" +#include "APP_SCALEEDITOR.h" +#include "APP_WAVEFORMEDITOR.h" +#include "APP_PONGGAME.h" +#include "APP_Backup.h" +#include "APP_SETTINGS.h" #define DECLARE_APP(a, b, name, prefix) \ { TWOCC::value, name, \ diff --git a/software/src/OC_calibration.ino b/software/src/OC_calibration.cpp similarity index 95% rename from software/src/OC_calibration.ino rename to software/src/OC_calibration.cpp index 25db4af01..a4ffda573 100644 --- a/software/src/OC_calibration.ino +++ b/software/src/OC_calibration.cpp @@ -5,7 +5,14 @@ * enter by pressing left encoder button during start up; use encoder switches to navigate. * */ - +#include +#include +#include "OC_DAC.h" +#include "OC_ADC.h" +#include "OC_ui.h" +#include "OC_menus.h" +#include "OC_strings.h" +#include "OC_digital_inputs.h" #include "OC_calibration.h" using OC::DAC; @@ -287,6 +294,147 @@ const CalibrationStep calibration_steps[CALIBRATION_STEP_LAST] = { { CALIBRATION_EXIT, "Calibration complete", "Save values? ", select_help, end_footer, CALIBRATE_NONE, 0, OC::Strings::no_yes, 0, 1 } }; +void calibration_draw(const CalibrationState &state) { + GRAPHICS_BEGIN_FRAME(true); + const CalibrationStep *step = state.current_step; + + graphics.drawLine(0, 10, 127, 10); + graphics.drawLine(0, 12, 127, 12); + graphics.setPrintPos(1, 2); + graphics.print(step->title); + + weegfx::coord_t y = OC::menu::CalcLineY(0); + + static constexpr weegfx::coord_t kValueX = OC::menu::kDisplayWidth - 30; + + graphics.setPrintPos(OC::menu::kIndentDx, y + 2); + switch (step->calibration_type) { + case CALIBRATE_OCTAVE: + case CALIBRATE_SCREENSAVER: + graphics.print(step->message); + graphics.setPrintPos(kValueX, y + 2); + graphics.print((int)state.encoder_value, 5); + OC::menu::DrawEditIcon(kValueX, y, state.encoder_value, step->min, step->max); + break; + + case CALIBRATE_ADC_OFFSET: + graphics.print(step->message); + graphics.setPrintPos(kValueX, y + 2); + graphics.print((int)OC::ADC::value(static_cast(step->index)), 5); + OC::menu::DrawEditIcon(kValueX, y, state.encoder_value, step->min, step->max); + break; + + case CALIBRATE_DISPLAY: + graphics.print(step->message); + graphics.setPrintPos(kValueX, y + 2); + graphics.pretty_print((int)state.encoder_value, 2); + OC::menu::DrawEditIcon(kValueX, y, state.encoder_value, step->min, step->max); + graphics.drawFrame(0, 0, 128, 64); + break; + + case CALIBRATE_ADC_1V: + case CALIBRATE_ADC_3V: + graphics.setPrintPos(OC::menu::kIndentDx, y + 2); + graphics.print(step->message); + y += OC::menu::kMenuLineH; + graphics.setPrintPos(OC::menu::kIndentDx, y + 2); + graphics.print((int)OC::ADC::value(ADC_CHANNEL_1), 2); + break; + + case CALIBRATE_NONE: + default: + if (CALIBRATION_EXIT != step->step) { + graphics.setPrintPos(OC::menu::kIndentDx, y + 2); + graphics.print(step->message); + if (step->value_str) + graphics.print(step->value_str[state.encoder_value]); + } else { + graphics.setPrintPos(OC::menu::kIndentDx, y + 2); + if (calibration_data_loaded && state.used_defaults) + graphics.print("Overwrite? "); + else + graphics.print("Save? "); + if (step->value_str) + graphics.print(step->value_str[state.encoder_value]); + + if (state.used_defaults && calibration_data_loaded) { + y += OC::menu::kMenuLineH; + graphics.setPrintPos(OC::menu::kIndentDx, y + 2); + graphics.print("NB replaces existing!"); + } + } + break; + } + + y += OC::menu::kMenuLineH; + graphics.setPrintPos(OC::menu::kIndentDx, y + 2); + if (step->help) + graphics.print(step->help); + + weegfx::coord_t x = OC::menu::kDisplayWidth - 22; + y = 2; + for (int input = OC::DIGITAL_INPUT_1; input < OC::DIGITAL_INPUT_LAST; ++input) { + uint8_t state = (digital_input_displays[input].getState() + 3) >> 2; + if (state) + graphics.drawBitmap8(x, y, 4, OC::bitmap_gate_indicators_8 + (state << 2)); + x += 5; + } + + graphics.drawStr(0, OC::menu::kDisplayHeight - OC::menu::kFontHeight - 1, step->footer); + + static constexpr uint16_t step_width = (OC::menu::kDisplayWidth << 8 ) / (CALIBRATION_STEP_LAST - 1); + graphics.drawRect(0, OC::menu::kDisplayHeight - 2, (state.step * step_width) >> 8, 2); + + GRAPHICS_END_FRAME(); +} + +/* DAC output etc */ + +void calibration_update(CalibrationState &state) { + + CONSTRAIN(state.encoder_value, state.current_step->min, state.current_step->max); + const CalibrationStep *step = state.current_step; + + switch (step->calibration_type) { + case CALIBRATE_NONE: + DAC::set_all_octave(0); + break; + case CALIBRATE_OCTAVE: + OC::calibration_data.dac.calibrated_octaves[step_to_channel(step->step)][step->index + DAC::kOctaveZero] = + state.encoder_value; + DAC::set_all_octave(step->index); + break; + case CALIBRATE_ADC_OFFSET: + OC::calibration_data.adc.offset[step->index] = state.encoder_value; + DAC::set_all_octave(0); + break; + case CALIBRATE_ADC_1V: + DAC::set_all_octave(1); + break; + case CALIBRATE_ADC_3V: + DAC::set_all_octave(3); + break; + case CALIBRATE_DISPLAY: + OC::calibration_data.display_offset = state.encoder_value; + display::AdjustOffset(OC::calibration_data.display_offset); + break; + case CALIBRATE_SCREENSAVER: + DAC::set_all_octave(0); + OC::calibration_data.screensaver_timeout = state.encoder_value; + break; + } +} + +/* misc */ + +uint32_t adc_average() { + delay(OC_CORE_TIMER_RATE + 1); + + return + OC::ADC::smoothed_raw_value(ADC_CHANNEL_1) + OC::ADC::smoothed_raw_value(ADC_CHANNEL_2) + + OC::ADC::smoothed_raw_value(ADC_CHANNEL_3) + OC::ADC::smoothed_raw_value(ADC_CHANNEL_4); +} + /* loop calibration menu until done */ void OC::Ui::Calibrate() { @@ -445,146 +593,6 @@ void OC::Ui::Calibrate() { } } -void calibration_draw(const CalibrationState &state) { - GRAPHICS_BEGIN_FRAME(true); - const CalibrationStep *step = state.current_step; - - graphics.drawLine(0, 10, 127, 10); - graphics.drawLine(0, 12, 127, 12); - graphics.setPrintPos(1, 2); - graphics.print(step->title); - - weegfx::coord_t y = menu::CalcLineY(0); - - static constexpr weegfx::coord_t kValueX = menu::kDisplayWidth - 30; - - graphics.setPrintPos(menu::kIndentDx, y + 2); - switch (step->calibration_type) { - case CALIBRATE_OCTAVE: - case CALIBRATE_SCREENSAVER: - graphics.print(step->message); - graphics.setPrintPos(kValueX, y + 2); - graphics.print((int)state.encoder_value, 5); - menu::DrawEditIcon(kValueX, y, state.encoder_value, step->min, step->max); - break; - - case CALIBRATE_ADC_OFFSET: - graphics.print(step->message); - graphics.setPrintPos(kValueX, y + 2); - graphics.print((int)OC::ADC::value(static_cast(step->index)), 5); - menu::DrawEditIcon(kValueX, y, state.encoder_value, step->min, step->max); - break; - - case CALIBRATE_DISPLAY: - graphics.print(step->message); - graphics.setPrintPos(kValueX, y + 2); - graphics.pretty_print((int)state.encoder_value, 2); - menu::DrawEditIcon(kValueX, y, state.encoder_value, step->min, step->max); - graphics.drawFrame(0, 0, 128, 64); - break; - - case CALIBRATE_ADC_1V: - case CALIBRATE_ADC_3V: - graphics.setPrintPos(menu::kIndentDx, y + 2); - graphics.print(step->message); - y += menu::kMenuLineH; - graphics.setPrintPos(menu::kIndentDx, y + 2); - graphics.print((int)OC::ADC::value(ADC_CHANNEL_1), 2); - break; - - case CALIBRATE_NONE: - default: - if (CALIBRATION_EXIT != step->step) { - graphics.setPrintPos(menu::kIndentDx, y + 2); - graphics.print(step->message); - if (step->value_str) - graphics.print(step->value_str[state.encoder_value]); - } else { - graphics.setPrintPos(menu::kIndentDx, y + 2); - if (calibration_data_loaded && state.used_defaults) - graphics.print("Overwrite? "); - else - graphics.print("Save? "); - if (step->value_str) - graphics.print(step->value_str[state.encoder_value]); - - if (state.used_defaults && calibration_data_loaded) { - y += menu::kMenuLineH; - graphics.setPrintPos(menu::kIndentDx, y + 2); - graphics.print("NB replaces existing!"); - } - } - break; - } - - y += menu::kMenuLineH; - graphics.setPrintPos(menu::kIndentDx, y + 2); - if (step->help) - graphics.print(step->help); - - weegfx::coord_t x = menu::kDisplayWidth - 22; - y = 2; - for (int input = OC::DIGITAL_INPUT_1; input < OC::DIGITAL_INPUT_LAST; ++input) { - uint8_t state = (digital_input_displays[input].getState() + 3) >> 2; - if (state) - graphics.drawBitmap8(x, y, 4, OC::bitmap_gate_indicators_8 + (state << 2)); - x += 5; - } - - graphics.drawStr(0, menu::kDisplayHeight - menu::kFontHeight - 1, step->footer); - - static constexpr uint16_t step_width = (menu::kDisplayWidth << 8 ) / (CALIBRATION_STEP_LAST - 1); - graphics.drawRect(0, menu::kDisplayHeight - 2, (state.step * step_width) >> 8, 2); - - GRAPHICS_END_FRAME(); -} - -/* DAC output etc */ - -void calibration_update(CalibrationState &state) { - - CONSTRAIN(state.encoder_value, state.current_step->min, state.current_step->max); - const CalibrationStep *step = state.current_step; - - switch (step->calibration_type) { - case CALIBRATE_NONE: - DAC::set_all_octave(0); - break; - case CALIBRATE_OCTAVE: - OC::calibration_data.dac.calibrated_octaves[step_to_channel(step->step)][step->index + DAC::kOctaveZero] = - state.encoder_value; - DAC::set_all_octave(step->index); - break; - case CALIBRATE_ADC_OFFSET: - OC::calibration_data.adc.offset[step->index] = state.encoder_value; - DAC::set_all_octave(0); - break; - case CALIBRATE_ADC_1V: - DAC::set_all_octave(1); - break; - case CALIBRATE_ADC_3V: - DAC::set_all_octave(3); - break; - case CALIBRATE_DISPLAY: - OC::calibration_data.display_offset = state.encoder_value; - display::AdjustOffset(OC::calibration_data.display_offset); - break; - case CALIBRATE_SCREENSAVER: - DAC::set_all_octave(0); - OC::calibration_data.screensaver_timeout = state.encoder_value; - break; - } -} - -/* misc */ - -uint32_t adc_average() { - delay(OC_CORE_TIMER_RATE + 1); - - return - OC::ADC::smoothed_raw_value(ADC_CHANNEL_1) + OC::ADC::smoothed_raw_value(ADC_CHANNEL_2) + - OC::ADC::smoothed_raw_value(ADC_CHANNEL_3) + OC::ADC::smoothed_raw_value(ADC_CHANNEL_4); -} #ifdef CALIBRATION_LOAD_LEGACY /* read settings from original O&C */ diff --git a/software/src/OC_calibration.h b/software/src/OC_calibration.h index fa61a22ba..8d4fbbd30 100644 --- a/software/src/OC_calibration.h +++ b/software/src/OC_calibration.h @@ -16,6 +16,8 @@ //#define CALIBRATION_LOAD_LEGACY +void calibration_load(); + namespace OC { // Originally, this was a single bit that would reverse both encoders. diff --git a/software/src/OC_ui.h b/software/src/OC_ui.h index f9b92a80d..056155fcf 100644 --- a/software/src/OC_ui.h +++ b/software/src/OC_ui.h @@ -1,11 +1,13 @@ #ifndef OC_UI_H_ #define OC_UI_H_ +#include #include "OC_config.h" #include "OC_debug.h" #include "UI/ui_button.h" #include "UI/ui_encoder.h" #include "UI/ui_event_queue.h" +#include "UI/ui_events.h" namespace OC { diff --git a/software/src/UI/ui_encoder.h b/software/src/UI/ui_encoder.h index 0e930aa8e..caa8168e9 100644 --- a/software/src/UI/ui_encoder.h +++ b/software/src/UI/ui_encoder.h @@ -23,6 +23,7 @@ #ifndef UI_ENCODER_H_ #define UI_ENCODER_H_ +#include #include "../util/util_macros.h" namespace UI { diff --git a/software/src/UI/ui_events.h b/software/src/UI/ui_events.h index 8b870c93c..daa82a69b 100644 --- a/software/src/UI/ui_events.h +++ b/software/src/UI/ui_events.h @@ -23,27 +23,30 @@ #ifndef UI_EVENTS_H_ #define UI_EVENTS_H_ +#include +#include + namespace UI { -enum EventType { - EVENT_NONE, - EVENT_BUTTON_PRESS, - EVENT_BUTTON_LONG_PRESS, - EVENT_ENCODER -}; - -// UI event struct -// Yes, looks similar to stmlib::Event but hey, they're UI events. -struct Event { - EventType type; - uint16_t control; - int16_t value; - uint16_t mask; - - Event() { } - Event(EventType t, uint16_t c, int16_t v, uint16_t m) - : type(t), control(c), value(v), mask(m) { } -}; + enum EventType { + EVENT_NONE, + EVENT_BUTTON_PRESS, + EVENT_BUTTON_LONG_PRESS, + EVENT_ENCODER + }; + + // UI event struct + // Yes, looks similar to stmlib::Event but hey, they're UI events. + struct Event { + uint16_t control; + int16_t value; + uint16_t mask; + EventType type; + + Event() { } + Event(UI::EventType t, uint16_t c, int16_t v, uint16_t m) + : type(t), control(c), value(v), mask(m) { } + }; }; // namespace UI diff --git a/software/src/hemisphere_config.h b/software/src/hemisphere_config.h index 1b2bb07cd..1ef0c064d 100644 --- a/software/src/hemisphere_config.h +++ b/software/src/hemisphere_config.h @@ -11,6 +11,58 @@ // * Category filtering is deprecated at 1.8, but I'm leaving the per-applet categorization // alone to avoid breaking forked codebases by other developers. +#include "HEM_ADSREG.h" +#include "HEM_ADEG.h" +#include "HEM_AnnularFusion.h" +#include "HEM_ASR.h" +#include "HEM_AttenuateOffset.h" +#include "HEM_Binary.h" +#include "HEM_BootsNCat.h" +#include "HEM_Brancher.h" +#include "HEM_Burst.h" +#include "HEM_Calculate.h" +#include "HEM_Carpeggio.h" +#include "HEM_ClockDivider.h" +#include "HEM_ClockSkip.h" +#include "HEM_Compare.h" +#include "HEM_CVRecV2.h" +#include "HEM_DrCrusher.h" +#include "HEM_DualQuant.h" +#include "HEM_EnigmaJr.h" +#include "HEM_EnvFollow.h" +#include "HEM_GateDelay.h" +#include "HEM_GatedVCA.h" +#include "HEM_LoFiPCM.h" +#include "HEM_Logic.h" +#include "HEM_LowerRenz.h" +#include "HEM_Metronome.h" +#include "HEM_hMIDIIn.h" +#include "HEM_hMIDIOut.h" +#include "HEM_MixerBal.h" +#include "HEM_Palimpsest.h" +#include "HEM_RunglBook.h" +#include "HEM_ScaleDuet.h" +#include "HEM_Schmitt.h" +#include "HEM_Scope.h" +#include "HEM_Sequence5.h" +#include "HEM_ShiftGate.h" +#include "HEM_TM.h" +#include "HEM_Shuffle.h" +#include "HEM_SkewedLFO.h" +#include "HEM_Slew.h" +#include "HEM_Squanch.h" +#include "HEM_Switch.h" +#include "HEM_TLNeuron.h" +#include "HEM_Trending.h" +#include "HEM_TrigSeq.h" +#include "HEM_TrigSeq16.h" +#include "HEM_Tuner.h" +#include "HEM_VectorEG.h" +#include "HEM_VectorLFO.h" +#include "HEM_VectorMod.h" +#include "HEM_VectorMorph.h" +#include "HEM_Voltage.h" + #define HEMISPHERE_AVAILABLE_APPLETS 51 ////////////////// id cat class name