Loading...
Searching...
No Matches
csoundCore.h File Reference
`#include "sysdep.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"`
`#include "find_opcode.h"`

## Data Structures

struct | CORFIL
struct | OPARMS
struct | arglst
struct | arg
struct | oentry
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 | AUXASYNC
| AuxAllocAsync data. More...
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 | MACRON
struct | 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 | _FFT_SETUP
| Nen FFT interface. More...
struct | MODULE_INFO
| plugin module info More...
struct | _alloc_data_
struct | _message_queue_t_
struct | CSOUND_
| Contains all function pointers, data, and data pointers required to run one instance of Csound. More...
struct | CSOUND_::sread__
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 | NOT_AN_INSTRUMENT INT32_MAX
#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)
#define | IS_STR_ARG(x)
#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)
#define | MAXPOS 0x7FFFFFFFL
#define | BYTREVS(n)
#define | BYTREVL(n)
#define | OCTRES 8192
#define | CPSOCTL(n)
#define | LOBITS 10
#define | LOFACT 1024
#define | LOSCAL FL(0.0009765625)
#define | LOMASK 1023
#define | SSTRCOD (float)NAN
#define | SSTRSIZ 1024
#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 (csound->A4/430.5389646099018460319362438314060262605)
#define | LOG10D20 0.11512925 /* for db to ampfac */
#define | DV32768 FL(0.000030517578125)
#define | PI (3.141592653589793238462643383279502884197)
#define | TWOPI (6.283185307179586476925286766559005768394)
#define | HALFPI (1.570796326794896619231321691639751442099)
#define | PI_F ((MYFLT) PI)
#define | TWOPI_F ((MYFLT) TWOPI)
#define | HALFPI_F ((MYFLT) HALFPI)
#define | INF (2147483647.0)
#define | ROOT2 (1.414213562373095048801688724209698078569)
#define | CS_AMPLMSG 01
#define | CS_RNGEMSG 02
#define | CS_WARNMSG 04
#define | CS_NOMSG 0x10
#define | CS_RAWMSG 0x40
#define | CS_TIMEMSG 0x80
#define | CS_NOQQ 0x400
#define | IGN(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 | MIDIMAXPORTS (64)
#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 | MAX_INCLUDE_DEPTH 100
#define | MAX_ALLOC_QUEUE 1024
#define | MAX_MESSAGE_STR 1024
#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 *)
CSOUND
struct CSOUND_ CSOUND
Definition csound.h:475

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 text | TEXT
| Storage for parsed orchestra code, for each opcode in an INSTRTXT.
typedef struct instr | INSTRTXT
| This struct is filled out by otran() at orch parse time.
typedef struct namedInstr | INSTRNAME
typedef struct op | OPTXT
| A chain of TEXT structs.
typedef struct fdch | FDCH
typedef struct auxch | AUXCH
typedef AUXCH *(* | aux_cb) (CSOUND *, void *, AUXCH *)
| this callback is used to notify the availability of new storage in 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.
typedef struct insds | INSDS
| This struct holds the info for a concrete instrument event instance in performance.
typedef int(* | SUBR) (CSOUND *, void *)
typedef struct opds | OPDS
| This struct holds the info for one opcode in a concrete instrument instance in performance.
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 MACRON | MACRON
typedef struct MACRO | 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.
typedef struct _FFT_SETUP | CSOUND_FFT_SETUP
| Nen FFT interface.
typedef struct _alloc_data_ | ALLOC_DATA
typedef struct _message_queue_t_ | message_string_queue_t

## Enumerations

enum | { FFT_LIB =0 , PFFT_LIB , VDSP_LIB }
enum | { FFT_FWD =0 , FFT_INV }

## Functions

int | ISSTRCOD (MYFLT)
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

## _MM_DENORMALS_ZERO_MASK

#define _MM_DENORMALS_ZERO_MASK 0

## _MM_DENORMALS_ZERO_OFF

#define _MM_DENORMALS_ZERO_OFF 0

## _MM_DENORMALS_ZERO_ON

#define _MM_DENORMALS_ZERO_ON 0

## _MM_SET_DENORMALS_ZERO_MODE

#define _MM_SET_DENORMALS_ZERO_MODE | ( |  | mode | ) |

## ALLCHNLS

