Csound  6.11
Classes | Macros | Typedefs | Enumerations | Functions
csound.h File Reference

Declares the public Csound application programming interface (API). More...

#include "sysdep.h"
#include "text.h"
#include <stdarg.h>
#include "cfgvar.h"
#include "msg_attr.h"
#include "version.h"
Include dependency graph for csound.h:

Go to the source code of this file.

Classes

struct  CSOUND_PARAMS
 
struct  CS_AUDIODEVICE
 
struct  CS_MIDIDEVICE
 
struct  csRtAudioParams
 
struct  RTCLOCK_S
 
struct  opcodeListEntry
 
struct  CsoundRandMTState_
 
struct  pvsdat_ext
 
struct  ORCTOKEN
 
struct  TREE
 
struct  controlChannelHints_s
 
struct  controlChannelInfo_s
 

Macros

#define PUBLIC
 
#define PUBLIC_DATA
 
#define CSOUND_EXITJMP_SUCCESS   (256)
 
#define CSOUNDINIT_NO_SIGNAL_HANDLER   1
 
#define CSOUNDINIT_NO_ATEXIT   2
 
#define CSOUND_CALLBACK_KBD_EVENT   (0x00000001U)
 
#define CSOUND_CALLBACK_KBD_TEXT   (0x00000002U)
 

Typedefs

typedef struct CSOUND_ CSOUND
 
typedef struct windat_ WINDAT
 
typedef struct xyindat_ XYINDAT
 
typedef struct RTCLOCK_S RTCLOCK
 
typedef struct CsoundRandMTState_ CsoundRandMTState
 
typedef struct pvsdat_ext PVSDATEXT
 
typedef struct ORCTOKEN ORCTOKEN
 
typedef struct TREE TREE
 
typedef struct controlChannelHints_s controlChannelHints_t
 
typedef struct controlChannelInfo_s controlChannelInfo_t
 
typedef void(* channelCallback_t) (CSOUND *csound, const char *channelName, void *channelValuePtr, const void *channelType)
 

Enumerations

enum  CSOUND_STATUS {
  CSOUND_SUCCESS = 0, CSOUND_ERROR = -1, CSOUND_INITIALIZATION = -2, CSOUND_PERFORMANCE = -3,
  CSOUND_MEMORY = -4, CSOUND_SIGNAL = -5
}
 
enum  CSOUND_FILETYPES {
  CSFTYPE_UNIFIED_CSD = 1, CSFTYPE_ORCHESTRA, CSFTYPE_SCORE, CSFTYPE_ORC_INCLUDE,
  CSFTYPE_SCO_INCLUDE, CSFTYPE_SCORE_OUT, CSFTYPE_SCOT, CSFTYPE_OPTIONS,
  CSFTYPE_EXTRACT_PARMS, CSFTYPE_RAW_AUDIO, CSFTYPE_IRCAM, CSFTYPE_AIFF,
  CSFTYPE_AIFC, CSFTYPE_WAVE, CSFTYPE_AU, CSFTYPE_SD2,
  CSFTYPE_W64, CSFTYPE_WAVEX, CSFTYPE_FLAC, CSFTYPE_CAF,
  CSFTYPE_WVE, CSFTYPE_OGG, CSFTYPE_MPC2K, CSFTYPE_RF64,
  CSFTYPE_AVR, CSFTYPE_HTK, CSFTYPE_MAT4, CSFTYPE_MAT5,
  CSFTYPE_NIST, CSFTYPE_PAF, CSFTYPE_PVF, CSFTYPE_SDS,
  CSFTYPE_SVX, CSFTYPE_VOC, CSFTYPE_XI, CSFTYPE_UNKNOWN_AUDIO,
  CSFTYPE_SOUNDFONT, CSFTYPE_STD_MIDI, CSFTYPE_MIDI_SYSEX, CSFTYPE_HETRO,
  CSFTYPE_HETROT, CSFTYPE_PVC, CSFTYPE_PVCEX, CSFTYPE_CVANAL,
  CSFTYPE_LPC, CSFTYPE_ATS, CSFTYPE_LORIS, CSFTYPE_SDIF,
  CSFTYPE_HRTF, CSFTYPE_VST_PLUGIN, CSFTYPE_LADSPA_PLUGIN, CSFTYPE_SNAPSHOT,
  CSFTYPE_FTABLES_TEXT, CSFTYPE_FTABLES_BINARY, CSFTYPE_XSCANU_MATRIX, CSFTYPE_FLOATS_TEXT,
  CSFTYPE_FLOATS_BINARY, CSFTYPE_INTEGER_TEXT, CSFTYPE_INTEGER_BINARY, CSFTYPE_IMAGE_PNG,
  CSFTYPE_POSTSCRIPT, CSFTYPE_SCRIPT_TEXT, CSFTYPE_OTHER_TEXT, CSFTYPE_OTHER_BINARY,
  CSFTYPE_UNKNOWN = 0
}
 
enum  controlChannelType {
  CSOUND_CONTROL_CHANNEL = 1, CSOUND_AUDIO_CHANNEL = 2, CSOUND_STRING_CHANNEL = 3, CSOUND_PVS_CHANNEL = 4,
  CSOUND_VAR_CHANNEL = 5, CSOUND_CHANNEL_TYPE_MASK = 15, CSOUND_INPUT_CHANNEL = 16, CSOUND_OUTPUT_CHANNEL = 32
}
 
enum  controlChannelBehavior { CSOUND_CONTROL_CHANNEL_NO_HINTS = 0, CSOUND_CONTROL_CHANNEL_INT = 1, CSOUND_CONTROL_CHANNEL_LIN = 2, CSOUND_CONTROL_CHANNEL_EXP = 3 }
 

Functions

PUBLIC int csoundInitialize (int flags)
 
PUBLIC CSOUNDcsoundCreate (void *hostData)
 
PUBLIC void csoundDestroy (CSOUND *)
 
PUBLIC int csoundGetVersion (void)
 
PUBLIC int csoundGetAPIVersion (void)
 
PUBLIC TREEcsoundParseOrc (CSOUND *csound, const char *str)
 
PUBLIC int csoundCompileTree (CSOUND *csound, TREE *root)
 
PUBLIC int csoundCompileTreeAsync (CSOUND *csound, TREE *root)
 
PUBLIC void csoundDeleteTree (CSOUND *csound, TREE *tree)
 
PUBLIC int csoundCompileOrc (CSOUND *csound, const char *str)
 
PUBLIC int csoundCompileOrcAsync (CSOUND *csound, const char *str)
 
PUBLIC MYFLT csoundEvalCode (CSOUND *csound, const char *str)
 
PUBLIC int csoundInitializeCscore (CSOUND *, FILE *insco, FILE *outsco)
 
PUBLIC int csoundCompileArgs (CSOUND *, int argc, const char **argv)
 
PUBLIC int csoundStart (CSOUND *csound)
 
PUBLIC int csoundCompile (CSOUND *, int argc, const char **argv)
 
PUBLIC int csoundCompileCsd (CSOUND *csound, const char *csd_filename)
 
PUBLIC int csoundCompileCsdText (CSOUND *csound, const char *csd_text)
 
PUBLIC int csoundPerform (CSOUND *)
 
PUBLIC int csoundPerformKsmps (CSOUND *)
 
PUBLIC int csoundPerformBuffer (CSOUND *)
 
PUBLIC void csoundStop (CSOUND *)
 
PUBLIC int csoundCleanup (CSOUND *)
 
PUBLIC void csoundReset (CSOUND *)
 
PUBLIC int csoundUDPServerStart (CSOUND *csound, unsigned int port)
 
PUBLIC int csoundUDPServerStatus (CSOUND *csound)
 
PUBLIC int csoundUDPServerClose (CSOUND *csound)
 
PUBLIC int csoundUDPConsole (CSOUND *csound, const char *addr, int port, int mirror)
 
PUBLIC void csoundStopUDPConsole (CSOUND *csound)
 
PUBLIC MYFLT csoundGetSr (CSOUND *)
 
PUBLIC MYFLT csoundGetKr (CSOUND *)
 
PUBLIC uint32_t csoundGetKsmps (CSOUND *)
 
PUBLIC uint32_t csoundGetNchnls (CSOUND *)
 
PUBLIC uint32_t csoundGetNchnlsInput (CSOUND *csound)
 
PUBLIC MYFLT csoundGet0dBFS (CSOUND *)
 
PUBLIC MYFLT csoundGetA4 (CSOUND *)
 
PUBLIC int64_t csoundGetCurrentTimeSamples (CSOUND *csound)
 
PUBLIC int csoundGetSizeOfMYFLT (void)
 
PUBLIC void * csoundGetHostData (CSOUND *)
 
PUBLIC void csoundSetHostData (CSOUND *, void *hostData)
 
PUBLIC int csoundSetOption (CSOUND *csound, const char *option)
 
PUBLIC void csoundSetParams (CSOUND *csound, CSOUND_PARAMS *p)
 
PUBLIC void csoundGetParams (CSOUND *csound, CSOUND_PARAMS *p)
 
PUBLIC int csoundGetDebug (CSOUND *)
 
PUBLIC void csoundSetDebug (CSOUND *, int debug)
 
PUBLIC const char * csoundGetOutputName (CSOUND *)
 
PUBLIC const char * csoundGetInputName (CSOUND *)
 
PUBLIC void csoundSetOutput (CSOUND *csound, const char *name, const char *type, const char *format)
 
PUBLIC void csoundGetOutputFormat (CSOUND *csound, char *type, char *format)
 
PUBLIC void csoundSetInput (CSOUND *csound, const char *name)
 
PUBLIC void csoundSetMIDIInput (CSOUND *csound, const char *name)
 
PUBLIC void csoundSetMIDIFileInput (CSOUND *csound, const char *name)
 
PUBLIC void csoundSetMIDIOutput (CSOUND *csound, const char *name)
 
PUBLIC void csoundSetMIDIFileOutput (CSOUND *csound, const char *name)
 
PUBLIC void csoundSetFileOpenCallback (CSOUND *p, void(*func)(CSOUND *, const char *, int, int, int))
 
PUBLIC void csoundSetRTAudioModule (CSOUND *csound, const char *module)
 
PUBLIC int csoundGetModule (CSOUND *csound, int number, char **name, char **type)
 
PUBLIC long csoundGetInputBufferSize (CSOUND *)
 
PUBLIC long csoundGetOutputBufferSize (CSOUND *)
 
PUBLIC MYFLT * csoundGetInputBuffer (CSOUND *)
 
PUBLIC MYFLT * csoundGetOutputBuffer (CSOUND *)
 
PUBLIC MYFLT * csoundGetSpin (CSOUND *)
 
PUBLIC void csoundClearSpin (CSOUND *)
 
PUBLIC void csoundAddSpinSample (CSOUND *csound, int frame, int channel, MYFLT sample)
 
PUBLIC void csoundSetSpinSample (CSOUND *csound, int frame, int channel, MYFLT sample)
 
PUBLIC MYFLT * csoundGetSpout (CSOUND *csound)
 
PUBLIC MYFLT csoundGetSpoutSample (CSOUND *csound, int frame, int channel)
 
PUBLIC void ** csoundGetRtRecordUserData (CSOUND *)
 
PUBLIC void ** csoundGetRtPlayUserData (CSOUND *)
 
PUBLIC void csoundSetHostImplementedAudioIO (CSOUND *, int state, int bufSize)
 
PUBLIC int csoundGetAudioDevList (CSOUND *csound, CS_AUDIODEVICE *list, int isOutput)
 
PUBLIC void csoundSetPlayopenCallback (CSOUND *, int(*playopen__)(CSOUND *, const csRtAudioParams *parm))
 
PUBLIC void csoundSetRtplayCallback (CSOUND *, void(*rtplay__)(CSOUND *, const MYFLT *outBuf, int nbytes))
 
PUBLIC void csoundSetRecopenCallback (CSOUND *, int(*recopen_)(CSOUND *, const csRtAudioParams *parm))
 
PUBLIC void csoundSetRtrecordCallback (CSOUND *, int(*rtrecord__)(CSOUND *, MYFLT *inBuf, int nbytes))
 
PUBLIC void csoundSetRtcloseCallback (CSOUND *, void(*rtclose__)(CSOUND *))
 
PUBLIC void csoundSetAudioDeviceListCallback (CSOUND *csound, int(*audiodevlist__)(CSOUND *, CS_AUDIODEVICE *list, int isOutput))
 
PUBLIC void csoundSetMIDIModule (CSOUND *csound, const char *module)
 
PUBLIC void csoundSetHostImplementedMIDIIO (CSOUND *csound, int state)
 
PUBLIC int csoundGetMIDIDevList (CSOUND *csound, CS_MIDIDEVICE *list, int isOutput)
 
PUBLIC void csoundSetExternalMidiInOpenCallback (CSOUND *, int(*func)(CSOUND *, void **userData, const char *devName))
 
PUBLIC void csoundSetExternalMidiReadCallback (CSOUND *, int(*func)(CSOUND *, void *userData, unsigned char *buf, int nBytes))
 
PUBLIC void csoundSetExternalMidiInCloseCallback (CSOUND *, int(*func)(CSOUND *, void *userData))
 
PUBLIC void csoundSetExternalMidiOutOpenCallback (CSOUND *, int(*func)(CSOUND *, void **userData, const char *devName))
 
PUBLIC void csoundSetExternalMidiWriteCallback (CSOUND *, int(*func)(CSOUND *, void *userData, const unsigned char *buf, int nBytes))
 
PUBLIC void csoundSetExternalMidiOutCloseCallback (CSOUND *, int(*func)(CSOUND *, void *userData))
 
PUBLIC void csoundSetExternalMidiErrorStringCallback (CSOUND *, const char *(*func)(int))
 
PUBLIC void csoundSetMIDIDeviceListCallback (CSOUND *csound, int(*mididevlist__)(CSOUND *, CS_MIDIDEVICE *list, int isOutput))
 
PUBLIC int csoundReadScore (CSOUND *csound, const char *str)
 
PUBLIC void csoundReadScoreAsync (CSOUND *csound, const char *str)
 
PUBLIC double csoundGetScoreTime (CSOUND *)
 
PUBLIC int csoundIsScorePending (CSOUND *)
 
PUBLIC void csoundSetScorePending (CSOUND *, int pending)
 
PUBLIC MYFLT csoundGetScoreOffsetSeconds (CSOUND *)
 
PUBLIC void csoundSetScoreOffsetSeconds (CSOUND *, MYFLT time)
 
PUBLIC void csoundRewindScore (CSOUND *)
 
PUBLIC void csoundSetCscoreCallback (CSOUND *, void(*cscoreCallback_)(CSOUND *))
 
PUBLIC int csoundScoreSort (CSOUND *, FILE *inFile, FILE *outFile)
 
PUBLIC int csoundScoreExtract (CSOUND *, FILE *inFile, FILE *outFile, FILE *extractFile)
 
PUBLIC CS_PRINTF2 void csoundMessage (CSOUND *, const char *format,...)
 
PUBLIC CS_PRINTF3 void csoundMessageS (CSOUND *, int attr, const char *format,...)
 
PUBLIC void csoundMessageV (CSOUND *, int attr, const char *format, va_list args)
 
PUBLIC void csoundSetDefaultMessageCallback (void(*csoundMessageCallback_)(CSOUND *, int attr, const char *format, va_list valist))
 
PUBLIC void csoundSetMessageCallback (CSOUND *, void(*csoundMessageCallback_)(CSOUND *, int attr, const char *format, va_list valist))
 
PUBLIC void csoundSetMessageStringCallback (CSOUND *csound, void(*csoundMessageStrCallback)(CSOUND *csound, int attr, const char *str))
 
PUBLIC int csoundGetMessageLevel (CSOUND *)
 
PUBLIC void csoundSetMessageLevel (CSOUND *, int messageLevel)
 
PUBLIC void csoundCreateMessageBuffer (CSOUND *csound, int toStdOut)
 
PUBLIC const char * csoundGetFirstMessage (CSOUND *csound)
 
PUBLIC int csoundGetFirstMessageAttr (CSOUND *csound)
 
PUBLIC void csoundPopFirstMessage (CSOUND *csound)
 
PUBLIC int csoundGetMessageCnt (CSOUND *csound)
 
void PUBLIC csoundDestroyMessageBuffer (CSOUND *csound)
 
PUBLIC int csoundGetChannelPtr (CSOUND *, MYFLT **p, const char *name, int type)
 
PUBLIC int csoundListChannels (CSOUND *, controlChannelInfo_t **lst)
 
PUBLIC void csoundDeleteChannelList (CSOUND *, controlChannelInfo_t *lst)
 
PUBLIC int csoundSetControlChannelHints (CSOUND *, const char *name, controlChannelHints_t hints)
 
PUBLIC int csoundGetControlChannelHints (CSOUND *, const char *name, controlChannelHints_t *hints)
 
PUBLIC int * csoundGetChannelLock (CSOUND *, const char *name)
 
PUBLIC MYFLT csoundGetControlChannel (CSOUND *csound, const char *name, int *err)
 
PUBLIC void csoundSetControlChannel (CSOUND *csound, const char *name, MYFLT val)
 
PUBLIC void csoundGetAudioChannel (CSOUND *csound, const char *name, MYFLT *samples)
 
PUBLIC void csoundSetAudioChannel (CSOUND *csound, const char *name, MYFLT *samples)
 
PUBLIC void csoundGetStringChannel (CSOUND *csound, const char *name, char *string)
 
PUBLIC void csoundSetStringChannel (CSOUND *csound, const char *name, char *string)
 
PUBLIC int csoundGetChannelDatasize (CSOUND *csound, const char *name)
 
PUBLIC void csoundSetInputChannelCallback (CSOUND *csound, channelCallback_t inputChannelCalback)
 
PUBLIC void csoundSetOutputChannelCallback (CSOUND *csound, channelCallback_t outputChannelCalback)
 
PUBLIC int csoundSetPvsChannel (CSOUND *, const PVSDATEXT *fin, const char *name)
 
PUBLIC int csoundGetPvsChannel (CSOUND *csound, PVSDATEXT *fout, const char *name)
 
PUBLIC int csoundScoreEvent (CSOUND *, char type, const MYFLT *pFields, long numFields)
 
PUBLIC void csoundScoreEventAsync (CSOUND *, char type, const MYFLT *pFields, long numFields)
 
PUBLIC int csoundScoreEventAbsolute (CSOUND *, char type, const MYFLT *pfields, long numFields, double time_ofs)
 
PUBLIC void csoundScoreEventAbsoluteAsync (CSOUND *, char type, const MYFLT *pfields, long numFields, double time_ofs)
 
PUBLIC void csoundInputMessage (CSOUND *, const char *message)
 
PUBLIC void csoundInputMessageAsync (CSOUND *, const char *message)
 
PUBLIC int csoundKillInstance (CSOUND *csound, MYFLT instr, char *instrName, int mode, int allow_release)
 
PUBLIC int csoundRegisterSenseEventCallback (CSOUND *, void(*func)(CSOUND *, void *), void *userData)
 
PUBLIC void csoundKeyPress (CSOUND *, char c)
 
PUBLIC int csoundRegisterKeyboardCallback (CSOUND *, int(*func)(void *userData, void *p, unsigned int type), void *userData, unsigned int type)
 
PUBLIC void csoundRemoveKeyboardCallback (CSOUND *csound, int(*func)(void *, void *, unsigned int))
 
PUBLIC int csoundTableLength (CSOUND *, int table)
 
PUBLIC MYFLT csoundTableGet (CSOUND *, int table, int index)
 
PUBLIC void csoundTableSet (CSOUND *, int table, int index, MYFLT value)
 
PUBLIC void csoundTableCopyOut (CSOUND *csound, int table, MYFLT *dest)
 
PUBLIC void csoundTableCopyOutAsync (CSOUND *csound, int table, MYFLT *dest)
 
PUBLIC void csoundTableCopyIn (CSOUND *csound, int table, MYFLT *src)
 
PUBLIC void csoundTableCopyInAsync (CSOUND *csound, int table, MYFLT *src)
 
PUBLIC int csoundGetTable (CSOUND *, MYFLT **tablePtr, int tableNum)
 
PUBLIC int csoundGetTableArgs (CSOUND *csound, MYFLT **argsPtr, int tableNum)
 
PUBLIC int csoundIsNamedGEN (CSOUND *csound, int num)
 
PUBLIC void csoundGetNamedGEN (CSOUND *csound, int num, char *name, int len)
 
PUBLIC int csoundSetIsGraphable (CSOUND *, int isGraphable)
 
PUBLIC void csoundSetMakeGraphCallback (CSOUND *, void(*makeGraphCallback_)(CSOUND *, WINDAT *windat, const char *name))
 
PUBLIC void csoundSetDrawGraphCallback (CSOUND *, void(*drawGraphCallback_)(CSOUND *, WINDAT *windat))
 
PUBLIC void csoundSetKillGraphCallback (CSOUND *, void(*killGraphCallback_)(CSOUND *, WINDAT *windat))
 
PUBLIC void csoundSetExitGraphCallback (CSOUND *, int(*exitGraphCallback_)(CSOUND *))
 
PUBLIC void * csoundGetNamedGens (CSOUND *)
 
PUBLIC int csoundNewOpcodeList (CSOUND *, opcodeListEntry **opcodelist)
 
PUBLIC void csoundDisposeOpcodeList (CSOUND *, opcodeListEntry *opcodelist)
 
PUBLIC int csoundAppendOpcode (CSOUND *, const char *opname, int dsblksiz, int flags, int thread, const char *outypes, const char *intypes, int(*iopadr)(CSOUND *, void *), int(*kopadr)(CSOUND *, void *), int(*aopadr)(CSOUND *, void *))
 
PUBLIC void csoundSetYieldCallback (CSOUND *, int(*yieldCallback_)(CSOUND *))
 
PUBLIC void * csoundCreateThread (uintptr_t(*threadRoutine)(void *), void *userdata)
 
PUBLIC void * csoundGetCurrentThreadId (void)
 
PUBLIC uintptr_t csoundJoinThread (void *thread)
 
PUBLIC void * csoundCreateThreadLock (void)
 
PUBLIC int csoundWaitThreadLock (void *lock, size_t milliseconds)
 
PUBLIC void csoundWaitThreadLockNoTimeout (void *lock)
 
PUBLIC void csoundNotifyThreadLock (void *lock)
 
PUBLIC void csoundDestroyThreadLock (void *lock)
 
PUBLIC void * csoundCreateMutex (int isRecursive)
 
PUBLIC void csoundLockMutex (void *mutex_)
 
PUBLIC int csoundLockMutexNoWait (void *mutex_)
 
PUBLIC void csoundUnlockMutex (void *mutex_)
 
PUBLIC void csoundDestroyMutex (void *mutex_)
 
PUBLIC void * csoundCreateBarrier (unsigned int max)
 
PUBLIC int csoundDestroyBarrier (void *barrier)
 
PUBLIC int csoundWaitBarrier (void *barrier)
 
PUBLIC void * csoundCreateCondVar ()
 
PUBLIC void csoundCondWait (void *condVar, void *mutex)
 
PUBLIC void csoundCondSignal (void *condVar)
 
PUBLIC void csoundSleep (size_t milliseconds)
 
PUBLIC int csoundSpinLockInit (spin_lock_t *spinlock)
 
PUBLIC void csoundSpinLock (spin_lock_t *spinlock)
 
PUBLIC int csoundSpinTryLock (spin_lock_t *spinlock)
 
PUBLIC void csoundSpinUnLock (spin_lock_t *spinlock)
 
PUBLIC long csoundRunCommand (const char *const *argv, int noWait)
 
PUBLIC void csoundInitTimerStruct (RTCLOCK *)
 
PUBLIC double csoundGetRealTime (RTCLOCK *)
 
PUBLIC double csoundGetCPUTime (RTCLOCK *)
 
PUBLIC uint32_t csoundGetRandomSeedFromTime (void)
 
PUBLIC void csoundSetLanguage (cslanguage_t lang_code)
 
PUBLIC const char * csoundGetEnv (CSOUND *csound, const char *name)
 
PUBLIC int csoundSetGlobalEnv (const char *name, const char *value)
 
PUBLIC int csoundCreateGlobalVariable (CSOUND *, const char *name, size_t nbytes)
 
PUBLIC void * csoundQueryGlobalVariable (CSOUND *, const char *name)
 
PUBLIC void * csoundQueryGlobalVariableNoCheck (CSOUND *, const char *name)
 
PUBLIC int csoundDestroyGlobalVariable (CSOUND *, const char *name)
 
PUBLIC int csoundRunUtility (CSOUND *, const char *name, int argc, char **argv)
 
PUBLIC char ** csoundListUtilities (CSOUND *)
 
PUBLIC void csoundDeleteUtilityList (CSOUND *, char **lst)
 
PUBLIC const char * csoundGetUtilityDescription (CSOUND *, const char *utilName)
 
PUBLIC int csoundRand31 (int *seedVal)
 
PUBLIC void csoundSeedRandMT (CsoundRandMTState *p, const uint32_t *initKey, uint32_t keyLength)
 
PUBLIC uint32_t csoundRandMT (CsoundRandMTState *p)
 
PUBLIC void * csoundCreateCircularBuffer (CSOUND *csound, int numelem, int elemsize)
 
PUBLIC int csoundReadCircularBuffer (CSOUND *csound, void *circular_buffer, void *out, int items)
 
PUBLIC int csoundPeekCircularBuffer (CSOUND *csound, void *circular_buffer, void *out, int items)
 
PUBLIC int csoundWriteCircularBuffer (CSOUND *csound, void *p, const void *inp, int items)
 
PUBLIC void csoundFlushCircularBuffer (CSOUND *csound, void *p)
 
PUBLIC void csoundDestroyCircularBuffer (CSOUND *csound, void *circularbuffer)
 
PUBLIC int csoundOpenLibrary (void **library, const char *libraryPath)
 
PUBLIC int csoundCloseLibrary (void *library)
 
PUBLIC void * csoundGetLibrarySymbol (void *library, const char *symbolName)
 

Detailed Description

Declares the public Csound application programming interface (API).

Author
John P. ffitch, Michael Gogins, Matt Ingalls, John D. Ramsdell, Istvan Varga, Victor Lazzarini, Andres Cabrera and Steven Yi.

Hosts using the Csound API must #include <csound.h>, and link with the Csound API library. Plugin libraries should #include <csdl.h> to get access to the API function pointers in the CSOUND structure, and do not need to link with the Csound API library. Only one of csound.h and csdl.h may be included by a compilation unit.

Hosts must first create an instance of Csound using the csoundCreate API function. When hosts are finished using Csound, they must destroy the instance of csound using the csoundDestroy API function. Most of the other Csound API functions take the Csound instance as their first argument. Hosts can only call the standalone API functions declared in csound.h.

Here is the complete code for the simplest possible Csound API host, a command-line Csound application:

#include <csound.h>
int main(int argc, char **argv)
{
CSOUND *csound = csoundCreate(NULL);
int result = csoundCompile(csound, argc, argv);
if (!result)
result = csoundPerform(csound);
csoundDestroy(csound);
return (result >= 0 ? 0 : result);
}

All opcodes, including plugins, receive a pointer to their host instance of Csound as the first argument. Therefore, plugins MUST NOT compile, perform, or destroy the host instance of Csound, and MUST call the Csound API function pointers off the Csound instance pointer.

MYFLT sr = csound->GetSr(csound);

In general, plugins should ONLY access Csound functionality through the API function pointers and public members of the #CSOUND_ structure.

License

Csound

Copyright (C) 2001-2013 John ffitch, Michael Gogins, Victor Lazzarini, Steven Yi, Istvan Varga, Andres Cabrera

This software is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this software; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

Macro Definition Documentation

◆ CSOUND_CALLBACK_KBD_EVENT

#define CSOUND_CALLBACK_KBD_EVENT   (0x00000001U)

Types for keyboard callbacks set in csoundRegisterKeyboardCallback()

◆ CSOUND_CALLBACK_KBD_TEXT

#define CSOUND_CALLBACK_KBD_TEXT   (0x00000002U)

◆ CSOUND_EXITJMP_SUCCESS

#define CSOUND_EXITJMP_SUCCESS   (256)

◆ CSOUNDINIT_NO_ATEXIT

#define CSOUNDINIT_NO_ATEXIT   2

◆ CSOUNDINIT_NO_SIGNAL_HANDLER

#define CSOUNDINIT_NO_SIGNAL_HANDLER   1

Flags for csoundInitialize().

◆ PUBLIC

#define PUBLIC

◆ PUBLIC_DATA

#define PUBLIC_DATA

Typedef Documentation

◆ channelCallback_t

typedef void(* channelCallback_t) (CSOUND *csound, const char *channelName, void *channelValuePtr, const void *channelType)

◆ controlChannelHints_t

This structure holds the parameter hints for control channels

◆ controlChannelInfo_t

◆ CSOUND

typedef struct CSOUND_ CSOUND

◆ CsoundRandMTState

◆ ORCTOKEN

typedef struct ORCTOKEN ORCTOKEN

◆ PVSDATEXT

typedef struct pvsdat_ext PVSDATEXT

◆ RTCLOCK

typedef struct RTCLOCK_S RTCLOCK

◆ TREE

