blaxpot / traktor-s4-mk1-midify

Get MIDI signals from a Traktor S4 DJ controller under linux
MIT License
10 stars 2 forks source link

Jog wheels not working #1

Closed j4ckp0t85 closed 1 year ago

j4ckp0t85 commented 1 year ago

Hello, i have tried to run mixxx using a prepared image for raspberry 4.

Long short story: i am able to use your software and i see the device on mixxx configuration.

For midi mapping i have tried the file posted on mixxx forum here

I can use volume, cross fade and play buttons plus some other buttons, but the jog wheels and shift button doesn't work.

Is it normal? Have you done some improvement?

blaxpot commented 1 year ago

I haven't yet implemented anything to send MIDI messages for the jog wheels. You can, however, see the events being received from the snd-usb-caiaq kernel module using traktor-s4-mk1-print-events. Here's some sample output:

# traktor-s4-mk1-print-events | grep 'code 52\|code 53'
...
event at 1666586086.493500, code 52, type 03, val 1004
event at 1666586086.493500, code 53, type 03, val 244
event at 1666586086.502095, code 52, type 03, val 1005
event at 1666586086.502095, code 53, type 03, val 244
event at 1666586086.534987, code 52, type 03, val 1006
event at 1666586086.534987, code 53, type 03, val 244
event at 1666586086.572279, code 52, type 03, val 1007
event at 1666586086.572279, code 53, type 03, val 244
event at 1666586086.594272, code 52, type 03, val 1008
event at 1666586086.594272, code 53, type 03, val 244
event at 1666586086.652746, code 52, type 03, val 1009
event at 1666586086.652746, code 53, type 03, val 244
event at 1666586086.683609, code 52, type 03, val 1010
event at 1666586086.683609, code 53, type 03, val 244
event at 1666586093.146407, code 52, type 03, val 1010
event at 1666586093.146407, code 53, type 03, val 245
event at 1666586093.243735, code 52, type 03, val 1010
event at 1666586093.243735, code 53, type 03, val 246
event at 1666586093.354742, code 52, type 03, val 1010
event at 1666586093.354742, code 53, type 03, val 245
...

I'll need to add logic to handle these events for the jog wheels to work. Likewise for the other rotary encoders (e.g. the gain/loop/browse knobs) and the pressure sensitive plates on top of the jog wheels.

j4ckp0t85 commented 1 year ago

I'm not that much in atm to contribute on this, but it would be cool to (at least) map all the control except leds and minimize all the setup with a raspberry, a tiny touch screen and an audio card

blaxpot commented 1 year ago

I've had a look into this a bit more. I think it will be best to convert the absolute position values for the jog wheels to relative values somehow inside traktor-s4-mk1-midify, since it seems that the Windows / macOS MIDI drivers do this.

It also seems that this will be the easiest way to get the jog wheels to behave in a way that most people will expect. There's a bit of info on the topic in the MIDI scripting section of the Mixxx wiki.

I'll verify by setting up a Windows machine to test before proceeding, but hopefully I can find the time to do this sometime this week.

j4ckp0t85 commented 1 year ago

Great. For me it's mostly important for pitch bending stuff and move to beat of interest for manual cueing.

Djing enabling sync is not an option :)

The second most important feature i miss are bass, low and mid channel knobs. Filter knobs too would be great.

I have mostly no experience on python, anyway if i recon correctly your script you have to populate mappings on the alsa address to midi id map (at least for for some of the controls) since if it's not mapped the script interrupt the execution. (from line 54)

The question is how you obtain the midi numeric id value from the code. The address is already known as of csv

blaxpot commented 1 year ago

Jog wheels are functional in v0.1.0.