#define ALLCHNLS 0x7fff

## ARG_CONSTANT

#define ARG_CONSTANT 0

## ARG_GLOBAL

#define ARG_GLOBAL 3

## ARG_LABEL

#define ARG_LABEL 5

## ARG_LOCAL

#define ARG_LOCAL 4

## ARG_PFIELD

#define ARG_PFIELD 2

## ARG_STRING

#define ARG_STRING 1

## ASYNC_GLOBAL

#define ASYNC_GLOBAL 1

## ASYNC_LOCAL

#define ASYNC_LOCAL 2

## BYTREVL

#define BYTREVL | ( |  | n | ) |

Value:
((n>>24 & 0xFF) | (n>>8 & 0xFF00L) | \
(n<<8 & 0xFF0000L) | (n<<24 & 0xFF000000L))

## BYTREVS

#define BYTREVS | ( |  | n | ) |

Value:
((n>>8 & 0xFF) | (n<<8 & 0xFF00))

## CPSOCTL

#define CPSOCTL | ( |  | n | ) |

Value:
((MYFLT)(1<<((int)(n)>>13))*csound->cpsocfrc[(int)(n)&8191])

## CS_AMPLMSG

#define CS_AMPLMSG 01

## CS_EKR

#define CS_EKR (p->h.insdshead->ekr)

## CS_ESR

#define CS_ESR (csound->esr)

## CS_KCNT

#define CS_KCNT (p->h.insdshead->kcounter)

## CS_KICVT

#define CS_KICVT (p->h.insdshead->kicvt)

## CS_KSMPS

#define CS_KSMPS (p->h.insdshead->ksmps)

## CS_NOMSG

#define CS_NOMSG 0x10

## CS_NOQQ

#define CS_NOQQ 0x400

## CS_ONEDKR

#define CS_ONEDKR (p->h.insdshead->onedkr)

## CS_ONEDKSMPS

#define CS_ONEDKSMPS (p->h.insdshead->onedksmps)

## CS_PDS

#define CS_PDS (p->h.insdshead->pds)

## CS_RAWMSG

#define CS_RAWMSG 0x40

## CS_RNGEMSG

#define CS_RNGEMSG 02

## CS_SPIN

#define CS_SPIN (p->h.insdshead->spin)

## CS_SPOUT

#define CS_SPOUT (p->h.insdshead->spout)

## CS_STATE_CLN

#define CS_STATE_CLN (8)

## CS_STATE_COMP

#define CS_STATE_COMP (2)

## CS_STATE_JMP

#define CS_STATE_JMP (16)

## CS_STATE_PRE

#define CS_STATE_PRE (1)

## CS_STATE_UTIL

#define CS_STATE_UTIL (4)

## CS_TIMEMSG

#define CS_TIMEMSG 0x80

## CS_WARNMSG

#define CS_WARNMSG 04

## CSFILE_FD_R

#define CSFILE_FD_R 1

## CSFILE_FD_W

#define CSFILE_FD_W 2

## CSFILE_SND_R

#define CSFILE_SND_R 4

## CSFILE_SND_W

#define CSFILE_SND_W 5

## CSFILE_STD

#define CSFILE_STD 3

## CSOUNDCORE_H

#define CSOUNDCORE_H

## CURTIME

#define CURTIME (((double)csound->icurTime)/((double)csound->esr))

## CURTIME_inc

#define CURTIME_inc (((double)csound->ksmps)/((double)csound->esr))

## DFLT_DBFS

#define DFLT_DBFS (FL(32768.0))

## DFLT_KR

#define DFLT_KR FL(4410.0)

## DFLT_KSMPS

#define DFLT_KSMPS 10

## DFLT_NCHNLS

#define DFLT_NCHNLS 1

## DFLT_SR

#define DFLT_SR FL(44100.0)

## DV32768

#define DV32768 FL(0.000030517578125)

## ENDIN

#define ENDIN 2

## ENDOP

#define ENDOP 4

## FLINKAGE_BUILTIN

#define FLINKAGE_BUILTIN | ( |  | name | ) |

Value:
NGFENS* name##_init(CSOUND *csound) \
{ (void) csound; return name; }
NGFENS
Definition csoundCore.h:702

## FMAXLEN

#define FMAXLEN ((MYFLT)(MAXLEN))

