summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMaking Sound Machines <roland@makingsoundmachines.com>2024-04-01 19:56:04 +0200
committerMaking Sound Machines <roland@makingsoundmachines.com>2024-04-01 19:56:04 +0200
commite1956aea7483f4d5559217442e9e154be562eb54 (patch)
treea06cfeb815c749a35179c47895f7172ee48136c3 /sw
parent9fa7cd56b220f992eb63054e6548b9235faa5748 (diff)
downloadplinky-e1956aea7483f4d5559217442e9e154be562eb54.tar.gz
0.A2 merges recorded and live touch playback
Diffstat (limited to 'sw')
-rwxr-xr-xsw/Core/Src/config.h2
-rwxr-xr-xsw/Core/Src/touch.h47
2 files changed, 34 insertions, 15 deletions
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;