Loading...
Searching...
No Matches
csound.h File Reference

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

`#include "sysdep.h"`
`#include "text.h"`
`#include <stdarg.h>`
`#include <stdio.h>`
`#include "cfgvar.h"`
`#include "msg_attr.h"`
`#include "version.h"`

## Data Structures

struct | CSOUND_PARAMS
| csound configuration structure, mirrors part of OPARMS, uses more meaningful names More...
struct | CS_AUDIODEVICE
| Device information. More...
struct | CS_MIDIDEVICE
struct | csRtAudioParams
| Real-time audio parameters structure. More...
struct | RTCLOCK_S
struct | opcodeListEntry
struct | CsoundRandMTState_
struct | pvsdat_ext
struct | ORCTOKEN
struct | TREE
struct | controlChannelHints_s
| This structure holds the parameter hints for control channels. More...
struct | controlChannelInfo_s

## Macros

#define | PUBLIC
#define | PUBLIC_DATA
#define | CSOUND_EXITJMP_SUCCESS (256)
#define | CSOUNDINIT_NO_SIGNAL_HANDLER 1
| Flags for csoundInitialize().
#define | CSOUNDINIT_NO_ATEXIT 2
#define | CSOUND_CALLBACK_KBD_EVENT (0x00000001U)
| Types for keyboard callbacks set in csoundRegisterKeyboardCallback().
#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
| This structure holds the parameter hints for control channels.
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 }
| Enables Python interface. More...

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_MPEG ,
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_UNUSED , 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
}

