Csound Csound-dev Csound-tekno Search About

Re: [Cs-dev] interfaces lib building in windows with MSVC

Date2005-10-28 21:39
FromMichael Gogins
SubjectRe: [Cs-dev] interfaces lib building in windows with MSVC
I do not wish to make assumptions about what thread starts when, or where, or whether Compile is implied or not. This is unnecessarily complex.

It is better for any and all Perform loops to bail out if Stop is called. That would be so much easier to understand for programmers using the API and should not be hard to implement.

Regards,
Mike

-----Original Message-----
From: Istvan Varga 
Sent: Oct 28, 2005 4:13 PM
To: csound-devel@lists.sourceforge.net
Subject: Re: [Cs-dev] interfaces lib building in windows with MSVC

By the way, how about changing csoundPerform() so that it no longer
implies csoundCompile(), but is rather just one of the various
csoundPerform*() functions that performs an entire score unless
caused to return early by a separate thread ? I mean something like:

{
     Csound csound;
     csound.Compile("examples/trapped.csd");
     // start the other thread
     // ...
     if (!csound.Perform())
       csound.Message("Performance terminated by another thread !\n");
     else
       csound.Message("End of score or error\n");
}

In other words, the fact that performance was stopped is indicated
by a zero return value that would otherwise never occur as csoundPerform()
normally only returns on end of score or error.
With this change, it may be enough to have a single function that
stops performance, and not other ones for pause/continue.


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel





-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-10-28 21:49
FromIstvan Varga
SubjectRe: [Cs-dev] interfaces lib building in windows with MSVC
Michael Gogins wrote:

> I do not wish to make assumptions about what thread starts when,
 > or where, or whether Compile is implied or not.
 > This is unnecessarily complex.
 >
> It is better for any and all Perform loops to bail out if Stop
 > is called. That would be so much easier to understand for
 > programmers using the API and should not be hard to implement.

Well, the only change I have suggested is moving out compilation
from csoundPerform() so that it is possible to continue the performance
if it is stopped (as opposed to finished or failed). That means
that instead of

csoundPerform(csound, argc, argv);

you would have

csoundCompile(csound, argc, argv);
csoundPerform();

This is only slightly more complex, but more flexible, as in the
first case you cannot re-call csoundPerform() again to continue
a stopped performance. It also makes it enough to have one "stop"
function (name anyone ?) that causes csoundPerform() to return
early.


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-10-29 01:09
FromDavid Akbari
SubjectRe: [Cs-dev] interfaces lib building in windows with MSVC
On Oct 28, 2005, at 4:49 PM, Istvan Varga wrote:

> you would have
>
> csoundCompile(csound, argc, argv);
> csoundPerform();
>
> This is only slightly more complex, but more flexible, as in the
> first case you cannot re-call csoundPerform() again to continue
> a stopped performance. It also makes it enough to have one "stop"
> function (name anyone ?) that causes csoundPerform() to return
> early.

This seems very similar to running either of Victor's encapsulations of 
the csoundlib. In csoundapi~ you have to initiate the compile and 
perform components separately. Likewise it is this way in the newly 
added cstclsh with the

% csCompile  name.csd

and

% csPlay

functions.

I find that working this way would lend itself to integrate much more 
easily with any sort of host app and subsequently I would like to 
express that I think this is a good idea to implement using "C" in the 
main library.

I think it's also important to consider having Csound deallocate all of 
it's resources upon early return from csoundPerform(). This includes 
but is not limited to PortAudio, PortMIDI, widget thread, etc.



-David



-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net