Forums > MaxMSP

Picture – sound converter

February 24, 2006 | 1:12 pm

I want to make a picture sound converter. The four corners of the picture will be represented by four surround speakers. Colour will be mapped on to sound frequency.
My problem is :

how do I read the rgb for all the pixels on an image simoultaneously.
At the moment im using an lcd object but cant work out how to read the rgb/pixel position from it…..

Any ideas ?


February 24, 2006 | 6:31 pm

basically :
what object allows me to read in a jpg/pict and output the rgb and grey scale values for each pixel ?


February 24, 2006 | 7:14 pm

suckah does the job I think.

Ed


February 24, 2006 | 7:17 pm

jit.qt.movie is the obvious choice for reading a jpeg. To get a
cell’s value as a max message, there is the matrix method getcell or
the object jit.iter. Might I suggest a run though the tutorials? I
think this would be covered there.

best,
wes


February 24, 2006 | 7:26 pm

gnee wrote:
> basically :
> what object allows me to read in a jpg/pict and output the rgb and grey scale values for each pixel ?

Jitter.

There’s no real way to do it without Jitter in Max.



NRB
February 25, 2006 | 11:31 am

Hello Augustine,

I’m amazed to see this post, i’m working exactly the same project at the moment! The project evolves from a project I produced last year involving colour frequency spectrum in relation to sound frequency and, you guessed it, four surround speakers. I called it the ‘Surround Canvas’ technique.

Would be interesting to hear about your progression.

NRB.


February 25, 2006 | 3:44 pm

NRB -

LOL ! Great minds eh ?
Its for my third year module on the sonic arts course at middlesex, I have to make a user friendly pluggin.
It occurred to me other picture/sound converters I used were unsatisfactory. For one thing they are time based whereas a picture is perceived in an instant. Also using the y axis to define frequency seemed unsatisfactory to me as well, colour makes much more sense. Using surround sound should give a static "sound picture" (of course the logical progression for this idea is to have a speaker for each pixel heheh).
What is more a picture is not represented in one dimension – aline -it is represented in two – a square – thus the four or more speakers.
On the whole it just seems more logical to represent with sound a picture in this way. Film of course changes over time and may be more compatable with music for this reason.
Anyway what did you use to read the pixels off ?

..
.
.


February 25, 2006 | 3:51 pm

Thanks for all the other replies – very useful !


February 26, 2006 | 10:01 am

Before Jitter I did something like that in Max reading data from a
raw pict file with "filein" object .
prehistoric but very economical cal
k


February 26, 2006 | 12:43 pm

> gnee wrote:
>> basically :
>> what object allows me to read in a jpg/pict and output the rgb and
>> grey scale values for each pixel ?
>
> Jitter.
>
> There’s no real way to do it without Jitter in Max.

There is a very real way to do this in max – LCD with the ‘getpixel’ message.

john.


February 27, 2006 | 5:30 pm

Of course you are right I should indeed go through the tutorials, and I will ! However I have to do this quite quickly and it takes time to get through all those tutorials to find just one tiny bit of information !

I tried as you suggested and it is perfect – it gives out the rgb for each pixel into ltocoll > coll. however how do I get the greyscale readings ?

thanks again for your replies .

Quote: wesley.hoke@gmail.com wrote on Fri, 24 February 2006 12:17
—————————————————-
> jit.qt.movie is the obvious choice for reading a jpeg. To get a
> cell’s value as a max message, there is the matrix method getcell or
> the object jit.iter. Might I suggest a run though the tutorials? I
> think this would be covered there.
>
> best,
> wes
>
>
>
—————————————————-


February 27, 2006 | 7:16 pm

this may or may not be what you are looking for. if you improve it, it would be cool if you would pm it back to me.

-oliver

