The file selection.proc defines a set of procedures to try to make it easier to manage the selection of objects in Praat. It is an attempt at providing some sort of informal API of sorts to save various selections, restore them at will, modify them, etc.
Install using CPrAN:
cpran install selection
You can download an archive of the latest version for manual installation, but you’ll have to also manually install the dependencies yourself. You can manually install the plugin just like any other Praat plugin.
include ../../plugin_selection/procedures/selection.proc
Praat does not allow for the creation of custom object types, so it was
necessary to generate some abstraction of a selection that could be represented
using the existing object types. A selection table is a object of type
Table
that represents a given selection. The procedures provide ways to
generate them based on the existing selection, to create new ones procedurally,
and to make them either from subsets, or as combinations of existing tables.
A selection table is simply a Table
that contains the following fields:
type
, holding the type of a given object as a stringname
, holding the name of a given object as a stringn
, a placeholder variable holding the value 1
id
, holding the id number of the corresponding objectAny Table
that contains at least these columns will be considered a
selection table, and can be used with these procedures.
Almost every procedure here uses selection tables to manage the selection, with two exceptions: saveSelection() and restoreSelection().
Below, all procedures are explained in an order that will hopefully make it easier to learn how to use them.
Please see the documentation for more detailed information on how to use these procedures.