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

PUBLIC int csoundChanIASetSample ( CSOUND *  ,
int  channel,
int  frame,
MYFLT  sample 
)

Sets the chani opcode MYFLT a-rate value for the indicated frame of the indicated channel. The bus is automatically extended if the channel is greater than previously used, 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 estend the bus.

Definition at line 205 of file bus.c.

References csoundChanIASetSample().

Referenced by csoundChanIASetSample().

{
  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;
  }
  csound->chanoa[n + i] = sample;
  return CSOUND_SUCCESS;
}


Generated by  Doxygen 1.6.0   Back to index