From 4c6c68e260a53e4cb4f077228f4fbc68fe4221fb Mon Sep 17 00:00:00 2001 From: Oleksiy Date: Thu, 3 Aug 2023 21:36:08 +0300 Subject: [PATCH] Updated pattern editor screen, fixed some minor bugs --- Software/Gravity/Gravity.ino | 2 +- Software/Gravity/Interactions.ino | 2 ++ Software/Gravity/UI.ino | 19 ++++++++++++++----- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/Software/Gravity/Gravity.ino b/Software/Gravity/Gravity.ino index 8b55b8d..8773b63 100644 --- a/Software/Gravity/Gravity.ino +++ b/Software/Gravity/Gravity.ino @@ -72,7 +72,7 @@ byte currentStep = 0; byte stepNumSelected = 0; bool *patternToEdit; -byte memCode = 'a'; //Change to different letter if you changed the data structure +byte memCode = 'A'; //Change to different letter if you changed the data structure unsigned int channelPulseCount[6]; unsigned int channelPulsesPerCycle[6]; diff --git a/Software/Gravity/Interactions.ino b/Software/Gravity/Interactions.ino index d008f6e..6737871 100644 --- a/Software/Gravity/Interactions.ino +++ b/Software/Gravity/Interactions.ino @@ -156,6 +156,8 @@ void checkInputs() { } else if (channels[displayTab - 1].mode > 2) { channels[displayTab - 1].mode = 2; } + channels[displayTab - 1].CV1Target = 0; + channels[displayTab - 1].CV2Target = 0; saveState(); } else if (insideTab && shiftBtnPushed && displayTab != 0 && menuItem == 1 && channels[displayTab - 1].mode == 0) { //Offset channels[displayTab - 1].offset = channels[displayTab - 1].offset + change; diff --git a/Software/Gravity/UI.ino b/Software/Gravity/UI.ino index 8ccb457..8d8c7e5 100644 --- a/Software/Gravity/UI.ino +++ b/Software/Gravity/UI.ino @@ -273,12 +273,21 @@ void updateScreen() { } //Edit Pattern Screen else if (displayScreen == 1) { - + byte pattern = channels[displayTab - 1].seqPattern; + String patStr; + if (pattern < 8) { + patStr = "EDIT PATTERN A" + String(pattern + 1); + } else { + patStr = "EDIT PATTERN B" + String(pattern - 7); + } + char patChar[16]; + patStr.toCharArray(patChar, 16); + u8g2.drawUTF8(31, 5, patChar); for (byte i = 0; i < 8; i++) { if (patternToEdit[i]) { - u8g2.drawUTF8(19 + i*12, 20, "q"); + u8g2.drawUTF8(19 + i*12, 24, "q"); } else { - u8g2.drawUTF8(19 + i*12, 20, "p"); + u8g2.drawUTF8(19 + i*12, 24, "p"); } } for (byte i = 8; i < 16; i++) { @@ -290,14 +299,14 @@ void updateScreen() { } if (!isRecording) { if (stepNumSelected < 8 ) { - u8g2.drawFrame(16 + stepNumSelected * 12, 12, 11, 11); + u8g2.drawFrame(16 + stepNumSelected * 12, 16, 11, 11); } else { u8g2.drawFrame(16 + (stepNumSelected-8) * 12, 32, 11, 11); } } if (isRecording) { - u8g2.drawUTF8(44, 60, "RECORDING"); + u8g2.drawUTF8(43, 60, "RECORDING"); } }