Csound Csound-dev Csound-tekno Search About

[Csnd] Re: Re: Tablew question

Date2007-11-15 16:57
Frommark jamerson
Subject[Csnd] Re: Re: Tablew question
Thanks victor, that worked out. The printing didn't work, but the sound did.   I had tried it with kvars previously, but I must have messed something up. thanks again.  

                                                                       Mark 

----- Original Message ----
From: Victor Lazzarini 
To: csound@lists.bath.ac.uk
Sent: Thursday, November 15, 2007 10:01:36 AM
Subject: [Csnd] Re: Tablew question


you are using ivars, so I can't see it working. Try this version:

instr 1

kndx    init 0
krn       = 0.25
loop:
kread    table     kndx,1
if kread > 0 kgoto positive
kwrite    =    kread+krn
kgoto write
positive:
kwrite    =     kread-krn
write:
     tablew  kwrite,kndx,1
kcheck table kndx, 1
printf "orig: %f, new: %f\n", kndx, kread, kcheck  ; this will print
 the 
results
kndx    = kndx + 1
if kndx<1024 kgoto loop

endin


At 15:44 15/11/2007, you wrote:

>Hey,
>
>     I'm trying to use the following instrument to rewrite a table
 during 
> a real-time performance:
>
>instr1
>
>indx    init 0
>irn       = 0.25
>loop:
>iread    table     indx,1
>if iread > 0 kgoto positive
>iwrite    =    iread+irn
>goto write
>positive:
>iwrite    =     iread-irn
>write:
>     tableiw  iwrite,indx,1
>indx    = indx + 1
>if indx<1024 kgoto loop
>     endin
>
>
>    Rewriting the table onto itself seems not to be functioning
 properly, 
> but if I write to a second table that doesn't yet exist, it seems to 
> function properly.  Is it not possible to rewrite a table onto
 itself, or 
> am I doing something else incorrect? Does anyone have an example of 
> something like this that they couls share with me?
>
>                                                                    
  Mark
>
>
>
>
> 
>____________________________________________________________________________________
>Get easy, one-click access to your favorites.
>Make Yahoo! your homepage.
>http://www.yahoo.com/r/hs
>
>
>Send bugs reports to this list.
>To unsubscribe, send email sympa@lists.bath.ac.uk with body
 "unsubscribe 
>csound"

Victor Lazzarini
Music Technology Laboratory
Music Department
National University of Ireland, Maynooth



Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body
 "unsubscribe csound"





      ____________________________________________________________________________________
Be a better sports nut!  Let your teams follow you 
with Yahoo Mobile. Try it now.  http://mobile.yahoo.com/sports;_ylt=At9_qDKvtAbMuh1G1SQtBI7ntAcJ