Added support for comb, allpass and flanger events.
[ahxm.git] / song.h
blob9d0c65c46f2e6cc36cc76d498d4083575e5d0849
1 /*
3 Ann Hell Ex Machina - Music Software
4 Copyright (C) 2003/2005 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 typedef enum
27 SONG_EV_TEMPO,
28 SONG_EV_METER,
29 SONG_EV_MEASURE,
31 SONG_EV_SS_SUSTAIN,
32 SONG_EV_SS_CHANNEL_MAP,
34 SONG_EV_SS_WAV,
35 SONG_EV_SS_PAT,
37 SONG_EV_SS_EFF_DELAY,
38 SONG_EV_SS_EFF_ECHO,
39 SONG_EV_SS_EFF_COMB,
40 SONG_EV_SS_EFF_ALLPASS,
41 SONG_EV_SS_EFF_FLANGER,
42 SONG_EV_SS_EFF_WOBBLE,
43 SONG_EV_SS_EFF_SQWOBBLE,
44 SONG_EV_SS_EFF_FADER,
45 SONG_EV_SS_EFF_REVERB,
47 SONG_EV_NOTE,
48 SONG_EV_SS_NOTE_ON_BY_TIME,
50 SONG_EV_NOTE_ON,
51 SONG_EV_NOTE_OFF,
53 SONG_EV_END
55 } song_ev_type;
57 struct song_ev_generic
59 song_ev_type type; /* event type */
60 double time; /* event time (1: whole note) */
61 int trk_id; /* track id */
64 struct song_ev_note
66 song_ev_type type; /* SONG_EV_NOTE */
67 double time;
68 int trk_id;
69 int note; /* MIDI-like note */
70 double len; /* note length (1: whole note) */
71 double vol; /* note volume (1: full volume) */
74 struct song_ev_tempo
76 song_ev_type type; /* SONG_EV_TEMPO */
77 double time;
78 int trk_id; /* always -1 */
79 double tempo; /* tempo in bpm */
82 struct song_ev_meter
84 song_ev_type type; /* SONG_EV_METER */
85 double time;
86 int trk_id; /* always -1 */
87 int num; /* meter numerator */
88 int den; /* meter denominator */
91 struct song_ev_ss_note_by_time
93 song_ev_type type; /* SONG_EV_SS_NOTE_BY_TIME */
94 double time;
95 int trk_id;
96 int note; /* MIDI-like note (to find the wave) */
97 double len; /* note length (1: whole note) */
98 double vol; /* note volume (1: full volume) */
101 struct song_ev_ss_sustain
103 song_ev_type type; /* SONG_EV_SS_SUSTAIN */
104 double time;
105 int trk_id;
106 int sustain; /* sustain time (in msecs) */
109 struct song_ev_ss_channel_map
111 song_ev_type type; /* SONG_EV_SS_CHANNEL_MAP */
112 double time;
113 int trk_id;
114 float vol[CHANNELS]; /* volume for each channel */
117 struct song_ev_ss_wav
119 song_ev_type type; /* SONG_EV_SS_WAV */
120 double time;
121 int trk_id;
122 char * file; /* path to .wav file */
123 int base; /* MIDI-like base note */
124 int min; /* MIDI-like minimum note */
125 int max; /* MIDI-like maximum note */
128 struct song_ev_ss_pat
130 song_ev_type type; /* SONG_EV_SS_PAT */
131 double time;
132 int trk_id;
133 char * file; /* path to .pat file */
136 struct song_ev_ss_eff
138 song_ev_type type; /* effect type */
139 double time;
140 int trk_id;
141 int channel; /* channel */
142 double size; /* size of effect */
143 float gain; /* gain */
144 double depth; /* depth */
145 double freq; /* freq */
146 double phase; /* phase */
147 float initial; /* initial vol */
148 float final; /* final vol */
152 union song_ev
154 struct song_ev_generic generic;
156 struct song_ev_tempo tempo;
157 struct song_ev_meter meter;
159 struct song_ev_note note;
161 struct song_ev_ss_note_by_time ss_note_by_time;
162 struct song_ev_ss_sustain ss_sustain;
163 struct song_ev_ss_channel_map ss_channel_map;
165 struct song_ev_ss_wav ss_wav;
166 struct song_ev_ss_pat ss_pat;
168 struct song_ev_ss_eff ss_eff;
171 extern union song_ev * _song;
172 extern int _n_song_ev;
174 void song_clear(void);
175 void add_song_ev(union song_ev * ev);
176 void song_sort(void);