Csound Csound-dev Csound-tekno Search About

[Cs-dev] Still trying to understand the API

Date2006-04-29 10:46
Fromjpff@codemist.co.uk
Subject[Cs-dev] Still trying to understand the API
What is the correct way to use the API in a simple case?  The code I
have says
    csoundInitialize(&argc, &argv, CSOUNDINIT_NO_SIGNAL_HANDLER);
    csound = csoundCreate(NULL);
    csoundPreCompile(csound);
    csoundReset(csound);
...create args...
    res = csoundCompile(csound, n, argv);
    do res = csoundPerformKsmps(csound);
    while (res==0);

the effect is to compile the stuff OK and I see
STARTING FILE
Creating orchestra
Creating score
orchname:  /tmp/fileGr17gw.orc
scorename: /tmp/fileu3HsMI.sco
rtaudio: PortAudio module enabled ... using blocking interface
rtmidi: PortMIDI module enabled
orch compiler:
7 lines read
        instr   1

but in the perform stage it seems to decide that there is no score,
and it does things with f statements which are not in my score.  How
should this work?  I have looked at a number of frontends and I cannot
see how they differ.

==John ffitch


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2006-04-29 11:05
FromRory Walsh
SubjectRe: [Cs-dev] Still trying to understand the API
Can you show us the csound messages output during the performance?

Rory.

jpff@codemist.co.uk wrote:
> What is the correct way to use the API in a simple case?  The code I
> have says
>     csoundInitialize(&argc, &argv, CSOUNDINIT_NO_SIGNAL_HANDLER);
>     csound = csoundCreate(NULL);
>     csoundPreCompile(csound);
>     csoundReset(csound);
> ...create args...
>     res = csoundCompile(csound, n, argv);
>     do res = csoundPerformKsmps(csound);
>     while (res==0);
> 
> the effect is to compile the stuff OK and I see
> STARTING FILE
> Creating orchestra
> Creating score
> orchname:  /tmp/fileGr17gw.orc
> scorename: /tmp/fileu3HsMI.sco
> rtaudio: PortAudio module enabled ... using blocking interface
> rtmidi: PortMIDI module enabled
> orch compiler:
> 7 lines read
>         instr   1
> 
> but in the perform stage it seems to decide that there is no score,
> and it does things with f statements which are not in my score.  How
> should this work?  I have looked at a number of frontends and I cannot
> see how they differ.
> 
> ==John ffitch
> 
> 
> -------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
> 


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2006-04-29 14:08
Fromjpff@codemist.co.uk
SubjectRe: [Cs-dev] Still trying to understand the API
??? I did !!!  There were no messages after 
 7 lines read
        instr   1

I can trace with gdb and the Perform stuff jumps straight into
sensevents and seems to think there is no score; it appears to loop in
sensevents.

I assume that I am doing something wrong in the way I am calling the
API

==John ffitch
>>>>> "Rory" == Rory Walsh  writes:

 Rory> Can you show us the csound messages output during the performance?
 Rory> Rory.

 Rory> jpff@codemist.co.uk wrote:
 >> What is the correct way to use the API in a simple case?  The code I
 >> have says
 >> csoundInitialize(&argc, &argv, CSOUNDINIT_NO_SIGNAL_HANDLER);
 >> csound = csoundCreate(NULL);
 >> csoundPreCompile(csound);
 >> csoundReset(csound);
 >> ...create args...
 >> res = csoundCompile(csound, n, argv);
 >> do res = csoundPerformKsmps(csound);
 >> while (res==0);
 >> 
 >> the effect is to compile the stuff OK and I see
 >> STARTING FILE
 >> Creating orchestra
 >> Creating score
 >> orchname:  /tmp/fileGr17gw.orc
 >> scorename: /tmp/fileu3HsMI.sco
 >> rtaudio: PortAudio module enabled ... using blocking interface
 >> rtmidi: PortMIDI module enabled
 >> orch compiler:
 >> 7 lines read
 >> instr   1
 >> 
 >> but in the perform stage it seems to decide that there is no score,
 >> and it does things with f statements which are not in my score.  How
 >> should this work?  I have looked at a number of frontends and I cannot
 >> see how they differ.
 >> 
 >> ==John ffitch
 >> 
 >> 
 >> -------------------------------------------------------
 >> Using Tomcat but need to do more? Need to support web services, security?
 >> Get stuff done quickly with pre-integrated technology to make your job easier
 >> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
 >> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
 >> _______________________________________________
 >> Csound-devel mailing list
 >> Csound-devel@lists.sourceforge.net
 >> https://lists.sourceforge.net/lists/listinfo/csound-devel
 >> 


 Rory> -------------------------------------------------------
 Rory> Using Tomcat but need to do more? Need to support web services, security?
 Rory> Get stuff done quickly with pre-integrated technology to make your job easier
 Rory> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
 Rory> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
 Rory> _______________________________________________
 Rory> Csound-devel mailing list
 Rory> Csound-devel@lists.sourceforge.net
 Rory> https://lists.sourceforge.net/lists/listinfo/csound-devel





-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2006-04-29 14:16
FromRory Walsh
SubjectRe: [Cs-dev] Still trying to understand the API
Oh, that's strange. I can't really see what the problem could be, but 
that's hardly surprising! Are you sure 'n' matches the number actual 
arguments your passing to csound? Sorry I can't be more help,

Rory.


