[Cs-dev] remove csoundPreCompile
Date | 2012-04-27 09:51 |
From | Tito Latini |
Subject | [Cs-dev] remove csoundPreCompile |
Attachments | None |
Date | 2012-04-27 10:21 |
From | Tito Latini |
Subject | Re: [Cs-dev] remove csoundPreCompile |
Attachments | None |
Date | 2012-04-27 10:22 |
From | Andres Cabrera |
Subject | Re: [Cs-dev] remove csoundPreCompile |
Hi Tito, How are the initial messages generated by csoundPreCompile now managed (Csound version, etc.)? Will they be passed when the Csound engine starts running? Cheers, Andrés On Fri, Apr 27, 2012 at 9:51 AM, Tito Latini |
Date | 2012-04-27 10:52 |
From | Tito Latini |
Subject | Re: [Cs-dev] remove csoundPreCompile |
Attachments | None |
Date | 2012-04-27 11:08 |
From | Andres Cabrera |
Subject | Re: [Cs-dev] remove csoundPreCompile |
Hi, OK, good. So you would need to register the message callbacks before creating Csound? I seem to remember you couldn't do this with the current API, but maybe I'm wrong... Cheers, Andrés On Fri, Apr 27, 2012 at 10:21 AM, Tito Latini |
Date | 2012-04-27 11:08 |
From | Andres Cabrera |
Subject | Re: [Cs-dev] remove csoundPreCompile |
Nice. I like the way it looks. Cheers, Andrés On Fri, Apr 27, 2012 at 10:52 AM, Tito Latini |
Date | 2012-04-27 11:09 |
From | Tito Latini |
Subject | Re: [Cs-dev] remove csoundPreCompile |
Attachments | None |
Date | 2012-04-27 11:19 |
From | Tito Latini |
Subject | Re: [Cs-dev] remove csoundPreCompile |
Attachments | None |
Date | 2012-04-27 11:22 |
From | Andres Cabrera |
Subject | Re: [Cs-dev] remove csoundPreCompile |
But then wouldn't that mean that the initial messages are not passed to the callback? Cheers, Andrés On Fri, Apr 27, 2012 at 11:09 AM, Tito Latini |
Date | 2012-04-27 11:29 |
From | Tito Latini |
Subject | Re: [Cs-dev] remove csoundPreCompile |
Attachments | None |
Date | 2012-04-27 11:52 |
From | Tito Latini |
Subject | Re: [Cs-dev] remove csoundPreCompile |
Attachments | None |
Date | 2012-04-27 11:54 |
From | Michael Gogins |
Subject | Re: [Cs-dev] remove csoundPreCompile |
Attachments | None None |
My comments: (1) None of these functions should cause Csound to actually exit the process, unless something happens in them that actually kills Csound. This is to accomodate hosts that may fix up things up or allow the user to fix things up and try again. If Die does not cause Csound to actually exit the process, it should be renamed.
(2) Could the need for this PreCompile function be avoided by re-ordering the compile and reset steps, so that callbacks can simply be set after csoundCreate and before csoundCompile?
(3) If not, certainly setting callbacks etc. before compiling does seem to be vital. Rename the function to csoundBindCallbacks or csoundInitialize or something that is more indicative of what it actually does. What else, in fact, does it do?
Finally, names are extremely important. We who have some experience with the code are one thing. People with less knowledge who need to use the API are another thing. The names should be as unambiguous, clear, and indicative of function as possible, consistent with being reasonably short. Actually, even the people who think they know the code will be benefit from renaming things as clearly as possible. Unclear names hide design problems.
Regards, Mike
On Fri, Apr 27, 2012 at 6:29 AM, Tito Latini <tito.01beta@gmail.com> wrote: Now I see 2 solutions: Michael Gogins Irreducible Productions http://www.michael-gogins.com Michael dot Gogins at gmail dot com |
Date | 2012-04-27 12:57 |
From | Tito Latini |
Subject | Re: [Cs-dev] remove csoundPreCompile |
Attachments | None |
Date | 2012-04-27 13:14 |
From | Tito Latini |
Subject | Re: [Cs-dev] remove csoundPreCompile |
Attachments | None |
Date | 2012-04-27 13:53 |
From | Michael Gogins |
Subject | Re: [Cs-dev] remove csoundPreCompile |
Attachments | None None |
Static global variables should not be used. There are several existing uses that would break. For example, I have some Cubase songs that have a different instance of CsoundVST on each of several tracks.
Regards, Mike
On Fri, Apr 27, 2012 at 7:57 AM, Tito Latini <tito.01beta@gmail.com> wrote: If a static global variable is not a problem, the solution is trivial. Michael Gogins Irreducible Productions http://www.michael-gogins.com Michael dot Gogins at gmail dot com |
Date | 2012-04-27 13:55 |
From | "Dr. Richard Boulanger" |
Subject | Re: [Cs-dev] remove csoundPreCompile |
Attachments | None None |
+1 for the most clear and intuitive and unambiguous naming. PS. Hopefully? All of these details descriptions of how computers work, how compilers work and how Csound works will hopefully end up in the new Csound Book, the Floss manual, the Csound Manual, the Csound Journal... and not just the email archive. They have been incredibly informative and enlightening. ___________________________________ Dr. Richard Boulanger, Ph.D. Professor of Electronic Production and Design Professional Writing and Music Technology Division Berklee College of Music 1140 Boylston Street Boston, MA 02215-3693 617-747-2485 (office) 774-488-9166 (cell) ____________________________________ ____________________________________ On Apr 27, 2012, at 6:54 AM, Michael Gogins wrote:
|
Date | 2012-04-27 14:18 |
From | Richard Dobson |
Subject | Re: [Cs-dev] remove csoundPreCompile |
+1 - with the seemingly global surge in the mission of teaching everyone to program (codecademy, RaspberryPi et al), Csound has the potential to be an extra-ordinary educational resource quite apart from its actual functionality. UK exam boards (and it seems most CS teachers) are more or less allergic to C and C++ (C has recently been removed from one list of "approved" languages, by one examining board in the UK), while they are dead keen on Java and Python. So anything that can be done in Csound to make the code as clear, readable and self-documenting as possible has to be a good thing. Doxygen, needless to say, will not cut it! Richard Dobson On 27/04/2012 13:55, Dr. Richard Boulanger wrote: > +1 for the most clear and intuitive and unambiguous naming. > > PS. Hopefully? All of these details descriptions of how computers work, > how compilers work and how Csound works will > hopefully end up in the new Csound Book, the Floss manual, the Csound > Manual, the Csound Journal... and not > just the email archive. They have been incredibly informative and > enlightening. .. ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net |
Date | 2012-04-27 14:33 |
From | Andres Cabrera |
Subject | Re: [Cs-dev] remove csoundPreCompile |
Hi, How about sending the initial batch of messages when the callback is set? This might also be an interesting idea to remove the message storing capabilities currently available in the API, which are limited and cumbersome. Maybe Csound could always store the messages which could be queried with an API call, or a callback could be set to process those messages. I'm not sure if there are performance or concurrency implications, but this would actually be nice for batch running where there is no need to set a message callback but just call an API function to get all the messages produced by Csound. Cheers, Andrés On Fri, Apr 27, 2012 at 11:52 AM, Tito Latini |
Date | 2012-04-27 15:58 |
From | Adam Puckett |
Subject | Re: [Cs-dev] remove csoundPreCompile |
At my community college, there is a computer architecture class that requires calculus. Then and only then do students learn C (and as far as I know, they only briefly touch on it; I have never taken the course myself.) On 4/27/12, Andres Cabrera |
Date | 2012-04-27 16:28 |
From | Tito Latini |
Subject | Re: [Cs-dev] remove csoundPreCompile |
Attachments | None |
Date | 2012-04-27 18:11 |
From | Tito Latini |
Subject | Re: [Cs-dev] remove csoundPreCompile |
Attachments | None |
Date | 2012-04-27 18:12 |
From | Michael Gogins |
Subject | Re: [Cs-dev] remove csoundPreCompile |
Attachments | None None |
What are the contents of a computer architecture class in a community college? If I had to teach an introduction to computer science and programming it would go like this:
(1) A very basic, basic, basic introduction to C programming. To provide context for what comes next.
(2) What is a Turing machine, the halting problem, P vs. NP, the complexity classes. (3) What the operating system, CPU, and code do when a simple program actually runs (I suppose this is something like "computer architecture?"), taught using a debugger.
(4) Basic introduction to C++ programming (because most software we are driving in, flying in, phoning on is written in C, C++, or a C-syntax type language).
(5) History and analysis of some notable programs -- more context. (6) Writing a parser. (6) Design patterns. No need at all for any calculus in all of this. Some notion of logic and formal system, yes. Regards, Mike On Fri, Apr 27, 2012 at 10:58 AM, Adam Puckett <adotsdothmusic@gmail.com> wrote: At my community college, there is a computer architecture class that Michael Gogins Irreducible Productions http://www.michael-gogins.com Michael dot Gogins at gmail dot com |
Date | 2012-04-27 18:14 |
From | Michael Gogins |
Subject | Re: [Cs-dev] remove csoundPreCompile |
Attachments | None None |
This is not correct, it implies a static callback, the callback must not be static. It is possible to imagine a use where several instances of Csound run in one process, and each one needs a different message callback.
But if this is just for a DEFAULT callback that can be separately replaced for each of several instances of Csound in one address space, then it is OK. Regards, Mike
On Fri, Apr 27, 2012 at 11:28 AM, Tito Latini <tito.01beta@gmail.com> wrote: Applied: Michael Gogins Irreducible Productions http://www.michael-gogins.com Michael dot Gogins at gmail dot com |
Date | 2012-04-27 18:37 |
From | Jacob Joaquin |
Subject | Re: [Cs-dev] remove csoundPreCompile |
Also +1. I'm personally in favor of making everything, including the code, as clear, readable and self-documenting as possibly. Even orchestra instrs and UDOs would benefit greatly if they supported a system for autodocs. On Fri, Apr 27, 2012 at 6:18 AM, Richard Dobson |
Date | 2012-04-27 18:40 |
From | Tito Latini |
Subject | Re: [Cs-dev] remove csoundPreCompile |
Attachments | None |
Date | 2012-04-27 18:44 |
From | Michael Gogins |
Subject | Re: [Cs-dev] remove csoundPreCompile |
Attachments | None None |
The callback function may be static, but takes a CSOUND object pointer. This is not what I am talking about. Within Csound itself, the callback pointer must not be static. I don't believe it is, but I want to make sure... I will check this later, also I will look to see what else csoundPreCompile might be doing or might possibly do.
Regards, Mike
On Fri, Apr 27, 2012 at 1:11 PM, Tito Latini <tito.01beta@gmail.com> wrote: No problem, it is only an example and like the original Michael Gogins Irreducible Productions http://www.michael-gogins.com Michael dot Gogins at gmail dot com |
Date | 2012-04-30 08:43 |
From | Andres Cabrera |
Subject | Re: [Cs-dev] remove csoundPreCompile |
Hi, I've been thinking a lot about this lately, and how about setting the callback when csound is created? csound = csoundCreate(0, msg_callback); I'm thinking about reducing the API, so wherever we can remove a function, I think that's a good thing. We could also remove the callback setter function (setting the callback would only be allowed when creating csound), and if a callback is not set, the internal message buffer mechanism is activated: So the functions: 1779 void PUBLIC csoundEnableMessageBuffer(CSOUND *csound, int toStdOut); 1805 void PUBLIC csoundDestroyMessageBuffer(CSOUND *csound); would go from the public API and the functions: 1784 PUBLIC const char* csoundGetFirstMessage(CSOUND *csound); 1790 int PUBLIC csoundGetFirstMessageAttr(CSOUND *csound); 1795 void PUBLIC csoundPopFirstMessage(CSOUND *csound); 1800 int PUBLIC csoundGetMessageCnt(CSOUND *csound); Would only work if no callback has been set. (These four functions could even be trimmed and cleaned up to make them more consice). Thoughts? Cheers, Andrés On Fri, Apr 27, 2012 at 4:28 PM, Tito Latini |
Date | 2012-04-30 11:23 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] remove csoundPreCompile |
I presume this idea is solely for messages; I guess it does not make sense for other callbacks, or does it? I am thinking this: typedef struct csound_cbs { ... } CSOUND_CALLBACKS; CSOUND *csoundCreate(void *userData, CSOUND_CALLBACKS *p) but that means limiting callback setting to newly created instances. Maybe not a good idea. Victor On 30 Apr 2012, at 08:43, Andres Cabrera wrote: > Hi, > > I've been thinking a lot about this lately, and how about setting the > callback when csound is created? > > csound = csoundCreate(0, msg_callback); > > I'm thinking about reducing the API, so wherever we can remove a > function, I think that's a good thing. > We could also remove the callback setter function (setting the > callback would only be allowed when creating csound), and if a > callback is not set, the internal message buffer mechanism is > activated: > > So the functions: > 1779 void PUBLIC csoundEnableMessageBuffer(CSOUND *csound, int toStdOut); > 1805 void PUBLIC csoundDestroyMessageBuffer(CSOUND *csound); > would go from the public API > > and the functions: > 1784 PUBLIC const char* csoundGetFirstMessage(CSOUND *csound); > 1790 int PUBLIC csoundGetFirstMessageAttr(CSOUND *csound); > 1795 void PUBLIC csoundPopFirstMessage(CSOUND *csound); > 1800 int PUBLIC csoundGetMessageCnt(CSOUND *csound); > > Would only work if no callback has been set. (These four functions > could even be trimmed and cleaned up to make them more consice). > > Thoughts? > > Cheers, > Andrés > > > > On Fri, Apr 27, 2012 at 4:28 PM, Tito Latini |
Date | 2012-04-30 11:52 |
From | Andres Cabrera |
Subject | Re: [Cs-dev] remove csoundPreCompile |
I think it should only be for messages, as other callbacks would be less used, and could have their own callback setter. But it makes me think. Would a user want to change any of the callbacks for a csound instance? If it only makes sense to set them once, maybe it would also make sense to have them all as an argument to the csoundCreate function. But in any case, I think the API might look cleaner to most users with my proposal. My only concern is that what I propose is considered bad practice or would be too unusual for most users. Cheers, Andrés On Mon, Apr 30, 2012 at 11:23 AM, Victor Lazzarini |
Date | 2012-04-30 13:05 |
From | andy fillebrown |
Subject | Re: [Cs-dev] remove csoundPreCompile |
Interesting. Maybe all the message functions be reduced to ... CSOUND *csoundCreate(void *hostData, void (*messageCallback_)(CSOUND *csound, int attribute, const char *message)); int csoundSetMessageCallback(CSOUND *, void (*messageCallback_)(CSOUND *csound, int attribute, const char *message)); Then make messages go to stdout only if messageCallback_ is zero. ~ andy.f On Mon, Apr 30, 2012 at 3:43 AM, Andres Cabrera |
Date | 2012-04-30 13:15 |
From | Andres Cabrera |
Subject | Re: [Cs-dev] remove csoundPreCompile |
That is another idea. Getting rid of the internal message buffer completely and just sending to stdout when no callback is set. Cheers, Andrés On Mon, Apr 30, 2012 at 1:05 PM, andy fillebrown |
Date | 2012-04-30 13:18 |
From | Michael Gogins |
Subject | Re: [Cs-dev] remove csoundPreCompile |
Attachments | None None |
This would work, but I prefer the pattern of first create, then initialize. The reason this pattern is better is that although adding initialization to creation is simpler, over time more and more stuff tends to creep into initialization, and then every user of the code has to keep changing their creation calls. If initialization is separate, then all users can keep the same creation code, and only those user whose initialization needs change will need to change their initialization code.
So, I definitely think the functions should be separate, but we need better names. I will look at the initialization code and propose a more descriptive name. Regards, Mike On Mon, Apr 30, 2012 at 3:43 AM, Andres Cabrera <mantaraya36@gmail.com> wrote: Hi, Michael Gogins Irreducible Productions http://www.michael-gogins.com Michael dot Gogins at gmail dot com |
Date | 2012-04-30 13:19 |
From | Michael Gogins |
Subject | Re: [Cs-dev] remove csoundPreCompile |
Attachments | None None |
I can definitely imagine use cases where people would want to change callbacks on a live instance. Debugging, changing audio outputs, etc. Regards, Mike
On Mon, Apr 30, 2012 at 6:52 AM, Andres Cabrera <mantaraya36@gmail.com> wrote: I think it should only be for messages, as other callbacks would be Michael Gogins Irreducible Productions http://www.michael-gogins.com Michael dot Gogins at gmail dot com |
Date | 2012-04-30 13:37 |
From | andy fillebrown |
Subject | Re: [Cs-dev] remove csoundPreCompile |
Thinking more on this, the message callback could be set before csoundCreate is called. This would remove the need to set it in csoundCreate. ~ af On Mon, Apr 30, 2012 at 8:05 AM, andy fillebrown |
Date | 2012-04-30 14:03 |
From | Michael Gogins |
Subject | Re: [Cs-dev] remove csoundPreCompile |
Attachments | None None |
I've glanced over the code. Csound has to set its signal handlers, set its environment variables, parse its command line, load modules and plugins, set its callbacks and drivers, set its global variables, reset its heap, parse the orchestra and score into an abstract syntax tree, and compile the abstract syntax tree into a runnable orchestra graph and score, and go into a loop of looking for events and running one kperiod while events are pending, and closing all system resources when no more events are pending. Correct me if that's not the correct order! if it's not the current order, maybe it's a better order. If that's correct, then I think the main API calls and sequence should be
csoundCreate -- Creates an instance of Csound and not much else. csoundInitialize -- Does everything up to resetting the heap: takes a message callback for the purpose of diagnostics during initialization, takes no other callbacks or other arguments, has a built-in default message callback (as already exists, prints to stdout).
Also exposed: csoundSetSignalHandler, csoundSetXXXCallback, csoundParseArgv, csoundSetEnv, csoundLoadModules, csoundSetGlobal, and I think this would be new, csoundSetArg, also getters for all setters. csoundCompile -- Resets the heap, parses the orc and sco into a tree, compiles the tree into a graph.
Also exposed: csoundReset, csoundParseOrc, csoundParseSco, csoundCompileTree csoundPerform -- Loops while events are pending to run one kperiod, calls csoundCleanup when no more events are pending.
Also exposed: csoundPerformKsmps to dispatch pending events and runs one kperiod, csoundCleanup to release all system resources. On Mon, Apr 30, 2012 at 8:19 AM, Michael Gogins <michael.gogins@gmail.com> wrote: I can definitely imagine use cases where people would want to change callbacks on a live instance. Debugging, changing audio outputs, etc. Michael Gogins Irreducible Productions http://www.michael-gogins.com Michael dot Gogins at gmail dot com |
Date | 2012-04-30 14:08 |
From | Michael Gogins |
Subject | Re: [Cs-dev] remove csoundPreCompile |
Attachments | None None |
No, no, and again no! The message callback must be set per instance of Csound, not globally. Therefore, it must be called when an instance is created, or after. You must NOT assume that all instances of Csound in process will use the same message callback.
A real-life example, which already exists and that I am not making up for the sake argument, that your proposal would kill: In Cubase I have one instance of CsoundVST on one track, another instance of CsoundVST on another track. Each instance logs its messages to its own individual message window.
With your proposal you would see two Csound message windows in Cubase, but all the messages for both instances of Csound would go to one message window. Most confusing! Regards, Mike
On Mon, Apr 30, 2012 at 8:37 AM, andy fillebrown <andy.fillebrown@gmail.com> wrote: Thinking more on this, the message callback could be set before Michael Gogins Irreducible Productions http://www.michael-gogins.com Michael dot Gogins at gmail dot com |
Date | 2012-04-30 16:54 |
From | andy fillebrown |
Subject | Re: [Cs-dev] remove csoundPreCompile |
Setting the message callback pointer before calling csoundCreate doesn't mean the callback pointer has to be global. static void (*currentMessageCallback)( CSOUND*, int, const char*) = 0; void csoundSetMessageCallback( CSOUND *csound, void (*messageCallback_)(CSOUND*, int, const char*)) { if (csound) csound->messageCallback = messageCallback_; else currentMessageCallback = messageCallback_; } CSOUND *csoundCreate() { CSOUND *csound = ... csound->messageCallback = currentMessageCallback; } That way the message callback can be set before or after the csound instance is created. ~ andy.f On Mon, Apr 30, 2012 at 9:08 AM, Michael Gogins |
Date | 2012-04-30 17:09 |
From | Andres Cabrera |
Subject | Re: [Cs-dev] remove csoundPreCompile |
Tito has already implemented a csoundSetDefaultMessageCallback, which writes to a static variable. I think this might be a good solution, although it does feel a bit odd setting the callback before creating csound. I do like the fact that create and initialize have been rolled into a single function. Anything that reduces complexity and the size of the API is good, I think. The only question is whether there is a need to do anything between create and initialize that would warrant separating them. Cheers, Andrés On Mon, Apr 30, 2012 at 4:54 PM, andy fillebrown |
Date | 2012-04-30 17:25 |
From | andy fillebrown |
Subject | Re: [Cs-dev] remove csoundPreCompile |
On Mon, Apr 30, 2012 at 12:09 PM, Andres Cabrera |
Date | 2012-04-30 17:32 |
From | Andres Cabrera |
Subject | Re: [Cs-dev] remove csoundPreCompile |
Yes, I think it's a matter of one or the other. I'm not partial to either, because I don't have that much experience in API design, but just wanted to keep the ball rolling. Cheers, Andrés On Mon, Apr 30, 2012 at 5:25 PM, andy fillebrown |
Date | 2012-04-30 17:35 |
From | Michael Gogins |
Subject | Re: [Cs-dev] remove csoundPreCompile |
Attachments | None None |
Using a static variable as a helper is not a good idea for several reasons. In the first place, the semantics are misleading. The naive user, like me, will assume that calling this function before the create function will set a static variable that will be shared by all users of Csound. If the callback must be set after creation, the implication is clearer that the callback must be set for each instance. (It's OK with me if there's a default callback that prints to stdout, that's the case now anyway).
In the second place, with Andy's scheme it actually is possible to corrupt the message callbacks in different instances of Csound if different threads are doing things concurrently. One such sequence would be like this. Thread A sets the default callback without a Csound instance. After the first 2 bytes of the callback address have been copied into the static variable, there is a context switch. Thread B then creates a Csound instance. The entire default callback pointer is assigned to thread B's instance callback. But this pointer contains an incomplete address that will cause a crash.
This is an unlikely sequence of events, but I know from experience that on a computer, such operations are repeated so many times in different orders that eventually the unlikely sequence will occur and there will be a crash.
Any static variable that is potentially shared by different threads can suffer from this kind of error. Protecting the write to the default callback pointer with an atomic operation would only partly solve this. It would still be possible for thread A to completely set the callback pointer, for there to be a context switch, for thread B to set the callback pointer to a different value, for there to be a context switch, for thread A to create an instance of Csound -- and it will get thread B's callback pointer, not the desired pointer for thread A.
And the semantics would still be potentially misleading. Regards, Mike On Mon, Apr 30, 2012 at 12:09 PM, Andres Cabrera <mantaraya36@gmail.com> wrote: Tito has already implemented a csoundSetDefaultMessageCallback, which Michael Gogins Irreducible Productions http://www.michael-gogins.com Michael dot Gogins at gmail dot com |
Date | 2012-04-30 17:58 |
From | andy fillebrown |
Subject | Re: [Cs-dev] remove csoundPreCompile |
On Mon, Apr 30, 2012 at 12:35 PM, Michael Gogins |
Date | 2012-04-30 18:20 |
From | Michael Gogins |
Subject | Re: [Cs-dev] remove csoundPreCompile |
Attachments | None None |
Evidently you did not read my post all the way through. I explicitly said that thread safety is not enough protection. To repeat myself, thread A can completely set the callback, be interrupted, then thread B can reset the callback, thread A can be resumed and create an instance of Csound with thread B's callback instead of its own callback.
Regards, Mike
On Mon, Apr 30, 2012 at 12:58 PM, andy fillebrown <andy.fillebrown@gmail.com> wrote:
Michael Gogins Irreducible Productions http://www.michael-gogins.com Michael dot Gogins at gmail dot com |
Date | 2012-05-01 12:27 |
From | andy fillebrown |
Subject | Re: [Cs-dev] remove csoundPreCompile |
On Mon, Apr 30, 2012 at 1:20 PM, Michael Gogins |
Date | 2012-05-01 13:55 |
From | andy fillebrown |
Subject | Re: [Cs-dev] remove csoundPreCompile |
On Tue, May 1, 2012 at 7:27 AM, andy fillebrown |
Date | 2012-05-01 14:18 |
From | Michael Gogins |
Subject | Re: [Cs-dev] remove csoundPreCompile |
Andres made several suggestions in this thread. Which one are you talking about? Regards, Mike On Tue, May 1, 2012 at 8:55 AM, andy fillebrown |
Date | 2012-05-01 15:08 |
From | andy fillebrown |
Subject | Re: [Cs-dev] remove csoundPreCompile |
I was referring to Andrés's suggestion of csoundCreate(0, msg_callback), but after reading your response regarding keeping init and create separated, I'm not so sure it's a good idea, now. Perhaps there is another solution we've not considered, yet? It just seem cumbersome to init and create. Create should just init if it needs to, imo, but I'm not seeing a way to deal with message callbacks without the separation (unless thread safety is thrown out =) Anyway, it's always a learning experience. Thanks for that. Cheers, ~ andy.f On Tue, May 1, 2012 at 9:18 AM, Michael Gogins |
Date | 2012-05-01 16:04 |
From | Michael Gogins |
Subject | Re: [Cs-dev] remove csoundPreCompile |
Actually, I think this suggestion is fine. The reason is that we need a message callback to be defined for diagnosing what happens immediately after the createCsound call is made. If the callback is null, a default callback printing to stdout would be used. After that, we simply need the ability to reset the callback with a separate function. Regards, Mike On Tue, May 1, 2012 at 10:08 AM, andy fillebrown |
Date | 2012-05-01 16:33 |
From | Andres Cabrera |
Subject | Re: [Cs-dev] remove csoundPreCompile |
Wouldn't changing the callback while the engine is running be a dangerous operation that could lead to a crash? Or would the callback be protected, or the user warned? Cheers, Andrés On Tue, May 1, 2012 at 4:04 PM, Michael Gogins |
Date | 2012-05-01 16:38 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] remove csoundPreCompile |
As long as it is done at block boundaries, and the callback is not buggy, I do not think there is a problem changing the callback on the run. On 1 May 2012, at 16:33, Andres Cabrera wrote: > Wouldn't changing the callback while the engine is running be a > dangerous operation that could lead to a crash? Or would the callback > be protected, or the user warned? > > Cheers, > Andrés > > On Tue, May 1, 2012 at 4:04 PM, Michael Gogins |