Csound API  6.03
csoundCore.h File Reference
#include "sysdep.h"
#include <pthread.h>
#include "cs_par_structs.h"
#include <stdarg.h>
#include <setjmp.h>
#include "csound_type_system.h"
#include "csound.h"
#include "cscore.h"
#include "csound_data_structures.h"
#include "csound_standard_types.h"
#include "pools.h"
#include "sort.h"
#include "text.h"
#include "prototyp.h"
#include "cwindow.h"
#include "envvar.h"
#include "remote.h"

Data Structures

struct  CORFIL
 
struct  OPARMS
 
struct  arglst
 
struct  arg
 
struct  oentry
 
struct  oentries
 
struct  text
 Storage for parsed orchestra code, for each opcode in an INSTRTXT. More...
 
struct  instr
 This struct is filled out by otran() at orch parse time. More...
 
struct  namedInstr
 
struct  op
 A chain of TEXT structs. More...
 
struct  fdch
 
struct  auxch
 
struct  ARRAYDAT
 
struct  TABDAT
 
struct  STRINGDAT
 
struct  monblk
 
struct  DPEXCL
 
struct  DPARM
 
struct  dklst
 
struct  mchnblk
 
struct  event
 This struct holds the data for one score event. More...
 
struct  insds
 This struct holds the info for a concrete instrument event instance in performance. More...
 
struct  opds
 This struct holds the info for one opcode in a concrete instrument instance in performance. More...
 
struct  lblblk
 
struct  OCTDAT
 
struct  DOWNDAT
 
struct  SPECDAT
 
struct  GEN01ARGS
 
struct  FUNC
 
struct  FGDATA
 
struct  NGFENS
 
struct  MEMFIL
 
struct  MEVENT
 
struct  SNDMEMFILE_
 
struct  pvx_memfile_
 
union  MIDIMESSAGE
 
struct  midiglobals
 
struct  eventnode
 
struct  TEMPO
 
struct  names
 
struct  threadInfo
 
struct  S_MACRO
 
struct  in_stack_s
 
struct  marked_sections
 
struct  namelst
 
struct  NAME__
 
struct  opcodinfo
 
struct  engine_state
 This struct will hold the current engine state after compilation. More...
 
struct  MODULE_INFO
 plugin module info More...
 
struct  CSOUND_
 Contains all function pointers, data, and data pointers required to run one instance of Csound. More...
 
struct  CSOUND_::sreadStatics__
 
struct  CSOUND_::onefileStatics__
 
struct  CSOUND_::lineventStatics__
 
struct  CSOUND_::musmonStatics__
 
struct  CSOUND_::libsndStatics__
 

Macros

#define CSOUNDCORE_H
 
#define _MM_DENORMALS_ZERO_MASK   0
 
#define _MM_DENORMALS_ZERO_ON   0
 
#define _MM_DENORMALS_ZERO_OFF   0
 
#define _MM_SET_DENORMALS_ZERO_MODE(mode)
 
#define OK   (0)
 
#define NOTOK   (-1)
 
#define CSFILE_FD_R   1
 
#define CSFILE_FD_W   2
 
#define CSFILE_STD   3
 
#define CSFILE_SND_R   4
 
#define CSFILE_SND_W   5
 
#define MAXINSNO   (200)
 
#define PMAX   (1998)
 
#define VARGMAX   (1999)
 
#define ORTXT   h.optext->t
 
#define INCOUNT   ORTXT.inlist->count
 
#define OUTCOUNT   ORTXT.outlist->count /* Not used */
 
#define INOCOUNT   ORTXT.inArgCount
 
#define OUTOCOUNT   ORTXT.outArgCount
 
#define IS_ASIG_ARG(x)   (csoundGetTypeForArg(x) == &CS_VAR_TYPE_A)
 
#define IS_STR_ARG(x)   (csoundGetTypeForArg(x) == &CS_VAR_TYPE_S)
 
#define CURTIME   (((double)csound->icurTime)/((double)csound->esr))
 
