Fixed a cosmetic bug in _add_measure_event().
[ahxm.git] / ss_gen.h
blobf7fc312f4d659b048fad6786139c51c1f048838a
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 */
37 int trk_id; /* track ID */
39 struct ss_wave w; /* the wave data */
40 float vol[CHANNELS]; /* the volumes */
42 double cursor; /* offset to next sample */
43 double inc; /* increment (frequency) */
45 int sustain; /* number of samples to play after release */
46 float dvol[CHANNELS]; /* volume decrement for each sample in sustain */
48 int portamento; /* number of samples of portamento */
49 double dest_inc; /* final portamento inc */
50 double dinc; /* delta of inc */
52 double vibrato;
53 double vib_depth;
54 double vib_inc;
58 int ss_gen_play(int note_id, int trk_id, double freq, float vol[],
59 struct ss_wave * w);
61 int ss_gen_release(int note_id);
63 int _ss_gen_frame(struct ss_gen * g, float frame[]);
65 void ss_gen_frame(int trk_id, float frame[]);
67 int ss_gen_portamento(struct ss_gen * g, int portamento, double dest_inc);