*BUILD LOG* 'CDJ 2000'-style DIY Traktor controller - Page 16
Page 16 of 21 FirstFirst ... 6121314151617181920 ... LastLast
Results 151 to 160 of 209
  1. #151
    Tech Guru MiL0's Avatar
    Join Date
    May 2009
    Location
    Brighton / Bangkok
    Posts
    1,386

    Default

    hmm I need to look into that... would be perfect for my controller.

    I guess I need to pick up TP2 and see how the track information is being exported... HID perhaps?

  2. #152
    Tech Mentor
    Join Date
    Feb 2011
    Location
    Southern Ontario, Canada
    Posts
    244

    Default

    HID is human interface device (keyboard/mouse)... I am not sure that they work with output, only input... I'd bet that it is standard midi, using some sort of unique encoding scheme to translate ascii -> hex...

    I think I'm going to have to play with this...

  3. #153
    Tech Guru MiL0's Avatar
    Join Date
    May 2009
    Location
    Brighton / Bangkok
    Posts
    1,386

    Default

    well if that's the case then it should be easier to decipher / reverse engineer... unless it's sysex?

  4. #154

    Default

    This controller looks like it would be awesome.
    OXYGEN 8 + Acer Netbook + Traktor + DJFRAGGIE!

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

    Default

    See next post... In short, my guess was wrong

    Here's a capture I made and what was going on inside traktor at the time.

    Before the capture started I added a blank denon device then I started the capture.

    First: I set the midi out port (this generated what seems to be an init message consisting of 4 midi messages [the first 4 in the file] to be sent)

    Second: I loaded a track: "Climax In My Head" by "2 Dirty", the file has a genre of "Electro House" and a total playtime of 6 minutes and 0 seconds.

    Third: I waited about 10 seconds before changing the midi out port to n/a to stop the midi messages.

    Note: I did NOT play the track, I'm purely trying to find the track name in the midst of a couple thousand midi messages.

    It seems to be sending deck b's details on channel 2 and deck a's on channel 1. The values have an upper limit of 0x0E (14) and seem to be rotating in a pattern of some sort.

    This would mean that they are sending the track data encoded in the control channels themselves as opposed to the cc value... Very interesting so far...
    Last edited by DjNecro; 04-13-2011 at 07:30 PM.

  6. #156
    Tech Mentor
    Join Date
    Feb 2011
    Location
    Southern Ontario, Canada
    Posts
    244

    Default

    Completely disregard my previous post... After some search keyword trial and error, I figured out that it isn't denon supporting traktor... It's that traktor has support for the denon... In that traktor sends midi out according to DENON's SPEC not their own (as I originally assumed)... It seems as though denon's midi protocol is wide open to the public.. You can find it in the PDF here: http://www.denondj.com/Assets/DImage...1916faea9a.pdf

    It starts on page 16... It uses a 2 byte system and a font table as opposed to encoding the string data in the midi...

    Now I get to play some more

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

    Default

    Ok, I think I have this licked... Using php (my main language) I've been able to go over the capture I made and extract the following:

    limaxInMyimax In My Hmax In My Heax In My Heax In My Head In My Head In My Head n My Head My Head CMy Head Cly Head Cli Head ClimHead Climaead Climaxad Climax d Climax I Climax InClimax In Climax In MClimax In Mylimax In My imax In My Hmax In My Heax In My Heax In My Head In My Head In My Head n My Head My Head CMy Head Cly Head Cli Head ClimHead Climaead Climaxad Climax d Climax I Climax InClimax In Climax In MClimax In Mylimax In My imax In My Hmax In My Heax In My Heax In My Head In My Head

    Dirty2DDirty 2 Diirty 2 Dirrty 2 Dirtty 2 Dirtyy 2 Dirty 2 Dirty 2 Dirty 2 Dirty 22 Dirty 2 Dirty 2 DDirty 2 Diirty 2 Dirrty 2 Dirtty 2 Dirtyy 2 Dirty 2 Dirty 2 Dirty 2 Dirty 22 Dirty 2 Dirty 2 DDirty 2 Diirty 2 Dirrty 2 Dirtty 2 Dirtyy 2 Dirty 2 Dirty 2 Dirty 2 Dirty 22 Dirty 2 Dirty 2 DDirty 2 Diirty 2 Dirrty 2 Dirtty 2 Dirtyy 2 Dirty 2 Dirty 2 Dirty 2 Dirty 22 Dirty 2 Dirty 2 DDirty 2 Diirty 2 Dirrty 2 Dirtty 2 Dirtyy 2 Dirty
    it looks jumbled because traktor sends the track name constantly... in a rotating fashion... Kind of odd, since they could have easily sent the complete track information in one burst, then let the controller do the scrolling... not sure who to blame; NI or Denon, but meh....

    The first block is the first line, the second block is of course the second line. The 'init' messages I initially saw were in fact messages for the denon to turn on the 'ELAPSED', 'm', 's', 'f' display symbols... The font table they're using seems to match up with the extended ascii (albeit slightly customized) table, so converting the combined (msb and lsb) font value to ascii is dead simple...

    After reading that pdf in detail I can say that I really really want one of those hc4500's... the control you have is amazing... set any led, any display icon/segment, read any button, any fader, encoder, etc... A-Mazing...

    The quick'n'dirty php code I used is below... not sure if anyone cares about php code since it's useless for midi controllers, but it may help..

    PHP Code:
    $blah file_get_csv('test.csv'true);

    function 
    ccIsSegment($cc) {
        
    $cc base_convert($cc1610); //convert hex STRING to an actual integer
        
    if (($cc >= 0x01 && $cc <= 0x05) || ($cc >= 0x07 && $cc <= 0x0D)) return 1// segment 1 MSB
        
    if (($cc >= 0x21 && $cc <= 0x25) || ($cc >= 0x27 && $cc <= 0x2D)) return -1// segment 1 LSB

        
    if ($cc >= 0x0E && $cc <= 0x19) return 2// segment 2 MSB
        
    if ($cc >= 0x2E && $cc <= 0x39) return -2// segment 2 LSB

        
    return false;
    }
    //split the capture into the two VFD segments
    foreach ($blah as $i=>$msg) {
        switch (
    ccIsSegment($msg['CC'])) {
            case 
    1// MSB
                
    $segment1['msb'][] = $msg;
                break;
            case -
    1// LSB
                
    $segment1['lsb'][] = $msg;
                break;
            case 
    2// msb
                
    $segment2['msb'][] = $msg;
                break;
            case -
    2// lsb
                
    $segment2['lsb'][] = $msg;
                break;
        }
    }

    //run through each segment, figure out the character and print it
    foreach ($segment1['lsb'] as $x => $seg) {
        
    $lowByte base_convert($seg['VALUE'], 1610); // convert hex string to decimal
        
    $highByte base_convert($segment1['msb'][$x]['VALUE'], 1610); // convert hex string to decimal
        
    $byte = (($highByte<<4) + $lowByte); // combine the high and low bytes
        
    echo chr($byte); // echo the character for the resulting decimal value (65=A, 66=B, etc -- the extended ascii table)
    }
    echo 
    "<hr>";
    foreach (
    $segment2['lsb'] as $x => $seg) {
        
    $lowByte base_convert($seg['VALUE'], 1610);
        
    $highByte base_convert($segment2['msb'][$x]['VALUE'], 1610);
        
    $byte = (($highByte<<4) + $lowByte);
        echo 
    chr($byte);


  8. #158
    Tech Guru MiL0's Avatar
    Join Date
    May 2009
    Location
    Brighton / Bangkok
    Posts
    1,386

    Default

    good work!!

    the PHP is useful actually... my plan would be to write a script in Autohotkey that does the same thing. The good thing about AHK is that it has midi functionality now and also you can save your script as an exe easily. So basically the AHK script would sit between Traktor and the controller, converting the midi into text.

    Once this is done, it's relatively trivial to get AHK to export the text to a text file and have LCDSmartie import the text to be displayed on a small LCD display

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

    Default

    Well in that case I'll clean the code up and get it to fully support the protocol... Would you use the php directly? or is there a language the ahk uses? I've never used it before..

  10. #160
    Tech Guru MiL0's Avatar
    Join Date
    May 2009
    Location
    Brighton / Bangkok
    Posts
    1,386

    Default

    AHK uses a sortof C style markup I guess... but it's much easier to use. It's basically used to create advanced Windows macros but can be used to create very powerful software that can interact with Windows at quite a low level. The midi library for AHK makes it very useful for a lot of Traktor related utilities (I used it to create the Traktor Klone software that duplicates parts of Traktor's GUI).

    But anyway, don't worry too much about cleaning up the PHP code (unless you really want to). It's given me some food for thought on how to approach the AHK script. I imagine the most useful way to implement the title/artists information would be as part of the Arduino code? The only reason I'd like to write this in AHK is that anyone could use the exe without needing to own an Arduino (you'd just need a usb LCD screen like the ones they recommend for use with LCDSmartie). See my "VU meter" thread in my signature for more details.

Posting Permissions

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