#define CURTIME_inc   (((double)csound->ksmps)/((double)csound->esr))
 
#define MAXLEN   0x1000000L
 
#define FMAXLEN   ((MYFLT)(MAXLEN))
 
#define PHMASK   0x0FFFFFFL
 
#define MAX_STRING_CHANNEL_DATASIZE   16384
 
#define PFRAC(x)   ((MYFLT)((x) & ftp->lomask) * ftp->lodiv)
 
#define MAXPOS   0x7FFFFFFFL
 
#define BYTREVS(n)   ((n>>8 & 0xFF) | (n<<8 & 0xFF00))
 
#define BYTREVL(n)
 
#define OCTRES   8192
 
#define CPSOCTL(n)   ((MYFLT)(1<<((int)(n)>>13))*csound->cpsocfrc[(int)(n)&8191])
 
#define LOBITS   10
 
#define LOFACT   1024
 
#define LOSCAL   FL(0.0009765625)
 
#define LOMASK   1023
 
#define SSTRCOD   (float)NAN
 
#define ISSTRCOD(X)   isnan(X)
 
#define SSTRSIZ   200
 
#define ALLCHNLS   0x7fff
 
#define DFLT_SR   FL(44100.0)
 
#define DFLT_KR   FL(4410.0)
 
#define DFLT_KSMPS   10
 
#define DFLT_NCHNLS   1
 
#define MAXCHNLS   256
 
#define MAXNAME   (256)
 
#define DFLT_DBFS   (FL(32768.0))
 
#define MAXOCTS   8
 
#define MAXCHAN   16 /* 16 MIDI channels; only one port for now */
 
#define ONEPT   1.02197486 /* A440 tuning factor */
 
#define LOG10D20   0.11512925 /* for db to ampfac */
 
#define DV32768   FL(0.000030517578125)
 
#define PI   (3.141592653589793238462643383279502884197)
 
#define TWOPI   (6.283185307179586476925286766559005768394)
 
#define PI_F   ((MYFLT) PI)
 
#define TWOPI_F   ((MYFLT) TWOPI)
 
#define INF   (2147483647.0)
 
#define AMPLMSG   01
 
#define RNGEMSG   02
 
#define WARNMSG   04
 
#define RAWMSG   0x40
 
#define TIMEMSG   0x80
 
#define IGN(X)   (void) X
 
#define ARG_CONSTANT   0
 
#define ARG_STRING   1
 
#define ARG_PFIELD   2
 
#define ARG_GLOBAL   3
 
#define ARG_LOCAL   4
 
#define ARG_LABEL   5
 
#define ASYNC_GLOBAL   1
 
#define ASYNC_LOCAL   2
 
#define CS_KSMPS   (p->h.insdshead->ksmps)
 
#define CS_KCNT   (p->h.insdshead->kcounter)
 
#define CS_EKR   (p->h.insdshead->ekr)
 
#define CS_ONEDKSMPS   (p->h.insdshead->onedksmps)
 
#define CS_ONEDKR   (p->h.insdshead->onedkr)
 
#define CS_KICVT   (p->h.insdshead->kicvt)
 
#define CS_ESR   (csound->esr)
 
#define CS_PDS   (p->h.insdshead->pds)
 
#define CS_SPIN   (p->h.insdshead->spin)
 
#define CS_SPOUT   (p->h.insdshead->spout)
 
#define INSTR   1
 
#define ENDIN   2
 
#define OPCODE   3
 
#define ENDOP   4
 
#define LABEL   5
 
#define SETBEG   6
 
#define PSET   6
 
#define USEROPCODE   7
 
#define SETEND   8
 
#define TOKMAX   50L /* Should be 50 but bust */
 
#define OPCODENUMOUTS_LOW   16
 
#define OPCODENUMOUTS_HIGH   64
 
#define OPCODENUMOUTS_MAX   256
 
#define MBUFSIZ   (4096)
 
#define MIDIINBUFMAX   (1024)
 
#define MIDIINBUFMSK   (MIDIINBUFMAX-1)
 
