Csound Csound-dev Csound-tekno Search About

Re: [Cs-dev] Csound API -- modules

Date2005-02-05 20:14
From"gogins@pipeline.com"
SubjectRe: [Cs-dev] Csound API -- modules
I like the idea of csoundInit being optional.

I think csoundPreCompile would be a more descriptive name.


Original Message:
-----------------
From: Istvan Varga istvan_v@mailbox.hu
Date: Sat, 05 Feb 2005 20:46:32 +0100
To: csound-devel@lists.sourceforge.net
Subject: Re: [Cs-dev] Csound API -- modules


gogins@pipeline.com wrote:

> If one can't always do csoundReset and what you propose for
> csoundInitialize at the same time, then they need to be different calls,

csoundReset is supposed to free all allocated memory and other resources,
unload modules, and in general do everything that is done by csoundDestroy,
with the exception of destroying the instance.
On the other hand, the init function, while implies csoundReset (and does
that at first), would allocate memory and load modules. Now, deleting the
csound instance after a csoundReset would be safe, but doing the same after
an init call would be leaking resources.

> but I would prefer a more descriptive name, like csoundInitializeModules
or
> something.

The function is not strictly limited to loading modules. It is a general
initialization call that prepares an instance to be used by csoundCompile,
thus naming it csoundInitializeModules would be confusing. At this time,
I'd prefer the name 'csoundInit', but if you can suggest a name that is
longer
and more descriptive, I will use that.
By the way, there is no technical reason why csoundInit could not be made
optional, making all the following uses valid:

1.
   csoundCreate
   csoundInit
   [do something with the configuration settings]
   csoundCompile
   csoundPerform
   csoundDestroy

2.
   csoundCreate
   csoundCompile  <-- will detect that csoundInit was not called
                      and call it automatically
   csoundPerform
   csoundDestroy

3.
   csoundCreate
   [csoundInit]   <-- optional
   csoundCompile
   csoundPerform
   [csoundInit]   <-- optional
   csoundCompile
   csoundPerform
   [csoundInit]   <-- optional
   csoundCompile
   csoundPerform
   [repeat Init, Compile, Perform any number of times]
   csoundDestroy


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel

--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .




-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-02-05 20:24
FromIstvan Varga
SubjectRe: [Cs-dev] Csound API -- modules
gogins@pipeline.com wrote:

> I like the idea of csoundInit being optional.
> 
> I think csoundPreCompile would be a more descriptive name.

OK, I will name it csoundPreCompile and the function will be
optional. I already have code in csoundCompile that can find
out whether an initialization call is needed.


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-02-05 21:51
FromIstvan Varga
SubjectRe: [Cs-dev] Csound API -- modules
gogins@pipeline.com wrote:

> I like the idea of csoundInit being optional.
> 
> I think csoundPreCompile would be a more descriptive name.

The updated code is now in the CVS. I could not test CsoundVST
since I do not have some of its dependencies, but I was able to
run a simple orc/sco in a loop from csound_main.c, both with
csoundCreate/Destroy, and with just Compile/Perform/Compile/etc.

There may be bugs in code that I did not touch that may also
cause re-entrancy problems in more complex orchestras.
In particular, I get errors about heap corruption when
memfiles are used, but those errors were already present
before my changes.


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-02-06 15:10
FromIstvan Varga
SubjectRe: [Cs-dev] Csound API -- modules
Istvan Varga wrote:

> In particular, I get errors about heap corruption when

Found and fixed it in sread.c. Memory allocated with mmalloc was
reallocated with realloc.


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net