Print

Print


Hi, I was looking into using the Csound API, using the example code from
the FLOSS manual (http://write.flossmanuals.net/csound/a-the-csound-api/)
and I've been getting an error where I'm getting no audio output. In the
terminal I get the following message:

 unknown rtaudio module: 'PortAudio', using dummy module

rtaudio: dummy module enabled

Really unsure why this is happening, I'm on a mac so PortAudio should be
the correct rtaudio module. I know my csd is running because I added a
printks statement which succeeds in printing to the terminal. Tried
selecting port audio both in my csd and in the command line. I've included
all the code I am using, please let me know if you see anything.

Here is my csd:

<CsoundSynthesizer>

<CsOptions>

-odac1 -+rtaudio=PortAudio

</CsOptions>

<CsInstruments>


sr = 44100

ksmps = 128

nchnls = 2

0dbfs = 1.0

turnon 1


instr 1

printks "i'm on", 1

a1 oscil .8, 440

outs a1, a1

endin


</CsInstruments>

<CsScore>


</CsScore>

</CsoundSynthesizer>


Here is the example code from the manual that I am running:

Run with command line ./apitest "csdfilename"

#include <stdio.h>
#include <csound/csound.h>

uintptr_t csThread(void *clientData);

typedef struct {
  int result;
  CSOUND *csound;
  int PERF_STATUS;
} userData;

int main(int argc, char *argv[])
{
  int finish;
  void *ThreadID;
  userData *ud;
  ud = (userData *)malloc(sizeof(userData));
  MYFLT *pvalue;
  ud->csound = csoundCreate(NULL);
  ud->result = csoundCompile(ud->csound, argc, argv);

  if (!ud->result) {
    ud->PERF_STATUS = 1;
    ThreadID = csoundCreateThread(csThread, (void *)ud);
  }
  else {
    return 1;
  }

  /* keep performing until user types a number and presses enter */
  scanf("%d", &finish);
  ud->PERF_STATUS = 0;
  csoundDestroy(ud->csound);
  free(ud);
  return 0;
}

/* performance thread function */
uintptr_t csThread(void *data)
{
  userData *udata = (userData *)data;
  if (!udata->result) {
    while ((csoundPerformKsmps(udata->csound) == 0) &&
           (udata->PERF_STATUS == 1));
    csoundDestroy(udata->csound);
  }
  udata->PERF_STATUS = 0;
  return 1;
}

Csound mailing list
[log in to unmask]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here