[Csnd] instant value
Date | 2011-04-14 22:00 |
From | Enrico Francioni |
Subject | [Csnd] instant value |
Hello everyone, perhaps the problem is easier than you think. Someone has an idea of how to capture the new instant value of gkx when the condition is satisfied, as in? this is my idea but does not work, how can I do? thanks, enrico ;===================== seed 0 girange = 3 gkx init 0 ;===================== instr 1 gkx trirand girange endin ;===================== instr 2 ktime timeinsts if ktime >=0 && ktime < 3 then print i(gkx) elseif ktime >=3 && ktime < 6 then print i(gkx) endif endin i1 0 7 i3 .001 6 e ;===================== -- View this message in context: http://csound.1045644.n5.nabble.com/instant-value-tp4304096p4304096.html Sent from the Csound - General mailing list archive at Nabble.com. Send bugs reports to the Sourceforge bug tracker https://sourceforge.net/tracker/?group_id=81968&atid=564599 Discussions of bugs and features can be posted here To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" |
Date | 2011-04-15 00:14 |
From | peiman khosravi |
Subject | Re: [Csnd] instant value |
This does not work because gkx is converted to i rate (in instrument 2) at the initialisation of the instrument, so it will not take account of any changes that occur after the initialization of instrument 2. This should work. Have I misunderstood you? instr 2 ktime timeinsts if ktime >=0 && ktime < 3 then printk 0, gkx elseif ktime >=3 && ktime < 6 then printk 0, gkx endif endin If you want to sample just one value then you want have this instead: instr 2 ktime timeinsts print i(gkx) if ktime==3 then printk 0, gkx endif endin Best, Peiman On 14/04/2011 22:00, Enrico Francioni wrote: > Hello everyone, > > perhaps the problem is easier than you think. > Someone has an idea of how to capture the new instant value of gkx when the > condition is satisfied, as in? > > this is my idea but does not work, > how can I do? > > thanks, > > enrico > > ;===================== > > > > > seed 0 > girange = 3 > gkx init 0 > > ;===================== > > instr 1 > > gkx trirand girange > > endin > > ;===================== > > instr 2 > > ktime timeinsts > > if ktime >=0 && ktime< 3 then > print i(gkx) > > elseif ktime >=3 && ktime< 6 then > print i(gkx) > > endif > > endin > > > > > i1 0 7 > i3 .001 6 > e > > > > > > ;===================== > > > > -- > View this message in context: http://csound.1045644.n5.nabble.com/instant-value-tp4304096p4304096.html > Sent from the Csound - General mailing list archive at Nabble.com. > > > Send bugs reports to the Sourceforge bug tracker > https://sourceforge.net/tracker/?group_id=81968&atid=564599 > Discussions of bugs and features can be posted here > To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" > Send bugs reports to the Sourceforge bug tracker https://sourceforge.net/tracker/?group_id=81968&atid=564599 Discussions of bugs and features can be posted here To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" |
Date | 2011-04-15 09:06 |
From | Enrico Francioni |
Subject | [Csnd] Re: instant value |
thanks peiman… perhaps I have not explained ... But I would like to have a new instantaneous value (generated with trirand opcode) every time I open the condition as in my example... seed 0 girange = 3 gkx init 0 ;===================== instr 1 gkx trirand girange ; generate a rand values between -3 and +3 endin ;===================== instr 2 ktime timeinsts if ktime >=0 && ktime < 3 then print i(gkx) ; istant value after 0 seconds elseif ktime >=3 && ktime < 6 then print i(gkx) ; istant value after 3 seconds - [this is likely to be (random) other than the first] endif endin i1 0 7 i2 .001 6 e -- View this message in context: http://csound.1045644.n5.nabble.com/instant-value-tp4304096p4304990.html Sent from the Csound - General mailing list archive at Nabble.com. Send bugs reports to the Sourceforge bug tracker https://sourceforge.net/tracker/?group_id=81968&atid=564599 Discussions of bugs and features can be posted here To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" |
Date | 2011-04-15 10:42 |
From | peiman khosravi |
Subject | Re: [Csnd] Re: instant value |
Sorry Enrico, I still don't quite understand you. trirand is generating values at k-rate so you mean you want to sample its output at a specific point in time? This example I sent does exactly that: |
Date | 2011-04-15 11:08 |
From | Enrico Francioni |
Subject | [Csnd] Re: instant value |
ok peiman, but I would like to get this instead: sr = 96000 ksmps = 100 nchnls = 1 0dbfs = 1 seed 0 girange = 3 gkx init 0 ;===================== instr 1 gkx trirand girange ; generate a rand values between -3 and +3 endin instr 2 ktime timeinsts print i(gkx) if ktime==3 then printk 0, gkx elseif ktime==4 then printk 0, gkx elseif ktime==5 then printk 0, gkx elseif ktime==6 then printk 0, gkx elseif ktime==7 then printk 0, gkx elseif ktime==10 then printk 0, gkx ; etc… endif endin f0 100 i1 0 60 i2 .001 60 e -- View this message in context: http://csound.1045644.n5.nabble.com/instant-value-tp4304096p4305206.html Sent from the Csound - General mailing list archive at Nabble.com. Send bugs reports to the Sourceforge bug tracker https://sourceforge.net/tracker/?group_id=81968&atid=564599 Discussions of bugs and features can be posted here To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" |
Date | 2011-04-15 11:18 |
From | peiman khosravi |
Subject | Re: [Csnd] Re: instant value |
It's working here. On 15/04/2011 11:08, Enrico Francioni wrote: > ok peiman, > > but I would like to get this instead: > > > > > > sr = 96000 > ksmps = 100 > nchnls = 1 > 0dbfs = 1 > > seed 0 > girange = 3 > gkx init 0 > > ;===================== > > instr 1 > > gkx trirand girange ; generate a rand values between -3 and +3 > > endin > > instr 2 > > ktime timeinsts > > print i(gkx) > > if ktime==3 then > printk 0, gkx > > > elseif ktime==4 then > printk 0, gkx > > > elseif ktime==5 then > printk 0, gkx > > elseif ktime==6 then > printk 0, gkx > > > elseif ktime==7 then > printk 0, gkx > > elseif ktime==10 then > printk 0, gkx > > ; etc… > > endif > > > endin > > > > f0 100 > i1 0 60 > i2 .001 60 > e > > > > > > > > > -- > View this message in context: http://csound.1045644.n5.nabble.com/instant-value-tp4304096p4305206.html > Sent from the Csound - General mailing list archive at Nabble.com. > > > Send bugs reports to the Sourceforge bug tracker > https://sourceforge.net/tracker/?group_id=81968&atid=564599 > Discussions of bugs and features can be posted here > To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" > Send bugs reports to the Sourceforge bug tracker https://sourceforge.net/tracker/?group_id=81968&atid=564599 Discussions of bugs and features can be posted here To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" |
Date | 2011-04-15 12:01 |
From | Enrico Francioni |
Subject | [Csnd] Re: instant value |
... unfortunately that is not the solution e … -- View this message in context: http://csound.1045644.n5.nabble.com/instant-value-tp4304096p4305301.html Sent from the Csound - General mailing list archive at Nabble.com. Send bugs reports to the Sourceforge bug tracker https://sourceforge.net/tracker/?group_id=81968&atid=564599 Discussions of bugs and features can be posted here To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" |
Date | 2011-04-15 12:12 |
From | francesco |
Subject | [Csnd] Re: instant value |
Hello Mr. Enrico, Your examples is working here too, like Mr. Peiman sayd. It is not what are You trying to do? (IT: da te non funziona o non è il risultato che ti aspetti?) ciao, francesco. My output: instr 2: #i0 = 0.000 i 2 time 3.00000: -1.45080 i 2 time 4.00000: 0.73128 i 2 time 5.00000: -1.13904 i 2 time 6.00000: -0.44148 i 2 time 7.00000: 0.62064 i 2 time 10.00000: -1.59675 -- View this message in context: http://csound.1045644.n5.nabble.com/instant-value-tp4304096p4305309.html Sent from the Csound - General mailing list archive at Nabble.com. Send bugs reports to the Sourceforge bug tracker https://sourceforge.net/tracker/?group_id=81968&atid=564599 Discussions of bugs and features can be posted here To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" |
Date | 2011-04-15 12:25 |
From | Enrico Francioni |
Subject | [Csnd] Re: instant value |
hi francesco! But I would like to work so that the condition, and unpack a single process variable (random) from each condition sr = 96000 ksmps = 100 nchnls = 1 0dbfs = 1 seed 0 girange = 3 gkx init 0 ;===================== instr 1 gkx trirand girange ; generate a rand values between -3 and +3 endin instr 2 ktime timeinsts if ktime>=3 && ktime< 4 then printk 0, gkx elseif ktime>=4 && ktime< 5 then printk 0, gkx elseif ktime>= 5 && ktime<6 then printk 0, gkx elseif ktime>= 6 && ktime<7 then printk 0, gkx elseif ktime>= 7 && ktime<10 then printk 0, gkx elseif ktime>= 10 && ktime<12 then printk 0, gkx ; etc… endif endin f0 100 i1 0 60 i2 .001 60 e -- View this message in context: http://csound.1045644.n5.nabble.com/instant-value-tp4304096p4305322.html Sent from the Csound - General mailing list archive at Nabble.com. Send bugs reports to the Sourceforge bug tracker https://sourceforge.net/tracker/?group_id=81968&atid=564599 Discussions of bugs and features can be posted here To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" |
Date | 2011-04-15 12:42 |
From | peiman khosravi |
Subject | Re: [Csnd] Re: instant value |
On 15/04/2011 12:25, Enrico Francioni wrote: > hi francesco! > > But I would like to work so that the condition, > and unpack a single process variable (random) from each condition > > > > > sr = 96000 > ksmps = 100 > nchnls = 1 > 0dbfs = 1 > > seed 0 > girange = 3 > gkx init 0 > > ;===================== > > instr 1 > > gkx trirand girange ; generate a rand values between -3 and +3 > > endin > > instr 2 > > ktime timeinsts > > > if ktime>=3&& ktime< 4 then > printk 0, gkx > > > elseif ktime>=4&& ktime< 5 then > printk 0, gkx > > > elseif ktime>= 5&& ktime<6 then > printk 0, gkx > > elseif ktime>= 6&& ktime<7 then > printk 0, gkx > > elseif ktime>= 7&& ktime<10 then > printk 0, gkx > > elseif ktime>= 10&& ktime<12 then > printk 0, gkx > > ; etc… > > endif > > > endin > > > > f0 100 > i1 0 60 > i2 .001 60 > e > > > > > > > > -- > View this message in context: http://csound.1045644.n5.nabble.com/instant-value-tp4304096p4305322.html > Sent from the Csound - General mailing list archive at Nabble.com. > > > Send bugs reports to the Sourceforge bug tracker > https://sourceforge.net/tracker/?group_id=81968&atid=564599 > Discussions of bugs and features can be posted here > To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" > Do you mean something like this: instr 2 ktime timeinsts if ktime>=3 && ktime< 4 then reinit pass elseif ktime>=4 && ktime< 5 then reinit pass elseif ktime>= 5 && ktime<6 then reinit pass elseif ktime>= 6 && ktime<7 then reinit pass elseif ktime>= 7 && ktime<10 then reinit pass elseif ktime>= 10 && ktime<12 then reinit pass endif pass: gikx trirand girange ; generate a rand values between -3 and +3 print gikx endin Send bugs reports to the Sourceforge bug tracker https://sourceforge.net/tracker/?group_id=81968&atid=564599 Discussions of bugs and features can be posted here To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" |
Date | 2011-04-15 12:49 |
From | francesco |
Subject | [Csnd] Re: instant value |
but You are doing this, if i'm right. The random variable gkx is changing at krate in instr 1, and every time the condition in instr 2 is satisfy You print the value at this time. (while i'm writing Mr. Peiman have a solution, maybe the right solution for You) ciao, francesco. -- View this message in context: http://csound.1045644.n5.nabble.com/instant-value-tp4304096p4305356.html Sent from the Csound - General mailing list archive at Nabble.com. Send bugs reports to the Sourceforge bug tracker https://sourceforge.net/tracker/?group_id=81968&atid=564599 Discussions of bugs and features can be posted here To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" |
Date | 2011-04-15 12:50 |
From | Enrico Francioni |
Subject | [Csnd] Re: instant value |
yes, francesco for example, it is clear that in this case: if ktime >= 3 && ktime <= 4 then the istant value i(gkx) will be captured at second 3, yes? -- View this message in context: http://csound.1045644.n5.nabble.com/instant-value-tp4304096p4305358.html Sent from the Csound - General mailing list archive at Nabble.com. Send bugs reports to the Sourceforge bug tracker https://sourceforge.net/tracker/?group_id=81968&atid=564599 Discussions of bugs and features can be posted here To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" |
Date | 2011-04-15 12:53 |
From | francesco |
Subject | [Csnd] Re: instant value |
I think yes ... (but many times i wrong!) Maybe Mr. Peiman could confirm if we are right. ciao, francesco. -- View this message in context: http://csound.1045644.n5.nabble.com/instant-value-tp4304096p4305361.html Sent from the Csound - General mailing list archive at Nabble.com. Send bugs reports to the Sourceforge bug tracker https://sourceforge.net/tracker/?group_id=81968&atid=564599 Discussions of bugs and features can be posted here To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" |
Date | 2011-04-15 12:58 |
From | peiman khosravi |
Subject | Re: [Csnd] Re: instant value |
No because you're using a krate conditional. So the value will keep being captured until ktime==4. So you get a printout on every control period during this time. P On 15/04/2011 12:50, Enrico Francioni wrote: > yes, francesco > > for example, it is clear that in this case: > > if ktime>= 3&& ktime<= 4 then > > the istant value i(gkx) will be captured at second 3, > > yes? > > -- > View this message in context: http://csound.1045644.n5.nabble.com/instant-value-tp4304096p4305358.html > Sent from the Csound - General mailing list archive at Nabble.com. > > > Send bugs reports to the Sourceforge bug tracker > https://sourceforge.net/tracker/?group_id=81968&atid=564599 > Discussions of bugs and features can be posted here > To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" > Send bugs reports to the Sourceforge bug tracker https://sourceforge.net/tracker/?group_id=81968&atid=564599 Discussions of bugs and features can be posted here To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" |
Date | 2011-04-15 13:05 |
From | francesco |
Subject | [Csnd] Re: instant value |
Sorry Mr. Peiman, You are referring to Your last example, am i right? thanks, ciao, francesco. -- View this message in context: http://csound.1045644.n5.nabble.com/instant-value-tp4304096p4305380.html Sent from the Csound - General mailing list archive at Nabble.com. Send bugs reports to the Sourceforge bug tracker https://sourceforge.net/tracker/?group_id=81968&atid=564599 Discussions of bugs and features can be posted here To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" |
Date | 2011-04-15 13:12 |
From | Enrico Francioni |
Subject | [Csnd] Re: instant value |
ok peiman, but the press of the values k I extract only the first instantaneous value (i) without limiting the condition to a single value: k1 ; only this value is my desired capture! k2 k3 k4 k5 k6 k7 k8 k9 k10 k ... kN -- View this message in context: http://csound.1045644.n5.nabble.com/instant-value-tp4304096p4305396.html Sent from the Csound - General mailing list archive at Nabble.com. Send bugs reports to the Sourceforge bug tracker https://sourceforge.net/tracker/?group_id=81968&atid=564599 Discussions of bugs and features can be posted here To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" |
Date | 2011-04-15 15:28 |
From | Justin Glenn Smith |
Subject | Re: [Csnd] Re: instant value |
I think what you want here is best done with the samphold and metro opcodes. |
Date | 2011-04-15 16:24 |
From | peiman khosravi |
Subject | Re: [Csnd] Re: instant value |
Hello, I was refering to Enrico's example. Best, Peiman On 15 April 2011 13:05, francesco |
Date | 2011-04-15 17:18 |
From | Justin Smith |
Subject | Re: [Csnd] Re: instant value |
Another comment:
|
Date | 2011-04-16 09:09 |
From | Enrico Francioni |
Subject | [Csnd] Re: instant value |
OK Justin, on line of the solution devised by peiman (thanks peiman), I think your solution number 4 is what I wanted to do; Obviously the timing of ktrigger them could determine the opcode linseg …or a table for example: instr 2 ival init 0 ktrig linseg 1, .0001, 0, 2.5, 0, .0001, 1, .0001, 0, 3, 0, .0001, 1, .0001, 0, 1.5, 0, .0001, 1, .0001, 0, 2, 0, .0001, 1, .0001, 0, 1, 0 restart: ival = i(gkx) if (ktrig == 0) kgoto cont reinit restart cont: print ival endin many thanks e -- View this message in context: http://csound.1045644.n5.nabble.com/instant-value-tp4304096p4307114.html Sent from the Csound - General mailing list archive at Nabble.com. Send bugs reports to the Sourceforge bug tracker https://sourceforge.net/tracker/?group_id=81968&atid=564599 Discussions of bugs and features can be posted here To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" |