#pragma once typedef float play_fn(void *, double time, float in, unsigned char midi_cmd[3]); #define struct_init(ptr) _struct_init((void **)ptr, sizeof(*ptr)) #define array_init(ptr, len) _struct_init((void **)ptr, sizeof(*ptr) * len) static inline int _struct_init(void **ptr, size_t size) { if (*ptr) return 0; if ((*ptr = calloc(size, 1))) return 0; return 1; } extern play_fn play;