| The following constants are used with csound->FileOpen2() and csound->ldmemfile2() to specify the format of a file that is being opened. More...
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 }
| Constants used by the bus interface (csoundGetChannelPtr() etc.). More...
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)
| Initialise Csound library with specific flags.
PUBLIC void | csoundSetOpcodedir (const char *s)
| Sets an opcodedir override for csoundCreate().
PUBLIC CSOUND * | csoundCreate (void *hostData)
| Creates an instance of Csound.
PUBLIC int | csoundLoadPlugins (CSOUND *csound, const char *dir)
| Loads all plugins from a given directory.
PUBLIC void | csoundDestroy (CSOUND *)
| Destroys an instance of Csound.
PUBLIC int | csoundGetVersion (void)
| Returns the version number times 1000 (5.00.0 = 5000).
PUBLIC int | csoundGetAPIVersion (void)
| Returns the API version number times 100 (1.00 = 100).
PUBLIC TREE * | csoundParseOrc (CSOUND *csound, const char *str)
| Parse the given orchestra from an ASCII string into a TREE.
PUBLIC int | csoundCompileTree (CSOUND *csound, TREE *root)
| Compile the given TREE node into structs for Csound to use this can be called during performance to compile a new TREE.
PUBLIC int | csoundCompileTreeAsync (CSOUND *csound, TREE *root)
| Asynchronous version of csoundCompileTree().
PUBLIC void | csoundDeleteTree (CSOUND *csound, TREE *tree)
| Free the resources associated with the TREE *tree This function should be called whenever the TREE was created with csoundParseOrc and memory can be deallocated.
PUBLIC int | csoundCompileOrc (CSOUND *csound, const char *str)
| Parse, and compile the given orchestra from an ASCII string, also evaluating any global space code (i-time only) this can be called during performance to compile a new orchestra.
PUBLIC int | csoundCompileOrcAsync (CSOUND *csound, const char *str)
| Async version of csoundCompileOrc().
PUBLIC MYFLT | csoundEvalCode (CSOUND *csound, const char *str)
| Parse and compile an orchestra given on an string, evaluating any global space code (i-time only).
PUBLIC int | csoundInitializeCscore (CSOUND *, FILE *insco, FILE *outsco)
| Prepares an instance of Csound for Cscore processing outside of running an orchestra (i.e.
PUBLIC int | csoundCompileArgs (CSOUND *, int argc, const char **argv)
| Read arguments, parse and compile an orchestra, read, process and load a score.
PUBLIC int | csoundStart (CSOUND *csound)
| Prepares Csound for performance.
PUBLIC int | csoundCompile (CSOUND *, int argc, const char **argv)
| Compiles Csound input files (such as an orchestra and score, or CSD) as directed by the supplied command-line arguments, but does not perform them.
PUBLIC int | csoundCompileCsd (CSOUND *csound, const char *csd_filename)
| Compiles a Csound input file (CSD, .csd file), but does not perform it.
PUBLIC int | csoundCompileCsdText (CSOUND *csound, const char *csd_text)
| Behaves the same way as csoundCompileCsd, except that the content of the CSD is read from the csd_text string rather than from a file.
PUBLIC int | csoundPerform (CSOUND *)
| Senses input events and performs audio output until the end of score is reached (positive return value), an error occurs (negative return value), or performance is stopped by calling csoundStop() from another thread (zero return value).
PUBLIC int | csoundPerformKsmps (CSOUND *)
| Senses input events, and performs one control sample worth (ksmps) of audio output.
PUBLIC int | csoundPerformBuffer (CSOUND *)
| Performs Csound, sensing real-time and score events and processing one buffer's worth (-b frames) of interleaved audio.
PUBLIC void | csoundStop (CSOUND *)
| Stops a csoundPerform() running in another thread.
PUBLIC int | csoundCleanup (CSOUND *)
| Prints information about the end of a performance, and closes audio and MIDI devices.
PUBLIC void | csoundReset (CSOUND *)
| Resets all internal memory and state in preparation for a new performance.
PUBLIC int | csoundUDPServerStart (CSOUND *csound, unsigned int port)
| Starts the UDP server on a supplied port number returns CSOUND_SUCCESS if server has been started successfully, otherwise, CSOUND_ERROR.
PUBLIC int | csoundUDPServerStatus (CSOUND *csound)
| returns the port number on which the server is running, or CSOUND_ERROR if the server is not running.
PUBLIC int | csoundUDPServerClose (CSOUND *csound)
| Closes the UDP server, returning CSOUND_SUCCESS if the running server was successfully closed, CSOUND_ERROR otherwise.
PUBLIC int | csoundUDPConsole (CSOUND *csound, const char *addr, int port, int mirror)
| Turns on the transmission of console messages to UDP on address addr port port.
PUBLIC void | csoundStopUDPConsole (CSOUND *csound)
| Stop transmitting console messages via UDP.
PUBLIC MYFLT | csoundGetSr (CSOUND *)
| Returns the number of audio sample frames per second.
PUBLIC MYFLT | csoundGetKr (CSOUND *)
| Returns the number of control samples per second.
PUBLIC uint32_t | csoundGetKsmps (CSOUND *)
| Returns the number of audio sample frames per control sample.
PUBLIC uint32_t | csoundGetNchnls (CSOUND *)
| Returns the number of audio output channels.
PUBLIC uint32_t | csoundGetNchnlsInput (CSOUND *csound)
| Returns the number of audio input channels.
PUBLIC MYFLT | csoundGet0dBFS (CSOUND *)
| Returns the 0dBFS level of the spin/spout buffers.
PUBLIC MYFLT | csoundGetA4 (CSOUND *)
| Returns the A4 frequency reference.
PUBLIC int64_t | csoundGetCurrentTimeSamples (CSOUND *csound)
| Return the current performance time in samples.
PUBLIC int | csoundGetSizeOfMYFLT (void)
| Return the size of MYFLT in bytes.
PUBLIC void * | csoundGetHostData (CSOUND *)
| Returns host data.
PUBLIC void | csoundSetHostData (CSOUND *, void *hostData)
| Sets host data.
PUBLIC int | csoundSetOption (CSOUND *csound, const char *option)
| Set a single csound option (flag).
PUBLIC void | csoundSetParams (CSOUND *csound, CSOUND_PARAMS *p)
| Configure Csound with a given set of parameters defined in the CSOUND_PARAMS structure.
PUBLIC void | csoundGetParams (CSOUND *csound, CSOUND_PARAMS *p)
| Get the current set of parameters from a CSOUND instance in a CSOUND_PARAMS structure.
PUBLIC int | csoundGetDebug (CSOUND *)
| Returns whether Csound is set to print debug messages sent through the DebugMsg() internal API function.
PUBLIC void | csoundSetDebug (CSOUND *, int debug)
| Sets whether Csound prints debug messages from the DebugMsg() internal API function.
PUBLIC MYFLT | csoundSystemSr (CSOUND *csound, MYFLT val)
| If val > 0, sets the internal variable holding the system HW sr.
PUBLIC const char * | csoundGetOutputName (CSOUND *)
| Returns the audio output name (-o).
PUBLIC const char * | csoundGetInputName (CSOUND *)
| Returns the audio input name (-i).
PUBLIC void | csoundSetOutput (CSOUND *csound, const char *name, const char *type, const char *format)
| Set output destination, type and format type can be one of "wav","aiff", "au","raw", "paf", "svx", "nist", "voc", "ircam","w64","mat4", "mat5", "pvf","xi", "htk","sds","avr","wavex","sd2", "flac", "caf","wve","ogg","mpc2k","rf64", or NULL (use default or realtime IO).
PUBLIC void | csoundGetOutputFormat (CSOUND *csound, char *type, char *format)
| Get output type and format.
PUBLIC void | csoundSetInput (CSOUND *csound, const char *name)
| Set input source.
PUBLIC void | csoundSetMIDIInput (CSOUND *csound, const char *name)
| Set MIDI input device name/number.
PUBLIC void | csoundSetMIDIFileInput (CSOUND *csound, const char *name)
| Set MIDI file input name.
PUBLIC void | csoundSetMIDIOutput (CSOUND *csound, const char *name)
| Set MIDI output device name/number.
PUBLIC void | csoundSetMIDIFileOutput (CSOUND *csound, const char *name)
| Set MIDI file utput name.
PUBLIC void | csoundSetFileOpenCallback (CSOUND *p, void(*func)(CSOUND *, const char *, int, int, int))
| Sets an external callback for receiving notices whenever Csound opens a file.
PUBLIC void | csoundSetRTAudioModule (CSOUND *csound, const char *module)
| Sets the current RT audio module.
PUBLIC int | csoundGetModule (CSOUND *csound, int number, char **name, char **type)
| retrieves a module name and type ("audio" or "midi") given a number Modules are added to list as csound loads them returns CSOUND_SUCCESS on success and CSOUND_ERROR if module number was not found
PUBLIC long | csoundGetInputBufferSize (CSOUND *)
| Returns the number of samples in Csound's input buffer.
PUBLIC long | csoundGetOutputBufferSize (CSOUND *)
| Returns the number of samples in Csound's output buffer.
PUBLIC MYFLT * | csoundGetInputBuffer (CSOUND *)
| Returns the address of the Csound audio input buffer.
PUBLIC MYFLT * | csoundGetOutputBuffer (CSOUND *)
| Returns the address of the Csound audio output buffer.
PUBLIC MYFLT * | csoundGetSpin (CSOUND *)
| Returns the address of the Csound audio input working buffer (spin).
PUBLIC void | csoundClearSpin (CSOUND *)
| Clears the input buffer (spin).
PUBLIC void | csoundAddSpinSample (CSOUND *csound, int frame, int channel, MYFLT sample)
| Adds the indicated sample into the audio input working buffer (spin); this only ever makes sense before calling csoundPerformKsmps().
PUBLIC void | csoundSetSpinSample (CSOUND *csound, int frame, int channel, MYFLT sample)
| Sets the audio input working buffer (spin) to the indicated sample this only ever makes sense before calling csoundPerformKsmps().
PUBLIC MYFLT * | csoundGetSpout (CSOUND *csound)
| Returns the address of the Csound audio output working buffer (spout).
PUBLIC MYFLT | csoundGetSpoutSample (CSOUND *csound, int frame, int channel)
| Returns the indicated sample from the Csound audio output working buffer (spout); only ever makes sense after calling csoundPerformKsmps().
PUBLIC void ** | csoundGetRtRecordUserData (CSOUND *)
| Return pointer to user data pointer for real time audio input.
PUBLIC void ** | csoundGetRtPlayUserData (CSOUND *)
| Return pointer to user data pointer for real time audio output.
PUBLIC void | csoundSetHostImplementedAudioIO (CSOUND *, int state, int bufSize)
| Calling this function with a non-zero 'state' value between csoundCreate() and the start of performance will disable all default handling of sound I/O by the Csound library, allowing the host application to use the spin/spout/input/output buffers directly.
PUBLIC int | csoundGetAudioDevList (CSOUND *csound, CS_AUDIODEVICE *list, int isOutput)
| This function can be called to obtain a list of available input or output audio devices.
PUBLIC void | csoundSetPlayopenCallback (CSOUND *, int(*playopen__)(CSOUND *, const csRtAudioParams *parm))
| Sets a function to be called by Csound for opening real-time audio playback.
PUBLIC void | csoundSetRtplayCallback (CSOUND *, void(*rtplay__)(CSOUND *, const MYFLT *outBuf, int nbytes))
| Sets a function to be called by Csound for performing real-time audio playback.
PUBLIC void | csoundSetRecopenCallback (CSOUND *, int(*recopen_)(CSOUND *, const csRtAudioParams *parm))
| Sets a function to be called by Csound for opening real-time audio recording.
PUBLIC void | csoundSetRtrecordCallback (CSOUND *, int(*rtrecord__)(CSOUND *, MYFLT *inBuf, int nbytes))
| Sets a function to be called by Csound for performing real-time audio recording.
PUBLIC void | csoundSetRtcloseCallback (CSOUND *, void(*rtclose__)(CSOUND *))
| Sets a function to be called by Csound for closing real-time audio playback and recording.
PUBLIC void | csoundSetAudioDeviceListCallback (CSOUND *csound, int(*audiodevlist__)(CSOUND *, CS_AUDIODEVICE *list, int isOutput))
| Sets a function that is called to obtain a list of audio devices.
PUBLIC void | csoundSetMIDIModule (CSOUND *csound, const char *module)
| Sets the current MIDI IO module.
PUBLIC void | csoundSetHostImplementedMIDIIO (CSOUND *csound, int state)
| call this function with state 1 if the host is implementing MIDI via the callbacks below.
PUBLIC int | csoundGetMIDIDevList (CSOUND *csound, CS_MIDIDEVICE *list, int isOutput)
| This function can be called to obtain a list of available input or output midi devices.
PUBLIC void | csoundSetExternalMidiInOpenCallback (CSOUND *, int(*func)(CSOUND *, void **userData, const char *devName))
| Sets callback for opening real time MIDI input.
PUBLIC void | csoundSetExternalMidiReadCallback (CSOUND *, int(*func)(CSOUND *, void *userData, unsigned char *buf, int nBytes))
| Sets callback for reading from real time MIDI input.
PUBLIC void | csoundSetExternalMidiInCloseCallback (CSOUND *, int(*func)(CSOUND *, void *userData))
| Sets callback for closing real time MIDI input.
PUBLIC void | csoundSetExternalMidiOutOpenCallback (CSOUND *, int(*func)(CSOUND *, void **userData, const char *devName))
| Sets callback for opening real time MIDI output.
PUBLIC void | csoundSetExternalMidiWriteCallback (CSOUND *, int(*func)(CSOUND *, void *userData, const unsigned char *buf, int nBytes))
| Sets callback for writing to real time MIDI output.
PUBLIC void | csoundSetExternalMidiOutCloseCallback (CSOUND *, int(*func)(CSOUND *, void *userData))
| Sets callback for closing real time MIDI output.
PUBLIC void | csoundSetExternalMidiErrorStringCallback (CSOUND *, const char *(*func)(int))
| Sets callback for converting MIDI error codes to strings.
PUBLIC void | csoundSetMIDIDeviceListCallback (CSOUND *csound, int(*mididevlist__)(CSOUND *, CS_MIDIDEVICE *list, int isOutput))
| Sets a function that is called to obtain a list of MIDI devices.
PUBLIC int | csoundReadScore (CSOUND *csound, const char *str)
| Read, preprocess, and load a score from an ASCII string It can be called repeatedly, with the new score events being added to the currently scheduled ones.
PUBLIC void | csoundReadScoreAsync (CSOUND *csound, const char *str)
| Asynchronous version of csoundReadScore().
PUBLIC double | csoundGetScoreTime (CSOUND *)
| Returns the current score time in seconds since the beginning of performance.
PUBLIC int | csoundIsScorePending (CSOUND *)
| Sets whether Csound score events are performed or not, independently of real-time MIDI events (see csoundSetScorePending()).
PUBLIC void | csoundSetScorePending (CSOUND *, int pending)
| Sets whether Csound score events are performed or not (real-time events will continue to be performed).
PUBLIC MYFLT | csoundGetScoreOffsetSeconds (CSOUND *)
| Returns the score time beginning at which score events will actually immediately be performed (see csoundSetScoreOffsetSeconds()).
PUBLIC void | csoundSetScoreOffsetSeconds (CSOUND *, MYFLT time)
| Csound score events prior to the specified time are not performed, and performance begins immediately at the specified time (real-time events will continue to be performed as they are received).
PUBLIC void | csoundRewindScore (CSOUND *)
| Rewinds a compiled Csound score to the time specified with csoundSetScoreOffsetSeconds().
PUBLIC void | csoundSetCscoreCallback (CSOUND *, void(*cscoreCallback_)(CSOUND *))
| Sets an external callback for Cscore processing.
PUBLIC int | csoundScoreSort (CSOUND *, FILE *inFile, FILE *outFile)
| Sorts score file 'inFile' and writes the result to 'outFile'.
PUBLIC int | csoundScoreExtract (CSOUND *, FILE *inFile, FILE *outFile, FILE *extractFile)
| Extracts from 'inFile', controlled by 'extractFile', and writes the result to 'outFile'.
PUBLIC CS_PRINTF2 void | csoundMessage (CSOUND *, const char *format,...)
| Displays an informational message.
PUBLIC CS_PRINTF3 void | csoundMessageS (CSOUND *, int attr, const char *format,...)
| Print message with special attributes (see msg_attr.h for the list of available attributes).
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))
| Sets a function to be called by Csound to print an informational message.
PUBLIC void | csoundSetMessageStringCallback (CSOUND *csound, void(*csoundMessageStrCallback)(CSOUND *csound, int attr, const char *str))
| Sets an alternative function to be called by Csound to print an informational message, using a less granular signature.
PUBLIC int | csoundGetMessageLevel (CSOUND *)
| Returns the Csound message level (from 0 to 231).
PUBLIC void | csoundSetMessageLevel (CSOUND *, int messageLevel)
| Sets the Csound message level (from 0 to 231).
PUBLIC void | csoundCreateMessageBuffer (CSOUND *csound, int toStdOut)
| Creates a buffer for storing messages printed by Csound.
PUBLIC const char * | csoundGetFirstMessage (CSOUND *csound)
| Returns the first message from the buffer.
PUBLIC int | csoundGetFirstMessageAttr (CSOUND *csound)
| Returns the attribute parameter (see msg_attr.h) of the first message in the buffer.
PUBLIC void | csoundPopFirstMessage (CSOUND *csound)
| Removes the first message from the buffer.
PUBLIC int | csoundGetMessageCnt (CSOUND *csound)
| Returns the number of pending messages in the buffer.
void PUBLIC | csoundDestroyMessageBuffer (CSOUND *csound)
| Releases all memory used by the message buffer.
PUBLIC int | csoundGetChannelPtr (CSOUND *, MYFLT **p, const char *name, int type)
| Stores a pointer to the specified channel of the bus in *p, creating the channel first if it does not exist yet.
PUBLIC int | csoundListChannels (CSOUND *, controlChannelInfo_t **lst)
| Returns a list of allocated channels in *lst.
PUBLIC void | csoundDeleteChannelList (CSOUND *, controlChannelInfo_t *lst)
| Releases a channel list previously returned by csoundListChannels().
PUBLIC int | csoundSetControlChannelHints (CSOUND *, const char *name, controlChannelHints_t hints)
| Set parameters hints for a control channel.
PUBLIC int | csoundGetControlChannelHints (CSOUND *, const char *name, controlChannelHints_t *hints)
| Returns special parameters (assuming there are any) of a control channel, previously set with csoundSetControlChannelHints() or the chnparams opcode.
PUBLIC int * | csoundGetChannelLock (CSOUND *, const char *name)
| Recovers a pointer to a lock for the specified channel called 'name'.
PUBLIC MYFLT | csoundGetControlChannel (CSOUND *csound, const char *name, int *err)
| retrieves the value of control channel identified by *name.
PUBLIC void | csoundSetControlChannel (CSOUND *csound, const char *name, MYFLT val)
| sets the value of control channel identified by *name
PUBLIC void | csoundGetAudioChannel (CSOUND *csound, const char *name, MYFLT *samples)
| copies the audio channel identified by *name into array *samples which should contain enough memory for ksmps MYFLTs
PUBLIC void | csoundSetAudioChannel (CSOUND *csound, const char *name, MYFLT *samples)
| sets the audio channel identified by *name with data from array *samples which should contain at least ksmps MYFLTs
PUBLIC void | csoundGetStringChannel (CSOUND *csound, const char *name, char *string)
| copies the string channel identified by *name into *string which should contain enough memory for the string (see csoundGetChannelDatasize() below)
PUBLIC void | csoundSetStringChannel (CSOUND *csound, const char *name, char *string)
| sets the string channel identified by *name with *string
PUBLIC int | csoundGetChannelDatasize (CSOUND *csound, const char *name)
| returns the size of data stored in a channel; for string channels this might change if the channel space gets reallocated Since string variables use dynamic memory allocation in Csound6, this function can be called to get the space required for csoundGetStringChannel()
PUBLIC void | csoundSetInputChannelCallback (CSOUND *csound, channelCallback_t inputChannelCalback)
| Sets the function which will be called whenever the invalue opcode is used.
PUBLIC void | csoundSetOutputChannelCallback (CSOUND *csound, channelCallback_t outputChannelCalback)
| Sets the function which will be called whenever the outvalue opcode is used.
PUBLIC int | csoundSetPvsChannel (CSOUND *, const PVSDATEXT *fin, const char *name)
| Sends a PVSDATEX fin to the pvsin opcode (f-rate) for channel 'name'.
PUBLIC int | csoundGetPvsChannel (CSOUND *csound, PVSDATEXT *fout, const char *name)
| Receives a PVSDAT fout from the pvsout opcode (f-rate) at channel 'name' Returns zero on success, CSOUND_ERROR if the index is invalid or if fsig framesizes are incompatible.
PUBLIC int | csoundScoreEvent (CSOUND *, char type, const MYFLT *pFields, long numFields)
| Send a new score event.
PUBLIC void | csoundScoreEventAsync (CSOUND *, char type, const MYFLT *pFields, long numFields)
| Asynchronous version of csoundScoreEvent().
PUBLIC int | csoundScoreEventAbsolute (CSOUND *, char type, const MYFLT *pfields, long numFields, double time_ofs)
| Like csoundScoreEvent(), this function inserts a score event, but at absolute time with respect to the start of performance, or from an offset set with time_ofs.
PUBLIC void | csoundScoreEventAbsoluteAsync (CSOUND *, char type, const MYFLT *pfields, long numFields, double time_ofs)
| Asynchronous version of csoundScoreEventAbsolute().
PUBLIC void | csoundInputMessage (CSOUND *, const char *message)
| Input a NULL-terminated string (as if from a console), used for line events.
PUBLIC void | csoundInputMessageAsync (CSOUND *, const char *message)
| Asynchronous version of csoundInputMessage().
PUBLIC int | csoundKillInstance (CSOUND *csound, MYFLT instr, char *instrName, int mode, int allow_release)
| Kills off one or more running instances of an instrument identified by instr (number) or instrName (name).
PUBLIC int | csoundRegisterSenseEventCallback (CSOUND *, void(*func)(CSOUND *, void *), void *userData)
| Register a function to be called once in every control period by sensevents().
PUBLIC void | csoundKeyPress (CSOUND *, char c)
| Set the ASCII code of the most recent key pressed.
PUBLIC int | csoundRegisterKeyboardCallback (CSOUND *, int(*func)(void *userData, void *p, unsigned int type), void *userData, unsigned int type)
| Registers general purpose callback functions that will be called to query keyboard events.
PUBLIC void | csoundRemoveKeyboardCallback (CSOUND *csound, int(*func)(void *, void *, unsigned int))
| Removes a callback previously set with csoundRegisterKeyboardCallback().
PUBLIC int | csoundTableLength (CSOUND *, int table)
| Returns the length of a function table (not including the guard point), or -1 if the table does not exist.
PUBLIC MYFLT | csoundTableGet (CSOUND *, int table, int index)
| Returns the value of a slot in a function table.
PUBLIC void | csoundTableSet (CSOUND *, int table, int index, MYFLT value)
| Sets the value of a slot in a function table.
PUBLIC void | csoundTableCopyOut (CSOUND *csound, int table, MYFLT *dest)
| Copy the contents of a function table into a supplied array *dest The table number is assumed to be valid, and the destination needs to have sufficient space to receive all the function table contents.
PUBLIC void | csoundTableCopyOutAsync (CSOUND *csound, int table, MYFLT *dest)
| Asynchronous version of csoundTableCopyOut().
PUBLIC void | csoundTableCopyIn (CSOUND *csound, int table, MYFLT *src)
| Copy the contents of an array *src into a given function table The table number is assumed to be valid, and the table needs to have sufficient space to receive all the array contents.
PUBLIC void | csoundTableCopyInAsync (CSOUND *csound, int table, MYFLT *src)
| Asynchronous version of csoundTableCopyIn().
PUBLIC int | csoundGetTable (CSOUND *, MYFLT **tablePtr, int tableNum)
| Stores pointer to function table 'tableNum' in *tablePtr, and returns the table length (not including the guard point).
PUBLIC int | csoundGetTableArgs (CSOUND *csound, MYFLT **argsPtr, int tableNum)
| Stores pointer to the arguments used to generate function table 'tableNum' in *argsPtr, and returns the number of arguments used.
PUBLIC int | csoundIsNamedGEN (CSOUND *csound, int num)
| Checks if a given GEN number num is a named GEN if so, it returns the string length (excluding terminating NULL char) Otherwise it returns 0.
PUBLIC void | csoundGetNamedGEN (CSOUND *csound, int num, char *name, int len)
| Gets the GEN name from a number num, if this is a named GEN The final parameter is the max len of the string (excluding termination).
PUBLIC int | csoundSetIsGraphable (CSOUND *, int isGraphable)
| Tells Csound whether external graphic table display is supported.
PUBLIC void | csoundSetMakeGraphCallback (CSOUND *, void(*makeGraphCallback_)(CSOUND *, WINDAT *windat, const char *name))
| Called by external software to set Csound's MakeGraph function.
PUBLIC void | csoundSetDrawGraphCallback (CSOUND *, void(*drawGraphCallback_)(CSOUND *, WINDAT *windat))
| Called by external software to set Csound's DrawGraph function.
PUBLIC void | csoundSetKillGraphCallback (CSOUND *, void(*killGraphCallback_)(CSOUND *, WINDAT *windat))
| Called by external software to set Csound's KillGraph function.
PUBLIC void | csoundSetExitGraphCallback (CSOUND *, int(*exitGraphCallback_)(CSOUND *))
| Called by external software to set Csound's ExitGraph function.
PUBLIC void * | csoundGetNamedGens (CSOUND *)
| Finds the list of named gens.
PUBLIC int | csoundNewOpcodeList (CSOUND *, opcodeListEntry **opcodelist)
| Gets an alphabetically sorted list of all opcodes.
PUBLIC void | csoundDisposeOpcodeList (CSOUND *, opcodeListEntry *opcodelist)
| Releases an opcode list.
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 *))
| Appends an opcode implemented by external software to Csound's internal opcode list.
PUBLIC void | csoundSetYieldCallback (CSOUND *, int(*yieldCallback_)(CSOUND *))
| Called by external software to set a function for checking system events, yielding cpu time for coopertative multitasking, etc.
PUBLIC void * | csoundCreateThread (uintptr_t(*threadRoutine)(void *), void *userdata)
| Creates and starts a new thread of execution.
PUBLIC void * | csoundCreateThread2 (uintptr_t(*threadRoutine)(void *), unsigned int stack, void *userdata)
| Creates and starts a new thread of execution with a user-defined stack size.
PUBLIC void * | csoundGetCurrentThreadId (void)
| Returns the ID of the currently executing thread, or NULL for failure.
PUBLIC uintptr_t | csoundJoinThread (void *thread)
| Waits until the indicated thread's routine has finished.
PUBLIC void * | csoundCreateThreadLock (void)
| Creates and returns a monitor object, or NULL if not successful.
PUBLIC int | csoundWaitThreadLock (void *lock, size_t milliseconds)
| Waits on the indicated monitor object for the indicated period.
PUBLIC void | csoundWaitThreadLockNoTimeout (void *lock)
| Waits on the indicated monitor object until it is notified.
PUBLIC void | csoundNotifyThreadLock (void *lock)
| Notifies the indicated monitor object.
PUBLIC void | csoundDestroyThreadLock (void *lock)
| Destroys the indicated monitor object.
PUBLIC void * | csoundCreateMutex (int isRecursive)
| Creates and returns a mutex object, or NULL if not successful.
PUBLIC void | csoundLockMutex (void *mutex_)
| Acquires the indicated mutex object; if it is already in use by another thread, the function waits until the mutex is released by the other thread.
PUBLIC int | csoundLockMutexNoWait (void *mutex_)
| Acquires the indicated mutex object and returns zero, unless it is already in use by another thread, in which case a non-zero value is returned immediately, rather than waiting until the mutex becomes available.
PUBLIC void | csoundUnlockMutex (void *mutex_)
| Releases the indicated mutex object, which should be owned by the current thread, otherwise the operation of this function is undefined.
PUBLIC void | csoundDestroyMutex (void *mutex_)
| Destroys the indicated mutex object.
PUBLIC void * | csoundCreateBarrier (unsigned int max)
| Create a Thread Barrier.
PUBLIC int | csoundDestroyBarrier (void *barrier)
| Destroy a Thread Barrier.
PUBLIC int | csoundWaitBarrier (void *barrier)
| Wait on the thread barrier.
PUBLIC void * | csoundCreateCondVar ()
| Creates a conditional variable.
PUBLIC void | csoundCondWait (void *condVar, void *mutex)
| Waits up on a conditional variable and mutex.
PUBLIC void | csoundCondSignal (void *condVar)
| Signals a conditional variable.
PUBLIC void | csoundDestroyCondVar (void *condVar)
| Destroys a conditional variable.
PUBLIC void | csoundSleep (size_t milliseconds)
| Waits for at least the specified number of milliseconds, yielding the CPU to other threads.
PUBLIC int | csoundSpinLockInit (spin_lock_t *spinlock)
| If the spinlock is not locked, lock it and return; if is is locked, wait until it is unlocked, then lock it and return.
PUBLIC void | csoundSpinLock (spin_lock_t *spinlock)
| Locks the spinlock.
PUBLIC int | csoundSpinTryLock (spin_lock_t *spinlock)
| Tries the lock, returns CSOUND_SUCCESS if lock could be acquired, CSOUND_ERROR, otherwise.
PUBLIC void | csoundSpinUnLock (spin_lock_t *spinlock)
| Unlocks the spinlock.
PUBLIC long | csoundRunCommand (const char *const *argv, int noWait)
| Runs an external command with the arguments specified in 'argv'.
PUBLIC void | csoundInitTimerStruct (RTCLOCK *)
| Initialise a timer structure.
PUBLIC double | csoundGetRealTime (RTCLOCK *)
| Return the elapsed real time (in seconds) since the specified timer structure was initialised.
PUBLIC double | csoundGetCPUTime (RTCLOCK *)
| Return the elapsed CPU time (in seconds) since the specified timer structure was initialised.
PUBLIC uint32_t | csoundGetRandomSeedFromTime (void)
| Return a 32-bit unsigned integer to be used as seed from current time.
PUBLIC void | csoundSetLanguage (cslanguage_t lang_code)
| Set language to 'lang_code' (lang_code can be for example CSLANGUAGE_ENGLISH_UK or CSLANGUAGE_FRENCH or many others, see n_getstr.h for the list of languages).
PUBLIC const char * | csoundGetEnv (CSOUND *csound, const char *name)
| Get pointer to the value of environment variable 'name', searching in this order: local environment of 'csound' (if not NULL), variables set with csoundSetGlobalEnv(), and system environment variables.
PUBLIC int | csoundSetGlobalEnv (const char *name, const char *value)
| Set the global value of environment variable 'name' to 'value', or delete variable if 'value' is NULL.
PUBLIC int | csoundCreateGlobalVariable (CSOUND *, const char *name, size_t nbytes)
| Allocate nbytes bytes of memory that can be accessed later by calling csoundQueryGlobalVariable() with the specified name; the space is cleared to zero.
PUBLIC void * | csoundQueryGlobalVariable (CSOUND *, const char *name)
| Get pointer to space allocated with the name "name".
PUBLIC void * | csoundQueryGlobalVariableNoCheck (CSOUND *, const char *name)
| This function is the same as csoundQueryGlobalVariable(), except the variable is assumed to exist and no error checking is done.
PUBLIC int | csoundDestroyGlobalVariable (CSOUND *, const char *name)
| Free memory allocated for "name" and remove "name" from the database.
PUBLIC int | csoundRunUtility (CSOUND *, const char *name, int argc, char **argv)
| Run utility with the specified name and command line arguments.
PUBLIC char ** | csoundListUtilities (CSOUND *)
| Returns a NULL terminated list of registered utility names.
PUBLIC void | csoundDeleteUtilityList (CSOUND *, char **lst)
| Releases an utility list previously returned by csoundListUtilities().
PUBLIC const char * | csoundGetUtilityDescription (CSOUND *, const char *utilName)
| Get utility description.
PUBLIC int | csoundRand31 (int *seedVal)
| Simple linear congruential random number generator: (*seedVal) = (*seedVal) * 742938285 % 2147483647 the initial value of *seedVal must be in the range 1 to 2147483646.
PUBLIC void | csoundSeedRandMT (CsoundRandMTState *p, const uint32_t *initKey, uint32_t keyLength)
| Initialise Mersenne Twister (MT19937) random number generator, using 'keyLength' unsigned 32 bit values from 'initKey' as seed.
PUBLIC uint32_t | csoundRandMT (CsoundRandMTState *p)
| Returns next random number from MT19937 generator.
PUBLIC void * | csoundCreateCircularBuffer (CSOUND *csound, int numelem, int elemsize)
| Create circular buffer with numelem number of elements.
PUBLIC int | csoundReadCircularBuffer (CSOUND *csound, void *circular_buffer, void *out, int items)
| Read from circular buffer.
PUBLIC int | csoundPeekCircularBuffer (CSOUND *csound, void *circular_buffer, void *out, int items)
| Read from circular buffer without removing them from the buffer.
PUBLIC int | csoundWriteCircularBuffer (CSOUND *csound, void *p, const void *inp, int items)
| Write to circular buffer.
PUBLIC void | csoundFlushCircularBuffer (CSOUND *csound, void *p)
| Empty circular buffer of any remaining data.
PUBLIC void | csoundDestroyCircularBuffer (CSOUND *csound, void *circularbuffer)
| Free circular buffer.
PUBLIC int | csoundOpenLibrary (void **library, const char *libraryPath)
| Platform-independent function to load a shared library.
PUBLIC int | csoundCloseLibrary (void *library)
| Platform-independent function to unload a shared library.
PUBLIC void * | csoundGetLibrarySymbol (void *library, const char *symbolName)
| Platform-independent function to get a symbol address in a shared library.