jpff@codemist.co.uk wrote:
> ??? I did !!!  There were no messages after 
>  7 lines read
>         instr   1
> 
> I can trace with gdb and the Perform stuff jumps straight into
> sensevents and seems to think there is no score; it appears to loop in
> sensevents.
> 
> I assume that I am doing something wrong in the way I am calling the
> API
> 
> ==John ffitch
>>>>>> "Rory" == Rory Walsh  writes:
> 
>  Rory> Can you show us the csound messages output during the performance?
>  Rory> Rory.
> 
>  Rory> jpff@codemist.co.uk wrote:
>  >> What is the correct way to use the API in a simple case?  The code I
>  >> have says
>  >> csoundInitialize(&argc, &argv, CSOUNDINIT_NO_SIGNAL_HANDLER);
>  >> csound = csoundCreate(NULL);
>  >> csoundPreCompile(csound);
>  >> csoundReset(csound);
>  >> ...create args...
>  >> res = csoundCompile(csound, n, argv);
>  >> do res = csoundPerformKsmps(csound);
>  >> while (res==0);
>  >> 
>  >> the effect is to compile the stuff OK and I see
>  >> STARTING FILE
>  >> Creating orchestra
>  >> Creating score
>  >> orchname:  /tmp/fileGr17gw.orc
>  >> scorename: /tmp/fileu3HsMI.sco
>  >> rtaudio: PortAudio module enabled ... using blocking interface
>  >> rtmidi: PortMIDI module enabled
>  >> orch compiler:
>  >> 7 lines read
>  >> instr   1
>  >> 
>  >> but in the perform stage it seems to decide that there is no score,
>  >> and it does things with f statements which are not in my score.  How
>  >> should this work?  I have looked at a number of frontends and I cannot
>  >> see how they differ.
>  >> 
>  >> ==John ffitch
>  >> 
>  >> 
>  >> -------------------------------------------------------
>  >> Using Tomcat but need to do more? Need to support web services, security?
>  >> Get stuff done quickly with pre-integrated technology to make your job easier
>  >> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
>  >> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>  >> _______________________________________________
>  >> Csound-devel mailing list
>  >> Csound-devel@lists.sourceforge.net
>  >> https://lists.sourceforge.net/lists/listinfo/csound-devel
>  >> 
> 
> 
>  Rory> -------------------------------------------------------
>  Rory> Using Tomcat but need to do more? Need to support web services, security?
>  Rory> Get stuff done quickly with pre-integrated technology to make your job easier
>  Rory> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
>  Rory> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>  Rory> _______________________________________________
>  Rory> Csound-devel mailing list
>  Rory> Csound-devel@lists.sourceforge.net
>  Rory> https://lists.sourceforge.net/lists/listinfo/csound-devel
> 
> 
> 
> 
> 
> -------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
> 


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2006-04-29 16:16
FromAnthony Kozar
SubjectRe: [Cs-dev] Still trying to understand the API
If Csound appears to be performing this score:

f0 86400

then Rory is probably right and your number of arguments is one less than it
should be.  (I am sure that *you* realize this being a commandline guru, but
you do have to count the "csound" as the first argument).

Anthony

Rory Walsh wrote on 4/29/06 9:16 AM:

> Oh, that's strange. I can't really see what the problem could be, but
> that's hardly surprising! Are you sure 'n' matches the number actual
> arguments your passing to csound? Sorry I can't be more help,
> 
> Rory.
> 
> 
> jpff@codemist.co.uk wrote:
>> ??? I did !!!  There were no messages after
>> 7 lines read
>> instr   1
>> 
>> I can trace with gdb and the Perform stuff jumps straight into
>> sensevents and seems to think there is no score; it appears to loop in
>> sensevents.
>> 
>> I assume that I am doing something wrong in the way I am calling the
>> API



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2006-04-29 22:28
Fromjpff@codemist.co.uk
SubjectRe: [Cs-dev] Still trying to understand the API
That is not the problem.  The csound structure does not have a score
included, and while there is a score file unpacked from the csd it is
not stored in the structure; hence no score.  I have no idea why this
could be.  Even more mysteriously this did work at one time

If I use separate sco and orc files the effect is the same.  btw I do
not see a message about sorting the score.

I suspect that some other API function needs to be called (or not called)
==John ffitch


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2006-05-01 16:05
FromAnthony Kozar
SubjectRe: [Cs-dev] Still trying to understand the API
Based on this explanation from Istvan, I think maybe you should not be
calling csoundReset() immediately following csoundPreCompile().  (Although I
would also think that csoundPreCompile() gets called again when you call
csoundCompile() with the code below).

*shrug*

Istvan Varga wrote on 5/1/06 4:52 AM:

> csoundPreCompile() does call csoundReset() first, but then also does some
> initialization that involves allocating memory, setting up internal
> structures, and more importantly loading plugins from OPCODEDIR.
> csoundCompile() calls csoundPreCompile() automatically unless you have
> already done so yourself.


jpff@codemist.co.uk wrote on 4/29/06 5:46 AM:

> What is the correct way to use the API in a simple case?  The code I
> have says
> csoundInitialize(&argc, &argv, CSOUNDINIT_NO_SIGNAL_HANDLER);
> csound = csoundCreate(NULL);
> csoundPreCompile(csound);
> csoundReset(csound);
> ...create args...
> res = csoundCompile(csound, n, argv);
> do res = csoundPerformKsmps(csound);
> while (res==0);



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2006-05-04 16:31
Fromjpff@cs.bath.ac.uk
Subject[Cs-dev] Re: Still trying to understand the API
btw I resolved this issue; the problem was that the Yield callback was
returning the wrong value.

Amazing what a good sleep and waking at 3am can do!
==John ffitch


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net