Csound Csound-dev Csound-tekno Search About

Re: [Cs-dev] some ideas for Csound 6

Date2009-02-07 19:24
Frommichael.gogins@gmail.com
SubjectRe: [Cs-dev] some ideas for Csound 6
You will not be able to define a list or map that is as good as std::list or 
std::map without putting in a very great deal of work for no particularly 
good reason.

I have examined the machine language generated for std::vector and std::map 
by GCC, MSVC, and Sun C/C++, at various times, while debugging in various 
contexts. It looks pretty minimal. I also have done direct timings of a 
limited number of comparisons and found, e.g., that iterating over 
std::vector goes the same speed as iterating over a plain C array (which is 
what std::vector is inside, anyway).

Regards,
Mike




----- Original Message ----- 
From: "Pinball" 
To: 
Sent: Saturday, February 07, 2009 4:17 AM
Subject: Re: [Cs-dev] some ideas for Csound 6


>
>
> Richard Dobson wrote:
>>
>> Anthony Kozar wrote:
>>
>> I still suspect that  whole chunks of
>> internal quasi-global variables currently in the CSOUND struct can be
>> eliminated by refactoring internal function calls to pass parameters and
>> return things
>>
>>
>
> This is the point.
>
> Before coding again, specifications for the instrument
> template, a memory layout, need to be defined and
> documented. Also, i see five main entities:
>
> the csParser (csScoreParser, csOrchestraParser)
> the csEventListener or csEventSensor
> the csPlayer or csPerformer
> the csInstrument
> the csScore
>
> each of them handling their own data.
>
>
> csOrchestraParser creates the instrument template
> instance, creating a csInstrument and adding it
> to a csInstrument list (instrument pool)
>
> csEventListener selects the csInstrument in the
> pool activating it. It adds it to a second
> csInstrument list (active instrument list).
>
> csPlayer traverses the active instrument list
> giving each opcode the chance to perform.
>
> csOrchestraParser is not the only source of
> instruments. Any other technique (complying with
> the specifications) may create a csInstrment
> and (dinamically as well) add it to the pool.
>
> It's not a matter of C or C++, it's a matter
> of defining and separating the tasks.
> C++ STL could be very useful. If C++ is not
> used, general functions that handle a List
> (and the like) should be developed anyway.
>
>
>
> -- 
> View this message in context: 
> http://www.nabble.com/Channels-tp21852607p21886378.html
> Sent from the Csound - Dev mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Create and Deploy Rich Internet Apps outside the browser with 
> Adobe(R)AIR(TM)
> software. With Adobe AIR, Ajax developers can use existing skills and code 
> to
> build responsive, highly engaging applications that combine the power of 
> local
> resources and data with the reach of the web. Download the Adobe AIR SDK 
> and
> Ajax docs to start building applications 
> today-http://p.sf.net/sfu/adobe-com
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
> 


------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2009-02-07 21:13
FromSteven Yi
SubjectRe: [Cs-dev] some ideas for Csound 6
Just my two cents, I do find C++ a compelling option, though I do find
it more frustrating that Java. =P  I feel like understanding Csound
internally would have been much quicker if it was in C++, as the
C-code it is in now has it's own tangles which don't feel as easy to
figure out as would happen with C++ (or any other object-oriented
language).  That again is just from my own experience working more
with object-oriented languages.

Regardless, I think this all ends up being a social question rather
than a technical one. My guess is we'll just keep going with C because
we're used to it.  :P

steven


