Renamed SS_GEN_NUM to SS_MAX_GENERATORS.
[ahxm.git] / song.h
blob41478f4198402d0992cbc33019f2e784b33d4929
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,
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,
46 SONG_EV_SS_EFF_OFF,
48 SONG_EV_MIDI_CHANNEL,
49 SONG_EV_MIDI_PROGRAM,
51 SONG_EV_NOTE,
52 SONG_EV_SS_PITCH_STRETCH,
54 SONG_EV_NOTE_ON,
55 SONG_EV_NOTE_OFF,
57 SONG_EV_END
59 } song_ev_type;
61 struct song_ev_generic
63 song_ev_type type; /* event type */
64 double time; /* event time (1: whole note) */
65 int trk_id; /* track id */
68 struct song_ev_note
70 song_ev_type type; /* SONG_EV_NOTE */
71 double time;
72 int trk_id;
73 int note; /* MIDI-like note */
74 double len; /* note length (1: whole note) */
75 float vol; /* note volume (1: full volume) */
78 struct song_ev_tempo
80 song_ev_type type; /* SONG_EV_TEMPO */
81 double time;
82 int trk_id; /* always -1 */
83 double tempo; /* tempo in bpm */
86 struct song_ev_meter
88 song_ev_type type; /* SONG_EV_METER */
89 double time;
90 int trk_id; /* always -1 */
91 int num; /* meter numerator */
92 int den; /* meter denominator */
95 struct song_ev_ss_pitch_stretch
97 song_ev_type type; /* SONG_EV_SS_PITCH_STRETCH */
98 double time;
99 int trk_id;
100 int note; /* MIDI-like note (to find the wave) */
101 double len; /* note length (1: whole note) */
102 float vol; /* note volume (1: full volume) */
105 struct song_ev_ss_sustain
107 song_ev_type type; /* SONG_EV_SS_SUSTAIN */
108 double time;
109 int trk_id;
110 double sustain; /* sustain time (in msecs) */
113 struct song_ev_ss_channel
115 song_ev_type type; /* SONG_EV_SS_CHANNEL */
116 double time;
117 int trk_id;
118 int channel; /* channel */
119 float vol; /* volume */
122 struct song_ev_ss_wav
124 song_ev_type type; /* SONG_EV_SS_WAV */
125 double time;
126 int trk_id;
127 char * file; /* path to .wav file */
128 int base; /* MIDI-like base note */
129 int min; /* MIDI-like minimum note */
130 int max; /* MIDI-like maximum note */
131 double loop_start; /* start of loop */
132 double loop_end; /* end of loop */
135 struct song_ev_ss_pat
137 song_ev_type type; /* SONG_EV_SS_PAT */
138 double time;
139 int trk_id;
140 char * file; /* path to .pat file */
143 struct song_ev_ss_eff
145 song_ev_type type; /* effect type */
146 double time;
147 int trk_id;
148 int channel; /* channel */
149 double size; /* size of effect */
150 float gain; /* gain */
151 double depth; /* depth */
152 double freq; /* freq */
153 double phase; /* phase */
154 float initial; /* initial vol */
155 float final; /* final vol */
158 struct song_ev_midi_channel
160 song_ev_type type; /* SONG_EV_MIDI_CHANNEL */
161 double time;
162 int trk_id;
163 int channel; /* midi channel (1-16) */
166 struct song_ev_midi_program
168 song_ev_type type; /* SONG_EV_MIDI_PROGRAM */
169 double time;
170 int trk_id;
171 int program; /* midi program (0-127) */
174 union song_ev
176 struct song_ev_generic generic;
178 struct song_ev_tempo tempo;
179 struct song_ev_meter meter;
181 struct song_ev_note note;
183 struct song_ev_ss_pitch_stretch ss_pitch_stretch;
184 struct song_ev_ss_sustain ss_sustain;
185 struct song_ev_ss_channel ss_channel;
187 struct song_ev_ss_wav ss_wav;
188 struct song_ev_ss_pat ss_pat;
190 struct song_ev_ss_eff ss_eff;
192 struct song_ev_midi_channel midi_channel;
193 struct song_ev_midi_program midi_program;
196 extern union song_ev * song;
197 extern int n_song_ev;
199 void song_clear(void);
200 void add_song_ev(union song_ev * ev);
201 void song_sort(void);