1 /* 2 convolve.h: 3 4 Copyright (C) 1996 Greg Sullivan 5 6 This file is part of Csound. 7 8 The Csound Library is free software; you can redistribute it 9 and/or modify it under the terms of the GNU Lesser General Public 10 License as published by the Free Software Foundation; either 11 version 2.1 of the License, or (at your option) any later version. 12 13 Csound is distributed in the hope that it will be useful, 14 but WITHOUT ANY WARRANTY; without even the implied warranty of 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 GNU Lesser General Public License for more details. 17 18 You should have received a copy of the GNU Lesser General Public 19 License along with Csound; if not, write to the Free Software 20 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 21 02110-1301 USA 22 */ 23 24 #ifndef _CONVOLVE_H_ 25 #define _CONVOLVE_H_ 26 27 #define CONVOLVE_VERSION_STRING "CONVOLVE VERSION: V1.1\n" 28 29 #ifndef NULL 30 #define NULL 0L 31 #endif /* !NULL */ 32 33 #define CVMAGIC 666 /* Evil, eh? */ 34 35 #define CVDFLTBYTS 4 36 37 typedef struct cvstruct 38 { 39 int32 magic; /* magic number to identify */ 40 int32 headBsize; /* byte offset from start to data */ 41 int32 dataBsize; /* total number of bytes of data */ 42 int32 dataFormat; /* (int) format specifier */ 43 MYFLT samplingRate; /* of original sample */ 44 int32 src_chnls; /* no. of channels in source */ 45 int32 channel; /* requested channel(s) */ 46 int32 Hlen; /* length of impulse reponse */ 47 int32 Format; /* (int) how words are org'd in frm */ 48 char info[CVDFLTBYTS]; /* extendable byte area */ 49 } CVSTRUCT; 50 51 /* Error codes returned by CONVOLVE file functions */ 52 #define CVE_OK 0 /* no error*/ 53 #define CVE_NOPEN -1 /* couldn't open file */ 54 #define CVE_NCV -2 /* not a CONVOLVE file */ 55 #define CVE_MALLOC -3 /* couldn't allocate memory */ 56 #define CVE_RDERR -4 /* read error */ 57 #define CVE_WRERR -5 /* write error */ 58 59 #define CV_UNK_LEN -1L /* flag if dataBsize unknown in hdr */ 60 61 /* values for dataFormat field */ 62 #define CVMYFLT (4+32) /* 32 bit float data */ 63 64 /* values for frameFormat field */ 65 #define CVRECT 1 /* real, imag pairs */ 66 67 /********************************/ 68 /* exported function prototypes */ 69 /********************************/ 70 71 #endif /* !_CONVOLVE_H_ */ 72