Csound Csound-dev Csound-tekno Search About

[Csnd] Re: k to i

Date2008-12-24 22:25
From"Art Hunkins"
Subject[Csnd] Re: k to i
Use the i function - as in, i(x). X is the k-time variable. Just don't use 
it in a k-rate expression; use it alone.

Art Hunkins

----- Original Message ----- 
From: "CarlosJP" 
To: 
Sent: Wednesday, December 24, 2008 4:39 PM
Subject: [Csnd] k to i


>
> Hi,
>
> I would like to control exp envelope duration from a fltk valuator. The
> problem is that expseg dur paramater is an i-time one and the output of 
> the
> valuator has k-rate instead. It's fine for me if an idur variable is first
> initialized to the current value of the valuator (that is, ignoring later
> widget changes during that note's span), but I don't know how to achieve
> that initial k to i conversion, if possible at all. Any help would be
> appreciated.
>
> Best regards
> -Carlos
> -- 
> View this message in context: 
> http://www.nabble.com/k-to-i-tp21156957p21156957.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe 
> csound" 


Date2008-12-25 03:21
FromLou Cohen
Subject[Csnd] Re: Re: k to i
Art,

Does this mean that an i-time parameter can be varied at k-rate, as in:

krisetemp init 1
idur = p3
idec init 0.1
krisetemp = krisetemp * 1.0001
irise = i(krisetemp)
kres linen kamp, irise, idur, idec

I can't quite imagine what happens at initialization time, and what happens
later on with code like this.

Thanks for clarifying! and happy holidays to all.

-Lou


On 12/24/08 17:25, "Art Hunkins     "  wrote:

> Use the i function - as in, i(x). X is the k-time variable. Just don't use
> it in a k-rate expression; use it alone.
> 
> Art Hunkins
> 
> ----- Original Message -----
> From: "CarlosJP" 
> To: 
> Sent: Wednesday, December 24, 2008 4:39 PM
> Subject: [Csnd] k to i
> 
> 
>> 
>> Hi,
>> 
>> I would like to control exp envelope duration from a fltk valuator. The
>> problem is that expseg dur paramater is an i-time one and the output of
>> the
>> valuator has k-rate instead. It's fine for me if an idur variable is first
>> initialized to the current value of the valuator (that is, ignoring later
>> widget changes during that note's span), but I don't know how to achieve
>> that initial k to i conversion, if possible at all. Any help would be
>> appreciated.
>> 
>> Best regards
>> -Carlos
>> -- 
>> View this message in context:
>> http://www.nabble.com/k-to-i-tp21156957p21156957.html
>> Sent from the Csound - General mailing list archive at Nabble.com.
>> 
>> 
>> 
>> Send bugs reports to this list.
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound" 
> 
> 
> 
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"



Date2008-12-25 06:29
FromJulian Peterson
Subject[Csnd] Re: Re: Re: k to i
Hi Lou:

No.  As Art H. points out, this requires the reinit opcode.

Essentially, i(k) allows you to use data that's stored in a k variable  
as an init value.  However, this is tricky, because the i pass happens  
before the first k pass.  Thus, the following doesn't work:

instr 1
	kblah = 1
	iblah = i(kblah)
	print iblah
endin

because the variable kblah isn't assigned 1 until after iblah tries to  
pull a value from kblah.  If you run this instrument as it is, it  
tells you that iblah = 0, not 1.

i() only works in cases where the kpass has already occurred.  For  
what you are trying to do, this should work.  You would be writing a  
value from a FLTK slider to a global k value from one instrument; then  
when a second instrument is activated, it can take the value already  
written to the global k value by the first instrument as an i value.

This is somewhat confusing; suffice to say that the i() operator is  
only useful in circumstances where another instrument has written a  
value to a global k value or if the instrument in question  
reinitializes its values at some point after it has already made a k  
pass.

Does anyone know of a good explanation of this out there on the web or  
in a book?  Understanding the whole i-pass k-pass process, esp. with  
respect to i() can be confusing to those who haven't had to use it  
before, and I'm afraid that my rather terse explanation might not be  
all that useful : )

J







On Dec 24, 2008, at 8:21 PM, Lou Cohen wrote:

> Art,
>
> Does this mean that an i-time parameter can be varied at k-rate, as  
> in:
>
> krisetemp init 1
> idur = p3
> idec init 0.1
> krisetemp = krisetemp * 1.0001
> irise = i(krisetemp)
> kres linen kamp, irise, idur, idec
>
> I can't quite imagine what happens at initialization time, and what  
> happens
> later on with code like this.
>
> Thanks for clarifying! and happy holidays to all.
>
> -Lou
>
>
> On 12/24/08 17:25, "Art Hunkins     "  wrote:
>
>> Use the i function - as in, i(x). X is the k-time variable. Just  
>> don't use
>> it in a k-rate expression; use it alone.
>>
>> Art Hunkins
>>
>> ----- Original Message -----
>> From: "CarlosJP" 
>> To: 
>> Sent: Wednesday, December 24, 2008 4:39 PM
>> Subject: [Csnd] k to i
>>
>>
>>>
>>> Hi,
>>>
>>> I would like to control exp envelope duration from a fltk  
>>> valuator. The
>>> problem is that expseg dur paramater is an i-time one and the  
>>> output of
>>> the
>>> valuator has k-rate instead. It's fine for me if an idur variable  
>>> is first
>>> initialized to the current value of the valuator (that is,  
>>> ignoring later
>>> widget changes during that note's span), but I don't know how to  
>>> achieve
>>> that initial k to i conversion, if possible at all. Any help would  
>>> be
>>> appreciated.
>>>
>>> Best regards
>>> -Carlos
>>> -- 
>>> View this message in context:
>>> http://www.nabble.com/k-to-i-tp21156957p21156957.html
>>> Sent from the Csound - General mailing list archive at Nabble.com.
>>>
>>>
>>>
>>> Send bugs reports to this list.
>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body  
>>> "unsubscribe
>>> csound"
>>
>>
>>
>> Send bugs reports to this list.
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body  
>> "unsubscribe
>> csound"
>
>
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body  
> "unsubscribe csound"


Date2008-12-25 19:26
FromMichael Rhoades
Subject[Csnd] Re: Re: k to i
Happy Holidays All,

I am not sure if this will work in your situation Carlos, but as a 
simple person when I come up against this barrier I always create a 
variable at the beginning of my orc like so:

kpan   =   p6

ipan   =   kpan

Then I can use the same value as either i-rate or k-rate input.

Hope this helps... otherwise please disregard.

Michael
www.perceptionfactory.com



Art Hunkins wrote:
> Use the i function - as in, i(x). X is the k-time variable. Just don't 
> use it in a k-rate expression; use it alone.
>
> Art Hunkins
>
> ----- Original Message ----- From: "CarlosJP" 
> To: 
> Sent: Wednesday, December 24, 2008 4:39 PM
> Subject: [Csnd] k to i
>
>
>>