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
25 #define SS_GEN_NUM 256
28 #define SS_GEN_PLAYING 3
29 #define SS_GEN_RELEASED 2
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 */
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
[],
66 int ss_gen_release(struct ss_gen
* g
);
68 int ss_gen_frame(struct ss_gen
* g
, float frame
[]);
70 void ss_gen_sustain(struct ss_gen
* g
, double sustain
);
71 int ss_gen_portamento(struct ss_gen
* g
, int portamento
, double dest_inc
);