GEN2 vs GEN10

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

GEN2 vs GEN10

Menno Knevel
Hi,
i am trying to generate some random with seed values for GEN10, but things happen out of my control it seems...

iseed   =   100
;
irnd1   rnd31 0.5, 0 , iseed
irnd1   +=  0.5
irnd2   rnd31 0.5, 0 , iseed + 1
irnd2   +=  0.5
irnd3   rnd31 0.5, 0 , iseed + 2
irnd3   +=  0.5
irnd4   rnd31 0.5, 0 , iseed + 3
irnd4   +=  0.5
irnd5   rnd31 0.5, 0 , iseed + 4
irnd5   +=  0.5
irnd6   rnd31 0.5, 0 , iseed + 5
irnd6   +=  0.5
irnd7   rnd31 0.5, 0 , iseed + 6
irnd7   +=  0.5
irnd8   rnd31 0.5, 0 , iseed + 7
irnd8   +=  0.5
irnd9   rnd31 0.5, 0 , iseed + 8
irnd9   +=  0.5
irnd10   rnd31 0.5, 0 , iseed + 9
irnd10   +=  0.5  
print   irnd1
print   irnd2
print   irnd3
print   irnd4
print   irnd5
print   irnd6
print   irnd7
print   irnd8
print   irnd9
print   irnd10        
girnd1       ftgen   50, 0, 16, 2, irnd1, irnd2, irnd3, irnd4, irnd5, irnd6, irnd7, irnd8, irnd9, irnd10
          prints    "%nContent of Function Table:%n"
indx      init      0
loop:
ival      table     indx, girnd1
          prints    "Index %d = %f%n", indx, ival
          loop_lt   indx, 1, ftlen(girnd1), loop

ftgen 50 prints out (more or less) the right values when i use GEN2 - not so with GEN10:

GEN2:
Content of Function Table:
Index 0 = 0.659629
Index 1 = 0.372027
Index 2 = 0.084426
Index 3 = 0.973615
Index 4 = 0.686014
Index 5 = 0.398413
Index 6 = 0.110811
Index 7 = 1.000000
Index 8 = 0.712399
Index 9 = 0.424798
Index 10 = 0.000000
Index 11 = 0.000000
Index 12 = 0.000000
Index 13 = 0.000000
Index 14 = 0.000000
Index 15 = 0.000000

GEN10:
Content of Function Table:
Index 0 = 0.000000
Index 1 = 1.000000
Index 2 = 0.443048
Index 3 = -0.497135
Index 4 = 0.954292
Index 5 = 0.249995
Index 6 = 0.034843
Index 7 = -0.247956
Index 8 = 0.000000
Index 9 = 0.247956
Index 10 = -0.034843
Index 11 = -0.249995
Index 12 = -0.954292
Index 13 = 0.497135
Index 14 = -0.443048
Index 15 = -1.000000

Why are the index values so different in GEN10?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] GEN2 vs GEN10

jpff
Sorry I do not follow.  GEN10 sums weighted sinusoids; your code does not
mention gen10 either?

  Confused of Bath

On Wed, 1 Mar 2017, Menno Knevel wrote:

> Hi,
> i am trying to generate some random with seed values for GEN10, but things
> happen out of my control it seems...
>
> iseed   =   100
> ;
> irnd1   rnd31 0.5, 0 , iseed
> irnd1   +=  0.5
> irnd2   rnd31 0.5, 0 , iseed + 1
> irnd2   +=  0.5
> irnd3   rnd31 0.5, 0 , iseed + 2
> irnd3   +=  0.5
> irnd4   rnd31 0.5, 0 , iseed + 3
> irnd4   +=  0.5
> irnd5   rnd31 0.5, 0 , iseed + 4
> irnd5   +=  0.5
> irnd6   rnd31 0.5, 0 , iseed + 5
> irnd6   +=  0.5
> irnd7   rnd31 0.5, 0 , iseed + 6
> irnd7   +=  0.5
> irnd8   rnd31 0.5, 0 , iseed + 7
> irnd8   +=  0.5
> irnd9   rnd31 0.5, 0 , iseed + 8
> irnd9   +=  0.5
> irnd10   rnd31 0.5, 0 , iseed + 9
> irnd10   +=  0.5
> print   irnd1
> print   irnd2
> print   irnd3
> print   irnd4
> print   irnd5
> print   irnd6
> print   irnd7
> print   irnd8
> print   irnd9
> print   irnd10
> girnd1       ftgen   50, 0, 16, 2, irnd1, irnd2, irnd3, irnd4, irnd5, irnd6,
> irnd7, irnd8, irnd9, irnd10
>          prints    "%nContent of Function Table:%n"
> indx      init      0
> loop:
> ival      table     indx, girnd1
>          prints    "Index %d = %f%n", indx, ival
>          loop_lt   indx, 1, ftlen(girnd1), loop
>
> ftgen 50 prints out (more or less) the right values when i use GEN2 - not so
> with GEN10:
>
> GEN2:
> Content of Function Table:
> Index 0 = 0.659629
> Index 1 = 0.372027
> Index 2 = 0.084426
> Index 3 = 0.973615
> Index 4 = 0.686014
> Index 5 = 0.398413
> Index 6 = 0.110811
> Index 7 = 1.000000
> Index 8 = 0.712399
> Index 9 = 0.424798
> Index 10 = 0.000000
> Index 11 = 0.000000
> Index 12 = 0.000000
> Index 13 = 0.000000
> Index 14 = 0.000000
> Index 15 = 0.000000
>
> GEN10:
> Content of Function Table:
> Index 0 = 0.000000
> Index 1 = 1.000000
> Index 2 = 0.443048
> Index 3 = -0.497135
> Index 4 = 0.954292
> Index 5 = 0.249995
> Index 6 = 0.034843
> Index 7 = -0.247956
> Index 8 = 0.000000
> Index 9 = 0.247956
> Index 10 = -0.034843
> Index 11 = -0.249995
> Index 12 = -0.954292
> Index 13 = 0.497135
> Index 14 = -0.443048
> Index 15 = -1.000000
>
> Why are the index values so different in GEN10?
>
>
>
> --
> View this message in context: http://csound.1045644.n5.nabble.com/GEN2-vs-GEN10-tp5754876.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] GEN2 vs GEN10

