1 /*
2     oscils.h:
3 
4     Copyright (C) 2002 Istvan Varga
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 /* ------ oscils, lphasor, and tablexkt by Istvan Varga (Jan 5 2002) ------ */
25 
26 #ifndef CSOUND_OSCILS_H
27 #define CSOUND_OSCILS_H
28 
29 /* oscils opcode struct */
30 
31 typedef struct {
32     OPDS    h;
33     MYFLT   *ar, *iamp, *icps, *iphs, *iflg;                /* opcode args  */
34     /* internal variables */
35     int     use_double;
36     double  xd, cd, vd;
37     MYFLT   x, c, v;
38 } OSCILS;
39 
40 /* lphasor opcode struct */
41 
42 typedef struct {
43     OPDS    h;
44     MYFLT   *ar, *xtrns, *ilps, *ilpe;                      /* opcode       */
45     MYFLT   *imode, *istrt, *istor;                         /* args         */
46     /* internal variables */
47     int     loop_mode;
48     double  phs, lps, lpe;
49     int     dir;            /* playback direction (0: backward, 1: forward) */
50 } LPHASOR;
51 
52 /* tablexkt opcode struct */
53 
54 typedef struct {
55     OPDS    h;
56     MYFLT   *ar, *xndx, *kfn, *kwarp, *iwsize;              /* opcode       */
57     MYFLT   *ixmode, *ixoff, *iwrap;                        /* args         */
58     /* internal variables */
59     int     raw_ndx, ndx_scl, wrap_ndx, wsize;
60     MYFLT   win_fact;
61 /*  double  wsized2_d, pidwsize_d; */           /* for oscils_hann.c */
62 } TABLEXKT;
63 
64 /* these functions are exported to entry*.c */
65 
66 #ifndef CSOUND_OSCILS_C
67 extern int oscils_set (CSOUND *, void*);
68 extern int oscils (CSOUND *, void*);
69 extern int lphasor_set (CSOUND *, void*);
70 extern int lphasor (CSOUND *, void*);
71 extern int tablexkt_set (CSOUND *, void*);
72 extern int tablexkt (CSOUND *, void*);
73 #endif
74 
75 #endif              /* CSOUND_OSCILS_H */
76 
77