Commit graph

226 commits

Author SHA1 Message Date
Mikael Degerfält
4c4d0e8b5a Unified main and patch menu input handling
Now all menu pages are handled the same way, which is great because now I can implement scrolling in the menu pages.
2019-06-23 17:14:17 +02:00
Mikael Degerfält
0d0ea5051d Made the sensor adjust menu driven by data
* Moved menu titles and option names into data structures.
 * Unified select menu option code
 * Also unified handling of menu selection, although main and rotator menus are still handled the old way.
 * Moved struct definitions to numenu.h
 * Grouped functions and variables together based on usage.
2019-06-23 17:14:17 +02:00
Mikael Degerfält
9a0bb369ac Menu selection is now data driven
Some major refactoring has been going on.
Added simple structs of data containing info about what action to take when a menu item is selected.

Finally removed all but one call to display.display() in menu-function. There might still be more than one call to it on a frame though, since some functions still calls it internally.
2019-06-23 17:14:17 +02:00
Mikael Degerfält
6a8e36635e Avoid calling display.display() twice in an update.
Moved functions around to have a better overview of draw function. This will make it easier for me to continue with the next part, which probably will be a more generic handling of menus.
2019-06-23 17:14:17 +02:00
Mikael Degerfält
2f5c546b2c Two unrelated changes
* Move text print of submenu into function
 * No need to check if value changed since writeSettings uses EEPROM.update.
2019-06-23 17:14:17 +02:00
Mikael Degerfält
e362546e3c First iteration of menu cleanup
* Broke up the code into more general functions instead of duplicating code
 * Made stuff const and removed variables no longer used
 * Use defines for menu button values
 * Changed the order or things to avoid forward declarations
 * Use array lookup instead of switch-case on some menu options
 * Adjust menu functionification
 * Cleaned up sensor rendering
2019-06-23 17:14:17 +02:00
Mikael Degerfält
435ad106d8
Merge pull request #14 from blind/sim
Use keys 1-7 for valve and trills
2019-06-23 17:07:31 +02:00
Mikael Degerfält
8723bb8706 Merge branch 'master' into sim 2019-06-23 17:01:16 +02:00
John Stäck
3d0e2cf719 Let imgui submodule be untracked without whining 2019-06-23 15:58:54 +02:00
John Stäck
095dacdf7f
Merge pull request #13 from Trasselfrisyr/midisim
Deeper MIDI simulation
2019-06-23 15:52:54 +02:00
John Stäck
98acd6067f
Merge pull request #12 from blind/initial-settings-bug
Write new factory constants even if old version was < 24
2019-06-23 15:51:27 +02:00
John Stäck
2332f37eca Advanced unusage of parameters 2019-06-23 14:51:31 +02:00
John Stäck
3d38f50d98 Add deeper simulation of USB midi 2019-06-23 14:30:32 +02:00
Mikael Degerfält
315013eb2b Updated readme 2019-06-23 13:34:19 +02:00
Mikael Degerfält
e46378f1a3 Merge branch 'master' into sim 2019-06-23 11:41:11 +02:00
Mikael Degerfält
3445c79f23 Press buttons 1-7 for valves and trills and left index input
Also moved bug workaround code to be in the same function for simpler removal at later stage.
2019-06-23 11:38:39 +02:00
Mikael Degerfält
25a31d8df8 Write new factor constants even if old version was < 24
This bug would probably never happen in real life, and could be fix by holding down menu and enter buttons at startup. But a bug is a bug.
The only reason I found this bug is that the simulator didn’t initialise EEPROM to 0xff, and even after I did that it crashed, because a version of 0xffff wasn't handled.
2019-06-23 10:24:42 +02:00
John Stäck
2d034b6369 C++ify midi.ino, change to appropriate datatypes 2019-06-23 09:55:51 +02:00
John Stäck
9777184429
Merge pull request #11 from blind/sim
Simple simulation code
2019-06-23 08:52:33 +02:00
Mikael Degerfält
0f8c0ff77e Don't spam digital write output 2019-06-22 23:10:26 +02:00
Mikael Degerfält
d9b18255e5 Initialize touch inputs to untouched 2019-06-22 23:10:03 +02:00
Mikael Degerfält
09a35aa1d9 Added flag to build for release, also set rpath for app bundle 2019-06-22 23:08:39 +02:00
Mikael Degerfält
d564e1b434
Fixed spelling 2019-06-21 18:59:21 +02:00
Mikael Degerfält
5596e0901d Added info on how to get the required submodules 2019-06-21 18:54:25 +02:00
Mikael Degerfält
f900be5306 More globals in UI + workaround for bug in firmware
A bug in the current NuEVI.ino does not write all default values to EEPROM on the first boot, unless menu + enter buttons are pressed. I added a workaround to the simulator that fakes that the buttons are pressed when calling the setup function.
2019-06-21 18:40:07 +02:00
Mikael Degerfält
9357d4b827 More inputs and outputs added in simulator
* Set default value for battery sensor input
 * Show EEPROM values as unsigned.
 * Simulate K1 to K7 inputs (valve and trills++)
