Csound API  6.18
Score Handling

Functions

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. More...
 
PUBLIC void csoundReadScoreAsync (CSOUND *csound, const char *str)
 Asynchronous version of csoundReadScore(). More...
 
PUBLIC double csoundGetScoreTime (CSOUND *)
 Returns the current score time in seconds since the beginning of performance. More...
 
PUBLIC int csoundIsScorePending (CSOUND *)
 Sets whether Csound score events are performed or not, independently of real-time MIDI events (see csoundSetScorePending()). More...
 
PUBLIC void csoundSetScorePending (CSOUND *, int pending)
 Sets whether Csound score events are performed or not (real-time events will continue to be performed). More...
 
PUBLIC MYFLT csoundGetScoreOffsetSeconds (CSOUND *)
 Returns the score time beginning at which score events will actually immediately be performed (see csoundSetScoreOffsetSeconds()). More...
 
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). More...
 
PUBLIC void csoundRewindScore (CSOUND *)
 Rewinds a compiled Csound score to the time specified with csoundSetScoreOffsetSeconds(). More...
 
PUBLIC void csoundSetCscoreCallback (CSOUND *, void(*cscoreCallback_)(CSOUND *))
 Sets an external callback for Cscore processing. More...
 
PUBLIC int csoundScoreSort (CSOUND *, FILE *inFile, FILE *outFile)
 Sorts score file 'inFile' and writes the result to 'outFile'. More...
 
PUBLIC int csoundScoreExtract (CSOUND *, FILE *inFile, FILE *outFile, FILE *extractFile)
 Extracts from 'inFile', controlled by 'extractFile', and writes the result to 'outFile'. More...
 

Detailed Description

Function Documentation

◆ csoundGetScoreOffsetSeconds()

PUBLIC MYFLT csoundGetScoreOffsetSeconds ( CSOUND )

Returns the score time beginning at which score events will actually immediately be performed (see csoundSetScoreOffsetSeconds()).

◆ csoundGetScoreTime()

PUBLIC double csoundGetScoreTime ( CSOUND )

Returns the current score time in seconds since the beginning of performance.

◆ csoundIsScorePending()

PUBLIC int csoundIsScorePending ( CSOUND )

Sets whether Csound score events are performed or not, independently of real-time MIDI events (see csoundSetScorePending()).

◆ csoundReadScore()

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.

Referenced by CsoundTextEvent::operator()().

◆ csoundReadScoreAsync()

PUBLIC void csoundReadScoreAsync ( CSOUND csound,
const char *  str 
)

Asynchronous version of csoundReadScore().

◆ csoundRewindScore()

PUBLIC void csoundRewindScore ( CSOUND )

Rewinds a compiled Csound score to the time specified with csoundSetScoreOffsetSeconds().

◆ csoundScoreExtract()

PUBLIC int csoundScoreExtract ( CSOUND ,
FILE *  inFile,
FILE *  outFile,
FILE *  extractFile 
)

Extracts from 'inFile', controlled by 'extractFile', and writes the result to 'outFile'.

The Csound instance should be initialised before calling this function, and csoundReset() should be called after score extraction to clean up. The return value is zero on success.

◆ csoundScoreSort()

PUBLIC int csoundScoreSort ( CSOUND ,
FILE *  inFile,
FILE *  outFile 
)

Sorts score file 'inFile' and writes the result to 'outFile'.

The Csound instance should be initialised before calling this function, and csoundReset() should be called after sorting the score to clean up. On success, zero is returned.

◆ csoundSetCscoreCallback()

PUBLIC void csoundSetCscoreCallback ( CSOUND ,
void(*)(CSOUND *)  cscoreCallback_ 
)

Sets an external callback for Cscore processing.

Pass NULL to reset to the internal cscore() function (which does nothing). This callback is retained after a csoundReset() call.

◆ 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).

Can be used by external software, such as a VST host, to begin score performance midway through a Csound score, for example to repeat a loop in a sequencer, or to synchronize other events with the Csound score.

◆ csoundSetScorePending()

PUBLIC void csoundSetScorePending ( CSOUND ,
int  pending 
)

Sets whether Csound score events are performed or not (real-time events will continue to be performed).

Can be used by external software, such as a VST host, to turn off performance of score events (while continuing to perform real-time events), for example to mute a Csound score while working on other tracks of a piece, or to play the Csound instruments live.