00001 /* 00002 * TEMPLATE.C 00003 * 00004 * One input one output script template working on 00005 * single percision floating point buffer data. 00006 */ 00007 #include "scripts.h" 00008 00009 void template_script(void) 00010 { 00011 mgk_data_type type; 00012 float *data; 00013 data = mgk_receive(0,&type); 00014 if(data && (type == (T_FLOAT | T_BUFFER))) { 00015 int size = mgk_buffer_size(data) / sizeof(float); 00016 /* Do something with the data */ 00017 /* ... */ 00018 /* Propagate the data. The input buffer can be reused as the Kernel */ 00019 /* protects data from aliasing */ 00020 mgk_propagate(0,data,(T_FLOAT | T_BUFFER)); 00021 } 00022 } 00023