Csound Csound-dev Csound-tekno Search About

Re: [Csnd] Used before defined?

Date2011-09-05 00:57
From"Partev Barr Sarkissian"
SubjectRe: [Csnd] Used before defined?
.... glissando,... you also try a morph where,

(freq1 + freq2)/ (time1 + time2) for going up in pitch,

(freq2 - freq1)/ (time1 + time2) for going down in pitch.

I use something like this to morph pitch, amplitude or 
phase differences over time. Sometimes mixing the dependent
variables simultaneously, like,

morphing pitch and amplitude over the p3- time duration,
and amplitude envelop and phase over the same duration.

Been useful to me.
-Partev


===================================================


--- tarmo@otsakool.edu.ee wrote:

From: Tarmo Johannes 
To: csound@lists.bath.ac.uk
Cc: Dima Bak 
Subject: Re: [Csnd] Used before defined?
Date: Wed, 31 Aug 2011 17:56:48 +0300

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"





_____________________________________________________________
Netscape.  Just the Net You Need.


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"