Csound Csound-dev Csound-tekno Search About

[Csnd] Used before defined?

Date2011-08-31 11:46
FromDima Bak
Subject[Csnd] Used before defined?

I have error when try to execute this csd. It says "input arg 'ifreqb' used before defined, line 17:"

Whats wrong? Thanks.


<CsoundSynthesizer>

<CsOptions>

</CsOptions>

<CsInstruments>

sr = 44100

kr = 4410

ksmps = 10

nchnls = 1

0dbfs = 4

ifreqa init 0

ifreqb init 0

instr 1

ifreqa = ifreqb

ifreqb = cpsoct (p4)

kfreqm line ifreqa,p3,ifreqb

aout oscil 1,kfreqm,1

out aout

endin

</CsInstruments>

<CsScore>

f 1 0 16384 9 1 1 90

i1 0 2 8.0

i1 + 2 8.7

</CsScore>

</CsoundSynthesizer>


Date2011-08-31 11:54
FromOeyvind Brandtsegg
SubjectRe: [Csnd] Used before defined?
Hello Dima,

The variable ifreqb is used here in your code

ifreqa = ifreqb

where you state that the variable ifreqa should be assigned the same value as what's currently stored in the variable ifreqb.

The problem is that ifreqb is not defined before its value is being asked for.
If you rearrange the code like this

ifreqb = cpsoct (p4)
ifreqa = ifreqb

then it should compile. 
It this still does what you want.

Oeyvind

2011/8/31 Dima Bak <sounddesign3003@gmail.com>

I have error when try to execute this csd. It says "input arg 'ifreqb' used before defined, line 17:"

Whats wrong? Thanks.


<CsoundSynthesizer>

<CsOptions>

</CsOptions>

<CsInstruments>

sr = 44100

kr = 4410

ksmps = 10

nchnls = 1

0dbfs = 4

ifreqa init 0

ifreqb init 0

instr 1

ifreqa = ifreqb

ifreqb = cpsoct (p4)

kfreqm line ifreqa,p3,ifreqb

aout oscil 1,kfreqm,1

out aout

endin

</CsInstruments>

<CsScore>

f 1 0 16384 9 1 1 90

i1 0 2 8.0

i1 + 2 8.7

</CsScore>

</CsoundSynthesizer>



Date2011-08-31 12:12
FromVictor Lazzarini
SubjectRe: [Csnd] Used before defined?
ifreqa init 0
ifreqb init 0

these are NOT global variables, so instr 1 cannot see them. The ifreqa & ifreqb in instr 1 are different variables in the scope of instr 1.
If you want globals you will need to add a g to the variable name.


On 31 Aug 2011, at 11:46, Dima Bak wrote:

I have error when try to execute this csd. It says "input arg 'ifreqb' used before defined, line 17:"
Whats wrong? Thanks.

<CsoundSynthesizer>
<CsOptions>
</CsOptions>
<CsInstruments>

sr = 44100
kr = 4410
ksmps = 10
nchnls = 1
0dbfs = 4

ifreqa init 0
ifreqb init 0

instr 1

ifreqa = ifreqb
ifreqb = cpsoct (p4)
kfreqm line ifreqa,p3,ifreqb
aout oscil 1,kfreqm,1
out aout
endin

</CsInstruments>
<CsScore>
f 1 0 16384 9 1 1 90

i1 0 2 8.0
i1 + 2 8.7

</CsScore>
</CsoundSynthesizer>

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




Date2011-08-31 12:15
FromDima Bak
SubjectRe: [Csnd] Used before defined?
I forgot that variables belong to instrument and try to initialize it in istr 0. How to set variables for instr 1 before execution? Using "init" in body of intr 1?

2011/8/31 Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no>
Hello Dima,

The variable ifreqb is used here in your code

ifreqa = ifreqb

where you state that the variable ifreqa should be assigned the same value as what's currently stored in the variable ifreqb.

The problem is that ifreqb is not defined before its value is being asked for.
If you rearrange the code like this

ifreqb = cpsoct (p4)
ifreqa = ifreqb

