Csound Csound-dev Csound-tekno Search About

[Csnd] giValue

Date2012-08-23 21:38
FromEnrico Francioni
Subject[Csnd] giValue
Hi!

in this "csd" how can I update "giValue" also instr 2?
instr 1 is activated (i1 0 .1) from the GUI and the new value "Value" is
sent from the GUI.
…thanks
e





giValue	init	0

instr 1
kValue	invalue	"value"
giValue	=	i(kValue)
;print		iValue
endin 1


instr 2
print		giValue
endin 2



i2	0	99999





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


Date2012-08-23 21:47
FromVictor Lazzarini
SubjectRe: [Csnd] giValue
yes, you can update giValue. It will be updated at init-time in every instance of instr 1.


On 23 Aug 2012, at 21:38, Enrico Francioni wrote:

> Hi!
> 
> in this "csd" how can I update "giValue" also instr 2?
> instr 1 is activated (i1 0 .1) from the GUI and the new value "Value" is
> sent from the GUI.
> …thanks
> e
> 
> 
> 
> 
> 
> giValue	init	0
> 
> instr 1
> kValue	invalue	"value"
> giValue	=	i(kValue)
> ;print		iValue
> endin 1
> 
> 
> instr 2
> print		giValue
> endin 2
> 
> 
> 
> i2	0	99999
> 
> 
> 
> 
> 
> --
> View this message in context: http://csound.1045644.n5.nabble.com/giValue-tp5715157.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"
> 

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie





Date2012-08-23 21:55
FromEnrico Francioni
Subject[Csnd] Re: giValue
this could be a solution?





giValue	init	0

instr 1
kValue	invalue	"value"
giValue	=	i(kValue)
;print		iValue
endin 1

instr 2
reset:
print		giValue
timout	0, .01, continua
reinit	reset
continua:
endin 2



i2	0	99999





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

Date2012-08-23 22:21
FromVictor Lazzarini
SubjectRe: [Csnd] Re: giValue
or

gkValue  init 0

instr 1

kValue invalue "value"
gkValue = i(kValue)

endin

instr 2

printk2 gkValue

endin


On 23 Aug 2012, at 21:55, Enrico Francioni wrote:

> this could be a solution?
> 
> 
> 
> 
> 
> giValue	init	0
> 
> instr 1
> kValue	invalue	"value"
> giValue	=	i(kValue)
> ;print		iValue
> endin 1
> 
> instr 2
> reset:
> print		giValue
> timout	0, .01, continua
> reinit	reset
> continua:
> endin 2
> 
> 
> 
> i2	0	99999
> 
> 
> 
> 
> 
> --
> View this message in context: http://csound.1045644.n5.nabble.com/giValue-tp5715157p5715160.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"
> 

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie





Date2012-08-24 10:29
FromEnrico Francioni
Subject[Csnd] Re: giValue
in the opcode *instr 2* can not be set "k" but only "i".

I can still use your solution Victor?

*

/I'm working with these opcodes using instantaneous values:/

…or for all topics:
ares *nestedap* asig, imode, imaxdel, idel1, igain1 [, idel2] [, igain2] [,
idel3] [, igain3] [, istor]

…or in a mixed manner ("k" and "i")
ares *nreverb* asig, ktime, khdif [, iskip] [,inumCombs] [, ifnCombs] [,
inumAlpas] [, ifnAlpas]
etc.




Victor Lazzarini wrote
> 
> or
> 
> gkValue  init 0
> 
> instr 1
> 
> kValue invalue "value"
> gkValue = i(kValue)
> 
> endin
> 
> instr 2
> 
> printk2 gkValue
> 
> endin
> 
> 
> On 23 Aug 2012, at 21:55, Enrico Francioni wrote:
> 
>> this could be a solution?
>> 
>> 
>> 
>> 
>> 
>> giValue	init	0
>> 
>> instr 1
>> kValue	invalue	"value"
>> giValue	=	i(kValue)
>> ;print		iValue
>> endin 1
>> 
>> instr 2
>> reset:
>> print		giValue
>> timout	0, .01, continua
>> reinit	reset
>> continua:
>> endin 2
>> 
>> 
>> 
>> i2	0	99999
>> 
>> 
>> 
>> 
>> 
>> --
>> View this message in context:
>> http://csound.1045644.n5.nabble.com/giValue-tp5715157p5715160.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@.ac with body "unsubscribe csound"
>> 
> 
> Dr Victor Lazzarini
> Senior Lecturer
> Dept. of Music
> NUI Maynooth Ireland
> tel.: +353 1 708 3545
> Victor dot Lazzarini AT nuim dot ie
> 
> 
> 
> 
> 
> 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@.ac with body "unsubscribe csound"
> 




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


