I'm going to describe a bit my project first, for you to understand why I'm trying to do weird things.
My project is to use audio effects (like EQ, filters, comp, …) to modify an image at the same time than a sound.
I first tried some fun stuff with audacity. Open you image in audacity (using import > raw data), apply fun effects, export it, and finally open the file as an image. It become fun when you use delay, reverb, flanger, …
But the image you get is "one shot", and I now want to use it as a live tool, when I modify the sound you hear, it modify the image at the same time using the same method.
But image data are wrote like these (R value for pix1, G value for pix1, B value for pix1, R value for pix2, G value for pix2, B value for pix 2, ……)
Thats the kind of "signal" I get when I open the image with audacity
Using GEM library of PD, the [pix_pix2sig~] object output 3 different and distinct signals (R, G and B ). But if I want the same thing that I said above, I need to put every sample value of R, G and B signal in one signal by "concatenating" them.
In other words, from this occuring at the same time
[Rsample1, Rsample2, Rsample3, …]
[Vsample1, Vsample2, Vsample3, …]
[Bsample1, Bsample2, Bsample3, …]
I want a function that makes:
[Rsample1, Vsample1, Bsample1, Rsample2, Vsample2, Bsample2, Rsample3, ……]
Then I do some audio treatments, and convert it back into 3 parallels audio signals for RVB and put it in the [pix_sig2pix~] GEM object.
I find a way to do it, here's what i did.
I store each 3 waveforms in 3 corresponding arrays (each arrays in the size of the image, 16385 + 3 = 16387 for a 128x128 image)
Then I read each sample of these waveforms using [counter] and [tabread] and put them one by one in an array of size 3 times greater than the previous ones.
It works, but if I want to do it quickly (close to the sample rate) I need to bang the [counter] so frequently that PD start to lag drastically. It cannot treat so many scalar data in a such short time.
Is there a way to do it more "properlly", only in signal computation ?
I did some research but I didn't exactly know what to type…
Hope you can help me.
PS: Sorry if my english isn't correct, i'm french