Traktor track name / time to LCD via MIDI! ...using Denon LCD support & Arduino - Page 6
Page 6 of 6 FirstFirst ... 23456
Results 51 to 55 of 55
  1. #51
    Newbie
    Join Date
    Dec 2016
    Posts
    1

    Default This could be used for triggering external workflows!

    Quote Originally Posted by Siytek View Post
    Hi All

    This has already been discussed in another thread however it was decided that it was probably a good idea to put the info in a new thread.

    Firstly.... here it is in action!

    http://www.youtube.com/watch?v=9gQBgCKsGgc

    Here is the info I posted about how its done...

    By using the MIDI outputted for the Denon HC4500. When you add a HC4500 to your list of controllers, Traktor will start to output MIDI for the track name, artist and time. Its not an option you can select in the 'add out' section in Traktor, it happens in the background as soon as you add the DN4500 controller and select a MIDI OUT port. I used the Denon MIDI sheet to get the info

    Here is the sheet I used, Denon MIDI (page 7) : HC4500 MIDI Command List

    As only 7 bits of the MIDI data messages are available (the first bit is used to identify the message type) and the LCD needs 8 bits of data to display a character, each character needs to be transmitted in two control change messages. The first bit is used to idenfify the message, nothing to do with LCD but will be used in your code by the MIDI IN routine. The next three bits are discarded, and the final 4 bits are used for the data. The first control change message contains the first 4 bits of the 8-bit LCD character data, and the second CC message contains the second 4 bits, so....

    X000AAAA
    +
    X000BBBB
    =
    AAAABBBB

    Where X is the message identifier bit, the '0s' are discarded, A is the first CC and B is the second CC.

    Assuming you have Arduino sucessfully receiving MIDI CC, by loading two CC messages into cc_data1 and cc_data2 the following code is a simplified way of getting the MIDI messages to the LCD. The actual code uses bitwise (see arduino website) to join the two nibbles together and simplified looks like this...

    This line shifts the first 4 bits of the first message along 4 places to make
    0000AAAA into AAAA0000
    lcd_nibble1 = (cc_data1 << 4);

    This line takes the data from the second CC message and passes it to a variable for the LCD routine
    lcd_nibble2 = cc_data2;

    Now we have the following
    lcd_nibble1 = AAAA0000
    lcd_nibble2 = 0000BBBB

    Now we need to merge the two using the bitwise OR operator...
    lcd_output = lcd_nibble1 | lcd_nibble2;

    so now 'lcd_output' is AAAABBBB, a complete byte which can be passed straight to the lcd.print command using the standard Arduino LCD library...
    lcd.print(lcd_output);

    Now this code could be better as the library will break the byte up back into nibbles to pass to the LCD using the 4-bit interface (as my design uses 4-bit connection) so when I get some time, ill most likely make a few mods to the library to save some considerable processing time! However at the moment in development, this method works great and is a good way to simply use the standard Arduino LCD library in 4 or 8 bit mode.

    There is one more thing, I described how to pass the CC data to the LCD but nothing about CC numbers. The value of the CC message relates to the character but the CC number determines both the character position and identifies whether the message is the first or second nibble of data. Its all in the Denon MIDI sheet. For example....

    If you (or Traktor!) wanted to display the letter 'A' in the second (of 16) character position and on the first line you would use the following...

    The character 8-bit code (from Denon or Hitachi LCD datasheet) is 0100 for the first nibble and 0001 for the second nibble, so...

    CC message 1 = 0001 = 1 (in decimal)
    CC message 2 = 0100 = 4

    From the Denon sheet, CC number 2 (0x02 in hex) represents the first nibble for the second character on the first line of the display. CC number 34 (0x22 in hex) represents the second nibble for the second character on the first line of the display, so...

    CC#02 value 1
    CC#34 value 4

    will display the letter 'A' in the second char position on the first line. BTW Deck A will output all this info on channel 1 and Deck B will output it on channel 2... so my advice if your designing a controller with the Denon LCD system, reserve ch1 and ch2 for the LCD data!

    Here is the actual code with bits removed that dont relate to the LCD (easier to understand! ), please note the MIDI channel is currently ignored but a simple if or switch statement could be included to check the channel is correct or identify whether the data is from deck A or deck B, just havent got round to doing it yet! to use this code the receiveMIDI routine is fired whenever the serial port data is read and verified to be a recognised MIDI message. The following variables must be passed to the routine...

    statusType = type of message, CC, note on, note off etc...
    MIDIchannel = self explanatory!
    param1 = first parameter of data (for CC this would be the CC number)
    param2 = second parameter of data (for CC this would be the CC value)

    Code:
    void receiveMIDI(byte statusType, byte MIDIchannel, byte param1, byte param2){
    
      switch (statusType) {
    
        break;
        case 0xB0:
        ///// IF MESSAGE IS CONTROL CHANGE MESSAGE (0xB0) /////
    
        switch(param1){ // CHECKS CC NUMBER, MSB GETS PUT IN tn_byte1
          
         case  0x01:
               tn_byte1 = (param2 << 4);
         break;
         case  0x02:
               tn_byte1 = (param2 << 4);
         break;
         case  0x03:
               tn_byte1 = (param2 << 4);
         break;
         case  0x04:
               tn_byte1 = (param2 << 4);
         break;
         case  0x05:
               tn_byte1 = (param2 << 4);
         break;
         case  0x07:
               tn_byte1 = (param2 << 4);
         break;
         case  0x08:
               tn_byte1 = (param2 << 4);
         break;
         case  0x09:
               tn_byte1 = (param2 << 4);
         break;
         case  0x21: // BEGIN LSB, MSB IS READY IN tn_byte1
          tn_byte2 = param2;
          tn_output = tn_byte1 | tn_byte2;
          track_name(0 , 0 , tn_output); // FIRES LCD PRINT WITH CO-ORDS AND CHAR DATA          
         break;
         case  0x22:
          tn_byte2 = param2;
          tn_output = tn_byte1 | tn_byte2;
          track_name(1 , 0 , tn_output);      
         break;
         case  0x23:
          tn_byte2 = param2;
          tn_output = tn_byte1 | tn_byte2;
          track_name(2 , 0 , tn_output);
         break;
         case  0x24:
          tn_byte2 = param2;
          tn_output = tn_byte1 | tn_byte2;
          track_name(3 , 0 , tn_output);
         break;
         case  0x25:
          tn_byte2 = param2;
          tn_output = tn_byte1 | tn_byte2;
          track_name(4 , 0 , tn_output);
         break;
         case  0x27:
          tn_byte2 = param2;
          tn_output = tn_byte1 | tn_byte2;
          track_name(5 , 0 , tn_output);
         break;
         case  0x28:
          tn_byte2 = param2;
          tn_output = tn_byte1 | tn_byte2;
          track_name(6 , 0 , tn_output);
         break;
         case  0x29:
          tn_byte2 = param2;
          tn_output = tn_byte1 | tn_byte2;
          track_name(7 , 0 , tn_output);
         break;
          
        }
    
    }
    
    }
    
    void track_name(byte lcd_col, byte lcd_row, byte lcd_data){
      
          lcd.setCursor(lcd_col , lcd_row);
          lcd.print(lcd_data); 
      
      
    }
    enjoy

    Here is the post about the board itself and the spec im aiming to achieve...

    * Arduino based design using ATMega168 (or 328) with on-board MIDI I/O port
    * 48 Analogue / Digital inputs or outputs (6 ports with 8 pins, each can be either I or O) by use of on-board multiplexers
    * Built-in twin 8-LED bargraph VU meter, controlled by MIDI CC
    * 8x2 (or 16x2 if you want) LCD display
    * Menu system allows for changes without reprogramming, so Arduino is optional, the MIDI config can be changed with the LCD menu
    * Supports the display of Traktor track name, artist and time on the LCD display (Uses/hijacks the data Traktor sends out for the Denon HC4500 LCD display)

    There is no built-in FTDI chip like there is with the Arduino boards however there is a connector for an FTDI programmer, I use the Modern Device USB-BUB, http://shop.moderndevice.com/products/usb-bub, the little red board shown in my picture below

    Im keen to get some feedback about whether peeps are interested in this kind of product aimed specifically at Traktor or Ableton. This is only a prototype board meant for testing all the features, so it looks a bit of a mess! Please excuse rubbish mobile phone camera pictures too!





    I have submitted a feature request for Traktor to send track load and track unload messages:

    TP-11697 Please implement metadata notifications on LOAD and UNLOAD

    If this data can be pulled some other way by modifying my TKS4 mapping to send track info over Midi or otherwise to Ableton this would suffice. Here is my project.

    If this can be accomplished without adding work to the NI queue or changing Traktor in any way I would love to try it. I am going to check out your work and see if I can utilize it.

    Thanks.

  2. #52
    Tech Guru the_bastet's Avatar
    Join Date
    May 2012
    Location
    Cincinnati, OH
    Posts
    2,765

    Default

    I would love to do something like this with the browsers in both Traktor and Serato.
    - Equipment - 2X Technics 1200, 2X Audio Technica ATLP1240, 2X XDJ700, 2X XDJ1000 MK2, Denon DNX-1100, Mixars DUO, DJM750 MK2, NI Audio 10, NI Aduio 4, Serato SL3, 4X Shure M44-7, 2X Ortofon Pro S, 2X Numark Groove Tool, Maschine MK3, Samson Carbon 49, Roland SE-02, Novation Launchcontrol, TouchOSC, Nocation Peak, Arturia MiniBrute, Korg Volca Kick, MicroKorg (Classic), NI Komplete Audio 6

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

    Default

    seems like this should be easier now that we have the S8 - has anyone ever tried sniffing / reverse engineering the communication protocol?

  4. #54

    Default

    Yes, I'm working on a QML file (QML files hold all the logic for the S8, S5 and D2) that sends track information to a Node.js server, after which you can display it on a webpage or send it somewhere else. It still needs some work though to get it 100% reliable.

  5. #55
    Newbie
    Join Date
    Apr 2018
    Location
    Germany
    Posts
    1

    Default

    first of all:

    great ideas and great work so far!
    I'm working on a similar project to get my old broken cdj 800 back to life, ready for midi and with a little extra things that could be displayed on a display. The ATmega168 could be a bit small for that, but an STM32 M3 or M4 could work...
    I was wondering which information I can get from Traktor in general. Maybe we could get the Waveform information through usb (maybe it has to be an HID-based controller instead if MIDI?)

    what do you guys think?

Page 6 of 6 FirstFirst ... 23456

Posting Permissions

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