## HALFPI

#define HALFPI (1.570796326794896619231321691639751442099)

## HALFPI_F

#define HALFPI_F ((MYFLT) HALFPI)

## IGN

#define IGN | ( |  | X | ) |

Value:
(void) X

## INCOUNT

#define INCOUNT ORTXT.inlist->count

## INF

#define INF (2147483647.0)

## INOCOUNT

#define INOCOUNT ORTXT.inArgCount

## INSTR

#define INSTR 1

## IS_ASIG_ARG

#define IS_ASIG_ARG | ( |  | x | ) |

Value:
(csoundGetTypeForArg(x) == &CS_VAR_TYPE_A)

## IS_STR_ARG

#define IS_STR_ARG | ( |  | x | ) |

Value:
(csoundGetTypeForArg(x) == &CS_VAR_TYPE_S)

## LABEL

#define LABEL 5

## LBUFSIZ

#define LBUFSIZ 32768

## LINKAGE_BUILTIN

#define LINKAGE_BUILTIN | ( |  | name | ) |

Value:
long name##_init(CSOUND *csound, OENTRY **ep) \
{ (void) csound; *ep = name; return (long) (sizeof(name)); }
OENTRY
struct oentry OENTRY

## LOBITS

#define LOBITS 10

## LOFACT

#define LOFACT 1024

## LOG10D20

#define LOG10D20 0.11512925 /* for db to ampfac */

## LOMASK

#define LOMASK 1023

## LOSCAL

#define LOSCAL FL(0.0009765625)

## MARGS

#define MARGS (3)

## MAX_ALLOC_QUEUE

#define MAX_ALLOC_QUEUE 1024

## MAX_INCLUDE_DEPTH

#define MAX_INCLUDE_DEPTH 100

## MAX_MESSAGE_STR

#define MAX_MESSAGE_STR 1024

## MAX_STRING_CHANNEL_DATASIZE

#define MAX_STRING_CHANNEL_DATASIZE 16384

## MAXCHAN

#define MAXCHAN 16 /* 16 MIDI channels; only one port for now */

## MAXCHNLS

#define MAXCHNLS 256

## MAXINSNO

#define MAXINSNO (200)

## MAXLEN

#define MAXLEN 0x1000000L

## MAXNAME

#define MAXNAME (256)

## MAXOCTS

#define MAXOCTS 8

## MAXPOS

#define MAXPOS 0x7FFFFFFFL

## MBUFSIZ

#define MBUFSIZ (4096)

## MIDIINBUFMAX

#define MIDIINBUFMAX (1024)

## MIDIINBUFMSK

#define MIDIINBUFMSK (MIDIINBUFMAX-1)

## MIDIMAXPORTS

#define MIDIMAXPORTS (64)

## NAMELEN

#define NAMELEN 40 /* array size of repeat macro names */

## NOT_AN_INSTRUMENT

#define NOT_AN_INSTRUMENT INT32_MAX

## NOTOK

#define NOTOK (-1)

## OCTRES

#define OCTRES 8192

## OK

#define OK (0)

## ONEPT

#define ONEPT (csound->A4/430.5389646099018460319362438314060262605)

## OPCODE

#define OPCODE 3

## OPCODENUMOUTS_HIGH

#define OPCODENUMOUTS_HIGH 64

## OPCODENUMOUTS_LOW

#define OPCODENUMOUTS_LOW 16

## OPCODENUMOUTS_MAX

#define OPCODENUMOUTS_MAX 256

## ORTXT

#define ORTXT h.optext->t

## OUTCOUNT

#define OUTCOUNT ORTXT.outlist->count /* Not used */

## OUTOCOUNT

#define OUTOCOUNT ORTXT.outArgCount

## PFRAC

#define PFRAC | ( |  | x | ) |

Value:
((MYFLT)((x) & ftp->lomask) * ftp->lodiv)

## PHMASK

#define PHMASK 0x0FFFFFFL

## PI

#define PI (3.141592653589793238462643383279502884197)

## PI_F

#define PI_F ((MYFLT) PI)

## PMAX

#define PMAX (1998)

## PSET

#define PSET 6

## ROOT2

#define ROOT2 (1.414213562373095048801688724209698078569)

## RPTDEPTH

