Debian Codegraph @

iOS/Csound iOS Swift Examples/Csound iOS SwiftExamples/csound-iOS/headers/cscore.h

raw symbols SCIP
1 /*
2 cscore.h:
3
4 Copyright (C) 1991 Barry Vercoe, John ffitch
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 CSCORE_H
25 #define CSCORE_H
26 /**
27 * \file csound.h
28 * \section section_api_cscore Cscore
29 *
30 * Beginning with Csound 5, all of the Cscore functions described in the
31 * manual are now part of the Csound API, and they can be called from a program
32 * that calls the Csound library.
33 *
34 * All of the CScore functions are renamed in the Csound API. For
35 * example, createv() is now cscoreCreateEvent(), and lcopy() is now
36 * cscoreListCopy(). In addition, each function takes an additional
37 * first parameter that is a pointer to a CSOUND instance. You can
38 * find the details in the header file, cscore.h, which may be
39 * included with your Csound distribution, or if not, can be found in
40 * Csound CVS `on SourceForge.
41 *
42 * Before you can use any of the Cscore API functions, you must create a CSOUND
43 * instance and initialize Cscore by calling csoundInitializeCscore() -- see
44 * csound.h for an explanation. An example main program that does all of this
45 * Top/cscormai.c. You should add a function called cscore() with your own
46 * score-processing code. An example that does nothing except write the score
47 * back out unchanged can be found in the file Top/cscore_internal.c.
48 *
49 * To create your own standalone Cscore program, you must compile cscormai.c
50 * (or your own main program) and the file containing your
51 * cscore() function, and link them with the Csound API library.
52 */
53
54 #include <stdio.h>
55
56 #ifndef MYFLT
57 #include "sysdep.h"
58 #endif
59 #include "csound.h"
60
61 typedef struct cshdr {
62 struct cshdr *prvblk;
63 struct cshdr *nxtblk;
64 int16 type;
65 int16 size;
66 } CSHDR;
67
68 /* Single score event structure */
69 typedef struct {
70 CSHDR h;
71 char *strarg;
72 char op;
73 int16 pcnt;
74 MYFLT p2orig;
75 MYFLT p3orig;
76 MYFLT p[1];
77 } EVENT;
78
79 /* Event list structure */
80 typedef struct {
81 CSHDR h;
82 int nslots;
83 int nevents;
84 EVENT *e[1];
85 } EVLIST;
86
87 /* Functions for working with single events */
88 PUBLIC EVENT *cscoreCreateEvent(CSOUND*, int);
89 PUBLIC EVENT *cscoreDefineEvent(CSOUND*, char*);
90 PUBLIC EVENT *cscoreCopyEvent(CSOUND*, EVENT*);
91 PUBLIC EVENT *cscoreGetEvent(CSOUND*);
92 PUBLIC void cscorePutEvent(CSOUND*, EVENT*);
93 PUBLIC void cscorePutString(CSOUND*, char*);
94
95 /* Functions for working with event lists */
96 PUBLIC EVLIST *cscoreListCreate(CSOUND*, int);
97 PUBLIC EVLIST *cscoreListAppendEvent(CSOUND*, EVLIST*, EVENT*);
98 PUBLIC EVLIST *cscoreListAppendStringEvent(CSOUND*, EVLIST*, char*);
99 PUBLIC EVLIST *cscoreListGetSection(CSOUND*);
100 PUBLIC EVLIST *cscoreListGetNext(CSOUND *, MYFLT);
101 PUBLIC EVLIST *cscoreListGetUntil(CSOUND*, MYFLT);
102 PUBLIC EVLIST *cscoreListCopy(CSOUND*, EVLIST*);
103 PUBLIC EVLIST *cscoreListCopyEvents(CSOUND*, EVLIST*);
104 PUBLIC EVLIST *cscoreListExtractInstruments(CSOUND*, EVLIST*, char*);
105 PUBLIC EVLIST *cscoreListExtractTime(CSOUND*, EVLIST*, MYFLT, MYFLT);
106 PUBLIC EVLIST *cscoreListSeparateF(CSOUND*, EVLIST*);
107 PUBLIC EVLIST *cscoreListSeparateTWF(CSOUND*, EVLIST*);
108 PUBLIC EVLIST *cscoreListAppendList(CSOUND*, EVLIST*, EVLIST*);
109 PUBLIC EVLIST *cscoreListConcatenate(CSOUND*, EVLIST*, EVLIST*);
110 PUBLIC void cscoreListPut(CSOUND*, EVLIST*);
111 PUBLIC int cscoreListPlay(CSOUND*, EVLIST*);
112 PUBLIC void cscoreListSort(CSOUND*, EVLIST*);
113 PUBLIC int cscoreListCount(CSOUND*, EVLIST *);
114
115 /* Functions for reclaiming memory */
116 PUBLIC void cscoreFreeEvent(CSOUND*, EVENT*);
117 PUBLIC void cscoreListFree(CSOUND*, EVLIST*);
118 PUBLIC void cscoreListFreeEvents(CSOUND*, EVLIST*);
119
120 /* Functions for working with multiple input score files */
121 PUBLIC FILE *cscoreFileOpen(CSOUND*, char*);
122 PUBLIC void cscoreFileClose(CSOUND*, FILE*);
123 PUBLIC FILE *cscoreFileGetCurrent(CSOUND*);
124 PUBLIC void cscoreFileSetCurrent(CSOUND*, FILE*);
125
126 #endif