Date2012-08-24 10:58
FromVictor Lazzarini
SubjectRe: [Csnd] Re: giValue
I think so. In instr 2 just do

ival = i(gkValue)

On 24 Aug 2012, at 10:29, Enrico Francioni wrote:

> 
> in the opcode *instr 2* can not be set "k" but only "i".
> 
> I can still use your solution Victor?
> 
> *
> 
> /I'm working with these opcodes using instantaneous values:/
> 
> …or for all topics:
> ares *nestedap* asig, imode, imaxdel, idel1, igain1 [, idel2] [, igain2] [,
> idel3] [, igain3] [, istor]
> 
> …or in a mixed manner ("k" and "i")
> ares *nreverb* asig, ktime, khdif [, iskip] [,inumCombs] [, ifnCombs] [,
> inumAlpas] [, ifnAlpas]
> etc.
> 
> 
> 
> 
> Victor Lazzarini wrote
>> 
>> or
>> 
>> gkValue  init 0
>> 
>> instr 1
>> 
>> kValue invalue "value"
>> gkValue = i(kValue)
>> 
>> endin
>> 
>> instr 2
>> 
>> printk2 gkValue
>> 
>> endin
>> 
>> 
>> On 23 Aug 2012, at 21:55, Enrico Francioni wrote:
>> 
>>> this could be a solution?
>>> 
>>> 
>>> 
>>> 
>>> 
>>> giValue	init	0
>>> 
>>> instr 1
>>> kValue	invalue	"value"
>>> giValue	=	i(kValue)
>>> ;print		iValue
>>> endin 1
>>> 
>>> instr 2
>>> reset:
>>> print		giValue
>>> timout	0, .01, continua
>>> reinit	reset
>>> continua:
>>> endin 2
>>> 
>>> 
>>> 
>>> i2	0	99999
>>> 
>>> 
>>> 
>>> 
>>> 
>>> --
>>> View this message in context:
>>> http://csound.1045644.n5.nabble.com/giValue-tp5715157p5715160.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@.ac with body "unsubscribe csound"
>>> 
>> 
>> Dr Victor Lazzarini
>> Senior Lecturer
>> Dept. of Music
>> NUI Maynooth Ireland
>> tel.: +353 1 708 3545
>> Victor dot Lazzarini AT nuim dot ie
>> 
>> 
>> 
>> 
>> 
>> 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@.ac with body "unsubscribe csound"
>> 
> 
> 
> 
> 
> --
> View this message in context: http://csound.1045644.n5.nabble.com/giValue-tp5715157p5715175.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"
> 

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie





Date2012-08-24 11:21
FromEnrico Francioni
Subject[Csnd] Re: giValue
…in this way *ival* is always = 0


gkValue  init 0 

instr 1 
gkValue invalue "value" 
endin 1

instr 2 
ival = i(gkValue) 
print		ival
endin 2


/P.S.
remember instr 1 is active only called for .1 second (from the GUI)/



