csound.h header is the primary interface for integrating Csound into host applications. It provides the complete public API for creating, configuring, and controlling Csound instances.
Overview
This header defines the core API that host applications use to:- Create and destroy Csound instances
- Compile and perform Csound code
- Control real-time audio and MIDI I/O
- Manage channels, tables, and events
- Access performance attributes and configuration
Key components
Opaque types
CSOUND pointer is the central handle for all Csound operations.
Status codes
Debug levels
Parameters structure
Device information
Channel types
Channel hints
Preprocessor macros
Platform visibility
Initialization flags
Keyboard callback types
Event types
Exit codes
Usage context
Host applications should include this header to access the full Csound API:Related headers
The main header automatically includes:csound_rtaudio.h- Real-time audio I/Ocsound_rtmidi.h- Real-time MIDI I/Ocfgvar.h- Configuration variablesmsg_attr.h- Message attributesversion.h- Version information
Thread safety
Most API functions are not thread-safe. When accessing channels or shared data from multiple threads:- Use
csoundLockChannel()andcsoundUnlockChannel() - Use atomic operations for control channels when available
- Avoid concurrent calls to compilation and performance functions
See also
- csoundCore.h - Internal engine structures
- Audio I/O - Real-time audio interface
- MIDI I/O - Real-time MIDI interface