then it should compile. 
It this still does what you want.

Oeyvind

2011/8/31 Dima Bak <sounddesign3003@gmail.com>

I have error when try to execute this csd. It says "input arg 'ifreqb' used before defined, line 17:"

Whats wrong? Thanks.


<CsoundSynthesizer>

<CsOptions>

</CsOptions>

<CsInstruments>

sr = 44100

kr = 4410

ksmps = 10

nchnls = 1

0dbfs = 4

ifreqa init 0

ifreqb init 0

instr 1

ifreqa = ifreqb

ifreqb = cpsoct (p4)

kfreqm line ifreqa,p3,ifreqb

aout oscil 1,kfreqm,1

out aout

endin

</CsInstruments>

<CsScore>

f 1 0 16384 9 1 1 90

i1 0 2 8.0

i1 + 2 8.7

</CsScore>

</CsoundSynthesizer>




Date2011-08-31 13:17
Fromjoachim heintz
SubjectRe: [Csnd] Used before defined?
yes you can use init in the body of the instrument. this sets variables
during the initialization.
you can have a look here, if you want further explanations:
http://en.flossmanuals.net/csound/ch016_a-initialization-and-performance-pass

	joachim


Am 31.08.2011 13:15, schrieb Dima Bak:
> I forgot that variables belong to instrument and try to initialize it in
> istr 0. How to set variables for instr 1 before execution? Using "init"
> in body of intr 1?
> 
> 2011/8/31 Oeyvind Brandtsegg  >
> 
>     Hello Dima,
> 
>     The variable ifreqb is used here in your code
> 
>     ifreqa = ifreqb
> 
>     where you state that the variable ifreqa should be assigned the same
>     value as what's currently stored in the variable ifreqb.
> 
>     The problem is that ifreqb is not defined before its value is being
>     asked for.
>     If you rearrange the code like this
> 
>     ifreqb = cpsoct (p4)
>     ifreqa = ifreqb
> 
>     then it should compile. 
>     It this still does what you want.
> 
>     Oeyvind
> 
>     2011/8/31 Dima Bak      >
> 
>         I have error when try to execute this csd. It says "input arg
>         'ifreqb' used before defined, line 17:"
> 
>         Whats wrong? Thanks.
> 
> 
>         
> 
>         
> 
>         
> 
>         
> 
>         sr = 44100
> 
>         kr = 4410
> 
>         ksmps = 10
> 
>         nchnls = 1
> 
>         0dbfs = 4
> 
>         ifreqa init 0
> 
>         ifreqb init 0
> 
>         instr 1
> 
>         ifreqa = ifreqb
> 
>         ifreqb = cpsoct (p4)
> 
>         kfreqm line ifreqa,p3,ifreqb
> 
>         aout oscil 1,kfreqm,1
> 
>         out aout
> 
>         endin
> 
>         
> 
>         
> 
>         f 1 0 16384 9 1 1 90
> 
>         i1 0 2 8.0
> 
>         i1 + 2 8.7
> 
>         
> 
>         
> 
> 
> 


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"

Date2011-08-31 13:46
Fromjpff@cs.bath.ac.uk
SubjectRe: [Csnd] Used before defined?
Or use a global i variable and init in instr 0 if you want the value of
the variable to be preserved with changes across instances
==John

