Csound Csound-dev Csound-tekno Search About

Re: guard point

Date1998-01-20 08:53
Fromrasmus ekman
SubjectRe: guard point
Qian Chen wrote:
> 
> Hi there,
> 
> Could somebody explain me what *guard point* is in a table?

Snipped from newbie notes that I am preparing (occasionally, 
from brushed-up list snips).

Csound ftables usually have the virtual length 1 (one), meaning 
"one cycle". Indexing a table from an orchestra is done using 
numbers in the range 0.0 through 0.9999... (other numbers are 
in effect cropped into their fractional part). Since any table 
index is in reality (inside Csound, in the computer's physical 
memory) always an integer, the decimal fractions used in Csound 
orchestras will often index points "between" the real points in 
the table. 

The guard point is an extra table point "beyond the end" of the 
table, the value of which is copied from the first location of 
the table, and used if/when the table interpolates from the final 
actual point in the table. 

Tables used with oscil and similar opcodes are cycled, so it is 
always good idea to include a guard point for them - else there 
may be a sharp noise each time the table goes from index 0.9999... 
and back to 0.0 (which is the same as table index 1.0, 2.0 etc). 
But if you are using the table as a rise or decay shape in fof or pan, 
the very last point is _not_ supposed to fade down towards the value
of the first point in the table.

Regards,

	re

Date1998-01-20 20:18
From"Matt J. Ingalls"
SubjectRe: guard point
> Tables used with oscil and similar opcodes are cycled, so it is 
> always good idea to include a guard point for them - else there 

> But if you are using the table as a rise or decay shape in fof or pan, 


i always thought of this the other way - so i took a look at the manual

the guard pt defaults to the first value of the table when you don't give
one (have table size a power of 2).

So you really don't need to think about it for an oscilating read.  Only
need to give one for single reads (like oscil1i, etc..)   if your end pt.
is not the same as the start pt. (otherwise you WILL get interpolation
between the end and "wrapped" beginning point!!)

-matt