Logo Search packages:      
Sourcecode: csound version File versions  Download package

PUBLIC int csoundPerformBuffer ( void *  csound  ) 

Performs Csound, sensing real-time and score events and processing one buffer's worth (-b frames) of interleaved audio. Returns a pointer to the new output audio in 'outputAudio' Note that csoundCompile must be called first, then call csoundGetOutputBuffer() and csoundGetInputBuffer() to get the pointer to csound's i/o buffers. Returns false during performance, and true when performance is finished.

Definition at line 198 of file csound.c.

  {
    volatile int returnValue;
    /* Number of samples still needed to create before returning.
     */
    static int sampsNeeded = 0;
    int sampsPerKperf = ksmps * nchnls;
    int done = 0;
    /* Setup jmp for return after an exit().
     */
    if (returnValue = setjmp(csoundJump_))
      {
        csoundMessage(csound, "Early return from csoundPerformBuffer().");
        return returnValue;
      }
    _rtCurOutBufCount = 0;
       sampsNeeded += O.outbufsamps;
    while (!done && sampsNeeded > 0)
      {
        done = sensevents();
        if (done)
          {
            return done;
          }
        if (kcnt)
          {
            int rtEvents = O.RTevents;
            O.RTevents = 0;
            kperf(1);
            kcnt -= 1;
            sampsNeeded -= sampsPerKperf;
            O.RTevents = rtEvents;
          }
      }
    return done;
  }


Generated by  Doxygen 1.6.0   Back to index