## Detailed Description

Declares the public Csound application programming interface (API).

# Cscore

Beginning with Csound 5, all of the Cscore functions described in the manual are now part of the Csound API, and they can be called from a program that calls the Csound library.

All of the CScore functions are renamed in the Csound API. For example, createv() is now cscoreCreateEvent(), and lcopy() is now cscoreListCopy(). In addition, each function takes an additional first parameter that is a pointer to a CSOUND instance. You can find the details in the header file, cscore.h, which may be included with your Csound distribution, or if not, can be found in Csound CVS `on SourceForge.

Before you can use any of the Cscore API functions, you must create a CSOUND instance and initialize Cscore by calling csoundInitializeCscore() – see csound.h for an explanation. An example main program that does all of this Top/cscormai.c. You should add a function called cscore() with your own score-processing code. An example that does nothing except write the score back out unchanged can be found in the file Top/cscore_internal.c.

To create your own standalone Cscore program, you must compile cscormai.c (or your own main program) and the file containing your cscore() function, and link them with the Csound API library. */

typedef struct cshdr { struct cshdr *prvblk; struct cshdr *nxtblk; int16 type; int16 size; } CSHDR;

/* Single score event structure

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);
}
csound.h
Declares the public Csound application programming interface (API).
CSOUND
struct CSOUND_ CSOUND
Definition csound.h:475
csoundCreate
PUBLIC CSOUND * csoundCreate(void *hostData)
Creates an instance of Csound.
csoundDestroy
PUBLIC void csoundDestroy(CSOUND *)
Destroys an instance of Csound.
csoundPerform
PUBLIC int csoundPerform(CSOUND *)
Senses input events and performs audio output until the end of score is reached (positive return valu...
csoundCompile
PUBLIC int csoundCompile(CSOUND *, int argc, const char **argv)
Compiles Csound input files (such as an orchestra and score, or CSD) as directed by the supplied comm...

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);
CSOUND_::GetSr
MYFLT(* GetSr)(CSOUND *)
Definition csoundCore.h:1022

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

Referenced by cscoreCopyEvent(), cscoreCreateEvent(), cscoreDefineEvent(), cscoreFileClose(), cscoreFileGetCurrent(), cscoreFileOpen(), cscoreFileSetCurrent(), cscoreFreeEvent(), cscoreGetEvent(), cscoreListAppendEvent(), cscoreListAppendList(), cscoreListAppendStringEvent(), cscoreListConcatenate(), cscoreListCopy(), cscoreListCopyEvents(), cscoreListCount(), cscoreListCreate(), cscoreListExtractInstruments(), cscoreListExtractTime(), cscoreListFree(), cscoreListFreeEvents(), cscoreListGetNext(), cscoreListGetSection(), cscoreListGetUntil(), cscoreListPlay(), cscoreListPut(), cscoreListSeparateF(), cscoreListSeparateTWF(), cscoreListSort(), cscorePutEvent(), cscorePutString(), csound_fgen_init(), csound_opcode_init(), csoundAddSpinSample(), csoundAppendOpcode(), csoundCleanup(), csoundClearBreakpoints(), csoundClearSpin(), csoundCloseLibrary(), csoundCompile(), csoundCompileArgs(), csoundCompileCsd(), csoundCompileCsdText(), csoundCompileOrc(), csoundCompileOrcAsync(), csoundCompileTree(), csoundCompileTreeAsync(), csoundCondSignal(), csoundCondWait(), csoundCreate(), csoundCreateBarrier(), csoundCreateCircularBuffer(), csoundCreateCondVar(), csoundCreateGlobalVariable(), csoundCreateMessageBuffer(), csoundCreateMutex(), csoundCreateThread(), csoundCreateThread2(), csoundCreateThreadLock(), csoundDebugContinue(), csoundDebugFreeInstrInstances(), csoundDebugFreeVariables(), csoundDebuggerClean(), csoundDebuggerInit(), csoundDebugGetInstrInstances(), csoundDebugGetVariables(), csoundDebugNext(), csoundDebugStop(), csoundDeleteChannelList(), csoundDeleteTree(), csoundDeleteUtilityList(), csoundDestroy(), csoundDestroyBarrier(), csoundDestroyCircularBuffer(), csoundDestroyCondVar(), csoundDestroyGlobalVariable(), csoundDestroyMessageBuffer(), csoundDestroyMutex(), csoundDestroyThreadLock(), csoundDisposeOpcodeList(), csoundEvalCode(), csoundFlushCircularBuffer(), csoundGet0dBFS(), csoundGetA4(), csoundGetAPIVersion(), csoundGetAudioChannel(), csoundGetAudioDevList(), csoundGetChannelDatasize(), csoundGetChannelLock(), csoundGetChannelPtr(), csoundGetControlChannel(), csoundGetControlChannelHints(), csoundGetCPUTime(), csoundGetCurrentThreadId(), csoundGetCurrentTimeSamples(), csoundGetDebug(), csoundGetEnv(), csoundGetFirstMessage(), csoundGetFirstMessageAttr(), csoundGetHostData(), csoundGetInputBuffer(), csoundGetInputBufferSize(), csoundGetInputName(), csoundGetKr(), csoundGetKsmps(), csoundGetLibrarySymbol(), csoundGetMessageCnt(), csoundGetMessageLevel(), csoundGetMIDIDevList(), csoundGetModule(), csoundGetNamedGEN(), csoundGetNamedGens(), csoundGetNchnls(), csoundGetNchnlsInput(), csoundGetOutputBuffer(), csoundGetOutputBufferSize(), csoundGetOutputFormat(), csoundGetOutputName(), csoundGetParams(), csoundGetPvsChannel(), csoundGetRandomSeedFromTime(), csoundGetRealTime(), csoundGetRtPlayUserData(), csoundGetRtRecordUserData(), csoundGetScoreOffsetSeconds(), csoundGetScoreTime(), csoundGetSizeOfMYFLT(), csoundGetSpin(), csoundGetSpout(), csoundGetSpoutSample(), csoundGetSr(), csoundGetStringChannel(), csoundGetTable(), csoundGetTableArgs(), csoundGetUtilityDescription(), csoundGetVersion(), csoundInitialize(), csoundInitializeCscore(), csoundInitTimerStruct(), csoundInputMessage(), csoundInputMessageAsync(), csoundIsNamedGEN(), csoundIsScorePending(), csoundJoinThread(), csoundKeyPress(), csoundKillInstance(), csoundListChannels(), csoundListUtilities(), csoundLoadPlugins(), csoundLockMutex(), csoundLockMutexNoWait(), csoundMessage(), csoundMessageS(), csoundMessageV(), csoundModuleCreate(), csoundModuleDestroy(), csoundModuleErrorCodeToString(), csoundModuleInfo(), csoundModuleInit(), csoundNewOpcodeList(), csoundNotifyThreadLock(), csoundOpenLibrary(), csoundParseOrc(), csoundPeekCircularBuffer(), csoundPerform(), csoundPerformBuffer(), csoundPerformKsmps(), csoundPopFirstMessage(), csoundQueryGlobalVariable(), csoundQueryGlobalVariableNoCheck(), csoundRand31(), csoundRandMT(), csoundReadCircularBuffer(), csoundReadScore(), csoundReadScoreAsync(), csoundRegisterKeyboardCallback(), csoundRegisterSenseEventCallback(), csoundRemoveBreakpoint(), csoundRemoveInstrumentBreakpoint(), csoundRemoveKeyboardCallback(), csoundReset(), csoundRewindScore(), csoundRunCommand(), csoundRunUtility(), csoundScoreEvent(), csoundScoreEventAbsolute(), csoundScoreEventAbsoluteAsync(), csoundScoreEventAsync(), csoundScoreExtract(), csoundScoreSort(), csoundSeedRandMT(), csoundSetAudioChannel(), csoundSetAudioDeviceListCallback(), csoundSetBreakpoint(), csoundSetBreakpointCallback(), csoundSetControlChannel(), csoundSetControlChannelHints(), csoundSetCscoreCallback(), csoundSetDebug(), csoundSetDefaultMessageCallback(), csoundSetDrawGraphCallback(), csoundSetExitGraphCallback(), csoundSetExternalMidiErrorStringCallback(), csoundSetExternalMidiInCloseCallback(), csoundSetExternalMidiInOpenCallback(), csoundSetExternalMidiOutCloseCallback(), csoundSetExternalMidiOutOpenCallback(), csoundSetExternalMidiReadCallback(), csoundSetExternalMidiWriteCallback(), csoundSetFileOpenCallback(), csoundSetGlobalEnv(), csoundSetHostData(), csoundSetHostImplementedAudioIO(), csoundSetHostImplementedMIDIIO(), csoundSetInput(), csoundSetInputChannelCallback(), csoundSetInstrumentBreakpoint(), csoundSetIsGraphable(), csoundSetKillGraphCallback(), csoundSetLanguage(), csoundSetMakeGraphCallback(), csoundSetMessageCallback(), csoundSetMessageLevel(), csoundSetMessageStringCallback(), csoundSetMIDIDeviceListCallback(), csoundSetMIDIFileInput(), csoundSetMIDIFileOutput(), csoundSetMIDIInput(), csoundSetMIDIModule(), csoundSetMIDIOutput(), csoundSetOpcodedir(), csoundSetOption(), csoundSetOutput(), csoundSetParams(), csoundSetPvsChannel(), csoundSetRecopenCallback(), csoundSetRTAudioModule(), csoundSetRtcloseCallback(), csoundSetRtplayCallback(), csoundSetRtrecordCallback(), csoundSetScoreOffsetSeconds(), csoundSetScorePending(), csoundSetSpinSample(), csoundSetStringChannel(), csoundSetYieldCallback(), csoundSleep(), csoundSpinLock(), csoundSpinLockInit(), csoundSpinTryLock(), csoundSpinUnLock(), csoundStart(), csoundStop(), csoundStopUDPConsole(), csoundSystemSr(), csoundTableCopyIn(), csoundTableCopyInAsync(), csoundTableCopyOut(), csoundTableCopyOutAsync(), csoundTableGet(), csoundTableLength(), csoundTableSet(), csoundUDPConsole(), csoundUDPServerClose(), csoundUDPServerStart(), csoundUDPServerStatus(), csoundUnlockMutex(), csoundWaitBarrier(), csoundWaitThreadLock(), csoundWaitThreadLockNoTimeout(), and csoundWriteCircularBuffer().

## 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

typedef struct controlChannelHints_s controlChannelHints_t

This structure holds the parameter hints for control channels.

## controlChannelInfo_t

typedef struct controlChannelInfo_s controlChannelInfo_t

## CSOUND

typedef struct CSOUND_ CSOUND

## CsoundRandMTState

typedef struct CsoundRandMTState_ 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

enum controlChannelBehavior

Enumerator
CSOUND_CONTROL_CHANNEL_NO_HINTS |
CSOUND_CONTROL_CHANNEL_INT |
CSOUND_CONTROL_CHANNEL_LIN |
CSOUND_CONTROL_CHANNEL_EXP |

## controlChannelType

enum 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

enum 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_MPEG |
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_UNUSED |
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

enum CSOUND_STATUS

Enables Python interface.

ERROR DEFINITIONS

Enumerator
CSOUND_SUCCESS |
CSOUND_ERROR |
CSOUND_INITIALIZATION |
CSOUND_PERFORMANCE |
CSOUND_MEMORY |
CSOUND_SIGNAL |