| Very interesting questions!
I personally am not terribly interested in a new "engine" for Csound.
It seems to me that it is good to continue to refine and extend the current
engine, with or without parser, for the sake of the body of work invested in
Csound -- not only the Csound code, but also instrument definitions, pieces
that can be studied, books, and so on and so on. Arguably, the richest body
of computer music based on a particular software sound synthesis system.
It also seems to me that it is good to invent something quite new, if
possible, that does not even share the Csound languages or concepts.
I am afraid putting a lot of work into the internals of Csound will not
provide as much "bang for the hour" as adding new opcodes, refining the code
(nobody has used a profiler on it, or have they?), and of course actually
making music.
Or, as much "bang" as writing a new synthesis system from scratch. I know
from experience both with computer music, and with trading systems, that
writing a new system from scratch is generally much easier than rewriting an
existing system.
If anyone is interested, I have been experimenting with new synthesis
systems for years. I would write a new system as a framework for an existing
language, rather than creating a new language designed for music. That way,
nobody has to write any code except for making sounds or scores. At the
moment, I am not quite sure just what language.
I have written working prototypes of such systems in Java, C++/Tcl,
C++/Python, C++/Lua, and C++ with embedded compiler (this last one based on
SAOL). OCaml, Lisp, Lua, Python, Java, C#, and F# would all work. So, for
that matter, would embedding a C or C++ compiler right into the synthesis
system. At the moment, I think writing a new system from scratch for Steel
Bank Common Lisp would be a good approach, or writing a new system from
scratch in C++ with Lua wrappers generated by SWIG. OCaml is very well
suited to the task, but not that many musicians know it.
Whatever language is chosen, it needs to be able to run routines written in
C or C++, and it needs to have either a native compiler, or a just in time
compiler. All the languages I mentioned meet this criterion.
At the moment, the silencevst project on SourceForge contains a working
prototype of such a system written in C++ that is programmable in Lua. It
only builds on Windows right now. The basic framework appears to be roughly
as efficient as Csound, but it is parallelizable (I even have parallel task
code written for Intel Threading Building Blocks, but it is stubbed out
right now because there doesn't seem to be a MinGW TBB).
A C/C++ system could be created similar to CLAM or the Create Signal Library
or by extending the STK. The required libraries, and the runtime library and
other support libraries required by the C++ compiler, could be packaged as
an integral part of the system, which would simply shell out to run the
compiler with a generated command, then load and run a shared library that
would be the piece. I had this working with SAOL and it worked very well. It
was certainly the most powerful of all the prototype systems I made. But
rather than implementing SAOL, I think it would be even more powerful to
simply create a DSP graph framework for the STK and write STK-type wrappers
for a bunch of other computer music goodies, then assume that you will write
pieces in C++ and the synthesis system will compile them for you without you
having to create a makefile. It would be easy to make such a system
parallelizable.
The size of all the libraries, C++ compiler, etc. is now roughly the same as
the size of the installer for Csound or Pure Data.
Regards,
Mike
----- Original Message -----
From: "Steven Yi"
To: "Developer discussions"
Sent: Sunday, September 09, 2007 9:15 PM
Subject: [Cs-dev] Engine Changes,or Csound 6 (was Re: [Csnd] feature
request: multiple strings in"i" statements)
> Hi Anthony,
>
> I wasn't aware of the previous conversation but searched my mail box
> and found it; it was right around when I was leaving Warsaw so
> probably was the furthest thing from my mind. (The nabble thread is
> here:
> http://www.nabble.com/Re%3A-more-than-one-string-in-an-i-statement-tf3655313.html#a10220997)
>
> The variant type is an ideal solution but I am close to certain it
> would require *much* more work than what is mentioned in that thread.
> The code in that thread does not take into account that the lookup as
> it is now is done per-opcode, not per-instrument. If we want to do
> away with the SSTRCOD and use a union, then we would have to check the
> type of the union, then check the type of the of the value it is being
> assigned to per expression or opcode arg value. Currently, opcodes
> themselves check for SSTRCOD then get the strarg value. Ideally,
> opcodes would just have char* or MYFLT* or whatever they are
> expecting, and the parser itself would hook together correctly and do
> type checking there. If we introduce the variant type but don't do
> the changes to opcodes, we're back to using some kind of magic
> variable so that the opcode can know its MYFLT * is signifying a
> string.
>
> At this point, I'm more and more interested in re-engineering the
> engine altogether. There are a number of STRUCT's that could be
> lightened up, memory allocation of instrument instances could change
> from the way it pre-allocates a giant block of memory with indexes to
> one where it is allocating each part individually (not as efficient
> but required for runtime changes to instruments), the maintaining of
> variable names to memory addresses (that is all erased currently after
> parse time, another factor in disallowing runtime modification of
> instruments), etc. There are also some variables exposed like
> curevtblk which opcodes use that makes it impossible to do multi-core
> or cluster computation. (There is a related variable that has the
> active instrtxt or something like that that goto uses (and thus
> if-else and all branching variants) use that also makes
> multi-core/cluster impossible).
>
> There are a lot of these types of things that are not small changes.
> What does everyone think of starting a new Csound6 branch that will go
> ahead and make some pretty big changes and making Csound5 a stable
> branch? I think then small changes like new opcodes could go into
> Csound5 and perhaps doing the hack suggestion for multiple strings per
> score node. We could outline large scale changes for Csound6 and then
> branch that off and start to really aim for that. If we can outline
> the exact changes we want, it should be easy then to target where
> we'll go (seems now we're in a bit of a gray area of figuring out
> where to go now) and should make it easier for outside developers to
> see where we all want to take this and perhaps participate. Having
> the unstable Csound6 branch (or even just making a new repository in
> CVS like csound5 is) would also make sure we safely do work there and
> not interfere with Csound5 and OLPC and other projects using that.
>
> Thoughts?
> steven
>
>
>
> On 9/9/07, Anthony Kozar wrote:
>> Just a note: I believe that this was discussed a couple of months ago
>> and
>> Michael Gogins already suggested a good solution. Of course, this
>> requires
>> modifying the EVTBLK struct. I pointed out that modifying EVTBLK will
>> break
>> API compatibility, and I think we decided to put off this change until a
>> time came that we were ready to increase the API major version number
>> (presumably because there are other changes to the API that we want to
>> make
>> as well).
>>
>> Anthony Kozar
>> anthonykozar AT sbcglobal DOT net
>> http://anthonykozar.net/
>>
>> Steven Yi wrote on 9/9/07 12:53 AM:
>>
>> > Hi All,
>> >
>> > I've taken a preliminary look today and it's a bit complicated to find
>> > a solution considering the way opcodes are all hooked up together as
>> > well as how the magic variable SSTRCOD is used. (The use of the
>> > SSTRCOD is a bit arbitrary in the first place and could in a very
>> > remote possibility cause an issue if someone were to use the value.)
>>
>>
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by: Microsoft
>> Defy all challenges. Microsoft(R) Visual Studio 2005.
>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net |