2019-06-21 18:13:02 +02:00
Mikael Degerfält
0871b2582d Simulator now uses ImGui for stuff 2019-06-21 18:08:24 +02:00
Mikael Degerfält
1be998153a Fake input and bug fixes
* Press W in simulator to activate (pretty slow shit, do avoid unless compiling with optimisations)
 * Tiny improvement of the EEPROM simulation.
 * Fixed type typo for millis and micros
2019-06-21 18:07:47 +02:00
Mikael Degerfält
266b3334cb Simple simulation code
Builds a native program on MacOS that runs the NuEVI firmware compiled for x86_64.
Only input is arrow keys for menu buttons for now. Only output is console and display.

Copied some more library files into the simulation folder, and renamed the modified *.cpp files from the libraries to *_sim.cpp.
2019-06-13 20:51:45 +02:00
John Stäck
c9123b746f
Merge pull request #10 from blind/memory-save
Save memory by changing int arrays to const short arrays
2019-06-11 23:20:01 +02:00
Mikael Degerfält
c43be09b1f Save memory by changing int arrays to const short arrays
No need to have them in RAM since they are never changed, and their value was never higher than 14 bits, so using 32 was just a waste.
2019-06-09 16:53:17 +02:00
John Stäck
8581738b40
Merge pull request #8 from blind/global-cleanup
Global namespace cleanup
2019-06-09 11:48:07 +02:00
John Stäck
5cdad52cc5
Merge pull request #9 from blind/readme
Removed section from readme that is no longer valid
2019-06-09 09:06:08 +02:00
Mikael Degerfält
cc3323fd03 Move access to usbMIDI to midi.ino
NuEVI.ino shouldn’t have to know about usbMIDI.
2019-06-08 22:22:13 +02:00
Mikael Degerfält
921fdb1266 Global namespace cleanup
Moved variables only used in menu to menu code. Variables only used in NuEVI.ino removed from globals.h and made static.
2019-06-08 15:34:16 +02:00
Mikael Degerfält
39d0f17914 Removed section from readme that is no longer valid 2019-06-08 14:03:50 +02:00
John Stäck
91aecdb82d
Merge pull request #7 from blind/double-save
Avoid converting value to a double
2019-06-08 10:11:24 +02:00
Mikael Degerfält
2c4fd26d25 Fix problem where the V was still visible if battery low 2019-06-07 23:57:17 +02:00
Mikael Degerfält
883dbf605e Avoid converting value to a double
No need to convert a value to double when all we want is a two digits converted to string.
This also avoids linking some math library, which saved almost 8K och program storage space.
2019-06-07 00:12:06 +02:00
John Stäck
5a3ccec2e6
Merge pull request #6 from blind/made-to-c
Renamed menu.ino to menu.cpp
2019-06-06 23:00:42 +02:00
Mikael Degerfält
58ea673994 Moved settings #defines to settings.h
I did feel like they belong in config.h
2019-06-04 23:34:26 +02:00
Mikael Degerfält
4bf2a3a91e Renamed menu.ino to menu.cpp
This change required lots of other changes to have it compile. I had to declare all variables from NuEVI.ino used by the menu as extern in a separate header file (globals.h).
Also I moved all defines from NuEVI.ino to a config.h file. I think some of these could be moved back or even moved into menu.cpp.
I declared many variables and functions in menu.cpp as static and moved them around to avoid forward declarations. For simplicity I did some forward declarations anyway.
Some varibles only used in menu.cpp was moved from NuEVI.ino instead of having them as externals.
2019-06-03 19:24:21 +02:00
Johan Berglund
f0010cb08c Support for CV box/CV board (compile option). Match idle CV from PWM breath CV on A6 to direct output idle voltage from breath sensor (so any of them can be used for CV box without need for recalibration of box). Added reading and ignoring incoming USB MIDI messages to prevent buffers from getting filled up blocking outgoing messages. 2019-05-25 11:05:17 +02:00
Johan Berglund
f06eb0b9a4 Cleanup 2019-03-21 09:28:21 +01:00
Johan Berglund
37c77356d5 Added way to enter regular menu instead of rotator menu (touch special key) if touch sensing is set too high. Added support for pneumatic bite sensing (add-on board). Experimental pitch CV out for built-in add-on CV scaler board (#define CVSCALEBOARD). LED brightness fix. 2019-03-21 09:15:28 +01:00
John Stäck
b892d36e05
Merge pull request #5 from Trasselfrisyr/refaktor2019
Refaktor2019
2019-03-18 15:03:36 +01:00
John Stäck
b6fc9c74d5
Merge pull request #4 from blind/calibrationloop
Use loop for calibration
2019-03-13 20:06:23 +01:00
John Stäck
cf89c9df42 Call this version 1.3.3. If it passes testing. 2019-03-05 08:02:31 +01:00
John Stäck
610d226bdb Let us not rename files right now.
This reverts commit 347b6e5c71.
2019-03-05 08:00:38 +01:00
Mikael Degerfält
82b0f3a47c Calibration code cleanup 2019-03-04 21:49:34 +01:00