g0orx / pihpsdr

Raspberry Pi standalone code for HPSDR (Protocol 1 and Protocol 2)
GNU General Public License v2.0
105 stars 73 forks source link

MIDI controller jog wheel doesn't match what Step is set to #157

Open madpsy opened 2 years ago

madpsy commented 2 years ago

I can't see what I'm doing wrong but quite possible I'm being silly. Do note this controller works perfectly with SDR Console.

When my MIDI controller's jog wheel is turned the minimum step is 63Hz even when the step is set to 1Hz in the Step menu. If you increase the Step it seems to track this '63' number by orders of magnitude.

Settings file:

midi[25].channels=1 midi[25].channel[0].action=VFO A midi[25].channel[0].type=WHEEL midi[25].channel[0].onoff=1 midi[25].channel[0].event=CTRL midi[25].channel[0]=0

Where is this '63' number coming from? It's quite annoying as it means the frequency never lands on anything useful.

aseqdump output:

Clockwise: 20:0 Control change 0, controller 25, value 1

Anti-clockwise: 20:0 Control change 0, controller 25, value 127

(Another issue is this particular jog wheel seems to reverse the direction of change, so clockwise decreases frequency - would be nice to have a reverse toggle for that. SDR Console doesn't have this issue.)

dl1ycf commented 2 years ago

Most MIDI "wheels" report 63 for one sense of rotation, and 65 for the other, and values <63 and values >65 if you rotate fast. Your controller reports 1 and 127. In this version of pihpsdr the number of VFO steps to go up or down is hard-coded as "value - 64", so you get steps of -63 and +63 times the VFO step size. There is a better interface (see github/dl1ycf) and John and I are currently in the process of merging this. For the time being, look at midi2.c and locate the code

                    // translate value to direction
                    new=0;
                    new=val-64;

and change the lst line to

new = (value < 64) ? 1 : -1;

and you have what you want.