Self build Midi Controller - Page 3
Page 3 of 3 FirstFirst 123
Results 21 to 27 of 27
  1. #21
    Tech Mentor
    Join Date
    Feb 2011
    Location
    Southern Ontario, Canada
    Posts
    244

    Default

    Heh, the 'cryptic' nature of that code is mostly due to the direct port manipulation... it's faster and more efficient than using digitalWrite(). and based on your code example, its actually exactly the same... I'm using the shortform of an if statement to safe some lines... it would normally look somthing similar to PORTD = 0b11101010, etc...

  2. #22
    Tech Guru
    Join Date
    May 2009
    Location
    Cincinnati, USA
    Posts
    779

    Default

    WWWWWWWWWWHHHHHHHHHOOOOOOOOOOOOOOOOOOOOSSSSSSSSSSS SHHHHHHHHHHHHHHHHHH

    (that's the sound of this thread flying over my head)

  3. #23
    Tech Convert
    Join Date
    Mar 2011
    Posts
    12

    Default

    Btw.: Did you ever used a rotary encoder for midi controlling?

  4. #24
    Tech Guru Archies'bald's Avatar
    Join Date
    May 2009
    Location
    Scotland
    Posts
    686

    Default

    Quote Originally Posted by ToOntown View Post
    WWWWWWWWWWHHHHHHHHHOOOOOOOOOOOOOOOOOOOOSSSSSSSSSSS SHHHHHHHHHHHHHHHHHH

    (that's the sound of this thread flying over my head)
    So far above my head, I couldn't hear the rumble from it's sonic boom.

  5. #25
    Tech Mentor
    Join Date
    Feb 2011
    Location
    Southern Ontario, Canada
    Posts
    244

    Default

    Yep, I have two in my current controller, though one has been removed so I can beta test these: http://www.djtechtools.com/forum/showthread.php?t=25088

    They're fairly simple to work with...

    Again, this is C, not bascom... but the idea is the same...

    Code:
    byte read_two_encoders() {
      int8_t enc_states[] = {0,-1,1,0,1,0,0,-1,-1,0,0,1,0,1,-1,0};
      static uint8_t old_AB1, old_AB2 = 0;
      byte rtn = 0;
    
      old_AB1 <<= 2; //remember previous state
      old_AB1 |= (ENC_PORT & 0b11); //add current state
      old_AB2 <<= 2; //remember previous state
      old_AB2 |= (ENC_PORT & 0b1100) >> 2; //add current state
      rtn |= (enc_states[(old_AB1 & 0b1111)]) & 0b11;
      return rtn | ((enc_states[(old_AB2 & 0b1111)]) & 0b11) << 2;
    }

  6. #26
    Tech Convert
    Join Date
    Mar 2011
    Posts
    12

    Default

    O.k. Thanks. I just have to buy an encoder and figure it out myself. Just one question: Do you use midi out to your controller to set for e.g. a LED, when play ist pressed?

  7. #27
    Tech Mentor
    Join Date
    Feb 2011
    Location
    Southern Ontario, Canada
    Posts
    244

    Default

    Yep, I have my transport controller rigged with two beat lights and 11 leds to show the crossfader position (i'm not currently using it because the end of my midi chain doesn't have midi-in..

    I've also done some work with these, things like using them as vu's or more recently pulsing beat lights using PWM...

Page 3 of 3 FirstFirst 123

Posting Permissions

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