summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaking Sound Machines <40341903+makingsoundmachines@users.noreply.github.com>2024-08-01 14:17:52 +0200
committerGitHub <noreply@github.com>2024-08-01 14:17:52 +0200
commit8069312a15ce3e60286a49e72bb80a7fad43d32c (patch)
treeb738d4b0196eb9d534bfc13bc24e07f2f3323c3d
parentad566c3ab1ff5500d26b7c96da3fa9cc3be9f36b (diff)
parent20df8dfa669f9ef70b591c01a67c1e2b133a40a6 (diff)
downloadplinky-8069312a15ce3e60286a49e72bb80a7fad43d32c.tar.gz
Merge pull request #20 from makingsoundmachines/main
Fixes encoder response for headphone volume
-rw-r--r--plink0A5.binbin0 -> 1048576 bytes
-rw-r--r--plink0A5.uf2bin0 -> 873984 bytes
-rwxr-xr-xsw/Core/Src/config.h3
-rwxr-xr-xsw/Core/Src/edit.h4
-rwxr-xr-xsw/Core/Src/params.h2
5 files changed, 6 insertions, 3 deletions
diff --git a/plink0A5.bin b/plink0A5.bin
new file mode 100644
index 0000000..5cf9f11
--- /dev/null
+++ b/plink0A5.bin
Binary files differ
diff --git a/plink0A5.uf2 b/plink0A5.uf2
new file mode 100644
index 0000000..31039bb
--- /dev/null
+++ b/plink0A5.uf2
Binary files 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;