Csound Csound-dev Csound-tekno Search About

how much does coding an opcode in C speed things up?

Date2016-04-30 02:10
FromMichael Mossey
Subjecthow much does coding an opcode in C speed things up?
I'm still working on demos of different harmonic-rich sounds at low pitches.

I have a promising algorithm but it's very CPU-intensive, and takes maybe four times "real time" to execute. I was wondering if learning to write Csound source code would allow me to write an opcode, thereby speeding it up. Right now, it takes maybe 200 i statements to make one bass note, with each i statement containing about 10 generating or envelope units (each i statement is one harmonic). So that could all go in a single custom opcode. This would get rid of the overhead in interpreting the Csound code, but I wonder how much that would really speed it up. I know this cannot be predicted exactly, but is it more like a factor of 2, 10, or 50?

Mike

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here