00001 /* 00002 convolve.h: 00003 00004 Copyright (C) 1996 Greg Sullivan 00005 00006 This file is part of Csound. 00007 00008 The Csound Library is free software; you can redistribute it 00009 and/or modify it under the terms of the GNU Lesser General Public 00010 License as published by the Free Software Foundation; either 00011 version 2.1 of the License, or (at your option) any later version. 00012 00013 Csound is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 GNU Lesser General Public License for more details. 00017 00018 You should have received a copy of the GNU Lesser General Public 00019 License along with Csound; if not, write to the Free Software 00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 00021 02111-1307 USA 00022 */ 00023 00024 #ifndef _CONVOLVE_H_ 00025 #define _CONVOLVE_H_ 00026 00027 #define CONVOLVE_VERSION_STRING "CONVOLVE VERSION: V1.1\n" 00028 00029 #ifndef NULL 00030 #define NULL 0L 00031 #endif /* !NULL */ 00032 00033 #define CVMAGIC 666 /* Evil, eh? */ 00034 00035 #define CVDFLTBYTS 4 00036 00037 typedef struct cvstruct 00038 { 00039 long magic; /* magic number to identify */ 00040 long headBsize; /* byte offset from start to data */ 00041 long dataBsize; /* total number of bytes of data */ 00042 long dataFormat; /* (int) format specifier */ 00043 MYFLT samplingRate; /* of original sample */ 00044 long src_chnls; /* no. of channels in source */ 00045 long channel; /* requested channel(s) */ 00046 long Hlen; /* length of impulse reponse */ 00047 long Format; /* (int) how words are org'd in frm */ 00048 char info[CVDFLTBYTS]; /* extendable byte area */ 00049 } CVSTRUCT; 00050 00051 /* Error codes returned by CONVOLVE file functions */ 00052 #define CVE_OK 0 /* no error*/ 00053 #define CVE_NOPEN -1 /* couldn't open file */ 00054 #define CVE_NCV -2 /* not a CONVOLVE file */ 00055 #define CVE_MALLOC -3 /* couldn't allocate memory */ 00056 #define CVE_RDERR -4 /* read error */ 00057 #define CVE_WRERR -5 /* write error */ 00058 00059 #define CV_UNK_LEN -1L /* flag if dataBsize unknown in hdr */ 00060 00061 /* values for dataFormat field */ 00062 #define CVMYFLT (4+32) /* 32 bit float data */ 00063 00064 /* values for frameFormat field */ 00065 #define CVRECT 1 /* real, imag pairs */ 00066 00067 /********************************/ 00068 /* exported function prototypes */ 00069 /********************************/ 00070 00071 #endif /* !_CONVOLVE_H_ */