[PD] Text object in PdDroid (insert and delete)

Arnault Malgat arnault.malgat at gmail.com
Mon Jul 9 17:53:33 CEST 2018


Hi,

I'm trying to design a patch for PdDroidParty in wich I need to dynamically
modifie the content of a [text] object, but [text insert] and [text delete]
don't seems to work.
Is it even possible or should I try to figure a way using lists (wich would
be drag since I can't find how to make [list store] work either) ?

This patch does not involve audio treatment at all but is a 4/4 bar rythm
generator for my percussions students.
Each rythm is an image wich appear on a canvas (they were initially drawed
using [filledcurved] and [drawpolygon] but as only GUI objects are shown by
PdDroid, it's the easiest way around i've thinked of when I decided to make
it usable on tablets)
The canvas receives are listed in a [text define -k rythme_list] object and
randomly selected to be shown or not.
As the knowledge of rythm depends on the student's level, I need this rythm
list to be editable from inside the patch (so I don't have to edit it all
along the year for each of my pupils). That's where [text insert] and [text
delet] comes at play.
It works fine on Pd but does not on my android device.

The patch with comment, if needed, is attached.

Thanks

Arnult

Bonjour,

Je cherche à réaliser un patch utilisable avec PdDroidParty dans lequel
j'ai besoin de pouvoir éditer dynamiquement les données contenu dans un
objet [text]. Cependant, je ne parviens pas a faire fonctionner ni [text
insert], ni [text delete], ces objets sont-ils sup^porté ou me faut-il
envisager de repenser la chose en n'utilisant que des list (ce qui ne va
pas être aisé puisque je ne parviens pas à utiliser [list store] non plus) ?

Ce patch n'implique aucun traitement audio, iul s'agit d'un générateur de
rythme sur une mesure à 4 temps pour mes élèves percussionnistes.
Chaque rythme est une image svg qui s'affiche sur un canvas (ils étaient
initiallement dessinés via [drawpolygon] et [filledcurve], mais comme
PdDroid n'affiche que les GUI, c'est la manière la plus simple qui me soit
venu à l'esprit pour en faire une version utilisable sur android).
Les receive des canvas sont stockés dans un objet [text define -k
rythme_list] et sélectionnés aléatoirement pour générer une mesure à 4
temps.
La maîtrise des rythmes dépendant du niveau de l'élève, il faut que cette
list soit modifiable depuis le patch (afin de m'éviter d'en réaliser une
version par élèves à chaque moment de l'année), ce pour quoi je
souhaiterais utiliser [text insert] et [text delete].

Le patch commenté est joint, à toute fin utile.

Merci

Arnault

#N canvas 201 120 499 276 10;#X obj 1 207 text define -k rythme_list;#A set
mi \; di \; ka \; ta \;;#N canvas -8 -8 1366 726 gen 0;#X obj 200 16 cnv 15
120 120 empty empty coord 20 12 0 14 -233017 -66577
0;#X obj 57 13 r generate;#X obj 57 44 t b b;
#N canvas -8 -8 1366 726 reset 0;
#X obj 44 14 inlet;
#X msg 44 81 \; \$1 pos 500 500;
#X obj 44 48 list split 1;
#X obj 9 49 t l;
#X connect 0 0 2 0;
#X connect 2 0 1 0;
#X connect 2 1 3 0;
#X connect 3 0 2 0;
#X restore 47 402 pd reset;
#N canvas -8 -8 1366 726 save_state 0;
#X obj 81 124 list prepend;
#X msg 81 82 \$1\$2;
#X obj 81 46 inlet;
#X obj 24 99 inlet;
#X text 81 25 state;
#X text 23 80 bang;
#X obj 57 294 outlet;
#X obj 81 163 t l;
#X obj 57 236 list;
#X obj 18 147 t b b b;
#X connect 0 0 7 0;
#X connect 1 0 0 0;
#X connect 2 0 1 0;
#X connect 3 0 9 0;
#X connect 7 0 0 1;
#X connect 7 0 8 1;
#X connect 8 0 6 0;
#X connect 9 0 8 1;
#X connect 9 1 0 1;
#X connect 9 2 8 0;
#X restore 47 368 pd save_state;
#N canvas -204 7 1366 719 instructions 0;
#N canvas 708 35 454 358 list_gen 0;
#X obj 63 115 text search rythme_list, f 11;
#X obj 63 90 symbol;
#X obj 63 156 sel -1;
#X obj 226 246 list;
#X obj 226 269 text insert rythme_list, f 11;
#X obj 29 268 text delete rythme_list, f 12;
#X obj 114 11 inlet;
#X obj 2 308 outlet;
#X obj 2 195 t b f;
#X obj 63 189 t b b;
#X obj 114 58 t l l;
#X obj 114 36 list;
#X text 147 122 text search works;
#X text 110 260 can't find a way to make this work, f 13;
#X text 299 263 can't find a way to make this work, f 14;
#X connect 0 0 2 0;
#X connect 1 0 0 0;
#X connect 2 0 9 0;
#X connect 2 1 8 0;
#X connect 3 0 4 0;
#X connect 6 0 11 0;
#X connect 8 0 7 0;
#X connect 8 1 5 0;
#X connect 9 0 7 0;
#X connect 9 1 3 0;
#X connect 10 0 1 0;
#X connect 10 1 3 1;
#X connect 11 0 10 0;
#X restore 433 115 pd list_gen;
#X obj 400 255 random;
#X obj 433 197 text size rythme_list;
#X obj 400 294 text get rythme_list;
#X obj 433 81 r rythme;
#X obj 442 167 loadbang;
#X msg 212 114 4;
#N canvas -8 -8 1600 818 uzi 0;
#X obj 27 142 until;
#X obj 26 173 f;
#X obj 72 174 + 1;
#X obj 137 255 sel;
#X obj 152 218 - 1;
#X msg 137 297 0;
#X obj 62 82 t f f;
#X obj 85 446 outlet;
#X obj 62 50 inlet;
#X obj 28 379 t f b;
#X obj 27 443 outlet;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X connect 1 0 3 0;
#X connect 1 0 9 0;
#X connect 2 0 1 1;
#X connect 3 0 5 0;
#X connect 4 0 3 1;
#X connect 5 0 1 1;
#X connect 6 0 0 0;
#X connect 6 1 4 0;
#X connect 8 0 6 0;
#X connect 9 0 10 0;
#X connect 9 1 7 0;
#X restore 212 148 pd uzi;
#N canvas -8 -8 1366 726 offset 0;
#X obj 96 174 +;
#X obj 96 140 *;
#X obj 96 278 outlet;
#X obj 33 52 inlet;
#X obj 111 50 inlet;
#X obj 205 50 inlet;
#X text 36 31 uzi;
#X text 201 30 x offset;
#X text 97 29 canvas size x;
#X obj 282 49 inlet;
#X obj 107 230 pack f f;
#X text 277 30 y offset;
#X connect 0 0 10 0;
#X connect 1 0 0 0;
#X connect 3 0 1 0;
#X connect 4 0 1 1;
#X connect 5 0 0 1;
#X connect 9 0 10 1;
#X connect 10 0 2 0;
#X restore 211 275 pd offset;
#X obj 211 374 list prepend;
#X obj 212 185 t f f;
#X obj 211 349 list prepend;
#X obj 280 313 + 1;
#X msg 211 484 \; \$1\$2 pos \$3 \$4;
#X obj 324 497 outlet;
#X obj 212 80 inlet;
#X obj 277 80 inlet;
#X obj 317 80 inlet;
#X obj 357 80 inlet;
#X text 508 109 add/remove rythm from generation list, f 20;
#X text 564 197 text size works;
#X text 525 294 text get works;
#X connect 0 0 2 0;
#X connect 1 0 3 0;
#X connect 2 0 1 1;
#X connect 3 0 9 1;
#X connect 4 0 0 0;
#X connect 5 0 2 0;
#X connect 6 0 7 0;
#X connect 7 0 10 0;
#X connect 7 1 1 0;
#X connect 8 0 11 0;
#X connect 9 0 13 0;
#X connect 9 0 14 0;
#X connect 10 0 8 0;
#X connect 10 1 12 0;
#X connect 11 0 9 0;
#X connect 12 0 11 1;
#X connect 15 0 6 0;
#X connect 16 0 8 1;
#X connect 17 0 8 2;
#X connect 18 0 8 3;
#X restore 122 301 pd instructions;
#X msg 285 48 110;
#X msg 286 80 40;
#X msg 285 106 100;
#X text 202 109 canva size x;
#X text 267 79 x;
#X text 267 48 y;
#X obj 329 14 loadbang;
#X text 135 369 keep list of shown canvas;
#X text 102 404 send back shown canvas off screen;
#X text 222 290 randomly select and move canvas on screen, f 17;
#X obj 11 265 r clear;
#X connect 1 0 2 0;
#X connect 2 0 5 0;
#X connect 2 1 4 0;
#X connect 4 0 3 0;
#X connect 5 0 4 1;
#X connect 6 0 5 3;
#X connect 7 0 5 2;
#X connect 8 0 5 1;
#X connect 12 0 6 0;
#X connect 12 0 7 0;
#X connect 12 0 8 0;
#X connect 16 0 4 0;
#X restore 60 240 pd gen;
#N canvas -8 -8 1366 726 add 0;
#N canvas -8 -8 1366 726 uzi 0;
#X obj 27 142 until;
#X obj 26 173 f;
#X obj 72 174 + 1;
#X obj 137 255 sel;
#X obj 152 218 - 1;
#X msg 137 297 0;
#X obj 62 82 t f f;
#X obj 85 446 outlet;
#X obj 62 50 inlet;
#X obj 28 379 t f b;
#X obj 27 443 outlet;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X connect 1 0 3 0;
#X connect 1 0 9 0;
#X connect 2 0 1 1;
#X connect 3 0 5 0;
#X connect 4 0 3 1;
#X connect 5 0 1 1;
#X connect 6 0 0 0;
#X connect 6 1 4 0;
#X connect 8 0 6 0;
#X connect 9 0 10 0;
#X connect 9 1 7 0;
#X restore 42 121 pd uzi;
#X obj 72 196 symbol;
#X msg 42 96 4;
#X obj 44 60 t b a;
#X obj 42 249 list prepend;
#X obj 42 176 + 1;
#X text 12 24 name;
#X msg 42 284 \; pd-droidparty_main.pd obj 500 500 cnv 50 100 50 \$1
\$1\$2 \$1 20 12 2 14 10 2;
#X msg 45 23 ta;
#X connect 0 0 5 0;
#X connect 1 0 4 1;
#X connect 2 0 0 0;
#X connect 3 0 2 0;
#X connect 3 1 1 0;
#X connect 4 0 7 0;
#X connect 5 0 4 0;
#X connect 8 0 3 0;
#X restore 1 240 pd add;
#X obj 500 500 cnv 50 100 50 mi mi2 mi 20 12 2 14 -233017 -66577 0
;
#X obj 500 500 cnv 50 100 50 mi mi3 mi 20 12 2 14 -233017 -66577 0
;
#X obj 500 500 cnv 50 100 50 mi mi4 mi 20 12 2 14 -233017 -66577 0
;
#X obj 500 500 cnv 50 100 50 di di1 di 20 12 2 14 -233017 -66577 0
;
#X obj 500 500 cnv 50 100 50 di di2 di 20 12 2 14 -233017 -66577 0
;
#X obj 500 500 cnv 50 100 50 di di3 di 20 12 2 14 -233017 -66577 0
;
#X obj 500 500 cnv 50 100 50 di di4 di 20 12 2 14 -233017 -66577 0
;
#X obj 500 500 cnv 50 100 50 ka ka1 ka 20 12 2 14 -233017 -66577 0
;
#X obj 500 500 cnv 50 100 50 ka ka2 ka 20 12 2 14 -233017 -66577 0
;
#X obj 500 500 cnv 50 100 50 ka ka3 ka 20 12 2 14 -233017 -66577 0
;
#X obj 500 500 cnv 50 100 50 ka ka4 ka 20 12 2 14 -233017 -66577 0
;
#X obj 500 500 cnv 50 100 50 ta ta1 ta 20 12 2 14 -233017 -66577 0
;
#X obj 500 500 cnv 50 100 50 ta ta2 ta 20 12 2 14 -233017 -66577 0
;
#X obj 500 500 cnv 50 100 50 ta ta3 ta 20 12 2 14 -233017 -66577 0
;
#X obj 500 500 cnv 50 100 50 ta ta4 ta 20 12 2 14 -233017 -66577 0
;
#N canvas -8 -8 1366 686 interface 0;
#X msg 13 204 ta;
#X msg 20 161 ka;
#X msg 33 119 di;
#X msg 49 77 mi;
#X msg 82 37 taka;
#X msg 128 36 tadi;
#X msg 173 35 tami;
#X msg 264 36 kami;
#X msg 308 37 dimi;
#X msg 218 36 kadi;
#X msg 352 47 takadi;
#X msg 357 92 takami;
#X msg 363 137 tadimi;
#X msg 371 181 kadimi;
#X msg 375 227 takadimi;
#X obj 13 183 r ta;
#X obj 20 140 r ka;
#X obj 33 98 r di;
#X obj 49 55 r mi;
#X obj 82 15 r taka;
#X obj 128 15 r tadi;
#X obj 173 14 r tami;
#X obj 218 14 r kadi;
#X obj 264 13 r kami;
#X obj 308 13 r dimi;
#X obj 352 24 r takadi;
#X obj 357 69 r takami;
#X obj 363 113 r tadimi;
#X obj 371 158 r kadimi;
#X obj 375 203 r takadimi;
#X obj 186 310 outlet;
#X obj 14 232 r chut;
#X msg 14 255 chut;
#X connect 0 0 30 0;
#X connect 1 0 30 0;
#X connect 2 0 30 0;
#X connect 3 0 30 0;
#X connect 4 0 30 0;
#X connect 5 0 30 0;
#X connect 6 0 30 0;
#X connect 7 0 30 0;
#X connect 8 0 30 0;
#X connect 9 0 30 0;
#X connect 10 0 30 0;
#X connect 11 0 30 0;
#X connect 12 0 30 0;
#X connect 13 0 30 0;
#X connect 14 0 30 0;
#X connect 15 0 0 0;
#X connect 16 0 1 0;
#X connect 17 0 2 0;
#X connect 18 0 3 0;
#X connect 19 0 4 0;
#X connect 20 0 5 0;
#X connect 21 0 6 0;
#X connect 22 0 9 0;
#X connect 23 0 7 0;
#X connect 24 0 8 0;
#X connect 25 0 10 0;
#X connect 26 0 11 0;
#X connect 27 0 12 0;
#X connect 28 0 13 0;
#X connect 29 0 14 0;
#X connect 31 0 32 0;
#X connect 32 0 30 0;
#X restore 245 209 pd interface;
#X obj 245 239 s rythme;
#X obj 16 10 bng 50 250 50 0 generate empty gen 17 22 0 10 -262144
-1 -1;
#X obj 166 6 bng 50 250 50 0 clear empty clear 14 22 0 10 -262144 -1
-1;
#X obj 290 8 bng 15 250 50 0 ta empty ta 17 7 0 10 -262144 -1 -1;
#X obj 290 27 bng 15 250 50 0 ka empty ka 17 7 0 10 -262144 -1 -1;
#X obj 290 44 bng 15 250 50 0 di empty di 17 7 0 10 -262144 -1 -1;
#X obj 290 62 bng 15 250 50 0 mi empty mi 17 7 0 10 -262144 -1 -1;
#X obj 500 500 cnv 50 100 50 mi mi1 mi 20 12 2 14 -233017 -66577 0
;
#X text 68 4 randomly move canvas with svg imagesto build a 4/4 mesure
, f 15;
#X text 327 203 receive bang from ta/ka/di/mi bang and send rythme
message to list_gen subpatch, f 25;
#X text 321 -2 supposed to add or delete lines in rythme_list text
object (work on Pc but not on Droidparty (see list_gen subpatch embed
in the instruction subpatch inside gen subpatch, f 26;
#X connect 18 0 19 0;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20180709/d9e7c95e/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: droidparty_main.pd
Type: application/octet-stream
Size: 8820 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20180709/d9e7c95e/attachment-0001.obj>


More information about the Pd-list mailing list