DIY MIDI device. Not started yet just after advice.

Hello all,

So recently i have discovered that the Arduion Teensey is a good device to build a MIDI controller around.
I already have a MIDI keyboard but it's missing a few functions that i would like to complete my setup and seen as i can't find anything that can do what i'm after i was thinking of building my own device.

I use Reaper as my DAW and what i would like to do is make a controller with 10 buttons and a the ability to plug in a foot switch.

Basically 8 buttons would be used to toggle on and off track arm for 8 separate tracks at a time and 2 buttons would be used to cycle through banks of tracks.
Example would be tracks 1 to 8 hit a bank button and move up to tracks 9 to 16 hit a button and move up to the next 8 tracks, hit another button and move back to the previous bank of tracks all while the arm toggle buttons would work on the tracks in the selected bank.

Would also like some kind of display showing what tracks are in the current bank, be it a 3 digit led above each button with the track number in it or a display showing from "track :XX to :XX" as well as a red led above each button to show if a track is armed or not within each bank of tracks.

The foot switch would be used for punching in and out of record or triggering a custom action depending on the session i am in at the time.
Would also have to have the ability to assign the device a MIDI channel.

I am tipping the hard part would be the MIDI device being able to read info from Reaper to be able to know what tracks are available and changing track banks. My current MIDI controller can do this for volume faders and mute/solo buttons so i am tipping it's possible.

So before i start purchasing anything i was wondering if this would be possible?
Would love to hear some thoughts about it.

I am tipping the hard part would be the MIDI device being able to read info from Reaper

Yes you are right this is the hardest part because it requires you to know how Reaper communicates over MIDI.
I played a part in a larger project for a girl will cerebral palsy to allow her to more easily access controls using Ableton Live. And is was only through some third party plugins could we send out the information about the page when the page was changed. This allowed us to set the controls like the motorised sliders to be the current value on the page.

So you need to be able to sync up your onscreen display with your external ones. The rest of you project sounds perfectly plausible, providing your hardware / software skill level is up to it. It should be a good project to learn on as by nature it is modular. You should always work on a project one small step at a time and don't try and do it all at once. This applies to both hardware and software.

If you want to look at our project the google the words:-
The Nashesizer
We are currently on the second iteration of the design and this work has been delayed due to the variable health of Gemma Nash.

Just had a look at The Nashesizer. Love the idea behind it, well done.

Yeah, will have to do some searching around and ask questions on the Reaper forums for info in passing info between the DAW and device.

Will be starting small first with 8 buttons plus foot switch then progress from there. Have done some programming years ago but that was with Blitz3d, a basic type language so i am pretty rusty but shouldn't be to hard to pick up some programming again "in theory" Lol!

Cheers for the info and good luck with The Nashesizer.

The Control Surface library I'm working on supports MIDI input, output and banks. Here's a simple example with 4 push buttons and 4 LEDs. Two more push buttons control the banks, and the active tracks are displayed on a 7-segment display:

