From 246db1ac371ac8a5b2c1ac029f27f67c82ff8d80 Mon Sep 17 00:00:00 2001 From: probonopd Date: Tue, 5 Apr 2022 19:17:38 +0200 Subject: [PATCH 1/5] Add picture [ci skip] --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 358b181..9e0538a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # MiniDexed ![](https://github.com/probonopd/MiniDexed/actions/workflows/build.yml/badge.svg) -![image](https://user-images.githubusercontent.com/2480569/161439882-99932f84-5abb-4a43-9fd5-87fb491f12a2.png) +![minidexed](https://user-images.githubusercontent.com/2480569/161813414-bb156a1c-efec-44c0-802a-8926412a08e0.jpg) [Dexed](https://asb2m10.github.io/dexed/) is a FM synthesizer closely modeled on the famous DX7 by a well-known Japanese manufacturer. MiniDexed is a port to run it on a bare metal Raspberry Pi (without a Linux kernel or operating system). __This is a work in progress. Contributions are highly welcome.__ From d6b4748425eb07d817292e29cd6297be63b15a45 Mon Sep 17 00:00:00 2001 From: probonopd Date: Tue, 5 Apr 2022 19:18:32 +0200 Subject: [PATCH 2/5] Remove WIP [ci skip] --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9e0538a..f4dfc80 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ![minidexed](https://user-images.githubusercontent.com/2480569/161813414-bb156a1c-efec-44c0-802a-8926412a08e0.jpg) -[Dexed](https://asb2m10.github.io/dexed/) is a FM synthesizer closely modeled on the famous DX7 by a well-known Japanese manufacturer. MiniDexed is a port to run it on a bare metal Raspberry Pi (without a Linux kernel or operating system). __This is a work in progress. Contributions are highly welcome.__ +[Dexed](https://asb2m10.github.io/dexed/) is a FM synthesizer closely modeled on the famous DX7 by a well-known Japanese manufacturer. MiniDexed is a port to run it on a bare metal Raspberry Pi (without a Linux kernel or operating system). ## TODO From 200f8807df79234817b75490adf4eeccb03ba0d3 Mon Sep 17 00:00:00 2001 From: probonopd Date: Tue, 5 Apr 2022 19:20:13 +0200 Subject: [PATCH 3/5] Update description [ci skip] --- README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index f4dfc80..b76b865 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,9 @@ ![minidexed](https://user-images.githubusercontent.com/2480569/161813414-bb156a1c-efec-44c0-802a-8926412a08e0.jpg) -[Dexed](https://asb2m10.github.io/dexed/) is a FM synthesizer closely modeled on the famous DX7 by a well-known Japanese manufacturer. MiniDexed is a port to run it on a bare metal Raspberry Pi (without a Linux kernel or operating system). +[Dexed](https://asb2m10.github.io/dexed/) is a FM synthesizer closely modeled on the famous DX7 by a well-known Japanese manufacturer. MiniDexed is a port to run it on a bare metal Raspberry Pi (without a Linux kernel or operating system). On Raspberry Pi 2 and larger, it can run 8 Dexed instances, basically creating an open source equivalent of the TX802 (8 DX7 instances without the keyboard in one box). -## TODO - - Contributions are highly welcome. +## Features - [x] Get [Synth_Dexed](https://codeberg.org/dcoredump/Synth_Dexed) to build with [circle-stdlib](https://github.com/smuehlst/circle-stdlib) - [x] Upload SD card contents to [GitHub Releases](../../releases) @@ -32,7 +30,7 @@ - [x] Add reverb effect - [ ] Make it possible to assign voice parameters to sliders and knobs on MIDI controllers -I am wondering whether we can run multiple Dexed instances, in order to recreate basically an open source equivalent of the TX802 (8 DX7 instances without the keyboard in one box). +Contributions are highly welcome. ## Usage From 0549529ca8fed605d93b879ed473946b6905e9d8 Mon Sep 17 00:00:00 2001 From: probonopd Date: Tue, 5 Apr 2022 19:29:50 +0200 Subject: [PATCH 4/5] Spelling fix [ci skip] --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b76b865..716559f 100644 --- a/README.md +++ b/README.md @@ -50,11 +50,11 @@ Contributions are highly welcome. ## Pinout -All devices on Raspberry Pi GPIOs are optional. +All devices on Raspberry Pi GPIOs are **optional**. __CAUTION:__ All GPIO numbers are [chip numbers](https://pinout.xyz/), not header positions. -|GPIO | Device | | Function | Direction | Commant| +|GPIO | Device | | Function | Direction | Comment| |---|---|---|---|---|---| |14 | UART | | TXD | | OUT | | serial MIDI| |15 | UART | | RXD | | IN | | serial MIDI| From 9c5dea76b078ed7ef69d99e7d65eab9498030929 Mon Sep 17 00:00:00 2001 From: Rene Stange Date: Tue, 5 Apr 2022 20:00:24 +0200 Subject: [PATCH 5/5] Add shortcut for changing the TG in parameter edit (#70) When a parameter is edited in the UI, the current TG can be changed by pressing the switch and turning the knob left or right. The selected TG remains active, when the parameter editor is left. The menu home position is entered by triple click now, reboot after holding the switch for ten seconds. --- src/uimenu.cpp | 59 +++++++++++++++++++++++++++++++++++++++++-- src/uimenu.h | 4 +++ src/userinterface.cpp | 25 +++++++++++++----- src/userinterface.h | 1 + 4 files changed, 80 insertions(+), 9 deletions(-) diff --git a/src/uimenu.cpp b/src/uimenu.cpp index 2b1ddc7..c139586 100644 --- a/src/uimenu.cpp +++ b/src/uimenu.cpp @@ -37,6 +37,7 @@ const CUIMenu::TMenuItem CUIMenu::s_MenuRoot[] = {0} }; +// inserting menu items before "TG1" affect TGShortcutHandler() const CUIMenu::TMenuItem CUIMenu::s_MainMenu[] = { {"TG1", MenuHandler, s_TGMenu, 0}, @@ -328,8 +329,7 @@ void CUIMenu::MenuHandler (CUIMenu *pUIMenu, TMenuEvent Event) break; default: - assert (0); - break; + return; } if (pUIMenu->m_pCurrentMenu) // if this is another menu? @@ -422,6 +422,11 @@ void CUIMenu::EditVoiceBankNumber (CUIMenu *pUIMenu, TMenuEvent Event) CMiniDexed::TGParameterVoiceBank, nValue, nTG); break; + case MenuEventPressAndStepDown: + case MenuEventPressAndStepUp: + pUIMenu->TGShortcutHandler (Event); + return; + default: return; } @@ -465,6 +470,11 @@ void CUIMenu::EditProgramNumber (CUIMenu *pUIMenu, TMenuEvent Event) pUIMenu->m_pMiniDexed->SetTGParameter (CMiniDexed::TGParameterProgram, nValue, nTG); break; + case MenuEventPressAndStepDown: + case MenuEventPressAndStepUp: + pUIMenu->TGShortcutHandler (Event); + return; + default: return; } @@ -512,6 +522,11 @@ void CUIMenu::EditTGParameter (CUIMenu *pUIMenu, TMenuEvent Event) pUIMenu->m_pMiniDexed->SetTGParameter (Param, nValue, nTG); break; + case MenuEventPressAndStepDown: + case MenuEventPressAndStepUp: + pUIMenu->TGShortcutHandler (Event); + return; + default: return; } @@ -559,6 +574,11 @@ void CUIMenu::EditVoiceParameter (CUIMenu *pUIMenu, TMenuEvent Event) pUIMenu->m_pMiniDexed->SetVoiceParameter (nParam, nValue, CMiniDexed::NoOP, nTG); break; + case MenuEventPressAndStepDown: + case MenuEventPressAndStepUp: + pUIMenu->TGShortcutHandler (Event); + return; + default: return; } @@ -607,6 +627,11 @@ void CUIMenu::EditOPParameter (CUIMenu *pUIMenu, TMenuEvent Event) pUIMenu->m_pMiniDexed->SetVoiceParameter (nParam, nValue, nOP, nTG); break; + case MenuEventPressAndStepDown: + case MenuEventPressAndStepUp: + pUIMenu->TGShortcutHandler (Event); + return; + default: return; } @@ -808,3 +833,33 @@ string CUIMenu::ToOscillatorDetune (int nValue) return Result; } + +void CUIMenu::TGShortcutHandler (TMenuEvent Event) +{ + assert (m_nCurrentMenuDepth >= 2); + assert (m_MenuStackMenu[0] = s_MainMenu); + unsigned nTG = m_nMenuStackSelection[0]; + assert (nTG < CConfig::ToneGenerators); + assert (m_nMenuStackItem[1] == nTG); + assert (m_nMenuStackParameter[1] == nTG); + + assert ( Event == MenuEventPressAndStepDown + || Event == MenuEventPressAndStepUp); + if (Event == MenuEventPressAndStepDown) + { + nTG--; + } + else + { + nTG++; + } + + if (nTG < CConfig::ToneGenerators) + { + m_nMenuStackSelection[0] = nTG; + m_nMenuStackItem[1] = nTG; + m_nMenuStackParameter[1] = nTG; + + EventHandler (MenuEventUpdate); + } +} diff --git a/src/uimenu.h b/src/uimenu.h index a590a82..9f85716 100644 --- a/src/uimenu.h +++ b/src/uimenu.h @@ -42,6 +42,8 @@ public: MenuEventHome, MenuEventStepDown, MenuEventStepUp, + MenuEventPressAndStepDown, + MenuEventPressAndStepUp, MenuEventUnknown }; @@ -98,6 +100,8 @@ private: static std::string ToOscillatorMode (int nValue); static std::string ToOscillatorDetune (int nValue); + void TGShortcutHandler (TMenuEvent Event); + private: CUserInterface *m_pUI; CMiniDexed *m_pMiniDexed; diff --git a/src/userinterface.cpp b/src/userinterface.cpp index f504d9d..058f14e 100644 --- a/src/userinterface.cpp +++ b/src/userinterface.cpp @@ -34,6 +34,7 @@ CUserInterface::CUserInterface (CMiniDexed *pMiniDexed, CGPIOManager *pGPIOManag m_pLCD (0), m_pLCDBuffered (0), m_pRotaryEncoder (0), + m_bSwitchPressed (false), m_Menu (this, pMiniDexed) { } @@ -177,12 +178,22 @@ void CUserInterface::EncoderEventHandler (CKY040::TEvent Event) { switch (Event) { + case CKY040::EventSwitchDown: + m_bSwitchPressed = true; + break; + + case CKY040::EventSwitchUp: + m_bSwitchPressed = false; + break; + case CKY040::EventClockwise: - m_Menu.EventHandler (CUIMenu::MenuEventStepUp); + m_Menu.EventHandler (m_bSwitchPressed ? CUIMenu::MenuEventPressAndStepUp + : CUIMenu::MenuEventStepUp); break; case CKY040::EventCounterclockwise: - m_Menu.EventHandler (CUIMenu::MenuEventStepDown); + m_Menu.EventHandler (m_bSwitchPressed ? CUIMenu::MenuEventPressAndStepDown + : CUIMenu::MenuEventStepDown); break; case CKY040::EventSwitchClick: @@ -193,17 +204,17 @@ void CUserInterface::EncoderEventHandler (CKY040::TEvent Event) m_Menu.EventHandler (CUIMenu::MenuEventSelect); break; + case CKY040::EventSwitchTripleClick: + m_Menu.EventHandler (CUIMenu::MenuEventHome); + break; + case CKY040::EventSwitchHold: - if (m_pRotaryEncoder->GetHoldSeconds () >= 3) + if (m_pRotaryEncoder->GetHoldSeconds () >= 10) { delete m_pLCD; // reset LCD reboot (); } - else - { - m_Menu.EventHandler (CUIMenu::MenuEventHome); - } break; default: diff --git a/src/userinterface.h b/src/userinterface.h index 6f29d5c..437993a 100644 --- a/src/userinterface.h +++ b/src/userinterface.h @@ -64,6 +64,7 @@ private: CWriteBufferDevice *m_pLCDBuffered; CKY040 *m_pRotaryEncoder; + bool m_bSwitchPressed; CUIMenu m_Menu; };