Connexion rapide:  

Forum: VirtualDJ Technical Support

Sujet Teensy MIDI custom controller no response during/after track plays

Ce topic est ancien et peut contenir des informations obselètes ou incorrectes.

K0mixPRO InfinityMember since 2012
K0mix wrote :
I am creating a custom MIDI controller using a Teensy 3.2. I am testing a single slide potentiometer (fader) mapped to the LEVEL on Deck 1.

The LEVEL slider on VDJ responds perfectly to the fader when VDJ is first opened and no audio is playing. I can load a track onto Deck 1 with no issue. However, when I then play this track (triggered via the UI or keyboard spacebar), the LEVEL slider immediately stops responding to my fader. I can still move it using a mouse on the UI though.
It will not respond again until I stop the track, unplug the Teensy from USB and plug it back in again.
If I do not stop the audio and unplug/replug the Teensy, the slider will respond for a brief moment (1 second perhaps) before stopping.
Using Arduino debug, I can see that the Teensy is still responding and creating valid MIDI messages.
The Teensy is not showing any messages in miditrace at any point.

Mapping file:
<?xml version="1.0" encoding="UTF-8"?>
<mapper device="Teensy MIDI" version="802" date="2018-04-21">
<map value="Slide01" action="level" />
</mapper>

Definition file:
<device name="Teensy MIDI" author="TS" description="Teensy MIDI JogWhlPWM01" version="800" type="MIDI" singledeck="yes" padColumns="1" padRows="1" padSides="1" motor="no" decks="1" drivername="Teensy MIDI" vid="0x16C0
" pid="0x0485">
<slider cc="0x14" name="Slide01" deck="1" channel="0" />
</device>

VirtualDJ v8.2 b4204, Windows 10, Infinity Pro license


 

Posté Sat 21 Apr 18 @ 5:23 am
If MIDITrace (Or MIDI OX or any other MIDI monitor tool) can't read data from your device, neither VirtualDJ will be able to.
Therefore you must first ensure that your device keeps sending MIDI data properly.

Your definition and mapper files seem correct. Therefore I suspect that there's something on your arduino build.

PS: You're using PID/VID for detection of the device. Are you sure these are unique to your controller ?
Try to remove VID/PID in case another defined device uses the same VID/PID and check again (but still MIDITrace should show incoming data from your controller)
 

Posté Sat 21 Apr 18 @ 8:51 am
K0mixPRO InfinityMember since 2012
PhantomDeejay, you're right it was an issue with my code. I failed to specify that the Teensy should ignore all MIDI messages that it receives.
Presumably VDJ sends messages when controls are moved or a track is playing, and this caused some sort of logjam for the Teensy (even though it was still printing serial data fine which is how I knew it was still running).

Anyway for anyone else interested, the fix was to add this at the end of the loop:
while (usbMIDI.read()) {}

Thanks very much!
 

Posté Sun 22 Apr 18 @ 4:41 am
K0mixPRO InfinityMember since 2012
Backing up what I thought, here's the official line from PJRC:

"MIDI controllers which only transmit data should be designed to read and ignore all incoming messages. If MIDI-OX or similar software is sending messages to Teensy, this simple code will prevent problems with USB buffers filling up with never-read messages.

// MIDI Controllers should discard incoming MIDI messages.
while (usbMIDI.read()) {
// read & ignore incoming messages
} "
https://www.pjrc.com/teensy/td_midi.html
 

Posté Sun 22 Apr 18 @ 5:19 am


(Les anciens sujets et forums sont automatiquement fermés)