help a newbie !!!!
Results 1 to 3 of 3
  1. #1
    Tech Convert
    Join Date
    Feb 2010
    Location
    Paris, France
    Posts
    8

    Default help a newbie !!!!

    hey guys,
    i'm trying to built my own midi controler and i am a a stage where i need to set up my teensy board for midi.

    all i need is 12 analog inputs (for rotative potentiometers) and 2 digital inputs (for rotative encoders)

    i understood that i need to enter some kind of code on the teensy.

    can anyone give me a kickstart ?

    many thanks in advance

    Robert
    RLP
    www.rlpmix.com
    soundcloud
    traktor pro 1.2.7 - X1 - macbookpro 15" - midifighter

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

    Default

    Hey,

    I'm not exactly sure what you mean but i assume you've now got 14 inputs connected to the teensy directly? And you want to know what you have to upload to transform this into a fully fledged midi controller?
    Well in your case you can use Midi Elements, created by Tomash Ghz (he is on DJTT too really talented DJ/producer) while this makes the programming super easy I can understand if this is still too hard, if you are not able to write the code yourself just PM me and I will write & debug it for you.

    Apologies for spelling errors, I am extremely hung over...
    MF Pro & Spectra | Kontrol S4 MKI | 2x Kontrol S1 MKI | MC-1000 | Generic MKI

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

    Default

    For others reading this later on, here is the final code:

    Code:
    // MIDI Elements MIDI
    // by Tomash Ghz
    // www.tomashg.com
    // ghz.tomash@gmail.com
    // Code written by Nickolas Boyer
    
    #include <MIDIElements.h>
    boolean debug=false; // print to serial instead of midi
    boolean secondary=false; // enable secondary midi messages
    int midiChannel=1; // midi channel number
    
    // declare all your components here
    MIDIEncoder *enc1;
    MIDIEncoder *enc2;
    Button *encBut1;
    Button *encBut2;
    Potentiometer *pot1;//(14, controlChannel, 17, false, debug); // knob on pin 45 (A7)
    Potentiometer *pot2;//(15, controlChannel, 18, false, debug); // knob on pin 44 (A6)
    Potentiometer *pot3;//(16, controlChannel, 19, false, debug); // knob on pin 45 (A7)
    Potentiometer *pot4;//(17, controlChannel, 20, false, debug); // knob on pin 44 (A6)
    Potentiometer *pot5;
    Potentiometer *pot6;
    Potentiometer *pot7;
    Potentiometer *pot8;
    Potentiometer *pot9;
    Potentiometer *pot10;
    Potentiometer *pot11;
    Potentiometer *pot12;
    
    void setup(){  
      enc1=new MIDIEncoder(2,3,midiChannel,1,false, debug); // setup an encoder on pins 1 and 2
      enc2=new MIDIEncoder(4,5,midiChannel,2,false, debug); // setup an encoder on pins 1 and 2
      pot1=new Potentiometer(A0, midiChannel, 17, false, debug); // knob on pin A0
      pot2=new Potentiometer(A1, midiChannel, 18, false, debug); // knob on pin A1
      pot3=new Potentiometer(A2, midiChannel, 19, false, debug); // knob on pin A2
      pot4=new Potentiometer(A3, midiChannel, 20, false, debug); // knob on pin A3
      pot5=new Potentiometer(A4, midiChannel, 21, false, debug);
      pot6=new Potentiometer(A5, midiChannel, 22, false, debug);
      pot7=new Potentiometer(A6, midiChannel, 23, false, debug);
      pot8=new Potentiometer(A7, midiChannel, 24, false, debug);
      pot9=new Potentiometer(A8, midiChannel, 25, false, debug);
      pot10=new Potentiometer(A9, midiChannel, 26, false, debug);
      pot11=new Potentiometer(A10, midiChannel, 27, false, debug);
      pot12=new Potentiometer(A11, midiChannel, 28, false, debug);
      encBut1=new Button(6, midiChannel, 10, false, debug); // encoder buttons
      encBut2=new Button(7, midiChannel, 11, false, debug); // encoder buttons
      
      usbMIDI.setHandleNoteOff(OnNoteOff); //set event handler for note off
      usbMIDI.setHandleNoteOn(OnNoteOn); //set event handler for note on
      usbMIDI.setHandleControlChange(OnControlChange); // set event handler for CC
    }
    
    void loop(){
      // add here all the input component reads
      pot1->read();
      pot2->read();
      pot3->read();
      pot4->read();
      pot5->read();
      pot6->read();
      pot7->read();
      pot8->read();
      pot9->read();
      pot10->read();
      pot11->read();
      pot12->read();
      enc1->read();
      enc2->read();
      encBut1->read();
      encBut2->read();
      
      usbMIDI.read(); // read all the incoming midi messages
    }
    
    //====================================================================
    // event handlers
    void OnNoteOn(byte channel, byte note, byte velocity){
      // add all your output component sets that will trigger with note ons
    }
    
    void OnNoteOff(byte channel, byte note, byte velocity){
      // add all your output component sets that will trigger with note ons
    }
    
    void OnControlChange(byte channel, byte control, byte value){
      // add all your output component sets that will trigger with cc
    }
    MF Pro & Spectra | Kontrol S4 MKI | 2x Kontrol S1 MKI | MC-1000 | Generic MKI

Posting Permissions

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