On Sat, Feb 7, 2009 at 11:24 AM,   wrote:
> You will not be able to define a list or map that is as good as std::list or
> std::map without putting in a very great deal of work for no particularly
> good reason.
>
> I have examined the machine language generated for std::vector and std::map
> by GCC, MSVC, and Sun C/C++, at various times, while debugging in various
> contexts. It looks pretty minimal. I also have done direct timings of a
> limited number of comparisons and found, e.g., that iterating over
> std::vector goes the same speed as iterating over a plain C array (which is
> what std::vector is inside, anyway).
>
> Regards,
> Mike
>
>
>
>
> ----- Original Message -----
> From: "Pinball" 
> To: 
> Sent: Saturday, February 07, 2009 4:17 AM
> Subject: Re: [Cs-dev] some ideas for Csound 6
>
>
>>
>>
>> Richard Dobson wrote:
>>>
>>> Anthony Kozar wrote:
>>>
>>> I still suspect that  whole chunks of
>>> internal quasi-global variables currently in the CSOUND struct can be
>>> eliminated by refactoring internal function calls to pass parameters and
>>> return things
>>>
>>>
>>
>> This is the point.
>>
>> Before coding again, specifications for the instrument
>> template, a memory layout, need to be defined and
>> documented. Also, i see five main entities:
>>
>> the csParser (csScoreParser, csOrchestraParser)
>> the csEventListener or csEventSensor
>> the csPlayer or csPerformer
>> the csInstrument
>> the csScore
>>
>> each of them handling their own data.
>>
>>
>> csOrchestraParser creates the instrument template
>> instance, creating a csInstrument and adding it
>> to a csInstrument list (instrument pool)
>>
>> csEventListener selects the csInstrument in the
>> pool activating it. It adds it to a second
>> csInstrument list (active instrument list).
>>
>> csPlayer traverses the active instrument list
>> giving each opcode the chance to perform.
>>
>> csOrchestraParser is not the only source of
>> instruments. Any other technique (complying with
>> the specifications) may create a csInstrment
>> and (dinamically as well) add it to the pool.
>>
>> It's not a matter of C or C++, it's a matter
>> of defining and separating the tasks.
>> C++ STL could be very useful. If C++ is not
>> used, general functions that handle a List
>> (and the like) should be developed anyway.
>>
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Channels-tp21852607p21886378.html
>> Sent from the Csound - Dev mailing list archive at Nabble.com.
>>
>>
>> ------------------------------------------------------------------------------
>> Create and Deploy Rich Internet Apps outside the browser with
>> Adobe(R)AIR(TM)
>> software. With Adobe AIR, Ajax developers can use existing skills and code
>> to
>> build responsive, highly engaging applications that combine the power of
>> local
>> resources and data with the reach of the web. Download the Adobe AIR SDK
>> and
>> Ajax docs to start building applications
>> today-http://p.sf.net/sfu/adobe-com
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>
>
> ------------------------------------------------------------------------------
> Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
> software. With Adobe AIR, Ajax developers can use existing skills and code to
> build responsive, highly engaging applications that combine the power of local
> resources and data with the reach of the web. Download the Adobe AIR SDK and
> Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2009-02-07 21:36
FromRichard Dobson
SubjectRe: [Cs-dev] some ideas for Csound 6
Steven Yi wrote:
> Just my two cents, I do find C++ a compelling option, though I do find
> it more frustrating that Java. =P  I feel like understanding Csound
> internally would have been much quicker if it was in C++, as the
> C-code it is in now has it's own tangles which don't feel as easy to
> figure out as would happen with C++ (or any other object-oriented
> language). 


A lot of those 'tangles" are down to the historical use of global 
variables, and some very short (to the degree of being opaque) variable 
names. And the need virtually to reverse-engineer it in the absence of 
documentation. It is not the fault of the language, merely of the epoch 
in which it was written (and where speed of execution was arguably even 
more a priority than it is now). A lot of refactoring has already taken 
place, but  that CSOUND struct is still in need of pruning. In principle 
it should have no explicit variables at all, just function calls 
(QueryInterface etc) that deliver both function pointers and data 
structures etc to the host. My instinct has always been to do all that 
within C, and then people will have a proper picture of the system, and 
can base any thoughts of moving to C++ (of some incarnation or other) on 
that. C++ can of course easily be used to create a whole lot of new tangles!


Richard Dobson





------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net