hi, nice to see the different ways in Pd to get to the same destination, thanks to all for the replies
Le 25/09/2020 à 12:18, IOhannes m zmölnig a écrit : > On 2020-09-25 00:30, Benjamin ~ b01 wrote: >> hi, >> >> I'm looking for a fast way to convert two 8 bit data to one 16 bit data >> in big lists >> a device send continuously packets of 16 000 bytes threw the network to >> udpreceive >> at the moment, to reconstitute from two bytes a 16 bit value, I'm using >> a list-drip and a counter to discriminate the MSB and LSB and do the >> *256 and + operation >> the aim is to feed a table with the result (see attached) and produce >> sound from it >> it works with packets of 2 000 bytes but pd freeze with bigger packets >> I'm wondering if there is a better way to achieve this ? > [...] > > doing quick benchmarks gives the following results: > > | implemtation | time (length=100000) | > |------------------|----------------------| > | 1 (repack/array) | 1.8ms | > | 2 (repack/tab) | 9.9ms | > | 3 (list/array) | 8.6ms | > | 4 (list/tab) | 9.8ms | > | 5 (list-drip/tab)| 29.8ms | > repack/array (attached) was indeed much faster, I can now receive packets of 32768 bytes and convert them in 16 bit values, put them in a table and play them without audio drops > but nowhere do i experience anything like *freezing* Pd. first tests were made with an old celeron laptop doing something else at the same time (I should try again), tests above were made on a i5 CPU @ 2.30GHz > afaict, you should do more benchmarking to find out where the actual > bottleneck(s) in your patch is (resp: are). it might *not* be the > conversion from bytes to short integers. I would say : 1. list-drip 2. conversion from bytes to short integers thks again ++ benjamin > > gsmt > IOhannes > > > > _______________________________________________ > [email protected] mailing list > UNSUBSCRIBE and account-management -> > https://lists.puredata.info/listinfo/pd-list
#N canvas 6 56 1478 773 10; #X obj 107 162 * 256; #X obj 107 194 +; #X obj 107 110 repack 2; #X obj 107 135 unpack f f; #X obj 107 220 - 32768; #X obj 107 243 / 32768; #X obj 107 317 array set echodata; #N canvas 0 50 450 250 (subpatch) 0; #X array echodata 10 float 3; #A 0 0.0285714 -1.78814e-07 0.0142856 0.0142856 0.0142856 0.0142856 0.0142856 0.0142856 0.0142856 0.0142856; #X coords 0 1 10 -1 200 140 1 0 0; #X restore 225 133 graph; #X obj 107 268 repack 10; #X msg 107 66 256 0 0 0 127 0 200 256 100 256 92 256 25 256 50 256 0 256 127 256; #X connect 0 0 1 0; #X connect 1 0 4 0; #X connect 2 0 3 0; #X connect 3 0 0 0; #X connect 3 1 1 1; #X connect 4 0 5 0; #X connect 5 0 8 0; #X connect 8 0 6 0; #X connect 9 0 2 0;
_______________________________________________ [email protected] mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