#define CS_STATE_PRE   (1)
 
#define CS_STATE_COMP   (2)
 
#define CS_STATE_UTIL   (4)
 
#define CS_STATE_CLN   (8)
 
#define CS_STATE_JMP   (16)
 
#define MARGS   (3)
 
#define NAMELEN   40 /* array size of repeat macro names */
 
#define RPTDEPTH   40 /* size of repeat_n arrays (39 loop levels) */
 
#define LINKAGE_BUILTIN(name)
 
#define FLINKAGE_BUILTIN(name)
 
Private Data

Private Data in the CSOUND struct to be used internally by the Csound library and should be hidden from plugins.

If a new variable member is needed by the library, add it below, as a private data member. If access is required solely by plugins (and not internally by the library), use the CreateGlobalVariable() etc. interface, instead of adding to CSOUND.

If you find that a plugin needs to access existing private data, first check above for an existing interface; if none is available, add one. Please avoid giving full access, or allowing plugins to change the values of private members, by using one of the two methods below:

1) To get the data member value:

returnType (*GetVar)(CSOUND *)

2) in case of pointers, data should be copied out to a supplied memory slot, rather than the pointer being obtained:

void (*GetData)(CSOUND *, dataType *)
dataType var;
csound->GetData(csound, &var);
#define LBUFSIZ   32768
 

Typedefs

typedef struct CORFIL CORFIL
 
typedef struct arglst ARGLST
 
typedef struct arg ARG
 
typedef struct oentry OENTRY
 
typedef struct oentries OENTRIES
 
typedef struct text TEXT
 Storage for parsed orchestra code, for each opcode in an INSTRTXT. More...
 
typedef struct instr INSTRTXT
 This struct is filled out by otran() at orch parse time. More...
 
typedef struct namedInstr INSTRNAME
 
typedef struct op OPTXT
 A chain of TEXT structs. More...
 
typedef struct fdch FDCH
 
typedef struct auxch AUXCH
 
typedef struct monblk MONPCH
 
typedef struct dklst DKLST
 
typedef struct mchnblk MCHNBLK
 
typedef struct event EVTBLK
 This struct holds the data for one score event. More...
 
typedef struct insds INSDS
 This struct holds the info for a concrete instrument event instance in performance. More...
 
typedef int(* SUBR) (CSOUND *, void *)
 
typedef struct opds OPDS
 This struct holds the info for one opcode in a concrete instrument instance in performance. More...
 
typedef struct lblblk LBLBLK
 
typedef int(* GEN) (FGDATA *, FUNC *)
 
typedef struct MEMFIL MEMFIL
 
typedef struct SNDMEMFILE_ SNDMEMFILE
 
typedef struct pvx_memfile_ PVOCEX_MEMFILE
 
typedef struct midiglobals MGLOBAL
 
typedef struct eventnode EVTNODE
 
typedef struct names NAMES
 
typedef struct threadInfo THREADINFO
 
typedef struct S_MACRO S_MACRO
 
typedef struct in_stack_s IN_STACK
 
typedef struct marked_sections MARKED_SECTIONS
 
typedef struct namelst NAMELST
 
typedef struct NAME__ NAME
 
typedef struct opcodinfo OPCODINFO
 
typedef struct engine_state ENGINE_STATE
 This struct will hold the current engine state after compilation. More...
 

Functions

int kperf_nodebug (CSOUND *csound)
 
int kperf_debug (CSOUND *csound)
 

Variables

int32 MYNAN
 
const uint32_t csOrcMask
 
const uint32_t csScoInMask
 
const uint32_t csScoSortMask
 
const uint32_t csMidiScoMask
 
const uint32_t csPlayScoMask
 

Macro Definition Documentation

