From 20df8dfa669f9ef70b591c01a67c1e2b133a40a6 Mon Sep 17 00:00:00 2001 From: Making Sound Machines Date: Thu, 1 Aug 2024 14:12:07 +0200 Subject: fixes Encoder response for headphone volume --- plink0A5.bin | Bin 0 -> 1048576 bytes plink0A5.uf2 | Bin 0 -> 873984 bytes sw/Core/Src/config.h | 3 ++- sw/Core/Src/edit.h | 4 +++- sw/Core/Src/params.h | 2 +- 5 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 plink0A5.bin create mode 100644 plink0A5.uf2 diff --git a/plink0A5.bin b/plink0A5.bin new file mode 100644 index 0000000..5cf9f11 Binary files /dev/null and b/plink0A5.bin differ diff --git a/plink0A5.uf2 b/plink0A5.uf2 new file mode 100644 index 0000000..31039bb Binary files /dev/null and b/plink0A5.uf2 differ diff --git a/sw/Core/Src/config.h b/sw/Core/Src/config.h index 682230e..2451839 100755 --- a/sw/Core/Src/config.h +++ b/sw/Core/Src/config.h @@ -54,4 +54,5 @@ // 0.A2 - Allows for playing notes from the touch surface over a recorded sequence. Still buggy. In touch.h #define MERGE_PLAYBACK 1 // 0.A3 - Fixes a USB bug in which some hosts wouldn't recognize Plinky. New startup sequence is plinky_init(), then midiinit(). // 0.A4 - Disabled MERGE_PLAYBACK in touch.h. DISABLE_AUTOSAVE flag enables Demo Mode - changes are not written to flash. Disables ProgramPage() in params.h -#define VERSION2 "v0.A4" +// 0.A5 - Encoder fix +#define VERSION2 "v0.A5" diff --git a/sw/Core/Src/edit.h b/sw/Core/Src/edit.h index e521dc7..10f530f 100755 --- a/sw/Core/Src/edit.h +++ b/sw/Core/Src/edit.h @@ -148,7 +148,9 @@ void finger_editing(int fi, int frame) { cur += ev * (FULL / maxi); } else { - cur += (int)floorf(0.5f + ev * maxf(1.f, encaccel * encaccel)); + int ev_sens = 1; + if (pi == P_HEADPHONE) ev_sens = 4; + cur += (int)floorf(0.5f + ev * ev_sens * maxf(1.f, encaccel * encaccel)); #ifdef DEBUG DebugLog("%d\r\n", (int)(maxf(1.f, encaccel * encaccel) * 100)); #endif diff --git a/sw/Core/Src/params.h b/sw/Core/Src/params.h index 532eac7..905cf3d 100755 --- a/sw/Core/Src/params.h +++ b/sw/Core/Src/params.h @@ -808,7 +808,7 @@ void EditParamNoQuant(u8 paramidx, u8 mod, s16 data) { return; if (paramidx == P_HEADPHONE) { if (mod == M_BASE) { - data = clampi(-45, (data / (FULL / 64)) - 45, 18); + data = clampi(-45, ((data + (FULL/128)) / (FULL / 64)) - 45, 18); if (data == sysparams.headphonevol) return; sysparams.headphonevol = data; -- cgit v1.2.3