the delay module is also a type of table.
For the ram type, the size of the table is set like "int32_t array[LENGTH]" where the length is set with the size attribute.
for the SDram type, inside the recording module, you have the "int32_t *array;" in "local" content, which is used as a table, where the length of the table is set in the "init" content.
you could see it like this:
you could create multiple "int32_t" by doing like,
int32_t a1,a2,a3,a4,a5,a6...... etc. allowing you to store a 32-bit value into each of these.
But, you could also just use one name and turn it into an array like this: int32_t a;
Which, in a sense, is just six 32-bit values in a row, which can be selected by entering a number between 0 and 5 between the brackets..
The table and delay modules both make use of these tables, although in a somewhat different way due to how the table is used.
The table arrays are often used such that, for the table-write module, you can select an index at the input side and put an incoming value somewhere at some index of the table. Then the table-read module has an input to select an index of the table and output the stored value from that index position.
The delay module works alike, except it has one important difference: the write and read positions are "coupled" as the delaytime is a position in comparison to the write position (it follows the writeposition at a certain distance).
So to have a 1 second delay at a 48000hz samplerate, you need to offset the read position by 48000 steps in comparison to the writeposition to read out the table at the position that was written 1 second or 48000 samples ago, by subtracting 48000 from the current writeposition.
This would look like this:
so the table is a set of int32_t values (or whatever bitsize you're using), which is constantly being overwritten to save the last incoming audio. The maximum size of the recording is set by the table length, after which the buffer is overwriting the values that were stored before, but at a time longer then the table can hold (eg. if your table size is 48000, you can only record 1 second, so after a second, it will overwrite the value that was recorded a second ago).
So to clear a delay, all you need to do is to set all these values inside the table to zero, so when they're being read, they just return "0".
The fact that you can use an index number makes it really easy to do:
if(off && ! (inlet_active))
this sets all the values from i=0 up to i=length-1 of the "array" table to zero.