#define _MM_DENORMALS_ZERO_MASK   0
#define _MM_DENORMALS_ZERO_OFF   0
#define _MM_DENORMALS_ZERO_ON   0
#define _MM_SET_DENORMALS_ZERO_MODE (   mode)
#define ALLCHNLS   0x7fff
#define AMPLMSG   01
#define ARG_CONSTANT   0
#define ARG_GLOBAL   3
#define ARG_LABEL   5
#define ARG_LOCAL   4
#define ARG_PFIELD   2
#define ARG_STRING   1
#define ASYNC_GLOBAL   1
#define ASYNC_LOCAL   2
#define BYTREVL (   n)
Value:
((n>>24 & 0xFF) | (n>>8 & 0xFF00L) | \
(n<<8 & 0xFF0000L) | (n<<24 & 0xFF000000L))
#define BYTREVS (   n)    ((n>>8 & 0xFF) | (n<<8 & 0xFF00))
#define CPSOCTL (   n)    ((MYFLT)(1<<((int)(n)>>13))*csound->cpsocfrc[(int)(n)&8191])
#define CS_EKR   (p->h.insdshead->ekr)
#define CS_ESR   (csound->esr)
#define CS_KCNT   (p->h.insdshead->kcounter)
#define CS_KICVT   (p->h.insdshead->kicvt)
#define CS_KSMPS   (p->h.insdshead->ksmps)
#define CS_ONEDKR   (p->h.insdshead->onedkr)
#define CS_ONEDKSMPS   (p->h.insdshead->onedksmps)
#define CS_PDS   (p->h.insdshead->pds)
#define CS_SPIN   (p->h.insdshead->spin)
#define CS_SPOUT   (p->h.insdshead->spout)
#define CS_STATE_CLN   (8)
#define CS_STATE_COMP   (2)
#define CS_STATE_JMP   (16)
#define CS_STATE_PRE   (1)
#define CS_STATE_UTIL   (4)
#define CSFILE_FD_R   1
#define CSFILE_FD_W   2
#define CSFILE_SND_R   4
#define CSFILE_SND_W   5
#define CSFILE_STD   3
#define CSOUNDCORE_H
#define CURTIME   (((double)csound->icurTime)/((double)csound->esr))
#define CURTIME_inc   (((double)csound->ksmps)/((double)csound->esr))
#define DFLT_DBFS   (FL(32768.0))
#define DFLT_KR   FL(4410.0)
#define DFLT_KSMPS   10
#define DFLT_NCHNLS   1
#define DFLT_SR   FL(44100.0)
#define DV32768   FL(0.000030517578125)
#define ENDIN   2
#define ENDOP   4
#define FLINKAGE_BUILTIN (   name)
Value:
NGFENS* name##_init(CSOUND *csound) \
{ (void) csound; return name; }
Contains all function pointers, data, and data pointers required to run one instance of Csound...
Definition: csoundCore.h:929
Definition: csoundCore.h:658
#define FMAXLEN   ((MYFLT)(MAXLEN))
#define IGN (   X)    (void) X
#define INCOUNT   ORTXT.inlist->count
#define INF   (2147483647.0)
#define INOCOUNT   ORTXT.inArgCount
#define INSTR   1
#define IS_ASIG_ARG (   x)    (csoundGetTypeForArg(x) == &CS_VAR_TYPE_A)
#define IS_STR_ARG (   x)    (csoundGetTypeForArg(x) == &CS_VAR_TYPE_S)
#define ISSTRCOD (   X)    isnan(X)
#define LABEL   5
#define LBUFSIZ   32768
#define LINKAGE_BUILTIN (   name)
Value:
long name##_init(CSOUND *csound, OENTRY **ep) \
{ (void) csound; *ep = name; return (long) (sizeof(name)); }
Contains all function pointers, data, and data pointers required to run one instance of Csound...
Definition: csoundCore.h:929
Definition: csoundCore.h:254
#define LOBITS   10
#define LOFACT   1024
#define LOG10D20   0.11512925 /* for db to ampfac */
#define LOMASK   1023
#define LOSCAL   FL(0.0009765625)
#define MARGS   (3)
#define MAX_STRING_CHANNEL_DATASIZE   16384
#define MAXCHAN   16 /* 16 MIDI channels; only one port for now */
#define MAXCHNLS   256
#define MAXINSNO   (200)
#define MAXLEN   0x1000000L
#define MAXNAME   (256)
#define MAXOCTS   8
#define MAXPOS   0x7FFFFFFFL
#define MBUFSIZ   (4096)
#define MIDIINBUFMAX   (1024)
#define MIDIINBUFMSK   (MIDIINBUFMAX-1)
#define NAMELEN   40 /* array size of repeat macro names */
#define NOTOK   (-1)
#define OCTRES   8192
#define OK   (0)
#define ONEPT   1.02197486 /* A440 tuning factor */
#define OPCODE   3
#define OPCODENUMOUTS_HIGH   64
#define OPCODENUMOUTS_LOW   16
#define OPCODENUMOUTS_MAX   256
#define ORTXT   h.optext->t
#define OUTCOUNT   ORTXT.outlist->count /* Not used */
#define OUTOCOUNT   ORTXT.outArgCount
#define PFRAC (   x)    ((MYFLT)((x) & ftp->lomask) * ftp->lodiv)
#define PHMASK   0x0FFFFFFL
#define PI   (3.141592653589793238462643383279502884197)
#define PI_F   ((MYFLT) PI)
#define PMAX   (1998)
#define PSET   6
#define RAWMSG   0x40
#define RNGEMSG   02
#define RPTDEPTH   40 /* size of repeat_n arrays (39 loop levels) */
#define SETBEG   6
#define SETEND   8
#define SSTRCOD   (float)NAN
#define SSTRSIZ   200
#define TIMEMSG   0x80
#define TOKMAX   50L /* Should be 50 but bust */
#define TWOPI   (6.283185307179586476925286766559005768394)
#define TWOPI_F   ((MYFLT) TWOPI)
#define USEROPCODE   7
#define VARGMAX   (1999)
#define WARNMSG   04

