Possible bug with text search range
Sam Ross <[email protected]> Wed, 18 Mar 2026 13:28:12 +0100
| Newsgroups | gmane.comp.multimedia.puredata.general |
|---|---|
| Message-ID | <CAKj+5=ALoX=SW_HGT9LeN1-qUO=_fuX_V5ShK-pj1Zb3vge-eA@mail.gmail.com> |
Hello all, I'm working on a midi sequencer and have encountered what may be a bug. The attached patch should hopefully be self-explanatory: I am using [text search] to locate repeated instances of the same cc number and update them if present, or insert as a new line if not. I first specify the range using standardised messages. I get strange behaviour depending at which point in the sequence I start, with [text search] returning results outside the requested range on some occasions. Perhaps this is better off on github but I'm not totally familiar with it and thought I'd try here first. Thanks for any help, including letting me know if it (doesn't) work for you. I'm on 0.56.2 on Debian 13. All the best, Sam. --- [email protected] - the Pure Data mailinglist https://lists.iem.at/hyperkitty/list/[email protected]/message/X3ZAJLAZDTH3ZXRPAY6MMQRCDWGWNZF4/ To unsubscribe send an email to [email protected] mailing list UNSUBSCRIBE and account-management -> https://lists.iem.at/
set-a-step-bug.pd
(text/x-puredata, 3.7 KB)
#N canvas 222 106 1286 895 12; #X msg 255 485 range \$1 \$2; #X obj 401 384 pack; #X obj 536 340 text search \$0/lane; #X obj 401 408 t l l; #X obj 440 819 text insert \$0/lane; #X msg 537 305 list END \$1; #X obj 500 629 unpack; #X obj 304 820 text set \$0/lane; #X obj 241 718 route 0 1; #X obj 161 624 sel -1; #X obj 241 694 list append; #X msg 173 658 1; #X obj 231 623 t b f, f 29; #X msg 233 653 0; #X obj 241 742 list; #X obj 281 743 list; #X text 596 821 0=overwrite/1=insert; #X obj 486 705 spigot 0; #X obj 560 704 spigot 1; #X obj 585 629 tgl 19 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000 0 1; #X obj 630 705 == 0; #X obj 585 653 t f f; #X text 641 653 insert before: start/end (default end); #X obj 743 428 text define \$0/lane; #X obj 365 340 text search \$0/lane; #X msg 365 306 list STEP \$1; #X obj 364 255 t f f; #X obj 105 63 hsl 162 19 0 127 0 0 empty empty midi-value -2 -10 0 12 #fcfcfc #000000 #000000 0 1; #X obj 105 96 i; #X obj 105 120 change; #X obj 364 171 f; #X obj 402 172 + 1; #X floatatom 364 219 5 0 0 0 - - - 0; #X obj 105 144 t f b; #X msg 753 272 clear; #X obj 806 296 until; #X obj 806 320 f; #X obj 841 321 + 1; #X msg 806 344 STEP \$1 \, END \$1; #X obj 806 394 text set \$0/lane 1e+06; #X obj 806 368 list; #X msg 843 271 0; #X floatatom 155 574 5 0 0 0 - - - 0; #X obj 135 406 t l l; #X obj 144 519 text search \$0/lane 0 2 3; #X msg 135 430 list \$1 \$3 \$4; #X msg 806 272 8; #X obj 364 195 mod 8; #X floatatom 410 57 5 0 0 2 start-step - - 0; #X obj 412 87 t f b; #X obj 752 233 t b b b; #X text 446 168 0 \, 1 - works \; 2 \, 3 - skips n-1 \; 4 \, 5 - skips * 2 \; 6 \, 7 - skips *3 \, *4; #X msg 644 50 click; #X listbox 260 447 20 0 0 0 - - - 0; #X text 501 517 (a simplified version of a midi sequencer with insert/overwrite functionality based on text search); #X obj 88 322 list prepend cc; #X obj 88 269 list append 74; #X obj 88 297 list append 1; #X floatatom 188 233 5 0 0 2 cc-n - - 0; #X text 749 70 #0. click text to view \; #1. set start-step \; #2. change midi-value \; #3. observe that although the range is updating correctly \, the search returns results outside range for part of the cycle \, which part depending on start-step. \; #4. changing the cc-n has some effect but doesn't eliminate the issue (subsequent cc-n seems ok \, but in returning to earlier ones problem returns).; #X connect 0 0 44 0; #X connect 1 0 3 0; #X connect 2 0 1 1; #X connect 3 0 53 0; #X connect 3 1 6 0; #X connect 5 0 2 0; #X connect 6 0 17 0; #X connect 6 1 18 0; #X connect 8 0 14 0; #X connect 8 1 15 0; #X connect 9 0 11 0; #X connect 9 1 12 0; #X connect 10 0 8 0; #X connect 11 0 10 0; #X connect 12 0 13 0; #X connect 12 1 7 1; #X connect 13 0 10 0; #X connect 14 0 7 0; #X connect 15 0 4 0; #X connect 17 0 4 1; #X connect 18 0 4 1; #X connect 19 0 21 0; #X connect 20 0 18 1; #X connect 21 0 17 1; #X connect 21 1 18 1; #X connect 24 0 1 0; #X connect 25 0 24 0; #X connect 26 0 25 0; #X connect 26 1 5 0; #X connect 27 0 28 0; #X connect 28 0 29 0; #X connect 29 0 33 0; #X connect 30 0 31 0; #X connect 30 0 47 0; #X connect 31 0 30 1; #X connect 32 0 26 0; #X connect 33 0 56 0; #X connect 33 1 30 0; #X connect 34 0 23 0; #X connect 35 0 36 0; #X connect 36 0 37 0; #X connect 36 0 38 0; #X connect 37 0 36 1; #X connect 38 0 40 0; #X connect 40 0 39 0; #X connect 41 0 36 1; #X connect 42 0 9 0; #X connect 43 0 45 0; #X connect 43 1 10 1; #X connect 44 0 42 0; #X connect 45 0 44 0; #X connect 46 0 35 0; #X connect 47 0 32 0; #X connect 48 0 49 0; #X connect 49 0 30 1; #X connect 49 1 50 0; #X connect 50 0 46 0; #X connect 50 1 41 0; #X connect 50 2 34 0; #X connect 52 0 23 0; #X connect 53 0 0 0; #X connect 55 0 43 0; #X connect 56 0 57 0; #X connect 57 0 55 0; #X connect 58 0 56 1;