> yes you can use init in the body of the instrument. this sets variables
> during the initialization.
> you can have a look here, if you want further explanations:
> http://en.flossmanuals.net/csound/ch016_a-initialization-and-performance-pass
>
> 	joachim
>
>
> Am 31.08.2011 13:15, schrieb Dima Bak:
>> I forgot that variables belong to instrument and try to initialize it in
>> istr 0. How to set variables for instr 1 before execution? Using "init"
>> in body of intr 1?
>>
>> 2011/8/31 Oeyvind Brandtsegg > >
>>
>>     Hello Dima,
>>
>>     The variable ifreqb is used here in your code
>>
>>     ifreqa = ifreqb
>>
>>     where you state that the variable ifreqa should be assigned the same
>>     value as what's currently stored in the variable ifreqb.
>>
>>     The problem is that ifreqb is not defined before its value is being
>>     asked for.
>>     If you rearrange the code like this
>>
>>     ifreqb = cpsoct (p4)
>>     ifreqa = ifreqb
>>
>>     then it should compile.
>>     It this still does what you want.
>>
>>     Oeyvind
>>
>>     2011/8/31 Dima Bak >     >
>>
>>         I have error when try to execute this csd. It says "input arg
>>         'ifreqb' used before defined, line 17:"
>>
>>         Whats wrong? Thanks.
>>
>>
>>         
>>
>>         
>>
>>         
>>
>>         
>>
>>         sr = 44100
>>
>>         kr = 4410
>>
>>         ksmps = 10
>>
>>         nchnls = 1
>>
>>         0dbfs = 4
>>
>>         ifreqa init 0
>>
>>         ifreqb init 0
>>
>>         instr 1
>>
>>         ifreqa = ifreqb
>>
>>         ifreqb = cpsoct (p4)
>>
>>         kfreqm line ifreqa,p3,ifreqb
>>
>>         aout oscil 1,kfreqm,1
>>
>>         out aout
>>
>>         endin
>>
>>         
>>
>>         
>>
>>         f 1 0 16384 9 1 1 90
>>
>>         i1 0 2 8.0
>>
>>         i1 + 2 8.7
>>
>>         
>>
>>         
>>
>>
>>
>
>




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"

Date2011-08-31 13:59
FromDima Bak
SubjectRe: [Csnd] Used before defined?
I just want to make note glide from (8.00 to 8.07). Thats all.

2011/8/31 <jpff@cs.bath.ac.uk>
Or use a global i variable and init in instr 0 if you want the value of
the variable to be preserved with changes across instances
==John

> yes you can use init in the body of the instrument. this sets variables
> during the initialization.
> you can have a look here, if you want further explanations:
> http://en.flossmanuals.net/csound/ch016_a-initialization-and-performance-pass
>
>       joachim
>
>
> Am 31.08.2011 13:15, schrieb Dima Bak:
>> I forgot that variables belong to instrument and try to initialize it in
>> istr 0. How to set variables for instr 1 before execution? Using "init"
>> in body of intr 1?
>>
>> 2011/8/31 Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no
>> <mailto:oyvind.brandtsegg@ntnu.no>>
>>
>>     Hello Dima,
>>
>>     The variable ifreqb is used here in your code
>>
>>     ifreqa = ifreqb
>>
>>     where you state that the variable ifreqa should be assigned the same
>>     value as what's currently stored in the variable ifreqb.
>>
>>     The problem is that ifreqb is not defined before its value is being
>>     asked for.
>>     If you rearrange the code like this
>>
>>     ifreqb = cpsoct (p4)
>>     ifreqa = ifreqb
>>
>>     then it should compile.
>>     It this still does what you want.
>>
>>     Oeyvind
>>
>>     2011/8/31 Dima Bak <sounddesign3003@gmail.com
>>     <mailto:sounddesign3003@gmail.com>>
>>
>>         I have error when try to execute this csd. It says "input arg
>>         'ifreqb' used before defined, line 17:"
>>
>>         Whats wrong? Thanks.
>>
>>
>>         <CsoundSynthesizer>
>>
>>         <CsOptions>
>>
>>         </CsOptions>
>>
>>         <CsInstruments>
>>
>>         sr = 44100
>>
>>         kr = 4410
>>
>>         ksmps = 10
>>
>>         nchnls = 1
>>
>>         0dbfs = 4
>>
>>         ifreqa init 0
>>
>>         ifreqb init 0
>>
>>         instr 1
>>
>>         ifreqa = ifreqb
>>
>>         ifreqb = cpsoct (p4)
>>
>>         kfreqm line ifreqa,p3,ifreqb
>>
>>         aout oscil 1,kfreqm,1
>>
>>         out aout
>>
>>         endin
>>
>>         </CsInstruments>
>>
>>         <CsScore>
>>
>>         f 1 0 16384 9 1 1 90
>>
>>         i1 0 2 8.0
>>
>>         i1 + 2 8.7
>>
>>         </CsScore>
>>
>>         </CsoundSynthesizer>
>>
>>
>>
>
>




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"