#define RPTDEPTH 40 /* size of repeat_n arrays (39 loop levels) */

## SETBEG

#define SETBEG 6

## SETEND

#define SETEND 8

## SSTRCOD

#define SSTRCOD (float)NAN

## SSTRSIZ

#define SSTRSIZ 1024

## TOKMAX

#define TOKMAX 50L /* Should be 50 but bust */

## TWOPI

#define TWOPI (6.283185307179586476925286766559005768394)

## TWOPI_F

#define TWOPI_F ((MYFLT) TWOPI)

## USEROPCODE

#define USEROPCODE 7

## VARGMAX

#define VARGMAX (1999)

## Typedef Documentation

## ALLOC_DATA

typedef struct _alloc_data_ ALLOC_DATA

## ARG

typedef struct arg ARG

## ARGLST

typedef struct arglst ARGLST

## aux_cb

typedef AUXCH *(* aux_cb) (CSOUND *, void *, AUXCH *)

this callback is used to notify the availability of new storage in AUXCH *.

It can be used to swap the old storage for the new one and return it for deallocation.

## AUXCH

typedef struct auxch AUXCH

## CORFIL

typedef struct CORFIL CORFIL

## CSOUND_FFT_SETUP

typedef struct _FFT_SETUP CSOUND_FFT_SETUP

Nen FFT interface.

## DKLST

typedef struct dklst DKLST

## ENGINE_STATE

typedef struct engine_state ENGINE_STATE

This struct will hold the current engine state after compilation.

## EVTBLK

typedef struct event EVTBLK

This struct holds the data for one score event.

## EVTNODE

typedef struct eventnode EVTNODE

## FDCH

typedef struct fdch FDCH

## GEN

typedef int(* GEN) (FGDATA *, FUNC *)

## IN_STACK

typedef struct in_stack_s IN_STACK

## INSDS

typedef struct insds INSDS

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

## INSTRNAME

typedef struct namedInstr INSTRNAME

## INSTRTXT

typedef struct instr INSTRTXT

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

It is used as a template for instrument events.

## LBLBLK

typedef struct lblblk LBLBLK

## MACRO

typedef struct MACRO MACRO

## MACRON

typedef struct MACRON MACRON

## MARKED_SECTIONS

typedef struct marked_sections MARKED_SECTIONS

## MCHNBLK

typedef struct mchnblk MCHNBLK

## MEMFIL

typedef struct MEMFIL MEMFIL

## message_string_queue_t

typedef struct _message_queue_t_ message_string_queue_t

## MGLOBAL

typedef struct midiglobals MGLOBAL

## MONPCH

typedef struct monblk MONPCH

## NAME

typedef struct NAME__ NAME

## NAMELST

typedef struct namelst NAMELST

## NAMES

typedef struct names NAMES

## OENTRY

typedef struct oentry OENTRY

## OPCODINFO

typedef struct opcodinfo OPCODINFO

## OPDS

typedef struct opds OPDS

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

## OPTXT

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.

## PVOCEX_MEMFILE

typedef struct pvx_memfile_ PVOCEX_MEMFILE

## SNDMEMFILE

typedef struct SNDMEMFILE_ SNDMEMFILE

## SUBR

typedef int(* SUBR) (CSOUND *, void *)

## TEXT

typedef struct text TEXT

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

## THREADINFO

typedef struct threadInfo THREADINFO

## Enumeration Type Documentation

## anonymous enum

anonymous enum

Enumerator
FFT_LIB |
PFFT_LIB |
VDSP_LIB |

## anonymous enum

anonymous enum

Enumerator
FFT_FWD |
FFT_INV |

## Function Documentation

## ISSTRCOD()

int ISSTRCOD | ( | MYFLT |  | ) |

extern

## kperf_debug()

int kperf_debug | ( | CSOUND * | csound | ) |

## kperf_nodebug()

int kperf_nodebug | ( | CSOUND * | csound | ) |

## Variable Documentation

## csMidiScoMask

const uint32_t csMidiScoMask

extern

## csOrcMask

const uint32_t csOrcMask

extern

## csPlayScoMask

const uint32_t csPlayScoMask

extern

## csScoInMask

const uint32_t csScoInMask

extern

## csScoSortMask

const uint32_t csScoSortMask

extern

## MYNAN

int32 MYNAN

extern