The BIG Arduino MIDI controller thread - Page 8
Page 8 of 16 FirstFirst ... 456789101112 ... LastLast
Results 71 to 80 of 155
  1. #71
    Tech Student
    Join Date
    May 2010
    Location
    Stuttgart, Germany
    Posts
    4

    Default

    iŽve found a piece of code, that has easy possibilities to edit the analogue (max. 16) an digital (max.68 ..the arduino only has 52 pins??) inputs on the arduino mega boards ..it should work with teensys too.

    This is the page on instructables with an tutorial how to build an complete controller with arduino. If you want to, you could use the midifighter mappings from djtt with your diy controller (if youŽve connected the buttons like its been described in the code) because the arduino will send the same Commands as the "real" midifighter

    To Connect your specific Inputs you just have to edit the Numbers (for the digitial inputs the 52 and for analogue inputs the 16) in this part of the Code:
    Code:
    #if defined(ARDUINO_MEGA)
      // Number of digital inputs. Can be anywhere from 0 to 68.
      #define NUM_DI 52
      // Number of analogue inputs. Can be anywhere from 0 to 16.
      #define NUM_AI 16
    And also the Numbers of the Pins on the Board:

    Digital Line:
    (e.g. if you have one button only the 2 will last for the digital Inputs)
    Code:
    #if defined(ARDUINO_MEGA)
        #define DIGITAL_PIN_ORDER 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53
    Analogue Line:
    (e.g. if you have one Pot, only the A0 will last for the analouge Inputs)
    Code:
    #if defined(ARDUINO_MEGA)
      #define ANALOGUE_PIN_ORDER A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15
    At the moment iŽve tested it with one pot and one button on my arduino mega -> works great!... in the next two weeks i desolder my diy controller and connect al the buttons and potis to the arduino.. IŽll let you know how it works

    Because of the length of the code i couldnŽt post it directly here, you could easily download it from the instructables page..

    Regards!
    Last edited by manou; 04-21-2011 at 05:52 AM.

  2. #72
    Tech Student
    Join Date
    Aug 2011
    Posts
    2

    Default

    wooohoo!! created a profile just to thank you for this thread. finally got a solid base to start with for my midi controller. got the one pot one button set up perfectly, and going through the LUFA firmware it runs like a charm straight over usb. perfect!!! hopefully my noob ass can build something to be proud of and show off here when im done.

    thanks so much!!

  3. #73
    Tech Student
    Join Date
    Aug 2011
    Posts
    2

    Default

    the code i am using is, not sure whos it is exactly now i had so many tabs open at the time. lol
    i found that i couldnt get the switch pin to work right, i think im still fuzzy on the pulldown resistor stuff, but have the lady ada tutorial on it ready to read again for my next try. or its a debouncing issue and that requires a bit more reading. lol, either way my solution to the problem was just wiring up a pot and using a couple hundred ohm resistor to ground, the 5v to the other pin, and the output to my a(0) pin on the arduino. basically just have the pot centered, slightly left for off, slightly right for on. not pretty, but it does the job i want for now.

    i believe the code is from here
    http://itp.nyu.edu/physcomp/Labs/MIDIOutput
    [as referenced on the very first page of this thread]

    and the midi firmware i am using is this one[i think, ive got a few and i renamed them for ease of DFU programming via linux]
    http://arduino.cc/en/Hacking/MidiWith8U2Firmware

    Code:
    // The switch is on Arduino pin 10:
    #define switchPin 10
    // Middle C (MIDI note value 60) is the lowest note we'll play:
    #define middleC 60
    //  Indicator LED:
    #define LEDpin 13
    
    // Variables:
    char note = 1;            // The MIDI note value to be played
    int AnalogValue = 0;           // value from the analog input
    int lastNotePlayed = 0;   // note turned on when you press the switch
    int lastSwitchState = 0;  // state of the switch during previous time through the main loop
    int currentSwitchState = 0;
    
    void setup() {
     //  set the states of the I/O pins:
     pinMode(switchPin, INPUT);
     pinMode(LEDpin, OUTPUT);
     //  Set MIDI baud rate:
     Serial.begin(31250);
     blink(3);
    }
    
    void loop() {
     //  My potentiometer gave a range from 0 to 1023:
     AnalogValue = analogRead(0);
     //  convert to a range from 0 to 127:
     note = AnalogValue/8;
     currentSwitchState = digitalRead(switchPin);
     // Check to see that the switch is pressed:
     if (currentSwitchState == 1) {
       //  check to see that the switch wasn't pressed last time
       //  through the main loop:
       if (lastSwitchState == 0) {
         // set the note value based on the analog value, plus a couple octaves:
        // note = note + 60;
         // start a note playing:
         noteOn(0x90, note, 0x40);
         // save the note we played, so we can turn it off:
         lastNotePlayed = note;
         digitalWrite(LEDpin, HIGH);
       }
     }
       else {   // if the switch is not pressed:
       //  but the switch was pressed last time through the main loop:
       if (lastSwitchState == 1) {
         //  stop the last note played:
         noteOn(0x90, lastNotePlayed, 0x00);
         digitalWrite(LEDpin, LOW);
       }
    }
    
     //  save the state of the switch for next time
     //  through the main loop:
     lastSwitchState = currentSwitchState;
    }
    
    //  plays a MIDI note.  Doesn't check to see that
    //  cmd is greater than 127, or that data values are  less than 127:
    void noteOn(char cmd, char data1, char data2) {
     Serial.print(cmd, BYTE);
     Serial.print(data1, BYTE);
     Serial.print(data2, BYTE);
    }
    
    // Blinks an LED 3 times
    void blink(int howManyTimes) {
     int i;
     for (i=0; i< howManyTimes; i++) {
       
       digitalWrite(LEDpin, HIGH);
       delay(100);
       digitalWrite(LEDpin, LOW);
       delay(100);
     }
    }
    Last edited by pain101; 08-26-2011 at 06:05 PM. Reason: adding links

  4. #74
    Tech Wizard
    Join Date
    May 2011
    Posts
    21

    Default

    I'm using THIS library and it is very easy to implement, specially the midi input, which is handled via "callbacks" where you set them as functions to be triggered when given midi input is read.

  5. #75
    Newbie
    Join Date
    Nov 2012
    Posts
    2

    Default Hey

    hey guys I joined up here just to talk Arduino projects... I really want to make my own controller...

    I have absolutely NO lick of programming experience. (or even building for that matter)...But I can hit the ground running and self teach rather well..

    But I have NO interest in learning a programming language to make a MIDI controller...especially if the inherent latency depends totally on the coding.

    With that being said...is there any scripts out there already or anybody that has preprogrammed Arduino brains (kind of like Livid)?? From what I read out there...it seems making a keyboard controller with velocity sensitive pads/keys seems impossible without adding another layer of software that sit between the controller and machine/PC.

  6. #76
    Tech Wizard Sample Seven's Avatar
    Join Date
    Mar 2012
    Location
    PA
    Posts
    77

    Default

    But I have NO interest in learning a programming language to make a MIDI controller...especially if the inherent latency depends totally on the coding.
    A little ambition goes a long way, since rudimentary programming really isn't that complicated. Also, the code for MIDI controllers is simple enough that you won't have to worry about latency.

    With that being said...is there any scripts out there already or anybody that has preprogrammed Arduino brains (kind of like Livid)??
    The Livid brains and Hale Microsystems products are about as plug and play as it gets. I'm sure there's example Arduino projects out there too.

    Programming an Arduino as a MIDI controller is not difficult though. There's a MIDI library that comes with the software that does all the tricky MIDI stuff for you, you just have to program the Arduino to work with the hardware you're using.

    From what I read out there...it seems making a keyboard controller with velocity sensitive pads/keys seems impossible without adding another layer of software that sit between the controller and machine/PC.
    Nope, it's entirely 100% possible to make a velocity sensitive keyboard using Arduino. It's more a question of how you set up your hardware for velocity detection.

  7. #77
    Newbie
    Join Date
    Nov 2012
    Posts
    2

    Default

    Thanks for the response....

    I just don't think it's time efficient for me to learn C language to build one controller. I mean, I understand it's something that I can build upon and keep with me forever (coding). But I have a family, lol.

    The only reason I was considering the Arduino/Teensy route was because I could build a controller with a pcb tht could accept the MPC's original pad sensor board more readily...I'm not even sure it's an option with the Livid kit without a major workaround.

    Has anybody had experience with the pads on the Livid contollers? Is the responsiveness acceptable for finger drumming?

  8. #78
    Tech Guru Nicky H's Avatar
    Join Date
    Jan 2009
    Location
    Leeds UK
    Posts
    2,485

    Default

    Quote Originally Posted by Hobbs View Post
    The only reason I was considering the Arduino/Teensy route was because I could build a controller with a pcb tht could accept the MPC's original pad sensor board more readily...I'm not even sure it's an option with the Livid kit without a major workaround.

    Has anybody had experience with the pads on the Livid contollers? Is the responsiveness acceptable for finger drumming?
    Yes Livid's new brain supports FSR's so should be fine.
    It could be done with Arduino as well though, but if you want to avoid programming then go for the Livid.
    SC | MC

  9. #79
    Tech Guru DJDoubleYou's Avatar
    Join Date
    Mar 2011
    Location
    Hyperspace
    Posts
    1,267

    Default

    one tip, check out the teensy
    MF Pro & Spectra | Kontrol S4 MKI | 2x Kontrol S1 MKI | MC-1000 | Generic MKI

  10. #80
    Tech Wizard
    Join Date
    Jan 2013
    Posts
    68

    Default This Thread is great!

    I want to start off by saying I think this thread is a great resource. Currently I am in my last semester Electrical Engineering in College and have over the past few months just started to get into djing. If possible I would LOVE to make a controller simular to a Midi Fighter that would run my remix decks in traktor. I was looking at the traktor F1 but after researching about DIY controllers it MIGHT be possible to make something that would work. I am also a drummer so being able to play one-shots easily on controller with out dishing out very much cash would be a huge asset. I have taken a course on program and would say I have a fairly basic understanding of programing. The course had me buy a kit with an arduino Mega 2560. From other kits I have a bunch of resistors and stuff including a couple breadboards. Any suggestions or insite is much appreciated!

Page 8 of 16 FirstFirst ... 456789101112 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •