Update of /cvsroot/pure-data/externals/aalex In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19502
Added Files: markov-machine-help.pd markov-machine.pd Log Message: Adding the markov machine abstraction.
--- NEW FILE: markov-machine-help.pd --- #N canvas 290 25 528 547 10; #X text 132 380 current state; #X msg 221 149 size 4; #X obj 138 111 t b b b b b; #X msg 221 170 row 1 1 2 3 4; #X obj 88 331 markov-machine 4; #X text 60 9 States are numbered from 1 to n.; #X text 283 147 Already implied by argument.; #X msg 215 192 row 2 4 3 2 1; #X msg 220 215 row 3 200 300 4000 0; #X msg 220 238 row 4 1 1 1 1; #X text 337 240 Equal chances; #X obj 4 153 cnv 15 50 50 empty empty empty 20 12 0 14 -258699 -66577 0; #X obj 86 60 cnv 15 50 50 empty empty empty 20 12 0 14 -258699 -66577 0; #X msg 18 165 next; #X msg 91 66 bang; #X obj -34 245 cnv 15 50 50 empty empty empty 20 12 0 14 -258699 -66577 0; #X msg -30 257 set 1; #X text 92 43 1 Setup; #X text 4 133 2 Get state; #X text -34 225 3 Set state; #X msg 276 294 content; #X obj -40 -118 cnv 15 450 125 empty empty empty 20 12 0 14 -258699 -66577 0; #X obj 277 -17 iemmatrix; #X obj 370 -17 zexy; #X text -26 -117 )c( Copyleft 2006 Alexandre Quessy http://alexandre.quessy.net/ ; #X text 71 -16 Using -lib iemmatrix , zexy; #X text 374 -134 ABOUT; #X obj 138 87 loadbang; #X text 210 331 A four states weighted FSM; #X obj 88 364 nbx 1 28 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 24 -258699 -1 -1 0 256; #X text -26 -86 [markov-machine] is a weighted finite states machine using an adjacency matrix for storing probabilities to obtain every other state next , It can be illustrated as an oriented graph. Probabilities are calculated on the sum of each numbers or every row.; #X connect 1 0 4 0; #X connect 2 0 9 0; #X connect 2 1 8 0; #X connect 2 2 7 0; #X connect 2 3 3 0; #X connect 2 4 1 0; #X connect 3 0 4 0; #X connect 4 0 29 0; #X connect 7 0 4 0; #X connect 8 0 4 0; #X connect 9 0 4 0; #X connect 13 0 4 0; #X connect 14 0 2 0; #X connect 16 0 4 0; #X connect 20 0 4 0; #X connect 27 0 2 0;
--- NEW FILE: markov-machine.pd --- #N canvas 637 33 900 932 10; #X obj 93 -33 inlet; #X obj 154 644 cnv 15 600 200 empty empty empty 20 12 0 14 -258699 -66577 0; #X obj 407 257 cnv 15 200 300 empty empty empty 20 12 0 14 -258699 -66577 0; #X obj 97 351 cnv 15 200 150 empty empty empty 20 12 0 14 -258699 -66577 0; #X obj 130 110 cnv 15 200 150 empty empty empty 20 12 0 14 -258699 -66577 0; #X obj 179 155 matrix; #X obj 225 115 prepend row; #X msg 139 119 zeros $1; #X obj 18 23 loadbang; #X obj 20 50 f $1; #X obj 111 396 f; #X text 138 398 current state; #X obj 12 755 outlet; #X obj 456 325 drip; #X obj 495 326 sum; #X obj 469 403 /; #X obj 159 456 random 1e+06; #X obj 159 480 / 1e+06; #X text 218 482 1/1000000; #X msg 574 339 set; #X msg 443 485 0.4 0.7 0.9 1; #X msg 468 430 add2 $1; #X msg 409 351 bang; #X obj 177 704 moses; #X obj 223 706 moses; #X obj 271 706 moses; #X obj 317 708 moses; #X obj 364 708 moses; #X obj 410 710 moses; #X obj 458 710 moses; #X obj 504 712 moses; #X obj 546 713 moses; #X obj 589 713 moses; #X obj 635 715 moses; #X obj 677 716 moses; #X obj 292 661 unpack f f f f f f f f f f f f f f; #X obj 178 819 f; #X obj 159 428 t b f; #X msg 245 418 row $1; #X text 207 822 next state; #X obj 16 694 f; #X obj 12 292 t b f; #X text 54 288 sets state; #X obj 67 311 t b b; #X text 109 309 gets next state; #X text 452 515 threshold (n/1.0) for each state according to its probability ; #X text 20 -5 arg: size; #X obj 453 364 +; #X msg 530 329 0; #X obj 451 274 t b a a b b; #X obj 518 373 f; #X text 509 402 Each treshold is added to all the numbers before... ; #X obj 161 250 mtx_print; #X obj 267 195 print debug; #X msg 178 733 1; #X msg 226 731 2; #X msg 266 734 3; #X msg 323 735 4; #X msg 365 737 5; #X msg 415 734 6; #X msg 453 738 7; #X msg 509 740 8; #X msg 551 742 9; #X msg 599 740 10; #X msg 639 743 11; #X msg 695 745 12; #X obj 145 359 loadbang; #X msg 144 378 1; #X obj 160 193 route matrix; #X obj 160 229 prepend matrix; #X text 667 624 MARKOV CHAIN; #X text 427 242 WEIGHTS FOR THIS ROW/STATE; #X text 260 332 STATE; #X text 219 90 ADJACENCY MATRIX; #X obj 423 -27 cnv 15 450 125 empty empty empty 20 12 0 14 -258699 -66577 0; #X obj 706 74 iemmatrix; #X obj 799 74 zexy; #N canvas 0 0 485 139 todo 0; #N canvas 0 0 450 300 1008-dynamic 0; #X restore 69 65 pd $0-dynamic; #X text 67 43 todo: dynamic patching for unlimited number of states ; #X text 67 93 todo: use [list] and not dynamic messages (faster?); #X restore 775 -20 pd todo; #X text 437 -26 )c( Copyleft 2006 Alexandre Quessy http://alexandre.quessy.net/ ; #X text 500 75 Using -lib iemmatrix , zexy; #X text 435 18 [markov-machine] is a weighted finite states machine using an adjency matrix for storing probabilities to get to each other state , It can be illustrated as an oriented graph.; #X text 837 -43 ABOUT; #X msg 23 126 bang; #X obj 93 -7 route size row next set content; #X obj 261 25 t b; #X connect 0 0 83 0; #X connect 5 0 68 0; #X connect 6 0 5 0; #X connect 7 0 5 0; #X connect 8 0 9 0; #X connect 9 0 7 0; #X connect 10 0 37 0; #X connect 10 0 40 1; #X connect 13 0 47 0; #X connect 14 0 15 1; #X connect 15 0 21 0; #X connect 16 0 17 0; #X connect 17 0 23 0; #X connect 19 0 20 0; #X connect 20 0 35 0; #X connect 21 0 20 0; #X connect 22 0 20 0; #X connect 23 0 54 0; #X connect 23 1 24 0; #X connect 24 0 55 0; #X connect 24 1 25 0; #X connect 25 0 56 0; #X connect 25 1 26 0; #X connect 26 0 57 0; #X connect 26 1 27 0; #X connect 27 0 28 0; #X connect 27 0 58 0; #X connect 28 0 59 0; #X connect 28 1 29 0; #X connect 29 0 60 0; #X connect 29 1 30 0; #X connect 30 0 61 0; #X connect 30 1 31 0; #X connect 31 0 62 0; #X connect 31 1 32 0; #X connect 32 0 63 0; #X connect 32 1 33 0; #X connect 33 0 64 0; #X connect 33 1 34 0; #X connect 34 0 65 0; #X connect 35 0 23 1; #X connect 35 1 24 1; #X connect 35 2 25 1; #X connect 35 3 26 1; #X connect 35 4 27 1; #X connect 35 5 28 1; #X connect 35 7 29 1; #X connect 35 9 30 1; #X connect 35 10 31 1; #X connect 35 11 32 1; #X connect 35 12 33 1; #X connect 35 13 34 1; #X connect 36 0 10 1; #X connect 37 0 16 0; #X connect 37 1 38 0; #X connect 38 0 5 0; #X connect 40 0 12 0; #X connect 41 0 40 0; #X connect 41 1 10 0; #X connect 43 0 40 0; #X connect 43 1 10 0; #X connect 47 0 50 0; #X connect 48 0 47 1; #X connect 49 0 22 0; #X connect 49 1 13 0; #X connect 49 2 14 0; #X connect 49 3 48 0; #X connect 49 4 19 0; #X connect 50 0 47 1; #X connect 50 0 15 0; #X connect 54 0 36 0; #X connect 55 0 36 0; #X connect 56 0 36 0; #X connect 57 0 36 0; #X connect 58 0 36 0; #X connect 59 0 36 0; #X connect 60 0 36 0; #X connect 61 0 36 0; #X connect 62 0 36 0; #X connect 63 0 36 0; #X connect 64 0 36 0; #X connect 65 0 36 0; #X connect 66 0 67 0; #X connect 67 0 10 1; #X connect 68 1 49 0; #X connect 69 0 52 0; #X connect 82 0 5 0; #X connect 83 0 7 0; #X connect 83 1 6 0; #X connect 83 2 43 0; #X connect 83 3 41 0; #X connect 83 4 84 0; #X connect 84 0 5 0;