[color=#5e6d03]#include[/color] [color=#434f54]<[/color][b][color=#d35400]Control_Surface[/color][/b][color=#434f54].[/color][color=#000000]h[/color][color=#434f54]>[/color]

[color=#434f54]// Create a seven segment display, connected to the SPI bus, with the load pin connected to pin 10[/color]
[b][color=#d35400]MAX7219SevenSegmentDisplay[/color][/b] [color=#d35400]display[/color] [color=#434f54]=[/color] [color=#000000]{[/color][color=#000000]10[/color][color=#000000]}[/color][color=#000000];[/color]

[color=#434f54]// A MIDI over USB interface[/color]
[b][color=#d35400]USBMIDI_Interface[/color][/b] [color=#00979c]midi[/color][color=#000000];[/color]

[color=#434f54]// Create a new bank with a total of 4 banks and with four tracks per bank[/color]
[b][color=#d35400]Bank[/color][/b][color=#434f54]<[/color][color=#000000]4[/color][color=#434f54]>[/color] [color=#000000]bank[/color][color=#000000]([/color][color=#000000]4[/color][color=#000000])[/color][color=#000000];[/color]

[color=#434f54]// Create a new bank selector with four bank settings that controls the bank above[/color]
[color=#434f54]// and with the increment button on pin A0 and the decrement button on pin A1[/color]
[b][color=#d35400]IncrementDecrementSelector[/color][/b][color=#434f54]<[/color][color=#000000]4[/color][color=#434f54]>[/color] [color=#000000]bankselector[/color] [color=#434f54]=[/color] [color=#000000]{[/color][color=#000000]bank[/color][color=#434f54],[/color] [color=#000000]{[/color][color=#000000]A0[/color][color=#434f54],[/color] [color=#000000]A1[/color][color=#000000]}[/color][color=#000000]}[/color][color=#000000];[/color]

[color=#434f54]// NoteButton reads state of a push button, sends out MIDI Note on/off events on the [/color]
[color=#434f54]// given address (MCU::REC_RDY_#) and channel (CHANNEL_1)[/color]
[b][color=#d35400]Bankable[/color][/b][color=#434f54]:[/color][color=#434f54]:[/color][b][color=#d35400]NoteButton[/color][/b] [color=#000000]buttons[/color][color=#000000][[/color][color=#000000]][/color] [color=#434f54]=[/color] [color=#000000]{[/color]
  [color=#000000]{bank, 2, {[/color][b][color=#d35400]MCU[/color][/b][color=#434f54]:[/color][color=#434f54]:[/color][color=#00979c]REC_RDY_1[/color][color=#434f54],[/color] [color=#00979c]CHANNEL_1[/color][color=#000000]}},[/color] [color=#434f54]// push button connected between pin 2 and ground[/color]
  [color=#000000]{bank, 3, {[/color][b][color=#d35400]MCU[/color][/b][color=#434f54]:[/color][color=#434f54]:[/color][color=#00979c]REC_RDY_2[/color][color=#434f54],[/color] [color=#00979c]CHANNEL_1[/color][color=#000000]}},[/color]
  [color=#000000]{bank, 4, {[/color][b][color=#d35400]MCU[/color][/b][color=#434f54]:[/color][color=#434f54]:[/color][color=#00979c]REC_RDY_3[/color][color=#434f54],[/color] [color=#00979c]CHANNEL_1[/color][color=#000000]}},[/color]
  [color=#000000]{bank, 5, {[/color][b][color=#d35400]MCU[/color][/b][color=#434f54]:[/color][color=#434f54]:[/color][color=#00979c]REC_RDY_4[/color][color=#434f54],[/color] [color=#00979c]CHANNEL_1[/color][color=#000000]}},[/color]
[color=#000000]}[/color][color=#000000];[/color]

[color=#434f54]// MIDINoteLED listens for MIDI Note on/off events on the given address (MCU::REC_RDY_#) [/color]
[color=#434f54]// and channel (CHANNEL_1) and turns on/off an LED accordingly[/color]
[b][color=#d35400]Bankable[/color][/b][color=#434f54]:[/color][color=#434f54]:[/color][b][color=#d35400]MIDINoteLED[/color][/b][color=#434f54]<[/color][color=#000000]4[/color][color=#434f54]>[/color] [color=#000000]leds[/color][color=#000000][[/color][color=#000000]][/color] [color=#434f54]=[/color] [color=#000000]{[/color]
  [color=#000000]{bank, 6, {[/color][b][color=#d35400]MCU[/color][/b][color=#434f54]:[/color][color=#434f54]:[/color][color=#00979c]REC_RDY_1[/color][color=#434f54],[/color] [color=#00979c]CHANNEL_1[/color][color=#000000]}},[/color] [color=#434f54]// LED + resistor connected between pin 6 and ground[/color]
  [color=#000000]{bank, 7, {[/color][b][color=#d35400]MCU[/color][/b][color=#434f54]:[/color][color=#434f54]:[/color][color=#00979c]REC_RDY_2[/color][color=#434f54],[/color] [color=#00979c]CHANNEL_1[/color][color=#000000]}},[/color]
  [color=#000000]{bank, 8, {[/color][b][color=#d35400]MCU[/color][/b][color=#434f54]:[/color][color=#434f54]:[/color][color=#00979c]REC_RDY_3[/color][color=#434f54],[/color] [color=#00979c]CHANNEL_1[/color][color=#000000]}},[/color]
  [color=#000000]{bank, 9, {[/color][b][color=#d35400]MCU[/color][/b][color=#434f54]:[/color][color=#434f54]:[/color][color=#00979c]REC_RDY_4[/color][color=#434f54],[/color] [color=#00979c]CHANNEL_1[/color][color=#000000]}},[/color]
[color=#000000]}[/color][color=#000000];[/color]

[color=#00979c]void[/color] [color=#5e6d03]setup[/color][color=#000000]([/color][color=#000000])[/color] [color=#000000]{[/color]
  [b][color=#d35400]Control_Surface[/color][/b][color=#434f54].[/color][color=#d35400]begin[/color][color=#000000]([/color][color=#000000])[/color][color=#000000];[/color]
  [color=#d35400]display[/color][color=#434f54].[/color][color=#d35400]begin[/color][color=#000000]([/color][color=#000000])[/color][color=#000000];[/color]
[color=#000000]}[/color]

[color=#00979c]void[/color] [color=#5e6d03]loop[/color][color=#000000]([/color][color=#000000])[/color] [color=#000000]{[/color]
  [b][color=#d35400]Control_Surface[/color][/b][color=#434f54].[/color][color=#5e6d03]loop[/color][color=#000000]([/color][color=#000000])[/color][color=#000000];[/color]
  [color=#434f54]// Print the tracks of the active bank[/color]
  [color=#00979c]uint8_t[/color] [color=#000000]track[/color] [color=#434f54]=[/color] [color=#000000]bank[/color][color=#434f54].[/color][color=#d35400]getSelection[/color][color=#000000]([/color][color=#000000])[/color] [color=#434f54]*[/color] [color=#000000]bank[/color][color=#434f54].[/color][color=#d35400]getTracksPerBank[/color][color=#000000]([/color][color=#000000])[/color][color=#000000];[/color]
  [color=#d35400]display[/color][color=#434f54].[/color][color=#d35400]display[/color][color=#000000]([/color][color=#000000]track[/color] [color=#434f54]+[/color] [color=#000000]1[/color][color=#434f54],[/color] [color=#000000]6[/color][color=#434f54],[/color] [color=#000000]7[/color][color=#000000])[/color][color=#000000];[/color]                       [color=#434f54]// first track of bank[/color]
  [color=#d35400]display[/color][color=#434f54].[/color][color=#d35400]display[/color][color=#000000]([/color][color=#005c5f]"--"[/color][color=#434f54],[/color] [color=#000000]3[/color][color=#000000])[/color][color=#000000];[/color]                               [color=#434f54]// separator[/color]
  [color=#d35400]display[/color][color=#434f54].[/color][color=#d35400]display[/color][color=#000000]([/color][color=#000000]track[/color] [color=#434f54]+[/color] [color=#000000]bank[/color][color=#434f54].[/color][color=#d35400]getTracksPerBank[/color][color=#000000]([/color][color=#000000])[/color][color=#434f54],[/color] [color=#000000]0[/color][color=#434f54],[/color] [color=#000000]1[/color][color=#000000])[/color][color=#000000];[/color] [color=#434f54]// last track of bank[/color]
[color=#000000]}[/color]

The hardest part is indeed getting feedback from Reaper. By default, it doesn't send any data to MIDI controllers.
If you select the Mackie Control Universal in Reaper (Preferences > Control/OSC/web), the code above works (with LEDs) for the first 8 tracks (that's all MCU supports). You could try using the MCU banks instead of the Control Surface banks.

Pieter

Thanks for the reply, looks interesting and sounds promising.
Going to have to order a board and start playing around with it i think.
I know there would be a way to do it, the current controller i am using is the Nektar Panorama T6 and that scrolls through banks of 8 tracks at a time regardless of how many tracks i have on a project. Will be interested to see where your Lib goes.

Just a random thought, does anyone know if there is a kind of virtual Arduino tinker board that can be used as a testing environment before moving on to a full hardware project?

By and large emulators are a waste of time. While they might be able to emulate the processor they are not much good with peripherals. An LED and switch is normally the best you get.

No worries.
Time to order some supplies i think.
Cheers.

Thank you every one for your help but i just received an email today from Nektar saying that one of the modes on the T6 is actually a generic MIDI, i didn't realize this and can apparently set up that mode to pretty much do what i am after.
Still can't cycle through banks like i wanted but can cycle through individual tracks and arm them as i go or assign buttons through custom actions to arm the tracks i want.
I still might make a custom MIDI interface further down the track but for now the T6 should do me for a while.