Csound Csound-dev Csound-tekno Search About

[Csnd] Re: cs_glue.hpp

Date2008-04-18 07:43
Fromvictor
Subject[Csnd] Re: cs_glue.hpp
In C++, you don't need these. They are there to allow languages like
Python to use some of the API functions.

Victor
----- Original Message ----- 
From: "James Hearon" 
To: 
Sent: Thursday, April 17, 2008 11:16 PM
Subject: [Csnd] cs_glue.hpp



Hi,
I've been having some trouble with the getters and setters from the 
CsoundMFLTArray class in cs_glue.hpp from interfaces.  These are supposed to 
talk to a software bus, but the .csd locks up when I try to use them.  I may 
not be doing it correctly.
Seems the ChanI opcodes still work fine for the software bus, but this part 
of the glue code by Istvan for the bus doesn't seem to work very well 
nowadays.
Anybody happen to know what might be needed or missing etc.?  The example 
below is incomplete (nothing in the csoundPerformKsmps loop), but it works 
for testing SetValue and GetValue.  The reason I was using the interfaces 
code is because I was working with the java wrappers where it doesn't seem 
working, and I went back to c for a sanity check.  I'm trying on a PC using 
DevC++ using GCC, and Mingw built libs.
Thanks.

//Test.cpp
//link to libcsound32 and libcsnd

#include "C:/temp/csound508/H/csound.h"
#include "C:/temp/csound508/H/csound.hpp"
#include "C:/temp/csound508/interfaces/cs_glue.hpp"

#include
#include
#include
#include

using namespace std;

int main(void)
{
    CSOUND *csound = csoundCreate(0);
    const char *argv[] = {"csound", "ChnGet.csd" };
int result= csoundCompile(csound, 2, (char **)argv);
                MYFLT* pvalue;
CsoundMYFLTArray(2);
CsoundMYFLTArray csoundMYFLTArray;

if(!result)
{
int testgetchptr =(csoundGetChannelPtr(csound, &pvalue, "pitch",
                CSOUND_INPUT_CHANNEL | CSOUND_CONTROL_CHANNEL));
                printf("---RESULT of GetChannelPtr: %d\n", testgetchptr); 
//zero is success

              //these guys are causing problems...
              //csoundMYFLTArray.SetValue(0, 400.0);
             //double mytest = csoundMYFLTArray.GetValue(0);
             //printf("---RESULT of GetValue(0): %e\n", mytest );

     while(csoundPerformKsmps(csound)==0){
       }
    }
    csoundDestroy(csound);
    return result;
}

==================
;ChnGet.csd


-+rtaudio=portaudio -odac -s -d  -b4096 -B4096


sr = 44100
ksmps = 10
nchnls = 1

chn_k "pitch", 1

instr 1
kval chnget "pitch"
printk2 kval
a1 oscil 5000, kval, 1
out a1
endin




f1 0 8192 10 1
i1 0 5
e


_________________________________________________________________
More immediate than e-mail? Get instant access with Windows Live Messenger.
http://www.windowslive.com/messenger/overview.html?ocid=TXT_TAGLM_WL_Refresh_instantaccess_042008

Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe 
csound"=