From: none on
On Wed, 04 Nov 2009 06:27:05 +0000, Alexandros Droseltis wrote:

> Hello!
>
> I am studying an ancient source written in Fortran IV (it is the
> programme "Free Stochastic Music" by Xenakis in [1]) and I do not
> understand the blank in the following line of code:
>
> HX=HINF+HM*X RANF(-1)
>
> By reading the theoretical text, I assume that RANF(-1) should be a
> random number in [0,1). Also I assume by reading the theoretical text,
> that HX should be a random number between HINF and HINF+HM.
> Compiling the code with g95 and using a random number, say TEMP,
> instead of RANF(-1), I always get for HX the value HINF and not what I
> expect (that is a random number between HINF and HINF+HM). Could
> someone please explain what the above assignment in Fortran IV means? I
> would be grateful.
>
> Best Regards
>
> Alexandros
>
>
> [1] Iannis Xenakis, Formalized Music; Thought and Mathematics in
> Composition, Pendragon Press, Stuyvesant New York

Would any of these help?

xranf: A random number in range -1 .. +1
http://www.linuxsir.com/bbs/thread304809.html

xranf: random number in range 0 .. 1
http://read.pudn.com/downloads21/sourcecode/graph/71499/gems/FastJitter.c__.htm

xranf: random integer in range 0 .. (argument value)
lss.fnal.gov/archive/other/mura/MURA-580.pdf
This would make -1 a 'funny' number

xranf: random number in range 0 .. 1
http://www.google.com/codesearch/p?hl=en&sa=N&cd=2&ct=rc#91PXtzWoYR8/cpmd/src/util.F&q=xranf%20lang:fortran


From: Alexandros Droseltis on
On 2009-11-05, none <none(a)none.net> wrote:
> Would any of these help?
>
> xranf: A random number in range -1 .. +1
> http://www.linuxsir.com/bbs/thread304809.html
>
> xranf: random number in range 0 .. 1
> http://read.pudn.com/downloads21/sourcecode/graph/71499/gems/FastJitter.c__.htm
>
> xranf: random integer in range 0 .. (argument value)
> lss.fnal.gov/archive/other/mura/MURA-580.pdf
> This would make -1 a 'funny' number
>
> xranf: random number in range 0 .. 1
> http://www.google.com/codesearch/p?hl=en&sa=N&cd=2&ct=rc#91PXtzWoYR8/cpmd/src/util.F&q=xranf%20lang:fortran
>

Thanks for this list! Item 3 is very interesting,
but, as you mention, xranf(-1) ist not defined.

Items 2 and 3 would do the job, but.. the code I'm studying is from
1963.

HAND

Alexandros
From: Alexandros Droseltis on
Hello!

I found the source of the original source code online. It is in
the book is at
http://books.google.com/books?id=y6lL3I0vmMwC&printsec=frontcover&dq=formalized+music#v=onepage&q=&f=false

The source is on pages 145-152 (jump from contents page to
chapter VI and then a few pages backwards).

Best Regards

Alexandros
From: glen herrmannsfeldt on
Alexandros Droseltis <usenet-1(a)alex-droseltis.com> wrote:

> I found the source of the original source code online. It is in
> the book is at
> http://books.google.com/books?id=y6lL3I0vmMwC&printsec=frontcover&dq=formalized+music#v=onepage&q=&f=false

> The source is on pages 145-152 (jump from contents page to
> chapter VI and then a few pages backwards).

Interesting. It says Fortran IV for the 7090, but it still uses
Fortran II style I/O statements and functions (with the trailing F).
(OS/360 Fortran IV supports the Fortran II I/O statements, but as
far as I know not the function names with the trailing F.)

It looks like a mistake. All other references are to RANF.
Two statements before, a value is assignned to X, so it is possible
that it should be X*RANF(-1), or maybe just X or just RANF(-1).

It might be that one could tell from the text what was expected
at that point.

Note that the version on the previously mentioned web site still
has the X TEMP in it, presumably an undefined variable.

-- glen
From: Erik Toussaint on
glen herrmannsfeldt wrote:
> Alexandros Droseltis <usenet-1(a)alex-droseltis.com> wrote:
>
>> I found the source of the original source code online. It is in
>> the book is at
>> http://books.google.com/books?id=y6lL3I0vmMwC&printsec=frontcover&dq=formalized+music#v=onepage&q=&f=false
>
>> The source is on pages 145-152 (jump from contents page to
>> chapter VI and then a few pages backwards).
>
> Interesting. It says Fortran IV for the 7090, but it still uses
> Fortran II style I/O statements and functions (with the trailing F).
> (OS/360 Fortran IV supports the Fortran II I/O statements, but as
> far as I know not the function names with the trailing F.)
>
> It looks like a mistake. All other references are to RANF.
> Two statements before, a value is assignned to X, so it is possible
> that it should be X*RANF(-1), or maybe just X or just RANF(-1).
>
> It might be that one could tell from the text what was expected
> at that point.
>
> Note that the version on the previously mentioned web site still
> has the X TEMP in it, presumably an undefined variable.
>
> -- glen

I googled this book and found a site which has a pdf version for
download. It's a different edition/pressing and the offending line of
code here simply reads:

520 HX=HINF+HM*X

So it appears to be an error in the edition the OP is using.

Erik.