URN OBJECT

Felix's icon

I have a problem with the urn object, it repeats always the same pattern or sequence (look for example to 3 consecutive numbers in the patch bellow, bang and look for them again...). How could i change this, and make the pattern or sequence more random?.
thanks,
Felix

Max Patch
Copy patch and select New From Clipboard in Max.

Jeremy's icon

I can't reproduce. What version of Max are you using, on what platform?

jb

Am 24.10.2006 um 17:54 schrieb Felix:

> I have a problem with the urn object, it repeats always the same
> pattern or sequence (look for example to 3 consecutive numbers in
> the patch bellow, bang and look for them again...). How could i
> change this, and make the pattern or sequence more random?.
> thenks,
> Felix

Felix's icon

i just open it in windows and OSX, and max/msp version 4.5.5.
Did you use the "new from clipboar", from the file menu?.
tried like this:

Max Patch
Copy patch and select New From Clipboard in Max.

thanks,
Felix

Jeremy's icon

Yes.

jb

Am 24.10.2006 um 18:18 schrieb Felix:

> i just open it in windows and OSX, and different max/msp versions.
> Did you use the "new from clipboar", from the file menu?.
> thanks,
> Felix

Roby Steinmetzer's icon
Felix's icon

Yes, that is one thing I also observed.
But I also see that urn always makes very similar sequence of numbers, and I want something more random …
See the attached doc file to better understand what I mean.
I copy the result of lists generated by the patch, and colored quickly some patterns that are repeated …
Thanks.
F

Trond Lossius's icon

Hi Felix,

do you know the scramble external? It is doing exactly what you want to
do here:

Max Patch
Copy patch and select New From Clipboard in Max.

Check maxobjects.com to find where to download it. I believe the most
recent version was compiled by Richard Dudas. Maybe it is at his share
page at C74 as part of the listop objects originally by McCartney.

Best,
Trond

Felix wrote:
> I have a problem with the urn object, it repeats always the same pattern or sequence (look for example to 3 consecutive numbers in the patch bellow, bang and look for them again...). How could i change this, and make the pattern or sequence more random?.
> thenks,
> Felix
>
> max v2;
> #N vpatcher 20 74 620 474;
> #P window setfont "Sans Serif" 9.;
> #P newex 189 119 40 9109513 uzi 9;
> #P button 189 95 15 0;
> #P message 190 253 195 9109513 4 8 6 7 2 0 1 5 3;
> #P newex 190 232 62 9109513 prepend set;
> #P newex 190 207 55 9109513 zl group 9;
> #P message 201 160 69 9109513 clear , seed 0;
> #P newex 190 183 43 9109513 urn 9 0;
> #P connect 5 0 6 0;
> #P fasten 1 0 0 0 206 179 195 179;
> #P fasten 6 0 0 0 194 179 195 179;
> #P connect 0 0 2 0;
> #P fasten 2 0 3 0 195 227 195 227;
> #P connect 3 0 4 0;
> #P fasten 0 1 1 0 228 203 273 203 273 157 206 157;
> #P pop;
> --

Peter Castine's icon

On around Oct 24, 2006, at 16:54, Felix said something like:
> I have a problem with the urn object, it repeats always the same
> pattern or sequence (look for example to 3 consecutive numbers in the
> patch bellow, bang and look for them again...). How could i change
> this, and make the pattern or sequence more random?.

Two ways.

The first improvement I would suggest is to use lp.ernie instead:

print: 2 3 1 6 5 4 7 0 8
print: 0 4 5 8 7 2 1 6 3
print: 6 2 7 3 5 8 0 4 1
print: 0 6 4 3 1 8 7 2 5
print: 6 5 2 8 1 3 4 0 7
print: 2 8 4 3 7 6 5 0 1
print: 6 2 1 3 5 4 8 7 0
print: 8 4 7 2 1 6 0 5 3
print: 6 2 4 3 8 0 1 7 5

Failing that, delete the 'seed 0' message from the message box in your
patch. That's what's killing you.

Best, Peter

-------------- http://www.bek.no/~pcastine/Litter/ --------------
Peter Castine | ^
| Litter Power & Litter Bundle for Jitter
pcastine@gmx.net |
pcastine@bek.no | iCE: Sequencing, Recording, and Interface Building
4-15@kagi.com | for Max/MSP
| Extremely cool
| http://www.dspaudio.com
| http://www.dspaudio.com/software/software.html

Felix's icon

Thank you all for your help!.
As Ruby says the patch works perfectly with an argument of 10 in the Uzi object. I don’t understand which object needs an extra bang; I suppose is the zl groupe.

