The wav.c test file accepts a .ahs file name as its first argument.
[ahxm.git] / ss_gen.h
blobb87766132b1971dcef6893fea8a4281e3ca9d13b
1 /*
3 Ann Hell Ex Machina - Music Software
4 Copyright (C) 2003/2004 Angel Ortega <angel@triptico.com>
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License
8 as published by the Free Software Foundation; either version 2
9 of the License, or (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 http://www.triptico.com
24 #ifndef SS_GEN_NUM
25 #define SS_GEN_NUM 256
26 #endif
28 #define SS_GEN_PLAYING 3
29 #define SS_GEN_RELEASED 2
30 #define SS_GEN_FREE 0
32 struct ss_gen
34 int mode; /* SS_GEN_* */
36 int note_id; /* note ID */
38 struct ss_wave w; /* the wave data */
39 float vol[CHANNELS]; /* the volumes */
41 double cursor; /* offset to next sample */
42 double inc; /* increment (frequency) */
44 int sustain; /* number of samples to play after release */
45 float dvol[CHANNELS]; /* volume decrement for each sample in sustain */
47 double portamento; /* portamento sum to inc */
49 double vibrato;
50 double vib_depth;
51 double vib_inc;
53 struct ss_gen * next;
54 struct ss_gen * prev;
57 extern struct ss_gen * _ss_gen_free;
59 void ss_gen_enqueue(struct ss_gen ** q, struct ss_gen * g);
60 void ss_gen_dequeue(struct ss_gen ** q, struct ss_gen * g);
61 struct ss_gen * _ss_gen_get_free(void);
63 int ss_gen_play(struct ss_gen * g, int note_id, double freq, float vol[],
64 struct ss_wave * w);
66 int ss_gen_release(struct ss_gen * g);
68 int ss_gen_frame(struct ss_gen * g, float frame[]);
70 int ss_gen_portamento(struct ss_gen * g, int portamento, double dest_inc);