From cc8d737f8a68ace07b5590e36fb44b8d793a73ce Mon Sep 17 00:00:00 2001 From: "5684185+vsariola@users.noreply.github.com" <5684185+vsariola@users.noreply.github.com> Date: Sun, 1 Feb 2026 13:02:42 +0200 Subject: [PATCH] change(tracker): midi controller value 64 maps to 64 in Sointu side --- tracker/midi.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tracker/midi.go b/tracker/midi.go index 4d73ac3..23c6950 100644 --- a/tracker/midi.go +++ b/tracker/midi.go @@ -243,7 +243,10 @@ func (m *MIDIModel) handleControlEvent(e ControlChange) { if err != nil { return } - newVal := (e.Value*(t.Max-t.Min)+63)/127 + t.Min + // +62 is chose so that the center position of a typical MIDI controller, + // which is 64, maps to 64 of a 0..128 range Sointu parameter. From there + // on, 65 maps to 66 and, importantly, 127 maps to 128. + newVal := (e.Value*(t.Max-t.Min)+62)/127 + t.Min if m.d.Song.Patch[i].Units[u].Parameters[t.Param] == newVal { return }