Forums > Jitter

Newbie:How to random read movie files?

May 2, 2008 | 9:29 pm

hi, advanced users!

I’m new to Jitter, and I have a bit of experiences in Max/Msp and PD.

I wanted to randomly read in 22 .mov clips in a folder.
So, I tried to change the clip names from 1 to 22 then I used
[random 22] object attached to [read $1( message box,
and...it opens os x's file browser window!!

Then I tried to use [umenu] but no success…

Can you guys please give me a tip on how to randomly choose .mov files inside a folder then read in to Jitter?

‘hope that I made myself clear with my poor english…

thanks!!


May 2, 2008 | 9:34 pm

this should do the trick :

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 282 227 63 196617 jit.qt.movie;
#P newex 282 183 68 196617 prepend read;
#P user ubumenu 237 156 100 196617 0 1 1 0;
#X add;
#X prefix_set 0 0 0;
#P window linecount 5;
#P comment 352 152 100 196617 < select your folder in the inspector (cmd-i) , and check the 'auto-populate' box;
#P connect 2 0 3 0;
#P connect 1 1 2 0;
#P window clipboard copycount 4;


May 2, 2008 | 9:56 pm

thanks for the hyper quick reply.

well, it remains two problem…

first, when [random 22] object attached, and when I push the button attached to [random], it still pops up the browser window,
however, in the umenu, I see the [random] did its job.
(one of the files are displayed in the umenu)

second, it won’t read the movie file.

when I simply click on [read 18(, it will read the file named 18, but in this way, nothing on the screen, not an error message in the max window….

any idea??


May 2, 2008 | 10:01 pm

there’s got to be something wrong with your patch… if you paste the bit that causing you trouble, it will be better to tell you what’s wrong.


May 2, 2008 | 10:21 pm

hi,

try this patch, it works here fine. I expanded it a bit: If you mix pictures and movies the pics will take less cpu…

have fun

Falk


May 2, 2008 | 10:32 pm

the attached file works fine with max media folder.
but when I auto-populate the umenu with my folder, I have tones of error messages saying-

random: doesn’t understand "int"

and some movies are playing but not the ones showing in the umenu.

did I do something wrong in files naming maybe?

I’ve named 1,2,3,4 then c05, c06….c22.

I’ve placed the movie folder in Max search path as explained in the manual.

I upload the patch that I’ve did before in case.

thanks!


May 2, 2008 | 10:34 pm

oh, one more thing.

I did not put the .mov extension after the file name as I imagined that I’ll directly use [random] object,

but it reads in anyway when I use just [read filename( message…


May 2, 2008 | 10:47 pm

D’oh… wont be able to read your patch. Just tried to start max 5 with iLok still in,… now I guess my demo will be finished :(

The error message you get sounds a bit odd, sounds like you’re sending a number to the random object instead of a bang. I can only speculate now, since I won’t be able to see your patch.
All I can say is that this works for me:

#P user jit.pwindow 281 251 82 62 0 1 0 0 1 0;
#P toggle 184 111 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 184 132 52 196617 metro 40;
#P button 237 111 15 0;
#P newex 327 175 61 196617 route count;
#P message 306 131 34 196617 count;
#P newex 237 131 43 196617 random;
#P newex 282 228 63 196617 jit.qt.movie;
#P newex 282 207 68 196617 prepend read;
#P user ubumenu 237 156 100 196617 0 1 1 0;
#X add;
#X prefix_set 0 0 "Macintosh HD:/Users/headlock/Pictures/" 0;
#P window linecount 4;
#P comment 403 132 100 196617 click this to set the range of the random object to the nr. of items in the ubumenu;
#P window linecount 1;
#P comment 342 132 100 196617 < <<<<<<<<<<;
#P connect 4 0 11 0;
#P fasten 9 0 4 0 189 226 287 226;
#P connect 10 0 9 0;
#P connect 8 0 5 0;
#P connect 5 0 2 0;
#P fasten 7 0 5 1 332 194 389 194 389 128 275 128;
#P connect 2 2 7 0;
#P fasten 6 0 2 0 311 152 242 152;
#P connect 3 0 4 0;
#P connect 2 1 3 0;
#P window clipboard copycount 12;


May 2, 2008 | 10:52 pm

Thanks for the patch,

I think I’ve had some ideas on how to random.

but I think the problem comes from my movie files…

it’s final cut files, and since I can play those in quicktime player, I thought that it’s possible to play in jitter too.

but maybe not…I’ll try to convert my files than re-try…


May 2, 2008 | 10:55 pm

some general things:

1. you have to use the middle outlet of the menu to get filenames.

if you have spaces within a filepath or filenam like mac HD/Users/your name/bla bla… you have to use quotes like: "mac HD/Users/your name/bla bla" see the object tosymbol or sprintf "%s"

2. sprintf can help you to make things clearer like

sprintf read filename%i.mov

if you get an int into the inlet it will produce: read filename1.mov, read filename2.mov, etc.

3.never use spaces in filenames or foldernames it


May 2, 2008 | 10:57 pm

you have the leftmost outlet of the umenu connected, which reports the
item index. connect the middle outlet instead.

~s

On Sat, May 3, 2008 at 12:32 AM, djeho wrote:
> the attached file works fine with max media folder.
> but when I auto-populate the umenu with my folder, I have tones of error messages saying-
>
> random: doesn’t understand "int"
>
> and some movies are playing but not the ones showing in the umenu.
>
> did I do something wrong in files naming maybe?
>
> I’ve named 1,2,3,4 then c05, c06….c22.
>
> I’ve placed the movie folder in Max search path as explained in the manual.
>
> I upload the patch that I’ve did before in case.
>
> thanks!


May 2, 2008 | 11:12 pm

I did a stupid mistake.

actually finalCut movie files are REFERENCE files, not actual movie files.

it’s normal that I always saw the same image, but not edited one…so I’ve imagined that it didn’t random…

and I didn’t know that umenu’s leftmost outlet outputs the numbers…that’s why I’ve got such an error messages.

I’m very sorry to bother you guys because of my dumb mistake.

But I’ve learned a lot more than 2 hours in front of docs from this foruming, thank you very much, really nice community.

I’ll refer to those two patches that you guys gave me to make something work out and I certainely bother you guys more with other questions!!!

thanks agian, ‘wish you guys a nice day!


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