I updated the stack generator routines in libpippi to support the new
pulsar osc style. They just return normal lpbuffer_t
buffers now, but also require pointers to two arrays which store the
offsets and sizes of each table inside the buffer. Otherwise the
interface is similar: the first param is the number of tables in the
stack, then there are two new required params for the offsets and
lengths for each table (it’s up to the caller to make sure they’re the
right size) and finally a series of alternating constants for the
wavetype, and the requested size. The special WT_USER and
WIN_USER constants now also can be given a pointer to an
lpbuffer_t instead of a size, and the table will be
included in the stack along with any built-in tables.
So, for example to create a stack of tables to be used for windows that consists of a 4096 element hanning window, a 128 element sine window, an arbitrarily sized window buffer (maybe filled with a microfragment of a fish vocalization? or anything) and a 1024 element triangle window:
#define num_tables 4
size_t onsets[num_tables] = {};
size_t lengths[num_tables] = {};
lpbuffer_t * fish = LPSoundFile.read("fish.wav");
lpbuffer_t * tables = LPWindow.create_stack(num_tables,
onsets, lengths,
WT_HANN, 4096,
WT_SINE, 128,
WT_USER, fish,
WT_TRI, 1024
);