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

    Default

    inside traktor, change the 'Interaction Mode' to Hold, not toggle.

  2. #12
    Tech Convert
    Join Date
    Mar 2011
    Posts
    12

    Default

    I tried, but it didn't work. May be the midi note ist the wrong one, which i send via the Atmel. I'm sending Ch3 CC70.

    Btw.: How do you use more than 8 Potis at the µC. It only contains 8 adcs.

  3. #13
    Tech Mentor
    Join Date
    Feb 2011
    Location
    Southern Ontario, Canada
    Posts
    244

    Default

    Quote Originally Posted by DANrulz81 View Post
    I tried, but it didn't work. May be the midi note ist the wrong one, which i send via the Atmel. I'm sending Ch3 CC70.
    You should be sending note-on and note-off midi messages for buttons, and CC's for pots and faders..

    Quote Originally Posted by DANrulz81 View Post
    Btw.: How do you use more than 8 Potis at the µC. It only contains 8 adcs.
    Through the use of multiplexer ic's! Do a search for CD4051 and its variants.

  4. #14
    Tech Convert
    Join Date
    Mar 2011
    Posts
    12

    Default

    Let me sum up:

    If i press the button (and holding it), I should send a 0x90 00 7F. And if I release the button, I should send a 0x80 00 7F?

    I'm sorry asking such silly questions, but I am a beginner in terms of midi
    Last edited by DANrulz81; 03-27-2011 at 03:11 PM.

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

    Default

    I am not used to sending direct midi messages.. I am using a midi library which makes it simple: midi.sendNoteOn(channel, note, velocity); midi.sendControlChange(channel, CC, value); etc...

    A small excerpt of my code is below:

    Code:
    void midiStreamNote(const uint8_t pitch, const bool onoff) {
    #ifdef DEBUG
      uint8_t command = ((onoff)? 0x90 : 0x80);
      Serial.print("cmd:");Serial.print(command >> 4,HEX);   // command type 0..15
      Serial.print(" ch:");Serial.print((MIDI_CHANNEL & 0x0f),DEC);  // channel 0..15
      Serial.print(" note:");Serial.print(pitch & 0x7f,DEC);   // note 0..127
      Serial.print(" vel:");Serial.println(MIDI_VELOCITY,HEX); // velocity 0..127
    #else
      if (onoff) {
        midi.sendNoteOn(MIDI_CHANNEL, pitch & 0x7f, 0x7f);
      } else {
        midi.sendNoteOff(MIDI_CHANNEL, pitch & 0x7f, 0x7f);
      }
    #endif
    }
    
    void midiStreamCC(const uint8_t cc, const uint8_t val) {
    #ifdef DEBUG
      Serial.print("cmd:");Serial.print(cc,DEC);   // command type 0..15
      Serial.print(" ch:");Serial.print(MIDI_CHANNEL,DEC);  // channel 0..15
      Serial.print(" val:");Serial.print(val & 0x7f,DEC);   // note 0..127
      Serial.print(" vel:");Serial.println(MIDI_VELOCITY,DEC); // velocity 0..127
    #else
      midi.sendControlChange(MIDI_CHANNEL, cc, val);
    #endif
    }
    Midi Library: http://timothytwillman.com/itp_blog/?page_id=240

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

    Default

    Hi,

    i figuered it out. It works fine by pressing the button sending note on, releasing sends note off. C is a language i don't understand, I write my software in Bascom, cause I grew up with Basic.

    Thanks any way, you saved my day

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

    Default

    Glad I could help

    I can certainly say that I've never heard of Bascom... but the thought of using a basic like language for avr programming is kind of neat... Please tell me they don't have GOTO

  8. #18
    Tech Convert
    Join Date
    Mar 2011
    Posts
    12

    Default

    Of course Bascom has GOTO, also Gosub, ... All of the happy Basic stuff. Now I have to figure out, how can I mux the Potis.

  9. #19
    Tech Mentor
    Join Date
    Feb 2011
    Location
    Southern Ontario, Canada
    Posts
    244

    Default

    With using basic? I have no clue... are you able to do your own serial comms? most multiplexers use spi or in some cases i2c.. The 4051 should work for you.. set its 3 input select pins to select which input to read, then read the analog value from a single analog input... Here's the code I'm using... it is C, and it's using plenty of bitmath to be warned

    Code:
     for(int i = 0; i < NUM_POTS; i++) {
        PORTD = (NUM_POTS > 8 && i >= 8) ? (i % 8) << 2 : i << 2; // set pins 2, 3 and 4 to value between 0 (00000) and 7 (11100) to select the pot
        if (i > 0 && (i % 8 == 0)) chipSelect++; // increase chip select index every 8 pots
        potValues[i] = analogRead(potReadPins[chipSelect]);
        if (abs(potValues[i] - prevPotValues[i]) > SMOOTHING) {
          prevPotValues[i] = potValues[i];
          midiStreamCC(i, map(potValues[i],5,1020,0,127));
        }
      }

  10. #20
    Tech Convert
    Join Date
    Mar 2011
    Posts
    12

    Default

    OMG, C is so cryptic. I got special SPI and I2C commands in bascom, for e.g.:
    Code:
    SPI:
    portb.7 = SCL
    portb.6 = MISO
    portb.5= MOSI
    portb.4 = SS
    spiout = 11010010
    Code:
    i2c:
    I2cstart
        I2cwbyte &H40
        I2cwbyte &HAA
    I2cstop
    I will try it as soon as possible. I got to buy some more potis and the other stuff like a 4051. Thanks anyway.

Page 2 of 3 FirstFirst 123 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
  •