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

PUBLIC int csoundChanOAGet ( CSOUND *  csound,
MYFLT *  value,
int  n 

Receives ksmps MYFLT values from the chano opcode (a-rate) at index 'n'. The bus is automatically extended if 'n' exceeds any previously used index value, clearing new locations to zero. Returns zero on success, CSOUND_ERROR if the index is invalid, and CSOUND_MEMORY if there is not enough memory to extend the bus.

Definition at line 163 of file bus.c.

References csoundChanOAGet().

Referenced by csoundChanOAGet().

    if (n < 0)
      return CSOUND_ERROR;
    n *= csound->ksmps;
    if ((unsigned int)n >= (unsigned int)csound->nchanoa) {
      int   err = chan_realloc(csound, &(csound->chanoa),
                               &(csound->nchanoa), n + csound->ksmps);
      if (UNLIKELY(err))
        return err;
    memcpy(value, &(csound->chanoa[n]), sizeof(MYFLT) * csound->ksmps);
    return CSOUND_SUCCESS;

Generated by  Doxygen 1.6.0   Back to index