Date2011-08-31 14:52
Fromjoachim heintz
SubjectRe: [Csnd] Used before defined?
well, in this case you don't need any init, but you must read both
values in one score line:


0dbfs = 4
instr 1
ifreqa = cpsoct(p4)
ifreqb = cpsoct(p5)
kfreqm line ifreqa,p3,ifreqb
aout oscili 1,kfreqm,1
out aout
endin


f 1 0 16384 9 1 1 90
i1 0 4 8.0 8.7



at least this is the easiest way to do it, i think.

	joachim


Am 31.08.2011 14:59, schrieb Dima Bak:
> I just want to make note glide from (8.00 to 8.07). Thats all.
> 
> 2011/8/31 >
> 
>     Or use a global i variable and init in instr 0 if you want the value of
>     the variable to be preserved with changes across instances
>     ==John
> 
>     > yes you can use init in the body of the instrument. this sets
>     variables
>     > during the initialization.
>     > you can have a look here, if you want further explanations:
>     >
>     http://en.flossmanuals.net/csound/ch016_a-initialization-and-performance-pass
>     >
>     >       joachim
>     >
>     >
>     > Am 31.08.2011 13:15, schrieb Dima Bak:
>     >> I forgot that variables belong to instrument and try to
>     initialize it in
>     >> istr 0. How to set variables for instr 1 before execution? Using
>     "init"
>     >> in body of intr 1?
>     >>
>     >> 2011/8/31 Oeyvind Brandtsegg      
>     >>      >>
>     >>
>     >>     Hello Dima,
>     >>
>     >>     The variable ifreqb is used here in your code
>     >>
>     >>     ifreqa = ifreqb
>     >>
>     >>     where you state that the variable ifreqa should be assigned
>     the same
>     >>     value as what's currently stored in the variable ifreqb.
>     >>
>     >>     The problem is that ifreqb is not defined before its value is
>     being
>     >>     asked for.
>     >>     If you rearrange the code like this
>     >>
>     >>     ifreqb = cpsoct (p4)
>     >>     ifreqa = ifreqb
>     >>
>     >>     then it should compile.
>     >>     It this still does what you want.
>     >>
>     >>     Oeyvind
>     >>
>     >>     2011/8/31 Dima Bak      
>     >>          >>
>     >>
>     >>         I have error when try to execute this csd. It says "input arg
>     >>         'ifreqb' used before defined, line 17:"
>     >>
>     >>         Whats wrong? Thanks.
>     >>
>     >>
>     >>         
>     >>
>     >>         
>     >>
>     >>         
>     >>
>     >>         
>     >>
>     >>         sr = 44100
>     >>
>     >>         kr = 4410
>     >>
>     >>         ksmps = 10
>     >>
>     >>         nchnls = 1
>     >>
>     >>         0dbfs = 4
>     >>
>     >>         ifreqa init 0
>     >>
>     >>         ifreqb init 0
>     >>
>     >>         instr 1
>     >>
>     >>         ifreqa = ifreqb
>     >>
>     >>         ifreqb = cpsoct (p4)
>     >>
>     >>         kfreqm line ifreqa,p3,ifreqb
>     >>
>     >>         aout oscil 1,kfreqm,1
>     >>
>     >>         out aout
>     >>
>     >>         endin
>     >>
>     >>         
>     >>
>     >>         
>     >>
>     >>         f 1 0 16384 9 1 1 90
>     >>
>     >>         i1 0 2 8.0
>     >>
>     >>         i1 + 2 8.7
>     >>
>     >>         
>     >>
>     >>         
>     >>
>     >>
>     >>
>     >
>     >
> 
> 
> 
> 
>     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"

Date2011-08-31 15:56
FromTarmo Johannes
SubjectRe: [Csnd] Used before defined?
hello, 

