Home · Standalone · rtcmix~ · uRTcmix · iRTcmix · Tutorials · Reference |
RTcmix an open-source digital signal processing and sound synthesis language |
about · links · contact |
rtaddoutINSTRUMENT design -- sample output-writing functionThe rtaddout() function is used in RTcmix instrument design to write one frame of generated samples to the output buffer for hearing or soundfile-writing. It will write the appropriate number of channels depending on the value of the INSTRUMENT variable outputchans (see the Instrument listing for more information about INSTRUMENT variables). Typically rtaddout is used in the sample-computing loop inside the INSTRUMENT::run() member function. rtaddout assumes that rtsetoutput() was called in the INSTRUMENT::init() member function. It replaces the older ADDOUT macro used in disk-only cmix. Usage
The rtaddout() function returns the number of channels of the output. Examples#include <Instrument.h> int MYINSTRUMENT::run() { float out[2]; for (i = 0; i < framesToRun(); i++) { ... out[0] = leftchannelsample; out[1] = rightchannelsample; rtaddout(out); } } See Also |