modtable

Modify the data coming through one table-handle and send the transformed data through another table-handle.


Synopsis

table = modtable(input_table_handle, “modification_type”, arg1, arg2, …)


Description

modtable returns a table-handle that will deliver data produced by modifying the values coming from another table. The specific data-transformation applied is determined by the “modification_type” text field in conjunction with any of the optional argN parameters. The input_table_handle variable should refer to another table via a table-handle, probably created using the maketable) command or possibly coming from a previous modtable.

Many of the arguments for modtable may themselves also be pfield-handles.


Arguments


Modification Types


Examples

Using these scorefile commands:

table = maketable("line", "nonorm", 1000, 0,0, 1,10, 2, -5)
newtable = modtable(table, "normalize", 1.0)

newtable will be associated with a new table that will start at 0.0, go up to 1.0, and then down to -0.5 over the 1000 elements in the table.

In this set of commands:

table = maketable("literal", "nonorm", 5, 1.0, 2.0, 3.0, 4.0, 5.0)
newtable = modtable(table, "reverse")

the table-handle newtable will be associated with a new table that will contain the following sequence of elements:

5.0, 4.0, 3.0, 2.0, 1.0
```cpp

And this scorefile fragment:

```cpp
table = maketable("literal", "nonorm", 5, 1.0, 2.0, 3.0, 4.0, 5.0)
newtable1 = modtable(table, "shift", 3)
newtable2 = modtable(table, "shift", -1)

will result in the table-handle newtable1 being associated with a new table that will contain the following sequence of elements:

cpp 3.0, 4.0, 5.0, 1.0, 2.0 cpp

and the elements of newtable2 being in the following order:

cpp 2.0, 3.0, 4.0, 5.0, 1.0 cpp


See Also

maketable, makeconnection, makeLFO, makerandom, makeconverter, makemonitor, makefilter, plottable