Csound Csound-dev Csound-tekno Search About

[Csnd] Tablew question

Date2007-11-15 15:44
Frommark jamerson
Subject[Csnd] Tablew question
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 

Date2007-11-15 16:01
FromVictor Lazzarini
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