max v2;
#N vpatcher 39 50 1192 812;
#P origin 0 6;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 560 246 72 196617 loadmess 100;
#P number 632 148 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 548 76 52 196617 select 15;
#P number 546 168 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#N vpatcher 312 297 1032 724;
#P origin 12 223;
#P window setfont "Sans Serif" 9.;
#P number 485 167 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P outlet 410 341 15 0;
#P inlet 368 72 15 0;
#P newex 404 309 27 196617 / 2;
#P number 398 286 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 398 263 27 196617 / 3;
#P newex 397 237 27 196617 +;
#P newex 434 199 27 196617 +;
#P number 436 167 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 395 166 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 356 141 112 196617 unpack 0 0 0 0 0 0 0 0;
#P newex 339 106 51 196617 route val;
#P connect 9 0 0 0;
#P connect 0 0 1 0;
#P connect 0 1 1 0;
#P connect 1 5 2 0;
#P connect 2 0 5 0;
#P connect 5 0 6 0;
#P connect 6 0 7 0;
#P connect 7 0 8 0;
#P connect 8 0 10 0;
#P connect 4 0 5 1;
#P connect 3 0 4 0;
#P connect 1 6 3 0;
#P connect 11 0 4 1;
#P connect 1 7 11 0;
#P pop;
#P newobj 551 143 52 196617 p avg256;
#P button 238 79 15 0;
#P newex 546 192 51 196617 split 110;
#P number 613 42 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 607 276 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 568 276 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 547 299 52 196617 makenote;
#P newex 564 335 43 196617 noteout;
#N counter 15;
#X flags 0 0;
#P newobj 575 103 66 196617 counter 15;
#N counter 15;
#X flags 0 0;
#P newobj 521 48 66 196617 counter 15;
#P toggle 718 64 77 0;
#P newex 592 69 58 196617 metro 500;
#P number 482 49 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 442 50 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 442 71 27 196617 pak;
#P message 475 86 70 196617 getcell $1 $2;
#P user jit.pwindow 303 159 183 171 0 1 1 0 1 0;
#P newex 444 110 117 196617 jit.matrix 4 char 16 16;
#P message 292 79 27 196617 stop;
#P flonum 323 58 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 323 79 42 196617 rate $1;
#P message 260 79 28 196617 read;
#P flonum 195 58 35 9 0.5 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 176 58 15 0;
#P newex 176 79 58 196617 metro 500;
#P newex 231 108 144 196617 jit.qt.movie 320 240;
#P user jit.pwindow 95 144 200 174 0 1 1 1 1 0;
#P connect 1 0 0 0;
#P connect 3 0 2 0;
#P connect 4 0 2 1;
#P connect 2 0 1 0;
#P fasten 6 0 1 0 328 101 236 101;
#P fasten 8 0 1 0 297 101 236 101;
#P fasten 5 0 1 0 265 101 236 101;
#P connect 25 0 1 0;
#P connect 9 0 10 0;
#P connect 7 0 6 0;
#P connect 18 0 13 0;
#P connect 13 0 12 0;
#P connect 1 0 9 0;
#P connect 11 0 9 0;
#P connect 14 0 12 1;
#P connect 12 0 11 0;
#P connect 17 0 14 0;
#P connect 15 0 17 0;
#P connect 26 0 27 0;
#P connect 27 0 24 0;
#P connect 24 0 20 0;
#P connect 17 0 28 0;
#P connect 9 1 26 0;
#P connect 20 0 19 0;
#P connect 30 0 21 0;
#P connect 21 0 20 1;
#P connect 28 0 18 0;
#P connect 20 1 19 1;
#P connect 22 0 20 2;
#P connect 16 0 15 0;
#P connect 9 1 29 0;
#P connect 23 0 15 1;
#P pop;



NRB
May 1, 2006 | 1:37 pm

Hello Oliver,

Are you still using the forums. E-mail me when possible.

Thanks,

NRB


May 1, 2006 | 1:56 pm

For any on interested the soution turned out to be using jit spill > and an rgb to hsl converter.


May 1, 2006 | 11:01 pm

if you want to do this without jitter and you
know about picture formats you could open
anything as binary data using [filein] …


May 1, 2006 | 11:53 pm

That might be an option for a future project if it makes thing more efficient cant be bad. The idea is to make a real time musical instrument.


Viewing 16 posts - 1 through 16 (of 16 total)