Victor Lazzarini wrote
> 
> I think so. In instr 2 just do
> 
> ival = i(gkValue)
> 
> On 24 Aug 2012, at 10:29, Enrico Francioni wrote:
> 
>> 
>> in the opcode *instr 2* can not be set "k" but only "i".
>> 
>> I can still use your solution Victor?
>> 
>> *
>> 
>> /I'm working with these opcodes using instantaneous values:/
>> 
>> …or for all topics:
>> ares *nestedap* asig, imode, imaxdel, idel1, igain1 [, idel2] [, igain2]
>> [,
>> idel3] [, igain3] [, istor]
>> 
>> …or in a mixed manner ("k" and "i")
>> ares *nreverb* asig, ktime, khdif [, iskip] [,inumCombs] [, ifnCombs] [,
>> inumAlpas] [, ifnAlpas]
>> etc.
>> 
>> 
>> 
>> 
>> Victor Lazzarini wrote
>>> 
>>> or
>>> 
>>> gkValue  init 0
>>> 
>>> instr 1
>>> 
>>> kValue invalue "value"
>>> gkValue = i(kValue)
>>> 
>>> endin
>>> 
>>> instr 2
>>> 
>>> printk2 gkValue
>>> 
>>> endin
>>> 
>>> 
>>> On 23 Aug 2012, at 21:55, Enrico Francioni wrote:
>>> 
>>>> this could be a solution?
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> giValue	init	0
>>>> 
>>>> instr 1
>>>> kValue	invalue	"value"
>>>> giValue	=	i(kValue)
>>>> ;print		iValue
>>>> endin 1
>>>> 
>>>> instr 2
>>>> reset:
>>>> print		giValue
>>>> timout	0, .01, continua
>>>> reinit	reset
>>>> continua:
>>>> endin 2
>>>> 
>>>> 
>>>> 
>>>> i2	0	99999
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> --
>>>> View this message in context:
>>>> http://csound.1045644.n5.nabble.com/giValue-tp5715157p5715160.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@.ac with body "unsubscribe csound"
>>>> 
>>> 
>>> Dr Victor Lazzarini
>>> Senior Lecturer
>>> Dept. of Music
>>> NUI Maynooth Ireland
>>> tel.: +353 1 708 3545
>>> Victor dot Lazzarini AT nuim dot ie
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 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@.ac with body "unsubscribe csound"
>>> 
>> 
>> 
>> 
>> 
>> --
>> View this message in context:
>> http://csound.1045644.n5.nabble.com/giValue-tp5715157p5715175.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@.ac with body "unsubscribe csound"
>> 
> 
> Dr Victor Lazzarini
> Senior Lecturer
> Dept. of Music
> NUI Maynooth Ireland
> tel.: +353 1 708 3545
> Victor dot Lazzarini AT nuim dot ie
> 
> 
> 
> 
> 
> 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@.ac with body "unsubscribe csound"
> 



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


Date2012-08-24 11:56
FromVictor Lazzarini
SubjectRe: [Csnd] Re: giValue
Well, I don't know, but I have this CSD:

<CsoundSynthesizer>
<CsOptions>
-d
</CsOptions>
<CsInstruments>

sr = 44100
ksmps = 256
nchnls = 2
0dbfs = 1

gkvalue init 0
instr 1
gkvalue invalue "slider1"
endin

instr 2
print i(gkvalue)
endin

</CsInstruments>
<CsScore>

f1 0 32768 10 1

; start dur num bits
i2 0 1
i2 4 1
i1 0 5
e

</CsScore>
</CsoundSynthesizer>

and when I move the slider I get this:

new alloc for instr 1:
new alloc for instr 2:
instr 2: #i0 = 0.550
B 0.000 .. 4.000 T 4.000 TT 4.000 M: 0.00000 0.00000
instr 2: #i0 = 0.790
B 4.000 .. 5.000 T 4.998 TT 4.998 M: 0.00000 0.00000
Score finished in csoundPerformKsmps().



On 24 Aug 2012, at 11:21, Enrico Francioni wrote:


…in this way *ival* is always = 0


gkValue  init 0

instr 1
gkValue invalue "value"
endin 1

instr 2
ival = i(gkValue)
print ival
endin 2


/P.S.
remember instr 1 is active only called for .1 second (from the GUI)/



Victor Lazzarini wrote

I think so. In instr 2 just do

ival = i(gkValue)

On 24 Aug 2012, at 10:29, Enrico Francioni wrote:


in the opcode *instr 2* can not be set "k" but only "i".

I can still use your solution Victor?

*

/I'm working with these opcodes using instantaneous values:/

…or for all topics:
ares *nestedap* asig, imode, imaxdel, idel1, igain1 [, idel2] [, igain2]
[,
idel3] [, igain3] [, istor]

