saltwater
Published © GPL3+

10 Button Midi Transport Controller for Studio One

This is a Transport Controller for the DAW Studio One. influenced by vintage studio reel to reel remotes, but updated.

BeginnerFull instructions provided2,698
10 Button Midi Transport Controller for Studio One

Things used in this project

Hardware components

Arduino Leonardo
Arduino Leonardo
×1
Arcade Button with Led
×10
Hook Up Wire Kit, 22 AWG
Hook Up Wire Kit, 22 AWG
×1
Through Hole Resistor, 120 ohm
Through Hole Resistor, 120 ohm
×3
LED, Blue
LED, Blue
×3

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Solder Wire, Lead Free
Solder Wire, Lead Free
Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires
Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires
Mastech MS8217 Autorange Digital Multimeter
Digilent Mastech MS8217 Autorange Digital Multimeter

Story

Read more

Schematics

wiring diagram

10 button midi controller

Code

10 button midi controller

Arduino
transport controller for Studio one
// If using with ATmega32U4 - Micro, Pro Micro, Leonardo...
#include <Control_Surface.h>
 
USBMIDI_Interface ardy2;

/////////////////////////////////////////////
// buttons
const int NButtons = 10; //*
const int buttonPin[NButtons] = {0,1,2,3,4,5,6,7,8,9};  //* the number of the pushbutton pins in the desired order
int buttonCState[NButtons] = {0};         // stores the button current value
int buttonPState[NButtons] = {0};        // stores the button previous value

/////////////////////////////////////////////
// debounce
unsigned long lastDebounceTime[NButtons] = {0};  // the last time the output pin was toggled
unsigned long debounceDelay = 13;    //* the debounce time; increase if the output flickers

byte midiCh = 11; //* MIDI channel to be used
byte note = 1; //* Lowest note to be used
byte cc = 1; //* Lowest MIDI CC to be used
///////////////////////////////////////////////
//record led
NoteLED noteLed { 10,{ MIDI_Notes::B(6),CHANNEL_1}};
//play led
NoteLED noteLedp { 11,{ MIDI_Notes::Bb(6),CHANNEL_1}};
//back light


void setup() {

 pinMode(12, OUTPUT);
digitalWrite(12, HIGH);
  for (int i = 0; i < NButtons; i++) {
    pinMode(buttonPin[i], INPUT_PULLUP);
  
  Control_Surface.begin();   
    
  }
 

}

void loop() {

  buttons();
 
  Control_Surface.loop();
 
}

/////////////////////////////////////////////
// BUTTONS
void buttons() {

  for (int i = 0; i < NButtons; i++) {

    buttonCState[i] = digitalRead(buttonPin[i]);
    /*
        // Comment this if you are not using pin 13...
        if (i == pin13index) {
          buttonCState[i] = !buttonCState[i]; //inverts pin 13 because it has a pull down resistor instead of a pull up
        }
        // ...until here
    */
    if ((millis() - lastDebounceTime[i]) > debounceDelay) {

      if (buttonPState[i] != buttonCState[i]) {
        lastDebounceTime[i] = millis();

        if (buttonCState[i] == LOW) {
         
          // use if using with ATmega32U4 (micro, pro micro, leonardo...)

                   
        controlChange(midiCh, 20 + i, 127); // manda control change (channel, CC, value)
          
          MidiUSB.flush();

                  Serial.print("button on  >> ");
               Serial.println(i);
        }
        else {
         
          // use if using with ATmega32U4 (micro, pro micro, leonardo...)
        
          
         controlChange(midiCh, 20 + i, 0); // manda control change (channel, CC, value)
         
          MidiUSB.flush();

          //          Serial.print("button off >> ");
          //          Serial.println(i);
        }
        buttonPState[i] = buttonCState[i];
      }
    }
  }
}



/////////////////////////////////////////////
// Arduino (pro)micro midi functions MIDIUSB Library
void noteOn(byte channel, byte pitch, byte velocity) {
  midiEventPacket_t noteOn = {0x09, 0x90 | channel, pitch, velocity};
  MidiUSB.sendMIDI(noteOn);
}

void noteOff(byte channel, byte pitch, byte velocity) {
  midiEventPacket_t noteOff = {0x08, 0x80 | channel, pitch, velocity};
  MidiUSB.sendMIDI(noteOff);
}

void controlChange(byte channel, byte control, byte value) {
  midiEventPacket_t event = {0x0B, 0xB0 | channel, control, value};
  MidiUSB.sendMIDI(event);
}

Credits

saltwater

saltwater

0 projects • 0 followers

Comments