Typedef Documentation

typedef struct arg ARG
typedef struct arglst ARGLST
typedef struct auxch AUXCH
typedef struct CORFIL CORFIL
typedef struct dklst DKLST
typedef struct engine_state ENGINE_STATE

This struct will hold the current engine state after compilation.

typedef struct event EVTBLK

This struct holds the data for one score event.

typedef struct eventnode EVTNODE
typedef struct fdch FDCH
typedef int(* GEN) (FGDATA *, FUNC *)
typedef struct in_stack_s IN_STACK
typedef struct insds INSDS

This struct holds the info for a concrete instrument event instance in performance.

typedef struct namedInstr INSTRNAME
typedef struct instr INSTRTXT

This struct is filled out by otran() at orch parse time.

It is used as a template for instrument events.

typedef struct lblblk LBLBLK
typedef struct mchnblk MCHNBLK
typedef struct MEMFIL MEMFIL
typedef struct midiglobals MGLOBAL
typedef struct monblk MONPCH
typedef struct NAME__ NAME
typedef struct namelst NAMELST
typedef struct names NAMES
typedef struct oentries OENTRIES
typedef struct oentry OENTRY
typedef struct opcodinfo OPCODINFO
typedef struct opds OPDS

This struct holds the info for one opcode in a concrete instrument instance in performance.

typedef struct op OPTXT

A chain of TEXT structs.

Note that this is identical with the first two members of struct INSTRTEXT, and is so typecast at various points in code.

typedef struct pvx_memfile_ PVOCEX_MEMFILE
typedef struct S_MACRO S_MACRO
typedef struct SNDMEMFILE_ SNDMEMFILE
typedef int(* SUBR) (CSOUND *, void *)
typedef struct text TEXT

Storage for parsed orchestra code, for each opcode in an INSTRTXT.

typedef struct threadInfo THREADINFO

Function Documentation

int kperf_debug ( CSOUND csound)
int kperf_nodebug ( CSOUND csound)

Variable Documentation

const uint32_t csMidiScoMask
const uint32_t csOrcMask
const uint32_t csPlayScoMask
const uint32_t csScoInMask
const uint32_t csScoSortMask
int32 MYNAN