[sdiy] Programming Language of choice

Scott Gravenhorst music.maker at gte.net
Mon Feb 29 00:37:17 CET 2016


 >I was wondering what the groups' consensus is on the most prominent 
 >programming language for a beginner in the world of MCUs.

For dsPIC33F I use assembly language - but I've learned assembly for 10+ 
different MCUs.  Much depends on the environment and I found that using 
C with a dsPIC was a bit clumsy because to get speed out of it, IMO, 16 
bit integer based fixed point arithmetic is necessary.  It can be done 
in C, but it's so ugly it might as well be assembly language.  Plus 
there are "tricks" that can be use in assembly that are difficult to get 
a C compiler to render to machine language as you would do them in 
assembly.  That said, it's a pretty low end MCU, but still quite music 
worthy IMO if you want to spend the time.

Currently I'm working with a Raspberry Pi 2B which is a whole 'nuther 
thing.  In this case - I don't have a desire to learn the highly complex 
assembly language for the ARM and after doing some development with it I 
can say that C is definitely the way to go, I will admit to having 
learned C some 40 years ago.  You can hear a bit of what my latest 
project does (so far - more to come) here: 
http://electro-music.com/forum/download.php?id=41299 which is a Chopin's 
Fantaisie rendered on a 32 voice Karplus-Strong synth running on a 
Raspberry Pi 2B with a Cirrus/Element14 audio card.  The interface to 
the sound card is through ALSA (which was another learning curve, but I 
think worth my time).  Oh - and the gcc compiler I use automatically 
uses the NEON floating point processor for single precision float and 
integer operations.

So my vote is - if you have a faster CPU, use C.  If you have a slower 
CPU and need to squeeze every drop out of it, you may need to consider 
assembly language.

-- ScottG



More information about the Synth-diy mailing list