Added comments to ss_outdev source.
[ahxm.git] / ss_core.h
bloba61a07c30a99d8792e040d1d433abb27e82b5dad
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
24 #ifndef SS_MAX_CHANNELS
25 #define SS_MAX_CHANNELS 16
26 #endif
28 extern int ss_frequency;
29 extern int ss_interpolation;
30 extern int ss_nchannels;
31 extern int ss_debug;
33 #define MS2F(ms) ((ms / 1000.0) * ss_frequency)
35 struct ss_wave
37 double size; /* size in frames */
38 int n_channels; /* # of channels */
39 float ** wave; /* the PCM waves */
40 int s_rate; /* original sample rate */
42 double loop_start; /* start of loop (-1, no loop) */
43 double loop_end; /* end of loop */
45 double base_freq; /* base frequency */
46 double min_freq; /* minimum frequency */
47 double max_freq; /* maximum frequency */
51 double ss_note_frequency(int note);
52 struct ss_wave * ss_alloc_wave(int size, int n_channels, int s_rate);
54 float ss_get_sample(float * wave, double size, double offset);
56 double ss_tempo_from_wave(struct ss_wave * w, int note, double len);
57 double ss_pitch_from_tempo(struct ss_wave * w, double tempo, double len);