From 535ff87b182d9ad808122912e52c5557f0ea8774 Mon Sep 17 00:00:00 2001 From: b Date: Sat, 4 Jan 2025 12:17:33 +0100 Subject: [PATCH] graphical indication of transposition --- font16.png | Bin 1077 -> 1200 bytes font16.xcf | Bin 38668 -> 37092 bytes font8.png | Bin 781 -> 877 bytes font8.xcf | Bin 21575 -> 20882 bytes gui.c | 22 ++++++++++++++++++++++ gui.h | 33 +++++++++++++++++++++++++++++++++ 6 files changed, 55 insertions(+) diff --git a/font16.png b/font16.png index 035d0b39f3a2c6398368d919cd28a18913afa149..76634955150a26f5f8e072bbc6abf05516b3f3b1 100644 GIT binary patch delta 1163 zcmV;61a$kg2(Sr|HGc$UNklU;fP?5rgxNl+DQV=+4 zE?cBnOt^?mlYNOi!L9ZY91PmVOlh_V!-R!NH%zsqm2;%~sWCIV-g0%#9r)e<)%nn0 zwg#Y$vkPDoXBT{5ib4=eLHy1X#aI9!0rFj&5!9&Gh?sy%z<-8%3ZSM#ZHy*CTENL2 z)-VONLBqfbzyuI~XAnL34rp`RD^l>2GKYSS1ZtuT)_^X(Vi{n1y8{^B^kA3LlRr`m ze|ED{9b7UjtkGKSuf4Si5Y%g;YiAS@q5?+{wnWys1T+{00hOvdfS%b6gG1BkHzbK^ zgd^(fgCcD!Nq*ngrllOL=tLW8u*=%Pqrt{*ITCplTnH9|CE{v169x}~`$0T1IJk%V1RMjGz=^>vzd)`L@X;MV zGw@qSjeG4;J-XwmSEM;Ux^PSIPo5)B8g2-7Llhc8&VPd>F@lC9Q&*93Ndh6`eFBHl(7+aZG*j{?LWK7s8B++0B& zpbRRBVk%l`S_K;Xp{9*F3mSm!*;dRNbcJ`n%>XanF;2H5gTG1uXFyXmm3S zfqKN%2#&RU8)SvE0@m^!)B%+hW(sT**o<8i*MF=ktV7jBacXD)*D?p$4g;{~{2{-{ zQAQ8s7de5&?!)r!yXBoI-hJ4A`d2wpyP%R{0Q`Yb0V;t}(Sf<**X8a71w9+3%;QO> z(^_WWWrd9MV0rgx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mep7a?VdHBEEuC!^wlHLcfX3>df$}eUz^p03bh6y($H(lK%1Vn zWUxjM#;`t7z2yKG*u^t1SK=*edqxna<#I*YH2BIT%kB$^MuI{HCmTh=TaN_9r2tDZ z7+yB8xa{F+xP@f_>)7DKy99Le1@#>XbKyFP_!JZ86UVTB0jzJzUG#s@&iu=R+s%*Z!I)dcB5^dm zMjvt0w^qrgvFz{fDBPhbhEFWB;q68c!CC*(ndxyc_SxF&zlf$K;3nVv`$ugf`m<3NUWw6$DGc7u9G2L@yebf*IlJ3-vbpa7&5q3i|*21bU-`T;NNgC|3UKonRQ zNHc;s3=F~hA#{j7l(vS@V6p+Oj3I;{DlZJB#i6t`l$M9m%1~MzN^3Jr&JPsVs0Ri) UG6u>z0C58lgMb1MI{+~Q0P{3dB>(^b diff --git a/gui.c b/gui.c index 5b9f228..cf974a5 100644 --- a/gui.c +++ b/gui.c @@ -71,6 +71,9 @@ const uint8_t gui_list_123[N_123+1] = LIST_123; uint8_t text_select[GUI_TITLE_SELECT_N] = GUI_TITLE_SELECT; uint8_t text_save[GUI_TITLE_SAVE_N] = GUI_TITLE_SAVE; +const uint8_t TEXT_KEYBOARD[12][GUI_KEYBOARD_N] = GUI_KEYBOARD; +const uint8_t *text_keyboard; + /* event handling */ inline void add_gui_event(const uint16_t event) @@ -944,8 +947,10 @@ inline void gui_event_options (const uint16_t event) if (gui_choice != 1) lcd_select_button(gui_choice, 0); gui_choice = 1; + make_text_keyboard(); lcd_select_button(1, 1); lcd_update_title(GUI_TITLE_OPTION_TRANSPOSE); + lcd_update_button(-1, text_keyboard, 0); } else if (event & BUTTON_C) { @@ -989,6 +994,8 @@ inline void gui_event_options (const uint16_t event) { set_transp(0); make_text_transpose(); + make_text_keyboard(); + lcd_update_button(-1, text_keyboard, 0); lcd_update_button(1, text_transpose, gui_choice == 1); reject_gui_events(); } @@ -1064,6 +1071,8 @@ inline void gui_event_options (const uint16_t event) set_transp(transp - 1); } make_text_transpose(); + make_text_keyboard(); + lcd_update_button(-1, text_keyboard, 0); lcd_update_button(1, text_transpose, 1); break; case 2: @@ -1499,6 +1508,19 @@ inline void make_text_transpose (void) text_transpose[x]='\0'; } +inline void make_text_keyboard (void) +{ + int8_t i; + + i = transp; + while (i < 0) + i += 12; + while (i >= 12) + i -= 12; + + text_keyboard = TEXT_KEYBOARD[i]; +} + inline void make_text_midi_in (void) { uint8_t x = GUI_BUTTONTEXT_MIDI_IN_INSERT; diff --git a/gui.h b/gui.h index 89c376b..2155127 100644 --- a/gui.h +++ b/gui.h @@ -165,6 +165,38 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND #define GUI_TITLE_SAVE_INSERT 16 +#define GUI_KEYBOARD_BASE "\x80\x81\x83\x84\x90\x92\x94\x90\x91\x93\x94" + +#define GUI_KEYBOARD_0 " \x80\x82\x84" GUI_KEYBOARD_BASE "CDEFGAH" +#define GUI_KEYBOARD_1 "\x88\x8A\x8C\x98\x9A\x9D\x9F\x80\x82\x84" GUI_KEYBOARD_BASE " F C" +#define GUI_KEYBOARD_2 " \x95\x96 \x85\x86\x80\x82\x84" GUI_KEYBOARD_BASE "DE GAH " +#define GUI_KEYBOARD_3 "\x8B\x8C \x9B\x9D\x9F \x80\x82\x84" GUI_KEYBOARD_BASE " FG CD" +#define GUI_KEYBOARD_4 "\x95\x97\x99 \x85\x87\x89\x80\x82\x84" GUI_KEYBOARD_BASE "E AH " +#define GUI_KEYBOARD_5 " \x9E\x9F \x80\x82\x84" GUI_KEYBOARD_BASE "FGA CDE" +#define GUI_KEYBOARD_6 "\x98\x9A\x9C\x85\x87\x8A\x8C\x80\x82\x84" GUI_KEYBOARD_BASE " H " +#define GUI_KEYBOARD_7 " \x95\x96\x80\x82\x84" GUI_KEYBOARD_BASE "GAHCDE " +#define GUI_KEYBOARD_8 "\x9B\x9D\x9F\x88\x8A\x8C \x80\x82\x84" GUI_KEYBOARD_BASE " C FG" +#define GUI_KEYBOARD_9 " \x85\x86 \x95\x97\x99\x80\x82\x84" GUI_KEYBOARD_BASE "AH DE " +#define GUI_KEYBOARD_10 "\x9E\x9F \x8B\x8C \x80\x82\x84" GUI_KEYBOARD_BASE " CD FGA" +#define GUI_KEYBOARD_11 "\x85\x87\x89\x95\x97\x9A\x9C\x80\x82\x84" GUI_KEYBOARD_BASE "H E " + +#define GUI_KEYBOARD { \ + GUI_KEYBOARD_0, \ + GUI_KEYBOARD_1, \ + GUI_KEYBOARD_2, \ + GUI_KEYBOARD_3, \ + GUI_KEYBOARD_4, \ + GUI_KEYBOARD_5, \ + GUI_KEYBOARD_6, \ + GUI_KEYBOARD_7, \ + GUI_KEYBOARD_8, \ + GUI_KEYBOARD_9, \ + GUI_KEYBOARD_10, \ + GUI_KEYBOARD_11 \ +} + +#define GUI_KEYBOARD_N 29 + #define GET_JOG() ((JOG_A ? JOG_L : 0) ^ (JOG_B ? JOG_H : 0)) @@ -237,6 +269,7 @@ inline uint8_t convert_wave(int8_t x); inline void make_text_tuning (void); inline void make_text_transpose (void); +inline void make_text_keyboard (void); inline void make_text_midi_in (void); inline void make_text_midi_out (void); inline void make_text_select (void); -- 2.30.2