MIDI recorder project idea - what microcontrollers could I use? - Page 1
Forum section: electronics / projects

author: skulldigger
author_rank: Contributor
timestamp: September 11, 2017, 10:44:27 pm
content: I'm a noob and I want to create MIDI sequencer recorder device with a lot of memory. Something like 100MB if possible. I looked at Arduinos but the max memory built-in is much lower than that. A raspberry pi could do it, but I hear they take awhile to boot. I want this to be instant-on. Can anyone offer any advice?

author: DaJMasta
author_rank: Super Contributor
timestamp: September 11, 2017, 10:48:29 pm
content: Use a regular micro and an external memory of some kind. I can think of almost no midi applications that would need 100MB of RAM, specifically, (that's a damn lot of recorded midis), so why not use flash? In that case, even an arduino with an SD card could work.

author: skulldigger
author_rank: Contributor
timestamp: September 11, 2017, 10:55:17 pm
content: Would an SD card be fast enough? I want to have multiple MIDI ports, say 4 In/Out pairs. So that's potentially 64 tracks I could play at the same time. The thing that takes a lot of memory is CC messages. Maybe 100MB is too much, I haven't really sat down and calculated it. My Yamaha V50 has a 16,000 note sequencer, and I can easily run out of memory if I start whaling on the mod wheel for a couple of minutes. So I definitely want way more than that.

author: skulldigger
author_rank: Contributor
timestamp: September 11, 2017, 11:00:25 pm
content: I guess if 16,000 notes is 48kb, and I want to whale on the mod wheel for 8 times that long * 64, then we have like 24MB.

author: skulldigger
author_rank: Contributor
timestamp: September 11, 2017, 11:08:41 pm
content: I also want editing, so I want to be able to move the data around, quickly.

author: ataradov
author_rank: Super Contributor
timestamp: September 11, 2017, 11:11:45 pm
content: The slowest memory you can find will be sufficient here. Even slowest SD card will work here.But for simplicity, have a look at SPI Flash devices. They are cheap, easy to work with, and available in solderable packages.But 100 MB is a lot for MIDI. I seriously doubt you need to store this much at a time.

author: skulldigger
author_rank: Contributor
timestamp: September 11, 2017, 11:16:39 pm
content: Cool, that's very helpful. Do you have any suggestions for what kind of microcontroller I could use?

author: ataradov
author_rank: Super Contributor
timestamp: September 11, 2017, 11:18:46 pm
content: What exactly you want to do with all that data? Just spit out MIDI data from flash memory? Virtually anything will work for that. If some heavier processing, then describe it.

author: skulldigger
author_rank: Contributor
timestamp: September 11, 2017, 11:30:25 pm
content: Well, firstly, I want to record from all 4 MIDI In ports at once. This would involve reading it in, separating the (up to) 16 channels into tracks, and storing the tracks individually. Each track would consist of a series of events that are somehow timestamped.Playing would be the inverse of that process.Playing and recording also have to occur simultaneously for overdubbing.I also want editing capabilities. So, copying one track to another. Copying portions of a track to other parts. Deleting tracks. Deleting portions of tracks.That's basically what I want to start with.

author: ataradov
author_rank: Super Contributor
timestamp: September 11, 2017, 11:35:26 pm
content: The hardest part here would be the UI. How do you want to do that?It is not very hard to capture and parse 4 MIDI inputs. But you will need an MCU with 4+ actual hardware UARTs, which eliminates Arduino and other AVR-based solutions. You are probably in the realm of at least ARM Cortex-M0+. But depending on your UI requirements, you may have to go higher.

author: DaJMasta
author_rank: Super Contributor
timestamp: September 11, 2017, 11:51:02 pm
content: There are some larger AVRs with several UARTs, and midi is like 30kbit per second, so software UART emulation would be able to capture a channel even on an Arduino. I agree going with something a little beefier is probably advisable, but if you were efficient about your other code or had a secondary micro to control the interface, I think you could make it work with an atmega2560, at at least.If you're looking for a graphical UI and fancy editing features... while a ~48MHz arm core would be plenty, it may be simpler to just go with something beefier and have extra overhead. Most of your work is going to end up being the software to edit, so maybe look for a platform you're familiar with working on and pick a part based on support for that. Something like a Pi Zero would be way overkill for the device, but it's got a large number of tools to work with and examples to work from. Instant on can be had by just cutting down on the OS being used (not quite instant, but like, a couple of seconds), or by just using sleep states and keeping the memory going - you don't need a full-GUI Linux OS to run the thing, so there's no reason to go with it and deal with the longer boot time.

author: skulldigger
author_rank: Contributor
timestamp: September 11, 2017, 11:56:08 pm
content: I could copy the V50, which has a 2x40 character display. It uses some special characters, but nothing graphical.There are 8 context-sensitive buttons under the display, transport buttons (rec, bwd, stop, play, fwd), a numeric keypad, increment/enter and decrement/cancel buttons, a Job button, and 8 track buttons. But 8 tracks is not enough, so I guess I would like 4 port buttons and 16 track buttons to select tracks. So there would be 4 port LED's, 16 dual-color track LED's, a record LED, a play LED. There also needs to be a data entry slider or knob. I think that covers it.I was hoping I could just copy the V50 and expand it a little to avoid having to design it from scratch, but I can see it's going to be unavoidable. I could probably code up a simulation in javascript pretty easily to nail down the UI.

author: ataradov
author_rank: Super Contributor
timestamp: September 11, 2017, 11:59:35 pm
content: In that case any MCU with 4 UARTs will do. I'd personally go for Atmel/Microchip SAM D21 here, but I work for Microchip, so I may be biased here.

author: skulldigger
author_rank: Contributor
timestamp: September 12, 2017, 12:18:47 am
content: Quote from: DaJMasta on September 11, 2017, 11:51:02 pmThat's a great idea. I didn't think of stripping down the kernel. And I think easy development is probably something I should make a top priority.Thanks for the help DaJMasta and ataradov! I really appreciate it!

author: ataradov
author_rank: Super Contributor
timestamp: September 12, 2017, 01:03:25 am
content: Quote from: skulldigger on September 12, 2017, 12:18:47 amWith RPi you will have to use USB hub and external UART adapters (which may not be flexible enough to support 31250 bps required for MIDI).Application processor would be my least favorite option here.It would be easier to get Cortex-M7 if you need to get a rich GUI.

author: skulldigger
author_rank: Contributor
timestamp: September 12, 2017, 02:13:02 am
content: You're talking over my head now. I don't understand what the ramifications of "you will have to use USB hub and external UART adapters" would be, and I don't know what you mean by "Application processor". And Cortex-M7 doesn't look like it has UART's?

author: ataradov
author_rank: Super Contributor
timestamp: September 12, 2017, 02:18:34 am
content: RPi on its own does not have 4 UARTs. Your only option of connecting this many UARTs to it is to use USB bus, but it does not have 4 USB ports, so you would need USB hub.Basically, it is not worth the effort, especially if 2x40 LCD is sufficient.Application processor is the thing sitting on the RPi, as opposed to a microcontroller.Cortex-M7 is a core, you need to look at a specific device. Atmel/Microchip SAM V7x or SAM E70 have enough UARTs in bigger packages.But Cortex-M0+ is totally sufficient and a better choice for what you have described so far.

author: skulldigger
author_rank: Contributor
timestamp: September 12, 2017, 02:28:13 am
content: Ah ok, thank you. Man, I wish I had the money to pay someone to do the electronic part for me! I really just want to design the device and write the code for it.

author: JPortici
author_rank: Super Contributor
timestamp: September 12, 2017, 05:54:24 am
content: one can always learnfirst thing you should do is stop, sit down and write all the requirements.from that you and everyone you want to be involved will have an idea of what you're going to do and what you'll need.from what you say the hardware should be pretty simple, it would be all about the user interface and that is what will determine which MCU you should use(probably literally anything that can go fast enough to keep up with the user interface will do)

author: DrGeoff
author_rank: Frequent Contributor
timestamp: September 12, 2017, 06:34:01 am
content: As others have suggested you need to work out what it is you really need. Then do some calculations.MIDI is just low speed serial ports. You can always add UARTS for as many serial ports as you want to control from an MCU.How much memory do you need? How much is volatile and how much is non-volatile?How do you plan to get data in or out of it? USB? Network?What will the UI be? This will depend on the complexity of functionality and ease-of-use required. Could be LCD touch screen or just a few rotary encoders, buttons and an LCD character display?An MCU may not be useful at all, you may be better with a CPU, memory and uarts?What type of OS are you planning to use? Write your own or attempt to hack an existing one?