Quick Sign In:  

Forum: VirtualDJ Technical Support

Topic: Building a custom effect controller using USB MIDI and the Teensy 4.0
Hello people,

for a while now I've been tinkering with the Teensy 4.0 to use as a custom USB MIDI controller with Virtual DJ using potentiometers, OLED displays, RGB LEDs and a bunch of buttons and knobs. I want to encourage everyone with a passion for music to be expand their knowledge with electronics, microcontrollers and MIDI to build the tools for a better DJ set. Since it has taken me a very long time to even figure out how to turn one knob in Virtual DJ with a pot connected to my Teensy, heres a quick rundown on how to get your Teensy up and running:

1. Upload the AnalogControlChange example found in Examples>Teensy>USB_MIDI>AnalogControlChange in the Arduino IDE
2. Set the USB Type to "MIDI"
3. Connect your potentiometer to the Teensys A0 pin (pin 14)
4. Configure Virtual DJ as described in the Controller developers guide (http://www.virtualdj.com/wiki/Controller%20Developers.html) using two new files:

- Go to Documents>VirtualDJ>Devices and create a new .xml file (it MUST be an .xml file) with the following content, the files name does'nt matter:
<device name="Teensy MIDI" author="Fabian" description="Teensy MIDI controller" version="850" decks="1" singledeck="yes" motor="no" type="MIDI" vid="0x16C0" pid="0x0485">
<slider cc="0x0A" name="FILTER" deck="1"/>
</device>
More information on how to set up this device file can be found here: http://www.virtualdj.com/wiki/ControllerDefinitionMIDIv8.html
It is CRUTIAL to give every input slider/knob/whatever an unique name. Uppon plugging your Teensy in and starting VirtualDJ you should now be greeted with a new message, saying it has detected a new controller.

- Now go to Documents>VirtualDJ>Mappers where you might find a mapping file already after starting VDJ. If not paste in the following contents to assign the knob FILTER to the filter of deck 1.
<mapper device="Teensy MIDI" version="850" date="2021-10-29">
<map value="FILTER" action="deck 1 filter" />
</mapper>

Now I know that this is a pretty simple function, but for me a proof of concept. I am to expand to to the whole effect section soon, including an effect selector switch, display of current BPM, effect and other variables, knobs for sub parameters and more. This also requires VDJ to send MIDI data to the Teensy, the Teensy interpreting and displaying it correctly.

If the interest is there feel free to leave feedback/comments/suggestions and of course questions in this thread, I am happy to help others along.

Greetings, Fabian
 

Posted Fri 29 Oct 21 @ 3:38 pm
locodogPRO InfinityModeratorMember since 2013
good going,I like a DIY, you might have some fun [better dial resolution than midi] with HID look up the many axis joystick on the teensy forum
 

Posted Fri 29 Oct 21 @ 5:10 pm
Good point actually, did not know about this. I will look into that very shortly
 

Posted Fri 29 Oct 21 @ 5:22 pm