next up previous contents
Next: ox_update: when parameter values Up: Setting up your callbacks Previous: ox_destroy: destroying machines

ox_work: processing and generating

int ox_work(machine* m, int block_size)

This is where the actual work happens; hence the name. First, grab your state object by casting m->state to whatever pointer type you are using for your state objects.

my_state *s = (my_state*) m->state;

Your parameters will have been set during the host's call to ox_update(). The number of samples you should generate for this block is held in block_size which is passed to you. Begin processing. Your input buffers will be arrays of type samp. m->lin and m->rin are the left and right input buffers1.4, while m->lout and m->rout are the output buffers.

There will also be an auxiliary input signal set, labeled xlin/xrin, for use in vocoding and other modulation tasks. This will be implemented soon.

If you generated any sound, return work_noisy; otherwise, return work_quiet.



David O'Toole
2000-07-19