Joined: May 14, 2013
|Posted: Tue May 14, 2013 11:08 am Post subject:
how to begin with microcontrollers ??
there is about 15 years I've been programming synthesis with softwares (MaxMSP & SuperCollider) and since a couple of monthes I'm thinking to do everything with microcontrollers.
I know almost nothing about microcontrollers, and have some knowledge about c++
But I am ready to plunge into it or whatever program if I see that my project feasible.
The project is to make samplers and complex audio synthesis that requires a lot of cycles like granular synthesis for exemple, for live performances.
So I have several newbie questions :
1 What model of microcontroller would be "powerful" enough to run complex synthesis
2 What would be the program language ?
3 Is there any audio library available ? (for filters etc..)
4 Can I store audio data of several Mo (from audio files) ? or do I need external storage ?
5 What reference can you suggest (book web site) for audio programming with pic ?
Thanks for your help
Joined: Nov 20, 2007
Location: West Red Spot, Jupiter
Audio files: 158
|Posted: Tue May 14, 2013 3:25 pm Post subject:
|Not sure if I can answer all the questions, but I will attempt to answer some.
As for 1) - you don't say whether you need polyphony or not, and if so how many voices.
2) - the best language to get the most of any microcontroller is going to be assembly language. Not what you wanted to hear I'm sure, but that is the truth since it is the only language where you actually talk in the chip's language. C is pretty and simpler, but it can be a devil if it won't optimize the way you need it to.
3) Libraries. Well, there won't be much for assembly. For C, you get to put up with whatever efficiency is written into the library and then (again) deal with the C compiler's ability to optimize the code. I write in assembly language because I can't trust any of that. Especially if you want to use "low end" processors like PIC or dsPIC.
4) I've had experience with PIC and dsPIC and they don't have a lot of internal RAM. Around 64 kbytes - MAX. Ain't much. For delay applications, I've added SPI SRAMs like 23LC1024 to a dsPIC.
5) I have no answer here, by the time I started with PIC and dsPIC, I had already programmed many other microprocessor devices and the paradigm is essentially the same for all. The only book I have here is "The Quintessential PIC Microcontroller" by Sid Katzen. It is very very basic.
You should understand that for DSP (which I believe is what you want to do), microcontrollers (such as dsPIC) are at the bottom of the food chain. A dsPIC33EP can run at 70 MHz while "real" DSP processors run in the hundreds of MHz. So if you want to go with the dsPIC, set you expectations fairly low. For example, it is conceivable to get 4 voices of polyphony from a dsPIC running a not too complex voice structure. I got 4 voices per dsPIC on my Harpie synth (total of 8 voices using 2 of them as voice engines - karplus-strong). The fact that such devices are not all that fast makes it more important to write extremely efficient code. This isn't going to be easy with a C compiler over which you have no optimization control (for example, the C30 compiler for the dsPIC line has a free "lite" version - this has only the most basic optimizations enabled). This is why I chose to use assembly language, but because I had already been exposed and understood assembly language from past experience it was rather easy for me. Still - if I were you - I would learn to use assembly language so that you have complete control over what the code does and there are no "head scratch" mysteries.
FPGA, dsPIC and Fatman Synth Stuff
Time flies like a banana.
Fruit flies when you're having fun.
BTW, Do these genes make my ass look fat?
corruptio optimi pessima