typedef struct TREE TREE

◆ WINDAT

typedef struct windat_ WINDAT

◆ XYINDAT

typedef struct xyindat_ XYINDAT

Enumeration Type Documentation

◆ controlChannelBehavior

Enumerator
CSOUND_CONTROL_CHANNEL_NO_HINTS 
CSOUND_CONTROL_CHANNEL_INT 
CSOUND_CONTROL_CHANNEL_LIN 
CSOUND_CONTROL_CHANNEL_EXP 

◆ controlChannelType

Constants used by the bus interface (csoundGetChannelPtr() etc.).

Enumerator
CSOUND_CONTROL_CHANNEL 
CSOUND_AUDIO_CHANNEL 
CSOUND_STRING_CHANNEL 
CSOUND_PVS_CHANNEL 
CSOUND_VAR_CHANNEL 
CSOUND_CHANNEL_TYPE_MASK 
CSOUND_INPUT_CHANNEL 
CSOUND_OUTPUT_CHANNEL 

◆ CSOUND_FILETYPES

The following constants are used with csound->FileOpen2() and csound->ldmemfile2() to specify the format of a file that is being opened. This information is passed by Csound to a host's FileOpen callback and does not influence the opening operation in any other way. Conversion from Csound's TYP_XXX macros for audio formats to CSOUND_FILETYPES values can be done with csound->type2csfiletype().

Enumerator
CSFTYPE_UNIFIED_CSD 
CSFTYPE_ORCHESTRA 
CSFTYPE_SCORE 
CSFTYPE_ORC_INCLUDE 
CSFTYPE_SCO_INCLUDE 
CSFTYPE_SCORE_OUT 
CSFTYPE_SCOT 
CSFTYPE_OPTIONS 
CSFTYPE_EXTRACT_PARMS 
CSFTYPE_RAW_AUDIO 
CSFTYPE_IRCAM 
CSFTYPE_AIFF 
CSFTYPE_AIFC 
CSFTYPE_WAVE 
CSFTYPE_AU 
CSFTYPE_SD2 
CSFTYPE_W64 
CSFTYPE_WAVEX 
CSFTYPE_FLAC 
CSFTYPE_CAF 
CSFTYPE_WVE 
CSFTYPE_OGG 
CSFTYPE_MPC2K 
CSFTYPE_RF64 
CSFTYPE_AVR 
CSFTYPE_HTK 
CSFTYPE_MAT4 
CSFTYPE_MAT5 
CSFTYPE_NIST 
CSFTYPE_PAF 
CSFTYPE_PVF 
CSFTYPE_SDS 
CSFTYPE_SVX 
CSFTYPE_VOC 
CSFTYPE_XI 
CSFTYPE_UNKNOWN_AUDIO 
CSFTYPE_SOUNDFONT 
CSFTYPE_STD_MIDI 
CSFTYPE_MIDI_SYSEX 
CSFTYPE_HETRO 
CSFTYPE_HETROT 
CSFTYPE_PVC 
CSFTYPE_PVCEX 
CSFTYPE_CVANAL 
CSFTYPE_LPC 
CSFTYPE_ATS 
CSFTYPE_LORIS 
CSFTYPE_SDIF 
CSFTYPE_HRTF 
CSFTYPE_VST_PLUGIN 
CSFTYPE_LADSPA_PLUGIN 
CSFTYPE_SNAPSHOT 
CSFTYPE_FTABLES_TEXT 
CSFTYPE_FTABLES_BINARY 
CSFTYPE_XSCANU_MATRIX 
CSFTYPE_FLOATS_TEXT 
CSFTYPE_FLOATS_BINARY 
CSFTYPE_INTEGER_TEXT 
CSFTYPE_INTEGER_BINARY 
CSFTYPE_IMAGE_PNG 
CSFTYPE_POSTSCRIPT 
CSFTYPE_SCRIPT_TEXT 
CSFTYPE_OTHER_TEXT 
CSFTYPE_OTHER_BINARY 
CSFTYPE_UNKNOWN 

◆ CSOUND_STATUS

Enables Python interface. ERROR DEFINITIONS

Enumerator
CSOUND_SUCCESS 
CSOUND_ERROR 
CSOUND_INITIALIZATION 
CSOUND_PERFORMANCE 
CSOUND_MEMORY 
CSOUND_SIGNAL