PDA

View Full Version : Spin for audio use



Low Profile
03-22-2009, 09:42 AM
hi there. I'm looking for the perfect microcontroller to use for my audio synthesizer project and the Propeller looks just right because I can calculate all the parts I need in parallel (oscillators, filters, modulators etc..). I know there are some audio projects that use the Propeller (open-Stomp and more), but I was reading something on wikipedia which made me worried and I hope you guys can confirm that its not correct.

From http://en.wikipedia.org/wiki/Parallax_Propeller
"Spin programming language executes approximately 80,000 instruction-tokens per second on each core, giving 8 times 80,000 for 640,000 high level instructions per second. Most machine-language instructions take 4 clock-cycles to execute, resulting in 20 MIPS per cog, or 160 MIPS in total for an 8-cog Propeller."

80,000 instructions per second?? Really? Each spin instruction takes 20,000,000/80,000 = 250 machine instructions to execute?! I hope I'm wrong because 2 instructions per sample (at 44Khz) isn't going to do much, haha...

So, what, is this information false or will I have to program in assembly?

Rayman
03-22-2009, 11:43 AM
You will probably need assembly for real-time audio processing.

But, there is a C compiler that is much faster than SPIN. You could try that...

Mike Green
03-22-2009, 11:59 AM
I think the quoted "tokens per second" is a bit low, off by maybe a factor of 5. It's still much slower than the native instruction speed which is 20MIPS/cog. The C compiler produces what's call Large Memory Model (LMM) code which is semi-interpreted native code which executes at roughly 4-5MIPS. Most programs for the Propeller are a combination of Spin interpretive code for the higher level functions and assembled native code for the lower level high speed functions.