Sorry Peter, but lp.ernie is in your ‘Litter Power Pro Package’, which is commercial. I only have the starter package…
Also, deleting the seed 0 messages gives me worst results; it gives always the same 9 number sequence but with a transposition to the left.
1 5 3 4 8 6 7 2 0;
5 3 4 8 6 7 2 0 1;
3 4 8 6 7 2 0 1 5;
4 8 6 7 2 0 1 5 3;
8 6 7 2 0 1 5 3 4;
6 7 2 0 1 5 3 4 8;

(I put the clear - seed 0 argument, after reading this in the max/msp manual: The number 0 uses the time elapsed since system startup (an unpredictable value) as the seed, ensuring an unpredictable sequence of numbers. This unpredictable seed is used by default when the urn object is created. However, once all numbers have been chosen, the sequence will repeat. Therefore, in order to achieve a nonrepeating sequence of numbers, you will need to send the urn object the seed 0 message each time you send it the clear message).

Using the combination of the scramble object with the urn object, as Trond suggest, gives me the best results.

0 8 5 2 7 6 3 1 4;
7 5 0 3 1 4 6 8 2;
8 3 5 2 7 4 1 0 6;
5 8 4 0 7 3 6 2 1;
1 3 4 0 2 8 6 5 7;
4 1 8 0 2 3 5 7 6;
2 6 8 0 5 7 4 1 3;

Thank you all,
Felix

Max Patch
Copy patch and select New From Clipboard in Max.

Jeremy's icon

Here's this patch's output on my box, without scramble:

2 8 6 3 0 7 5 1 4
6 4 1 2 7 0 3 8 5
2 4 0 1 6 3 5 7 8
3 1 7 4 6 0 5 2 8
1 5 8 2 6 0 4 7 3
8 2 3 4 0 5 7 6 1
7 0 2 6 1 4 5 3 8
5 1 6 2 3 7 0 4 8
1 6 7 8 0 3 2 5 4
7 3 1 6 5 4 2 8 0
5 2 0 6 1 3 7 4 8
2 7 5 6 1 8 0 4 3
6 4 8 2 5 1 7 3 0
6 7 2 8 1 3 5 0 4
5 6 7 1 4 3 0 2 8

I am reasonably certain that you are using an old version of MaxMSP,
with a broken urn object. A quick peek at the Incremental Updates
page [1] would indicate that a version of urn appeared on 10 January
2006 and corrects seeding problems. This update is intended for Max
4.5.6 or previous.

jb

Am 25.10.2006 um 11:27 schrieb Felix:

> As Ruby says the patch works perfectly with an argument of 10 in
> the Uzi object. I don’t understand which object needs an
> extra bang; I suppose is the zl groupe.

Roby Steinmetzer's icon

On 25 oct. 06, at 11:27, Felix wrote:
> Thank you all for your help!.
> As Ruby says the patch works perfectly with an argument of 10 in
> the Uzi object. I don’t understand which object needs an
> extra bang; I suppose is the zl groupe.

No, it's the urn object.
As stated in the help file:
"When all numbers up to the maximum (set via an argument or the right
inlet) have been output, the next bang urn receives causes a bang to
be sent out the right outlet."
So, in order to have the [clear] message to be sent to the urn object
you have to add an extra bang after the 9 bangs. That's why Uzi needs
10 as argument. If you only use 9 as argument to Uzi, the first bang
of the next sequence of 1 to 9 from Uzi is used to clear urn and you
will only have left 8 bangs to get the numbers from urn, with the
result that zl group (as it is waiting for 9 numbers) won't send out
its list the moment you expect it.
But one bang later, the first bang of the next sequence. And so on...

The scramble object won't make you much happier as it merely
scrambles the input list. The problem was before (the missing extra
bang).
The last patch you posted works perfect here (with urn).

Roby

Felix's icon

Thanks Roby,
Now I understand why I need the extra bang.
I don’t understand what you mean when you say:
> The last patch you posted works perfect here (with urn).
Because with that patch I get this kind of sequence:

8 6 7 2 0 1 5 3 4;
6 7 2 0 1 5 3 4 8;
7 2 0 1 5 3 4 8 6;
2 0 1 5 3 4 8 6 7;
0 1 5 3 4 8 6 7 2;
1 5 3 4 8 6 7 2 0;
5 3 4 8 6 7 2 0 1;
3 4 8 6 7 2 0 1 5;
4 8 6 7 2 0 1 5 3;

You get random lists with it?
Could you send me what you get from the output of the object ‘zl groupe 9’ (like above)?
Thanks,
Felix

Felix's icon

Thanks Jeremy,
I'm really Sorry for the trouble, but yes i have an older version of max, 4.5.5.
So the urn object i'm using doesn't work well, it creates 'not very random list' ... it's a bug!
I'll upgrade to the latest version of max.
Thanks,
felix

Felix's icon

