I would like to get into audio processing and I'm coming from Arduino boards. Nothing too crazy, I want to start with loading an audio file from an sd card, playing back audio files with ADCs (not dedicated MP3 modules), changing pitch, cutting and pasting sound files, playing back multiple files at once. I'd, like to experiment on a project along the likes of OP-1 by Teenage Engineering. I know just mentioning that name might sound overly ambitious and that I'm shooting for way too high for a first project, that's why, again, I just want to get a grasp on the basics of loading a file into a buffer, playing it back, cutting and pasting sound sections, etc. One thing about the Arduino is that it's use of libraries is both liberating and limiting, as one one side libraries help with skipping base coding of very rudimentary tasks (like reading a file off an SD card or playing the file back) but at the same time you are stuck with whatever functions the library creator provided you with.

So to the heart of the question. When I posted about this topic, I was immediately told that I'd be better looking at ARM processors with an immediate reference of the Raspberry PI. Now I love the platform, in fact I just got my pi Zeros in the mail today. But I don't want to be using Linux as a middle ground here. I simply much more interested in the trial of creating my own GUI, learning the ropes of audio processing and so on.

So does AVR offer an equivalent to the ARM Cortex platform that is powerful enough for some multi track sample playback. audio processing and so on?

I have the AVR ISP mk2 and programmed Atmega328p and Attiny85s but only via an arduino bootloader. I know it might be out of my scope as I'm coming from a fundamentally different approach to programming these controllers. I've got a goal and I've got the will to learn, I'm just looking for some advice and some direction.

Oh, thank you so much for a quick response. Actually I had a question on the Sam controllers. Seems to me like these ones are pretty powerful and versatile, seeing how it can run Linux on rasberry pi is alone mind boggling. What I don't quite get is that ARM is the name of the company but it also stands for "Advanced RISC Machines" Atmels Sams are all 32 bit controllers and they all seem to be advertised as ARM-based, what gives? ARM is both a company name and an architecture of Controllers? Did ARM develop the architecture and Atmel is licensin to develop it's SAM controllers which are also advertised as ARM? Are the SAM - ARM-based controllers matching the ARM - Cortex controllers in power (general ballpark that is). Atmel even employs the word "Cortex" in some of the product titles for the SAM platforms. You might see the confusion in beginners.

Atmel have a number of ARM cortex products, but that is a very wide brush as it encompasses devices with 8k flash and 48MHz up to many hundred of MHz with lots of external ram running Linux.
Note raspi zero is not ARM Cortex! Raspi3 is CortexA53.
CortexA is processors that can run Linux, CortexM ad microcontrollers usually with internal flash.
There are quite a few projects for software synths on the interwebs using cortex M processors. Note that generally you need lots of ram and MP3 decoding in software requires the more higher end cortex cpus like the m4 and m7. I too would suggest the raspi as it is fast, has lots of ram, audio hardware and is cheap. Its your choice if you want to run Linux or nor on it.

Firstly, the most debilitating part of the arduino stuff is the "ide" itself.

Libraries are distributed as source code, and in any decent ide it is trivial to switch between different sorce code files.

It is very common to jump from a function call to to it's implementation with 2 mouse presses or a key combination,

The IDE will find it instantly, regardles of the file that function is in and therefore libraries are easily extended or modified.

The world of ARM is also very big and diverse. It's range is from very small uC's which only consume 100nA while executing code upto Multi Core, Multi Ghz processors such as used in the Raspi or almost all phones nowaday's.

So if you have no inherrent objection to ARM I want to suggest STM32F103C8T6 ("blue pill").

These cost about USD 2 and can be programed via built in bootloader or via ST-Link -V2 (Also USD2).

This board also has SD interface, I2S hardware and dma which is a very neat combination for an audio player.

