Merge branch 'list' into audio
[cantaveria.git] / org.h
bloba48fa50b4fbc325972bd40c000f5b650944c9847
1 /*
2 org.c
3 various software synths and samples
5 Copyright (C) 2009 Evan Rinehart
7 This software comes with no warranty.
8 1. This software can be used for any purpose, good or evil.
9 2. Modifications must retain this license, at least in spirit.
12 #define SAMPLE_RATE 44100
13 #define PI 3.1415926535897931
14 #define PI2 2*PI
16 enum {
17 EV_NOTEON = 0x90,
18 EV_NOTEOFF = 0x80,
19 EV_CONTROLLER = 0xC0,
20 EV_PITCHBEND = 0xE0
23 typedef void (*mix_callback)(void* data, float out[], int count);
24 typedef void (*control_callback)(void* data, int type, int val1, int val2, int val);
25 typedef void (*cleanup_callback)(void* data);
27 typedef struct {
28 mix_callback mix;
29 control_callback control;
30 cleanup_callback cleanup;
31 void* data;
32 } instrument;
34 enum instrument_name {
35 ORG_DEFAULT,
36 ORG_KARPLUS,
37 ORG_UNKNOWN
42 instrument load_instrument(enum instrument_name name);
43 void org_init();