next up previous contents
Next: ox_create: manufacturing new machines Up: Setting up your callbacks Previous: Setting up your callbacks

   
ox_init: the startup

int ox_init(machine_type* t)

This function is called when the shared library is first loaded. OCTAL will pass you the address of a machine_type structure, which you must fill in with the appropriate data. You may also perform any other one-time initialization tasks here, such as precomputing a large lookup table, loading a special configuration file, etcetera.

Here is a quick example of how to fill in the structure, taken from the example square wave generator machine included in the OCTAL distribution:

  t->long_name        = "David's Simple Squarewave Machine"; 
  t->short_name       = "dtosquare"; 
  t->max_tracks       = 1; 
  t->input_channels   = 1; 
  t->output_channels  = 1;   
  t->num_params       = 2; 

  /* give it the address of my array of param structs */ 
  t->param_specs      = my_params;



David O'Toole
2000-07-19