This processor also has enough horsepower to do mp3 decoding on the fly if needed (Lib's available).

Your wish of wanting to do pitch bending is probably beyond the capabilities of AVR's (Not sure here).

Yet another possibility is to use ESP8266.

Although this (Also USD2) processor has built in WiFi, you don't have to use it. But you can stream you audio to it if you like.

This one default runs on 80MHz, but CPU clock is pll selectable and you can run it on 160MHz if you like which will give you plenty of horses.

And very recently I stumbled into PlatformIO.

This stuff is simply amazing. You can seemlessly switch between "arduino" native AVR, stm32 ESP and some 20 other processor architectures, support for multiple ide's, etc.

The most difficult choice with PlatformIO is to decide which IDE and hardware you want to use.

After that it is almost trivial to configure a project. Check out their website, or type PlatformIO in youtube.

PlatformIO also supports "arduino" projects and at the same tim takes a lot of the "arduino" pain out.

Fun thing is, in PlatformIO you can compile an "arduino" project for AVR, STM32, ESP8266 and a bunch of other uC's too (Teensy, others).

Depending on what platform you want to compile for it just pulls the right compiler from internet and installs it on your pc for further use.

Your selection out of the 1800 supported libaries also have local copies for each project and can be easily adjusted to your own liking.

Ah, thank you on clearing the licensing misunderstanding. Also interesting note on having a choice whether I want to run Linux on a raspberry pi unit.

My main base of reasoning for starting with just a controller on it's own is that the projects I'm having in mind would be the sort of projects I'd transfer from a prototyping board into KiCad and get it professionally fabricated (just the print). So basically you're saying I can use the raspberry pi hardware as a prototyping board. My concern is that if I create a functioning prototype using the PI, I'd effectively have to re-create a raspberry pi board on my own schematic to match the prototype I had on a breadboard. This is kind of why when it comes to much simpler projects, I prototype using a bare-bone Atmega328P controller with the resistors, crystal and capacitors and arduino bootloader loaded onto it, instead of using an actual Arduino Uno. I'd probably be more comfortable getting an ARM controller alone and putting it on a PCB adapter board that brought out all the I/O pins from SMD to breadboard friendly DIP format.

Edit:

Oh wow you guys wen't all out on this. Thank you so much for clearing that up. This is amazing.

So considering that majority of Atmels lineup is simply not designed for handling audio would not be out of question and that looking into ARM own Cortex line-up for this sort of a project would not be all that ludicrous? I know I should not be engaged in tribalism and I should consider all the available technologies for a perfect fit of this projects requirements, even if it means looking at direct competitor products. But I feel like the amount of time I've spend with arduino platform and IDE, some of that knowledge and experience would carry over to working with the core controllers via Atmel Studio directly. I've looked into Atmel Studio tutorials on youtube and the level of intimacy of the code with the hardware is both amazing and petrifying for someone who's been using just "digitalWrite(13,HIGH)" to set the pin to high.

A long time ago it started with the Acorn Archimedes in 1983 but from there it quickly became an intellectual property company.

The arm holding (company) does not produce any microcontrollers.

They just design the processors, peripherals, etc.

From them you can licence almost anything in between the right to use the bare instruction set (patens of the first gen's have expired) righ up to the layout of masks to manufacture uC's. or VHDL code which you can dump into a little corner of an FPGA.

Nowaday's you have "fabless" companies which buy the mask layout from ARM and order "hardware" companies to fabricate the IC's for them.

ARM is becoming so dominating in the uC world that there are probably only a very few uC manufacturers which do not offer an ARM variant, and those companies probably operate in niche markets.

And as I said in #7 there are loads of different uC's which can be very different from each other indeed. See the list on:

If you're a hobbyist and curious about ARM processors (uC's not the PC horsepower variant) then ARM Cortex-M3 is a very good mix of features. It is big enough to have almost no limitiations for most of your projects and it is small enough so that you can don't completely loose all hope of understanding how it works.

Just for fun I bought some STM32F103C8T6 boards, and my reasons were mainly out of curiosity (didn't have a specific project in mind) and because of it's price point (A few bucks from Ali / Ebay)

Getting started used to be ... problematic but PlatformIO (at least promises to) take all the pain out of that and make the first blinking led project just as trivial as with your first arduino.

STM32 is a controller I've run into numerous times when looking at various Arduino tutorials online. (Absolutely no connection there, so it's not that I'm looking to run the Arduino Bootloader on the STM32 and program it from there) Thanks for clearing the whole licensing system once again. So in a nutshell ARM is a company that operates like Nvidia Developing the GTX 1080 and selling the License to companies like MSI, ASUS and GYGABYTE to produce their own versions of the graphics card. Got it. So in this case, I it would be fine to look into the Atmels Cotex series SAM - (SMART ARM MCU) for this project. Indeed exciting to have realized that.

I'd like to also see if you could provide some input on this question about online college-level courses for learning the Atmel Studio:

I'd like to take a moment to thank everybody for your input, you've made quick sense of the available platforms and choices, cleared any uncertainties and you've also made a new member feel welcomed to your community. I truly appreciate the sheer amount of information I've learned today. Thank you for all of your help.

Nvidia sells chips to the likes of Gigabyte et al. Pull off the heatsink and you'll see the nvidia logo on the chip. They might also sell intellectual property.
ARM sells intellectual property, not chips.

Nvidia sells chips to the likes of Gigabyte et al. Pull off the heatsink and you'll see the nvidia logo on the chip. They might also sell intellectual property. ARM sells intellectual property, not chips.

Just out of curiosity. If I were to develop a project using a prototyping board that hosts an STM32-xxxxxxx version, instead of purchasing a controller alone and trying to wire it up with my own crystal and power circuit... Are there schematics available for that prototyping board so that you can pluck it into the schematic software and build your project around that (optionally deleting stuff you didn't not use) Considering that a prototyping board would usually solve basic problems like proper power circuit, possible some fuses and improper wiring protection, crystal circuit in place, communication with a computer etc...

Different manufacturers/boards have differing levels of support. Most will have schematics but only a few have schematics that are in Eagle (for example). The infineon xmctogo has Eagle files for schematic and pcb.
ST for example disallow using their dev boards in commercial products. Most of the boards are not compliant with emc standards anyway, so you can't use them in commercial products in the western world.

An important thing to notice is that ARM and even "ARM Cortex" are multiple families of CPU architectures.

The Cortex-A ARM processors are big, high-speed devices capable, frequently with graphics co-processors of running linux, while the Cortex-M processors are smaller and slower CPUs aimed at "microcontroller applications." Within Cortex-M, there are M0, M0+, M3, M4, and M7 (in approximate order of increasing performance.) None of those are really capable of running linux, although most are probably capable of Audio processing.

For Audio processing, coming from the Arduino environment, I think I'd recommend the Teensy 3.x series from PJRC. They've written an extensive audio library...

ST for example disallow using their dev boards in commercial products. Most of the boards are not compliant with emc standards anyway, so you can't use them in commercial products in the western world.

Yep, that's actually a part of the reason why I'm not too keen on using an Arduino Uno to develop my projects and just go for an Atmega328p with a 16mHz crystal dirrectly on the breadboard. I'm just thinking if it's even possible to do so with the 32bit ARM controllers we've been discussing above... controllers with a much larger i/o assortment and I'd imaging requiring more set-up for just basic functionality.

Looking at the blue pill tho, there's barely anything on that board, a dozen of resistors on the back side by the looks of it (will have to look at it closer once it arrives) but for the most part the chip seems to handle everything. An Uno, by comparison is a jungle of components. I'll check this also in a second but does the STM32 on the blue pill have on board serial communication or will I need a UART chip like the CH340 to get USB to serial working? Again If anything I'll check the product page, just while we're on the subject.

I'd, like to experiment on a project along the likes of OP-1 by Teenage Engineering.

I've looked at those in the past - they look like great toys to play with! So did you see which CPU it was they chose for that (not so much the OP-1 but their "pocket operators")? I remember reading that they picked it because it was specifically designed for audio processing. If they chose it for what has become a very popular audio development system do you not think they may have made a particularly well informed choice?

Refreshing my memory about their site reminds me that the CPU they chose was "Silabs EFM 32 gecko mcu". I seem to remember reading something on that site previously which went into more detail about the facilities of that chip and why they chose it (though I can't find that now )

It seems with every lead and insight, all leads are pointing towards investing into getting to know the Cortex Processors. Now the OP-1 is doing a LOT more than what I am trying to achieve for now. It seems there is a huge performance overhead that allows it to do so much Digital Audio Processing. Well in my case I need to figure out just how much audio work can be done on a ARM processor alone without having to interface with a dedicated DSP chip to offload all audio processing onto IT. That is a bit out of my scope for now. I gotta start small, figure out how to play an audio sample alone first. I'm sure it will be a good idea to start looking into DSP ICs when I get to to things like EQing and Low/high cut and band-pass Filters. Looking at Raspberry PI series, there are a lot of synth and sampler projects that are essentially Linux programs, don't thing the Raspberry Pi are outfitted with DSP Ics (But it's just a speculation, haven't looked at the schematic, for all I know I could as well be)

An Arduino - or any other ready-assembled board/module - is going to give you a far superior platform than a breadboard!

Yes absolutely in most cases. But when It's time to move the project from the breadboard onto a standalone PCB, everything that was on the Arduino Uno becomes an affecting factor in the performance and accuracy of the project, with things like component noise affecting input readings and power consumption etc. To make sure I have the same performance on a standalone device using the Atmega328 as I do on the proto-board using Uno, , I'd basically have to re-create an Uno on my schematic to match the set up and conditions. I'm much more in favor of standalone chip programming like this. As the components used in this bare-bone prototyping set up is pretty much the same to what is going to be on my circuit design anyways.

The Raspi has plenty of ram and cpu so sound generation is not too much of a problem. The average PC has lots more of everything. No use looking at a schematic for a Raspi- just about everything is in the chip.

The OP-1 works with a BF-524 as main CPU. That is a "BlackFin" DSP chip made by Analog Devices. It is also used in digital storage oscilloscopes because of its DSP capabilities.

I mean can we find something of matching power along the line of ARM processors. If these suckers can run a linux OS, which would run some Linux based raspberry PI sampler then I'm sure I'd be able to play a sample straight in code without using Linux as a middle man.

Well in my case I need to figure out just how much audio work can be done on a ARM processor alone without having to interface with a dedicated DSP chip to offload all audio processing onto IT

To give you an idea a 48MHz ARM can probably do MP3 decode in real time. That is quite a "heavy" DSP function so it shows that quite a lot is achievable. Note that a Cortex M4 is a Cortex M3 with added "DSP like" support. So when picking Cortex you may want to favour M4 over M3 and find out about floating point DSP and NEON support.

M.Thatch wrote:

Looking at Raspberry PI series, there are a lot of synth and sampler projects that are essentially Linux programs, don't thing the Raspberry Pi are outfitted with DSP Ics

You are comparing apples and oranges. Cortex M3 and M4 are typically 50MHz..120MHz CPUs - most at the lower end. An RPi is a beast of a CPU. It's a cortex A not a Cortex M and it's running at (in Pi 3)| 1.2GHz, it's 64 bit (not just 32 bit) and there are FOUR CPUs so that's a bit like 1.2GHz * 4 = 4.8GHz - so it's like about one hundred 48MHz Cortex M3 all running at once. So, yeah, it does not need a DSP (though high end Intel and ARM processors usually have that as a matter of course anyway).

In fact an RPi (3) is pretty much the same as your Smartphone or possibly even your laptop/desktop in terms of CPU performance. For anything but multi-track (and I mean like 32 or 64 track) audio you could effectively consider the CPU power to be "infinite" / "unlimited"

So on the great scale of things from a 0.5K Attiny4 being run at 128KHz up to an Octo Core 64 bit CPU running at 1.6GHz there are going to be different levels of possibility. I guess it goes without saying that the more CPU and RAM you pour into the thing the less you will have to be concerned about running out of resources. A desktop/laptop/Linux SBC (with decent CPU) will never "run out". On the other hand if you managed to squeeze a synth into a tiny4 with 0.5K flash and 32 bytes of RAM you peers would applaud you as the all conquering hero - up there with the likes of E L Chan, Atomic Zombie and others who appear to have stretched lowly 8 bit micros way beyond what you might have thought possible. See my link elsewhere to Rolf's Xmega synth - that ranks up there as "utterly amazing". If you did the same on an Rpi people would say "so what, another one to join the pile of 500+ similar projects ??" where's the cleverness in using a sledgehammer to open a can of beans?

You seem to be focusing too much on the processor and not enough on how much RAM you will need. Audio processing eats memory.

#1 This forum helps those that help themselves

#2 All grounds are not created equal

#3 How have you proved that your chip is running at xxMHz?

#4 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand." - Heater's ex-boss

I think I saw somewhere that that's not how the speed of quad core processors summed up. Could have been Linus Tech Tips, could have been concerning a different processor architecture. But somewhere out there someone said that 4x 2ghz processors does not equal to 8 Ghz of processing speed. But anyways. Maybe mentioning things like OP-1 and Raspberry PI was counter-intuitive, I mean now it makes it sounds like the ARM processors can't even do what little I ask them to do - playing a couple of sound files off an sd card through an ADC chip, when just that has been done on an Atmega328. Logically it's just combining two buffers containing amplitude data to "mix" the two sounds together and output the result to the one ADC.

Brian Fairchild wrote:

You seem to be focusing too much on the processor and not enough on how much RAM you will need. Audio processing eats memory.

Huh, really wasn't thinking of that consciously because on the Arduino forum that issue was addressed by loading larger audio files in sections to play them back. Load audio data into the buffer, start playing it back, unload parts that were played, load in the next chunk in the buffer. Figured the concept is similar across all controllers. I mean with a processor powerful enough, you could logically do all that loading and unloading to compensate for the lack of memory but that's really just laments logic on my part. I'd be dealing with small samples, not 3 - 6 minute audio tracks. Heck, for now I just want to learn how to load a sound from and SD card into a buffer and platy it back via an ADC ic.

You seem to be focusing too much on the processor and not enough on how much RAM you will need. Audio processing eats memory.

+10

Again things like RPI wil not "run out" for this kind of thing. RPi 3 has 1GB of DRAM and the CPU itself has 512KB of Level 2 cache internally.

Micocontrollers (and that's what M in Cortex M means) are actually designed for what the name implies "controllers". Things like operating your washing machine or microwave oven (or the pumps in a chemical plant). Such tasks don't often need a "lot" of RAM so they generally offer a few K (ARM Cortex are better than AVR - they typically have X2 or X4 RAM for a given flash size). Some devices have an "external bus interface" allowing more RAM to be added externally. If you see Rolf's Xmega synthesiser he uses the EBI on an Xmega to add 1MB of SRAM which helps a lot.

To be honest you might be better off with an RPi and "learn the trade" there - things like applying filters, doing FFTs and so on. When you have the knowledge then take that and see if you can shoehorn it into a small CPU to make a "cheap" standalone, easily constructed product from it. (like Teenage Engineering).

In fact if you look at a picture of one of the teenage engineering designs...