Emulate The Traktor Kontrol F1 - finished!
Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1
    Tech Wizard
    Join Date
    Jun 2011
    Posts
    41

    Default Emulate The Traktor Kontrol F1 - finished!

    Get the code: https://github.com/tunecrew/emulate-the-f1

    Read the details: http://www.tunecrew.com/category/emulate-the-f1/

    There is a basic sketch that lets you use an M-Audio Trigger Finger to control deck 3 in Traktor as a Remix Deck. The pads map to the cells as expected and the knobs map to gain and filter. It is still rough though but it works and it illustrates how you send commands to the remix decks.

    This project has a couple pros and cons when it comes to controlling the remix decks:

    Pro - you don't need to do any mappings in Traktor
    Pro - there are no latency issues from either MIDI or Traktor mappings
    Pro - using Arduino sketches you can programme any behaviour you'd like, e.g. play a whole row of cells at once, etc., including possibly things that are not doable with mappings in Traktor
    Pro - using Arduino sketches you can easily build custom hardware controllers and map these to the remix decks, ala MIDI Fighter Twister
    Con - it requires an extra piece of hardware or two(the Arduino board and a MIDI shield)
    Con - doesn't receive output from Traktor to light up LEDs (yet)

  2. #2
    Tech Mentor
    Join Date
    Sep 2013
    Posts
    159

    Default

    Round of applause Tunecrew :-) I was going to take a look at that after I'd finished my mega midifighter :-D

    Any reason you chose the Uno over say, a teensy 2.0? Native hid with the teensyduino software.

  3. #3
    Tech Wizard
    Join Date
    Jun 2011
    Posts
    41

    Default

    Quote Originally Posted by ReggieUK View Post
    Round of applause Tunecrew :-) I was going to take a look at that after I'd finished my mega midifighter :-D

    Any reason you chose the Uno over say, a teensy 2.0? Native hid with the teensyduino software.
    thanx!

    yes there is a specific reason - with the Leonardo (and the Teensy I think) the USB emulation is in software on the main processor, so I think this makes loading Arduino sketches harder after you've loaded the emulation firmware. What I am doing is flashing the USB chip (ATmega16u2 in this case) to emulate the F1, then loading sketches in a standard way with an ISP onto the main processor.

    But I could be wrong - it is possible just as easy on the single chip boards like the Teensy, etc.

  4. #4
    Tech Mentor
    Join Date
    Sep 2013
    Posts
    159

    Default

    I need to double check on the HID stuff on the leonardo but I've just adapted midi serial code to usb midi to work on the arduino leonardo, that is using a midi-usb firmware, are you aware that the midifighter uses a single atmega chip? 16u2 I think it is but the code will work on a 32u2, 32u4 etc.

    The leonardo doesn't come with native usb midi support, you have to add a 'core' to the arduino ide called 'Arcore', this allows you just write your program directly in the arduino IDE using USBMidi.noteon(xx,yy,zz); style calls and upload from there too :-) I *think* it's got HID support in the arcore code.

    I'll look into this a bit more but all of the teensy boards can be programmed directly from the arduino 1.0.5 IDE using teensyduino, you get a bunch of extra option in the tools menu, with the main one being 'USB Type', for the teensy 2.0, this gives you 8 options:
    Serial
    Keyboard + mouse + joystick
    Serial + keyboard + mouse + joystick
    Disk(internal) + keyboard
    Disk(external) + keyboard
    Midi
    Raw HID
    Flight Sim Controls

  5. #5
    Tech Wizard
    Join Date
    Jun 2011
    Posts
    41

    Default

    Quote Originally Posted by ReggieUK View Post
    I need to double check on the HID stuff on the leonardo but I've just adapted midi serial code to usb midi to work on the arduino leonardo, that is using a midi-usb firmware, are you aware that the midifighter uses a single atmega chip? 16u2 I think it is but the code will work on a 32u2, 32u4 etc.

    The leonardo doesn't come with native usb midi support, you have to add a 'core' to the arduino ide called 'Arcore', this allows you just write your program directly in the arduino IDE using USBMidi.noteon(xx,yy,zz); style calls and upload from there too :-) I *think* it's got HID support in the arcore code.

    I'll look into this a bit more but all of the teensy boards can be programmed directly from the arduino 1.0.5 IDE using teensyduino, you get a bunch of extra option in the tools menu, with the main one being 'USB Type', for the teensy 2.0, this gives you 8 options:
    Serial
    Keyboard + mouse + joystick
    Serial + keyboard + mouse + joystick
    Disk(internal) + keyboard
    Disk(external) + keyboard
    Midi
    Raw HID
    Flight Sim Controls
    like I said you could be very correct!

    what happens to the bootloader on those boards when you change the USB type? can you still load sketches over USB or do you need an ISP?

  6. #6
    Tech Mentor
    Join Date
    Sep 2013
    Posts
    159

    Default

    I've just noticed you're using an external midi unit to provide the controls and then using the uno to recieve that midi and convert it to HID, I wondered how you were getting all those inputs from an uno :-D

    I wasn't going to do that, i was just going to look at adding a couple of port expanders and doing it all on the leonardo, clearly something like a mega would be most suitable though as it doesn't require any extra hardware, it does have the issue though that it needs moco lufa but from what I've been reading, you simply need to jumper a pair of pins to be able to swap it from programming mode to HID mode.

  7. #7
    Tech Wizard
    Join Date
    Jun 2011
    Posts
    41

    Default

    Quote Originally Posted by ReggieUK View Post
    I've just noticed you're using an external midi unit to provide the controls and then using the uno to recieve that midi and convert it to HID, I wondered how you were getting all those inputs from an uno :-D

    I wasn't going to do that, i was just going to look at adding a couple of port expanders and doing it all on the leonardo, clearly something like a mega would be most suitable though as it doesn't require any extra hardware, it does have the issue though that it needs moco lufa but from what I've been reading, you simply need to jumper a pair of pins to be able to swap it from programming mode to HID mode.
    the MIDI shield is "dumb" - it is really just an opto isolator

    in theory the input doesn't have to be MIDI - it could be anything - switches, pots, etc.

    why don't you fork the code on github and try it on the teensy or leonardo? if it works we can roll it back into the master

  8. #8
    Tech Mentor
    Join Date
    Sep 2013
    Posts
    159

    Default

    I haven't had to touch the bootloader at all, it stays the same, when you turn it on/reset it, it goes into bootloader mode, once it realises nothing is trying to program it, it switches itself into midi-usb mode, whilst also retaining the usb-serial connection so it can still be programmed.

    I have been using it to write usb midi controller code, I started from someone's code on an instructable which was basically cloning the midi fighter for arduino uno etc. I adapted it to work with the leonardo + arcore, I've now improved it to do loads of stuff, I cleaned up all the analog input code, added rotary encoders, added RGB addressable LED support which light up via midi, added the ability to change the colours via midi note + velocity on 'spare' channels and also added the ability to save custom colours to eeprom. Oh, I also added rudimentary midi thru support too.

    The leonardo + arcore is incredibly versatile, all of that fits in about 8kb of code, in theory, it should support up to 128 inputs.

  9. #9
    Tech Mentor
    Join Date
    Sep 2013
    Posts
    159

    Default

    Ha, you read my mind, I forked it about 10 minutes ago :-D

  10. #10
    Tech Mentor
    Join Date
    Sep 2013
    Posts
    159

    Default

    I'm not entirely sure how it would work directly on a leonardo or teensy 2.0 at this moment with the way it is, I take it the emulator library is expecting hid information via serial from this line in the example sketch?

    // send HID message
    Serial.write(report, 22);


    if so that might need adapting depending on the board, for teensyduino at least, you can write the HID code directly in the main program, no need to send it out of the serial at all.

    https://github.com/rkistner/arcore

    That's the 'core' that makes it happen on an arudino leonardo, I've adapted the code slightly so can send note on/note off/CC messages instead of 3 raw bytes for the midi, I haven't checked the HID side of things yet but the author is active.

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

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