…or in a mixed manner ("k" and "i")
ares *nreverb* asig, ktime, khdif [, iskip] [,inumCombs] [, ifnCombs] [,
inumAlpas] [, ifnAlpas]
etc.




Victor Lazzarini wrote

or

gkValue  init 0

instr 1

kValue invalue "value"
gkValue = i(kValue)

endin

instr 2

printk2 gkValue

endin


On 23 Aug 2012, at 21:55, Enrico Francioni wrote:

this could be a solution?


<CsoundSynthesizer>
<CsInstruments>

giValue init 0

instr 1
kValue invalue "value"
giValue = i(kValue)
;print iValue
endin 1

instr 2
reset:
print giValue
timout 0, .01, continua
reinit reset
continua:
endin 2

</CsInstruments>
<CsScore>
i2 0 99999
</CsScore>
</CsoundSynthesizer>



--
View this message in context:
http://csound.1045644.n5.nabble.com/giValue-tp5715157p5715160.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@.ac with body "unsubscribe csound"


Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie





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@.ac with body "unsubscribe csound"





--
View this message in context:
http://csound.1045644.n5.nabble.com/giValue-tp5715157p5715175.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@.ac with body "unsubscribe csound"


Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie





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@.ac with body "unsubscribe csound"




--
View this message in context: http://csound.1045644.n5.nabble.com/giValue-tp5715157p5715179.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"


Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie




Date2012-08-24 14:04
FromEnrico Francioni
Subject[Csnd] Re: giValue
thanks Victor,
as I wrote in the first message, my case is different:

instr 2 is always *on*
and
instr 1 I turn it on when I want, from the GUI, for .1 seconds (from here
depart values ​​iValue)




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


Date2012-08-24 14:29
FromVictor Lazzarini
SubjectRe: [Csnd] Re: giValue
In that case, the problem is to do with using i-time vars, as they are only updated when instr 2 starts.
If you can use reinit , then that is the solution.

On 24 Aug 2012, at 14:04, Enrico Francioni wrote:

> 
> thanks Victor,
> as I wrote in the first message, my case is different:
> 
> instr 2 is always *on*
> and
> instr 1 I turn it on when I want, from the GUI, for .1 seconds (from here
> depart values ​​iValue)
> 
> 
> 
> 
> --
> View this message in context: http://csound.1045644.n5.nabble.com/giValue-tp5715157p5715186.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"
> 

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie





Date2012-08-24 14:56
FromEnrico Francioni
Subject[Csnd] Re: giValue
thanks Victor,

if there are other ideas ...
(perhaps with the *tables*?)

ciao
e



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

Date2012-08-24 15:02
FromVictor Lazzarini
SubjectRe: [Csnd] Re: giValue
Well the problem is that you need to update the value of a variable that can only be updated at init time. There are only two ways of doing it:
starting a new instance or re-initialising.
On 24 Aug 2012, at 14:56, Enrico Francioni wrote:

> 
> thanks Victor,
> 
> if there are other ideas ...
> (perhaps with the *tables*?)
> 
> ciao
> e
> 
> 
> 
> --
> View this message in context: http://csound.1045644.n5.nabble.com/giValue-tp5715157p5715188.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"
> 

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie





Date2012-08-24 15:36
FromEnrico Francioni
Subject[Csnd] Re: giValue
I also thought of another solution:

- A *table* (write) to load the value inside instr 1

and

- A second *table* (read) on all the time to read (load) the value (or the
new value) in instr 2

I do not know if you can go...






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

Date2012-08-24 16:01
FromVictor Lazzarini
SubjectRe: [Csnd] Re: giValue
But the problem is that you will only be able to read once, at init-time. So that is not different from a global variable.
On 24 Aug 2012, at 15:36, Enrico Francioni wrote:

> 
> I also thought of another solution:
> 
> - A *table* (write) to load the value inside instr 1
> 
> and
> 
> - A second *table* (read) on all the time to read (load) the value (or the
> new value) in instr 2
> 
> I do not know if you can go...
> 
> 
> 
> 
> 
> 
> --
> View this message in context: http://csound.1045644.n5.nabble.com/giValue-tp5715157p5715190.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"
> 

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie