From e1956aea7483f4d5559217442e9e154be562eb54 Mon Sep 17 00:00:00 2001 From: Making Sound Machines Date: Mon, 1 Apr 2024 19:56:04 +0200 Subject: 0.A2 merges recorded and live touch playback --- plink0A2.bin | Bin 0 -> 1048576 bytes plink0A2.uf2 | Bin 0 -> 873984 bytes sw/Core/Src/config.h | 2 +- sw/Core/Src/touch.h | 47 +++++++++++++++++++++++++++++++++-------------- 4 files changed, 34 insertions(+), 15 deletions(-) create mode 100644 plink0A2.bin create mode 100644 plink0A2.uf2 diff --git a/plink0A2.bin b/plink0A2.bin new file mode 100644 index 0000000..2a28245 Binary files /dev/null and b/plink0A2.bin differ diff --git a/plink0A2.uf2 b/plink0A2.uf2 new file mode 100644 index 0000000..c07604b Binary files /dev/null and b/plink0A2.uf2 differ diff --git a/sw/Core/Src/config.h b/sw/Core/Src/config.h index 57caea3..ad77997 100755 --- a/sw/Core/Src/config.h +++ b/sw/Core/Src/config.h @@ -49,4 +49,4 @@ // 0.9z - fix shimmer click? thanks hippo! // 0.A - USB MIDI Sync // 0.A1 - HW SERIAL MIDI SYNC & More CCs -#define VERSION2 "v0.A1" +#define VERSION2 "v0.A2" diff --git a/sw/Core/Src/touch.h b/sw/Core/Src/touch.h index 91c9a49..6df81d7 100755 --- a/sw/Core/Src/touch.h +++ b/sw/Core/Src/touch.h @@ -745,20 +745,39 @@ void finger_synth_update(int fi) { if (!want_recording_on) last_rec_step = 255; } - if (!any_fingers_down) { - - // read from pattern - FingerRecord *fr = readpattern(fi); - if (fr && (isplaying() || seq_rhythm.did_a_retrig)) { - read_from_seq = true; - - int pr = fr->pressure[phase0] * 12; - int pos = fr->pos[phase0 / 2]; - synth_dst_finger->pressure = (pr && !seq_rhythm.supress) ? randrange(pr, pr+12)-512 : -1024; - synth_dst_finger->pos = randrange(pos * 8, pos * 8 + 8); - synth_dst_finger->written = 1; - } - // read from latch +#define MERGE_PLAYBACK 1 + if (MERGE_PLAYBACK) { + // read from pattern + FingerRecord *fr = readpattern(fi); + if (fr && (isplaying() || seq_rhythm.did_a_retrig)) { + + int pr = fr->pressure[phase0] * 12; + int pos = fr->pos[phase0 / 2]; + pr = (pr && !seq_rhythm.supress) ? randrange(pr, pr+12)-512 : -1024; + if (pr > 0) { + read_from_seq = true; + synth_dst_finger->pressure = pr; + synth_dst_finger->pos = randrange(pos * 8, pos * 8 + 8); + synth_dst_finger->written = 1; + } + } + } + + if (!any_fingers_down) { + if (!MERGE_PLAYBACK) { + // read from pattern + FingerRecord *fr = readpattern(fi); + if (fr && (isplaying() || seq_rhythm.did_a_retrig)) { + read_from_seq = true; + + int pr = fr->pressure[phase0] * 12; + int pos = fr->pos[phase0 / 2]; + synth_dst_finger->pressure = (pr && !seq_rhythm.supress) ? randrange(pr, pr+12)-512 : -1024; + synth_dst_finger->pos = randrange(pos * 8, pos * 8 + 8); + synth_dst_finger->written = 1; + } + } + // read from latch bool latchon = ((rampreset.flags & FLAGS_LATCH)) ; if (latch_valid && latchon && shift_down != SB_CLEAR) { int latchvel = latch[fi].avgvel * 12; -- cgit v1.2.3