Re: [Cs-dev] remove csoundPreCompile
Date | 2012-04-30 14:34 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] remove csoundPreCompile |
Attachments | None None |
The order appears correct, but some things will be changed, in particular the ability to compile and load while running, the generation of a fast load representation and similar operations. I would not worry too much about the final look of the API at this stage, but I agree we need to discuss it thoroughly. Victor Lazzarini Michael Gogins <michael.gogins@gmail.com> wrote: 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 |