[PD] pix2sig and back

Peter P. peterparker at fastmail.com
Tue Oct 24 13:18:08 CEST 2017


Hi list,

I am trying to convert an audio signal to pixel data using pix_sig2pix~
and then back to audio data using pix_pix2sig~ without further
manipulations. Please see attached patch.

I do scale the audio signal from -1 to 1 to lie in a range compliant
to pixel data, which I assume to be 0 to 1.

Not having connected an input to the subpatch, this signal will hence be
0.5 and will display in the red color channel.

Converting that red channel back to audio signals and doing the opposite
scaling operation, I am getting a 51dB constant signal at the output
even without having attached a signal to the input of pix_sig2pix~.
Checking with a snapshot~ object indicates a constant signal of 0.003921

I assume this to be due to limited resolution numbers in the pixel data
and wonder what their resolution is?

Then I texture the pixel data onto a rectangle. This rectangle
does flicker and flip diagonally from time to time and I wonder if it is
an error on my machine only and where it could come from.

Also, I am getting an error message in the Pd console upon creating a
single pix_sig2pix~ object in an empty patch:
	GEM: Someone sent a bogus pointer to copy2Image
and am curious if this red error message is related to the above problem...

Thank you for all ideas and advice!
Peter
-------------- next part --------------
#N canvas 392 617 553 264 10;
#X declare -lib Gem;
#X obj 116 35 declare -lib Gem;
#X msg 153 86 \; pd dsp 1;
#X obj 36 137 gemwin;
#X msg 53 109 0 \, destroy;
#X msg 36 87 reset \, create \, 1;
#N canvas 523 48 337 518 reblockedSubpatch 0;
#X obj 47 426 pix_texture;
#X obj 47 92 gemhead;
#X obj 192 411 outlet~;
#X obj 195 18 inlet~;
#X obj 67 371 loadbang;
#X obj 47 25 block~ 16384;
#X obj 47 153 pix_sig2pix~ 128 128;
#X obj 196 57 +~ 1;
#X obj 196 95 *~ 0.5;
#X obj 193 337 *~ 2;
#X obj 193 370 -~ 1;
#X obj 47 293 pix_pix2sig~ 128 128;
#X obj 47 454 rectangle 3 3;
#X text 244 22 -1...1;
#X text 229 57 0...2;
#X text 245 95 0...1;
#X text 233 340 0...2;
#X text 233 371 -1...1;
#X msg 67 395 quality 0;
#X connect 0 0 12 0;
#X connect 1 0 6 0;
#X connect 3 0 7 0;
#X connect 4 0 18 0;
#X connect 6 0 11 0;
#X connect 7 0 8 0;
#X connect 8 0 6 0;
#X connect 9 0 10 0;
#X connect 10 0 2 0;
#X connect 11 0 0 0;
#X connect 11 1 9 0;
#X connect 18 0 0 0;
#X restore 274 58 pd reblockedSubpatch;
#X obj 275 103 env~;
#X floatatom 275 127 5 0 0 0 - - -, f 5;
#X obj 374 142 snapshot~;
#X obj 374 113 metro 100;
#X floatatom 374 173 9 0 0 0 - - -, f 9;
#X obj 374 84 loadbang;
#X text 432 174 <-not zero;
#X obj 36 52 t b b;
#X msg 36 26 bang;
#X text 14 25 1;
#X obj 275 18 sig~ 0;
#X connect 3 0 2 0;
#X connect 4 0 2 0;
#X connect 5 0 6 0;
#X connect 5 0 8 0;
#X connect 6 0 7 0;
#X connect 8 0 10 0;
#X connect 9 0 8 0;
#X connect 11 0 9 0;
#X connect 13 0 1 0;
#X connect 13 1 4 0;
#X connect 14 0 13 0;
#X connect 16 0 5 0;


More information about the Pd-list mailing list