Jeremy
I tried the upgraded urn external from the link you send me.
urn really works now!
I didn’t know the Incremental Downloads link, very useful!
Thanks,
F

Roby Steinmetzer's icon

On 25 oct. 06, at 14:08, Felix wrote:
>
> You get random lists with it?
> Could you send me what you get from the output of the object
> ‘zl groupe 9’ (like above)?

Here are mine:

8 4 2 7 1 6 5 3 0;
5 3 1 4 7 6 0 2 8;
0 8 7 1 4 6 5 3 2;
5 0 3 4 7 8 6 1 2;
0 6 1 3 4 7 2 8 5;
3 4 6 7 5 2 8 0 1;
2 1 3 0 6 4 8 5 7;
1 8 5 0 6 3 4 7 2;
6 1 8 2 4 7 5 0 3;
7 3 2 8 6 0 5 4 1;

Hm, different from yours and from Jeremy's...
Anyone got something else?

Roby

Peter Castine's icon

On around Oct 25, 2006, at 10:27, Felix said something like:
> Sorry Peter, but lp.ernie is in your ‘Litter Power Pro
> Package’, which is commercial. I only have the starter
> package…

Litter Pro is not expensive--a couple of Lattes Grande at Starbrucks or
a few McBurger menus. But, no, if you don't have it you don't have
lp.ernie.

> (I put the clear - seed 0 argument, after reading this in the max/msp
> manual: The number 0 uses the time elapsed since system startup (an
> unpredictable value)

Aside from problems with 'old' version of urn, if you send seed 0
messages in short succession you will seed with values that are very
close to each other.

Look, try the following patch (relax, standard objects only). If you
open it today and click on the 'ticks' message box, you will get one
value. Open the patch tomorrow and you'll most likely get a completely
different ('unpredictable') value. But click on the message box three
times consecutively, and the numbers aren't all that different, are
they? But that's exactly what you're feeding urn with a 'seed 0'
message.

Max Patch
Copy patch and select New From Clipboard in Max.

Feeding most random number generators with seed values that are close
generates sequences of random numbers that initially have high
correlation. It generally takes maybe a dozen iterations until chaotic
behavior kicks in and you get really different sequences. I don't know
exactly how C74's urn maps its core random number generator to 'pick a
ball from the urn', but using 'seed 0' messages in quick succession has
a high potential for generating not-very-random behavior.

It may well be that the updated version of urn fixes this problem as
well. Frankly, I don't know how people lived with it for so long. In
the time you could have had so many Lattes that you wouldn't even miss
the ones that bought you Litter Pro.-)

Best, Peter

-------------- http://www.bek.no/~pcastine/Litter/ --------------
Peter Castine | ^
| Litter Power & Litter Bundle for Jitter
pcastine@gmx.net |
pcastine@bek.no | iCE: Sequencing, Recording, and Interface Building
4-15@kagi.com | for Max/MSP
| Extremely cool
| http://www.dspaudio.com
| http://www.dspaudio.com/software/software.html

Roby Steinmetzer's icon
Peter Castine's icon

On around Oct 26, 2006, at 10:38, Stefan Tiedje--ironically
enough--said something like:
> Too many misleading answeres in this thread:
> The seed will start over the sequence, just get rid of it:

A seed with a non-zero value will simply repeat the sequence, but the
parameter zero has a special meaning for the seed message. It resorts
to grabbing uptime, measured in units of 1/60 second, and using *that*
as a seed value.

As I endeavoured to point out yesterday, this works well enough if
'seed 0' messages come at more-or-less random times, but if they come
in quick succession the uptime values will be too close to generate
really different sequences.

Looking at the original patch, it seems that the 4.5.5-and-earlier urn
wasn't anywhere near as random as should be expected. If the
incremental update fixes the problems, then fine. Personally, I haven't
used urn in my own work for over five years. Lp.ernie is simply much
more flexible and, IMHO, more reliable.

-- P.

>
-------------- http://www.bek.no/~pcastine/Litter/ --------------
Peter Castine | ^
| Litter Power & Litter Bundle for Jitter
pcastine@gmx.net |
pcastine@bek.no | iCE: Sequencing, Recording, and Interface Building
4-15@kagi.com | for Max/MSP
| Extremely cool
| http://www.dspaudio.com
| http://www.dspaudio.com/software/software.html

Stefan Tiedje's icon

Roby Steinmetzer wrote:
>
> What is misleading in my answer?

I thought the only reason for the repetition was the uneccessary seed 0
message. The many answers I read did not point to a simplified solution
just without seed...

Stefan

--
Stefan Tiedje------------x-------
--_____-----------|--------------
--(_|_ ----|-----|-----()-------
-- _|_)----|-----()--------------
----------()--------www.ccmix.com