if I get you right, you want to have a glissando from the frequency of the previous note to the new one?

then I sugest you should use one global variable to store the value of the old frequency.  Like:








sr = 44100
kr = 4410
ksmps = 10
nchnls = 1
0dbfs = 4


giOldfreq init 20 ; 0 is probably not a good choice for frequency


instr 1

ifreqa        =       giOldfreq
ifreqb         =        cpsoct (p4)
kfreqm                line ifreqa,p3,ifreqb

giOldfreq=ifreqb ; now when line parameters are initialized, you can store the current value so next time it will be the "old" value

kdeclick linen 0dbfs, 0.01,p3,0.01

aout                oscil 1,kfreqm,1
                        out aout*kdeclick
endin




f 1 0 16384 9 1 1 90


i1 0 2 8.0
i1 + 2 8.7
i1 + 2 9.7
i1 + 2 3.0









On Wednesday 31 August 2011 15:59:20 Dima Bak wrote:
> I just want to make note glide from (8.00 to 8.07). Thats all.
> 
> 2011/8/31 
> 
> > Or use a global i variable and init in instr 0 if you want the value of
> > the variable to be preserved with changes across instances
> > ==John
> >
> > > yes you can use init in the body of the instrument. this sets variables
> > > during the initialization.
> > > you can have a look here, if you want further explanations:
> > >
> > http://en.flossmanuals.net/csound/ch016_a-initialization-and-performance-pass
> > >
> > >       joachim
> > >
> > >
> > > Am 31.08.2011 13:15, schrieb Dima Bak:
> > >> I forgot that variables belong to instrument and try to initialize it in
> > >> istr 0. How to set variables for instr 1 before execution? Using "init"
> > >> in body of intr 1?
> > >>
> > >> 2011/8/31 Oeyvind Brandtsegg  > >> >
> > >>
> > >>     Hello Dima,
> > >>
> > >>     The variable ifreqb is used here in your code
> > >>
> > >>     ifreqa = ifreqb
> > >>
> > >>     where you state that the variable ifreqa should be assigned the same
> > >>     value as what's currently stored in the variable ifreqb.
> > >>
> > >>     The problem is that ifreqb is not defined before its value is being
> > >>     asked for.
> > >>     If you rearrange the code like this
> > >>
> > >>     ifreqb = cpsoct (p4)
> > >>     ifreqa = ifreqb
> > >>
> > >>     then it should compile.
> > >>     It this still does what you want.
> > >>
> > >>     Oeyvind
> > >>
> > >>     2011/8/31 Dima Bak  > >>     >
> > >>
> > >>         I have error when try to execute this csd. It says "input arg
> > >>         'ifreqb' used before defined, line 17:"
> > >>
> > >>         Whats wrong? Thanks.
> > >>
> > >>
> > >>         
> > >>
> > >>         
> > >>
> > >>         
> > >>
> > >>         
> > >>
> > >>         sr = 44100
> > >>
> > >>         kr = 4410
> > >>
> > >>         ksmps = 10
> > >>
> > >>         nchnls = 1
> > >>
> > >>         0dbfs = 4
> > >>
> > >>         ifreqa init 0
> > >>
> > >>         ifreqb init 0
> > >>
> > >>         instr 1
> > >>
> > >>         ifreqa = ifreqb
> > >>
> > >>         ifreqb = cpsoct (p4)
> > >>
> > >>         kfreqm line ifreqa,p3,ifreqb
> > >>
> > >>         aout oscil 1,kfreqm,1
> > >>
> > >>         out aout
> > >>
> > >>         endin
> > >>
> > >>         
> > >>
> > >>         
> > >>
> > >>         f 1 0 16384 9 1 1 90
> > >>
> > >>         i1 0 2 8.0
> > >>
> > >>         i1 + 2 8.7
> > >>
> > >>         
> > >>
> > >>         
> > >>
> > >>
> > >>
> > >
> > >
> >
> >
> >
> >
> > 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"
> 
> 


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"