The ss_ins_freq_on() function has been renamed to ss_ins_note_on_by_freq().
[ahxm.git] / song.h
blobed800ae0a0eb3b0197cd15efec59f16fdb456040
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_SET_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_NOTE_ON_BY_TIME,
54 SONG_EV_SS_NOTE_ON,
56 SONG_EV_MIDI_NOTE_ON,
58 SONG_EV_NOTE_OFF,
60 SONG_EV_END
62 } song_ev_type;
64 struct song_ev_generic
66 song_ev_type type; /* event type */
67 double time; /* event time (1: whole note) */
68 int trk_id; /* track id */
71 struct song_ev_note
73 song_ev_type type; /* SONG_EV_NOTE */
74 double time;
75 int trk_id;
76 int note; /* MIDI-like note */
77 double len; /* note length (1: whole note) */
78 float vol; /* note volume (1: full volume) */
81 struct song_ev_tempo
83 song_ev_type type; /* SONG_EV_TEMPO */
84 double time;
85 int trk_id; /* always -1 */
86 double tempo; /* tempo in bpm */
89 struct song_ev_meter
91 song_ev_type type; /* SONG_EV_METER */
92 double time;
93 int trk_id; /* always -1 */
94 int num; /* meter numerator */
95 int den; /* meter denominator */
98 struct song_ev_ss_note_by_time
100 song_ev_type type; /* SONG_EV_SS_NOTE_BY_TIME */
101 double time;
102 int trk_id;
103 int note; /* MIDI-like note (to find the wave) */
104 double len; /* note length (1: whole note) */
105 float vol; /* note volume (1: full volume) */
108 struct song_ev_ss_sustain
110 song_ev_type type; /* SONG_EV_SS_SUSTAIN */
111 double time;
112 int trk_id;
113 double sustain; /* sustain time (in msecs) */
116 struct song_ev_ss_set_channel
118 song_ev_type type; /* SONG_EV_SS_SET_CHANNEL */
119 double time;
120 int trk_id;
121 int channel; /* channel */
122 float vol; /* volume */
125 struct song_ev_ss_wav
127 song_ev_type type; /* SONG_EV_SS_WAV */
128 double time;
129 int trk_id;
130 char * file; /* path to .wav file */
131 int base; /* MIDI-like base note */
132 int min; /* MIDI-like minimum note */
133 int max; /* MIDI-like maximum note */
134 double loop_start; /* start of loop */
135 double loop_end; /* end of loop */
138 struct song_ev_ss_pat
140 song_ev_type type; /* SONG_EV_SS_PAT */
141 double time;
142 int trk_id;
143 char * file; /* path to .pat file */
146 struct song_ev_ss_eff
148 song_ev_type type; /* effect type */
149 double time;
150 int trk_id;
151 int channel; /* channel */
152 double size; /* size of effect */
153 float gain; /* gain */
154 double depth; /* depth */
155 double freq; /* freq */
156 double phase; /* phase */
157 float initial; /* initial vol */
158 float final; /* final vol */
161 struct song_ev_midi_channel
163 song_ev_type type; /* SONG_EV_MIDI_CHANNEL */
164 double time;
165 int trk_id;
166 int channel; /* midi channel (1-16) */
169 struct song_ev_midi_program
171 song_ev_type type; /* SONG_EV_MIDI_PROGRAM */
172 double time;
173 int trk_id;
174 int program; /* midi program (0-127) */
177 union song_ev
179 struct song_ev_generic generic;
181 struct song_ev_tempo tempo;
182 struct song_ev_meter meter;
184 struct song_ev_note note;
186 struct song_ev_ss_note_by_time ss_note_by_time;
187 struct song_ev_ss_sustain ss_sustain;
188 struct song_ev_ss_set_channel ss_set_channel;
190 struct song_ev_ss_wav ss_wav;
191 struct song_ev_ss_pat ss_pat;
193 struct song_ev_ss_eff ss_eff;
195 struct song_ev_midi_channel midi_channel;
196 struct song_ev_midi_program midi_program;
199 extern union song_ev * song;
200 extern int n_song_ev;
202 void song_clear(void);
203 void add_song_ev(union song_ev * ev);
204 void song_sort(void);