Menno Knevel
i'm confused too, but presume this is because of a lack of knowledge from my part :)
Still i like to understand so i can move on...

i have simplified the example somewhat so that 8 rnd31 with different seeds generate 8 different values:
instr 1:  irnd1 = 0.605
instr 1:  irnd2 = 0.361
instr 1:  irnd3 = 0.117
instr 1:  irnd4 = 0.872
instr 1:  irnd5 = 0.605
instr 1:  irnd6 = 0.361
instr 1:  irnd7 = 0.117
instr 1:  irnd8 = 0.872
ftable 50:

When i use GEN2, without normalization, the values are put in correct:
girnd1       ftgen   50, 0, 8, -2, irnd1, irnd2, irnd3, irnd4, irnd5, irnd6, irnd7, irnd8
Content of Function Table:
Index 0 = 0.605322
Index 1 = 0.360928
Index 2 = 0.116533
Index 3 = 0.872138
Index 4 = 0.605322
Index 5 = 0.360928
Index 6 = 0.116533
Index 7 = 0.872138

But
when i use GEN10, without normalization, i get:
girnd1       ftgen   50, 0, 8, -10, irnd1, irnd2, irnd3, irnd4, irnd5, irnd6, irnd7, irnd8
Content of Function Table:
Index 0 = 0.000000
Index 1 = 0.428027
Index 2 = 1.582901
Index 3 = 0.428027
Index 4 = 0.000000
Index 5 = -0.428027
Index 6 = -1.582901
Index 7 = -0.428027

What is happening here? Why are the random-with-seed values not used as a one-to-one copy in GEN10?
Or does it have to do with the way the values are printed?

Goal is to generate random-with-seeds values for GEN10 at i-rate, where the random values stand for the harmonics amplitude.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] GEN2 vs GEN10

Justin Smith
" Why are the random-with-seed values not used as a
one-to-one copy in GEN10?"

I must be missing something here, because the args to gen 10 are the strengths of harmonics, and the values in the table look like perfectly reasonable results if the harmonics had those respective amplitudes

On Thu, Mar 2, 2017 at 11:21 AM Menno Knevel <[hidden email]> wrote:
i'm confused too, but presume this is because of a lack of knowledge from my
part :)
Still i like to understand so i can move on...

i have simplified the example somewhat so that 8 rnd31 with different seeds
generate 8 different values:
instr 1:  irnd1 = 0.605
instr 1:  irnd2 = 0.361
instr 1:  irnd3 = 0.117
instr 1:  irnd4 = 0.872
instr 1:  irnd5 = 0.605
instr 1:  irnd6 = 0.361
instr 1:  irnd7 = 0.117
instr 1:  irnd8 = 0.872
ftable 50:

When i use GEN2, without normalization, the values are put in correct:
girnd1       ftgen   50, 0, 8, -2, irnd1, irnd2, irnd3, irnd4, irnd5, irnd6,
irnd7, irnd8
Content of Function Table:
Index 0 = 0.605322
Index 1 = 0.360928
Index 2 = 0.116533
Index 3 = 0.872138
Index 4 = 0.605322
Index 5 = 0.360928
Index 6 = 0.116533
Index 7 = 0.872138

But
when i use GEN10, without normalization, i get:
girnd1       ftgen   50, 0, 8, -10, irnd1, irnd2, irnd3, irnd4, irnd5,
irnd6, irnd7, irnd8
Content of Function Table:
Index 0 = 0.000000
Index 1 = 0.428027
Index 2 = 1.582901
Index 3 = 0.428027
Index 4 = 0.000000
Index 5 = -0.428027
Index 6 = -1.582901
Index 7 = -0.428027

What is happening here? Why are the random-with-seed values not used as a
one-to-one copy in GEN10?
Or does it have to do with the way the values are printed?

Goal is to generate random-with-seeds values for GEN10 at i-rate, where the
random values stand for the harmonics amplitude.



--
View this message in context: http://csound.1045644.n5.nabble.com/GEN2-vs-GEN10-tp5754876p5754880.html
Sent from the Csound - General mailing list archive at Nabble.com.

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] GEN2 vs GEN10

Menno Knevel
no, i was clearly missing something, but by asking the question alone i now understand.
I was confused about the i-rate concept.
When the tables get their p values from rnd31 and then the Gen is read back to be displayed by:
ival      table     indx, girnd1
          prints    "Index %d = %f%n", indx, ival
          loop_lt   indx, 1, ftlen(girnd1), loop
the calculation by the Gen has finished and read back. Of course, this takes some time to calculate, although the instrument calculates with a score like: i1 0 0 - p3 is zero seconds long, while the calculation surely must take some time to calculate. This "contradiction in time" is now no longer a contradiction for me because the i-rate values are just getting ready to be used - but still they are i- rate values.
:)

 
Loading...