{"id":118,"date":"2017-03-31T20:56:53","date_gmt":"2017-03-31T20:56:53","guid":{"rendered":"http:\/\/w2pa.net\/SDR\/?p=118"},"modified":"2017-09-10T13:09:19","modified_gmt":"2017-09-10T13:09:19","slug":"update-and-summary-of-pl-1-function","status":"publish","type":"post","link":"http:\/\/w2pa.net\/SDR\/2017\/03\/31\/update-and-summary-of-pl-1-function\/","title":{"rendered":"Update and Summary of PL-1 Function"},"content":{"rendered":"<p>After my ramblings about the code and discovering how to get the PL-1 working, I thought I ought to document some kind of summary. So here it is.<\/p>\n<p>Setting up the various controls work as before in Px (see previous posts &#8211; using &#8220;Px&#8221; saves me typing its long name).\u00a0 By that I mean that the MIDI setup dialog still works and you get a tab labeled properly as &#8220;CMD PL-1,&#8221; similar to how it works with the Hercules.\u00a0 The mapping procedure is mostly the same with the Behringer.<\/p>\n<h5>Main Wheel<\/h5>\n<p>The main wheel is big and very smooth turning, great as a main-tuning knob.\u00a0 You can set it to be, for example, a VFO &#8211; the most obvious mapping and probably the most useful.\u00a0 If you do, the code makes use of the wheel&#8217;s speed sensitivity to change tuning rate in three steps &#8211; slow, medium, and fast.\u00a0 It transitions through the speeds gradually as you turn faster.\u00a0 If you give it a good spin you&#8217;ll fly across the band, and if you turn it slowly you&#8217;ll fine-tune the radio using the step size defined elsewhere (mine is set to 10Hz).\u00a0 I&#8217;ve eliminated the wheel&#8217;s sensitivity to touching its top surface.\u00a0 It may be useful for something but I haven&#8217;t thought of anything yet.\u00a0 And besides, it&#8217;s always possible to touch the top surface accidentally while tuning, causing something else to happen inadvertently &#8211; so I&#8217;m guessing it&#8217;s probably not going to be useful for anything.<\/p>\n<p>To program the main wheel, go through MIDI setup as usual, spinning it clockwise and counterclockwise.\u00a0 The max\/min numbers won&#8217;t matter because to get the speed sensitivity, the code reads the all the reported values anyway and does the right thing.\u00a0 If you plan to use it for both VFOs, first program it for VFOA, then keep reading&#8230;<\/p>\n<p>There is a new CAT function I&#8217;ve added called &#8220;Toggle Wheel to VFOA\/VFOB.&#8221;\u00a0 You can map this to any of the buttons.\u00a0 It is used to toggle the main wheel&#8217;s function between controlling VFOA and VFOB. To set up this function properly you need to do it in a certain order:<\/p>\n<ol>\n<li>Map VFOA to the main wheel as above.<\/li>\n<li>Map a button of your choice to the &#8220;Toggle Wheel to VFOA\/VFOB&#8221; function.<\/li>\n<li>Save and exit MIDI Setup.<\/li>\n<li>Press the button you just mapped in step #2 once (and <strong>only<\/strong> once).<\/li>\n<li>Go back into MIDI setup.<\/li>\n<li>Map VFOB to the wheel, which behaves now as a different control than it did in step #1.<\/li>\n<li>Save and exit setup.<\/li>\n<li>Have fun.<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h5>Small Knobs<\/h5>\n<p>The knobs on the Behringer CMD PL-1 behave like wheels instead of knobs as Px defines them or is expecting knobs to behave, i.e. with limits and values, like a slider. That\u2019s why Px lumps knobs and sliders together.\u00a0 So when you program a PL-1 knob, you have to choose &#8220;Wheel&#8221; as the control type in the MIDI setup.\u00a0 You can map any knob to anything in the UI that makes sense.\u00a0 That is, it can be used to control anything that has a value that changes continuously.<\/p>\n<p>In addition, I&#8217;ve written code that activates the LEDs around each knob as you rotate them, roughly as a percentage of the specific function&#8217;s minimum and maximum values.\u00a0 At the time I&#8217;m writing now, this feature works for AF gains, AGC gains, and RIT\/XIT.\u00a0 I can add others if needed.<\/p>\n<p>For RIT\/XIT there are additional behaviors.\u00a0 First, the center (midpoint) LED lights only when the RIT\/XIT is exactly zero.\u00a0 Then the counterclockwise and clockwise ones light depending on how much you turn the knob.\u00a0 Despite the wide range of settings in PowerSDR, I chose to limit the LEDs to only indicate a maximum of plus or minus 2kHz. I found that if I took in a wider range, they changed too slowly to have any meaning.\u00a0 Note: you can still keep cranking the knob and go well beyond 2kHz all you like &#8211; but the LEDs will hit their maximum and minimum at 2kHz or slightly less.<\/p>\n<p>For most of the mappings of knobs to UI slider controls, the LEDs also work in the reverse direction. For example, if you map a PL-1 knob to the RX1 AF Gain, then slide the on-screen RX1 AF slider in the user interface, the LEDs will change just like you were turning the PL-1 knob.<\/p>\n<p>The second feature of these knobs is that they act as buttons when you push down on them.\u00a0 So you can map them as buttons.\u00a0 But I&#8217;ve implemented code that detects when you push them to zero the RIT\/XIT.\u00a0 This seems more useful than on\/off, which you can map to any other button you like.<\/p>\n<h5><img loading=\"lazy\" decoding=\"async\" class=\"alignright wp-image-170 size-full\" src=\"http:\/\/w2pa.net\/SDR\/wp-content\/uploads\/2017\/04\/DSC_0006-e1492302021888.jpg\" alt=\"\" width=\"600\" height=\"900\" \/>Buttons<\/h5>\n<p>The PL-1 buttons have fairly standard behavior &#8211; they produce messages going down and going up.\u00a0 You map them just like with any other controller.<\/p>\n<p>They are capable of changing to one other color than their default orange. So, you can add messages to M0YGG&#8217;s already existing MIDI setup dialog to make them do what you want.\u00a0 For the PL-1, you just need to send back the message as received, but change the &#8220;value&#8221; part of the message to a number, depending on what you want the button&#8217;s LED to do.\u00a0 For default orange, send 0 (0x00); for the alternate color, send 1 (0x01), and to have it alternate or flash between the two, send 2 (0x02).<\/p>\n<p>The buttons all have only one alternate color: CUE can be pink\/purple, Play\/Pause can be green, and all the others can be blue.\u00a0 I added a section in the code to change some of them to their alternate color on startup.\u00a0 I think it looks cooler than all orange.\u00a0 I may make this customizable later.\u00a0 For now, you can use the built-in messaging (as above) to change color however you like.<\/p>\n<p>As an example, I have my &#8220;SCRATCH&#8221; button mapped to toggle between VFOs.\u00a0 In MIDI setup, I entered a message to turn it blue for VFOA and orange for VFOB.<\/p>\n<h5>Slider<\/h5>\n<p>The PL-1&#8217;s slider can be mapped in setup as a &#8220;knob or slider.&#8221;\u00a0 I had to do some interception of its messages because its control ID changes (something none of the other controls do).\u00a0 Now it works fine and the change in control ID is transparent to the user (although you might notice I chose to use &#8220;73&#8221; &#8211; 0x49 &#8211; as the code).\u00a0 When you map it to an existing slider in the UI, the LEDs follow the slider&#8217;s movement.\u00a0 The one bit of quirkiness comes about because there is, of course, no way to move that slider under program control.\u00a0 Thus, if you change the slider in the UI, the LEDs will change and become out-of-sync with the actual slider, until you move it yourself.\u00a0 When you do, its value will jump instantly to its actual physical setting.<\/p>\n<p>Notice that the knobs don&#8217;t have this problem.\u00a0 Since the knobs have no absolute position (they just freely turn), there is no direct correspondence between knob position and value or UI slider position, and so the qurkiness described above for the PL-1 slider&#8217;s LEDs isn&#8217;t an issue with the knobs.<\/p>\n<h5>Multiple Controllers<\/h5>\n<p>M0YGG&#8217;s original code nicely handles multiple controllers.\u00a0 The changes I made to handle the PL-1 have their effect only for the PL-1.\u00a0 So programming the Hercules, for example, should be unaffected.\u00a0 In fact, you can use both connected at the same time.\u00a0 This hasn&#8217;t been thoroughly tested but W1JA, who has one of each, has verified that both work together.<\/p>\n<p><span style=\"font-size: 10pt;\">de W2PA<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>After my ramblings about the code and discovering how to get the PL-1 working, I thought I ought to document some kind of summary. So here it is. Setting up the various controls work as before in Px (see previous <span class=\"excerpt-dots\">&hellip;<\/span> <a class=\"more-link\" href=\"http:\/\/w2pa.net\/SDR\/2017\/03\/31\/update-and-summary-of-pl-1-function\/\"><span class=\"more-msg\">Continue reading &rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,10],"tags":[],"class_list":["post-118","post","type-post","status-publish","format-standard","hentry","category-midi-controllers","category-powersdr"],"_links":{"self":[{"href":"http:\/\/w2pa.net\/SDR\/wp-json\/wp\/v2\/posts\/118","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/w2pa.net\/SDR\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/w2pa.net\/SDR\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/w2pa.net\/SDR\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/w2pa.net\/SDR\/wp-json\/wp\/v2\/comments?post=118"}],"version-history":[{"count":10,"href":"http:\/\/w2pa.net\/SDR\/wp-json\/wp\/v2\/posts\/118\/revisions"}],"predecessor-version":[{"id":172,"href":"http:\/\/w2pa.net\/SDR\/wp-json\/wp\/v2\/posts\/118\/revisions\/172"}],"wp:attachment":[{"href":"http:\/\/w2pa.net\/SDR\/wp-json\/wp\/v2\/media?parent=118"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/w2pa.net\/SDR\/wp-json\/wp\/v2\/categories?post=118"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/w2pa.net\/SDR\/wp-json\/wp\/v2\/tags?post=118"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}