{"id":95,"date":"2017-02-13T15:06:22","date_gmt":"2017-02-13T15:06:22","guid":{"rendered":"http:\/\/w2pa.net\/SDR\/?p=95"},"modified":"2017-02-13T15:52:46","modified_gmt":"2017-02-13T15:52:46","slug":"using-the-behringer-cmd-pl-1-controller-with-powersdr-openhpsdr-mrx-ps","status":"publish","type":"post","link":"http:\/\/w2pa.net\/SDR\/2017\/02\/13\/using-the-behringer-cmd-pl-1-controller-with-powersdr-openhpsdr-mrx-ps\/","title":{"rendered":"Using the Behringer CMD PL-1 controller with PowerSDR OpenHPSDR mRX PS"},"content":{"rendered":"<p>The first thing of any complexity that I tried to do with the source code for PowerSDR OpenHPSDR mRX PS (hereafter referred to as Px) was to try getting my PL-1 controller to work properly.\u00a0 Although M0YGG&#8217;s code works quite well with the Hercules controllers, and recognizes the PL-1 and can map its buttons quite well, it doesn&#8217;t work with the main wheel or the knobs, because of what it&#8217;s expecting about their behavior &#8211; i.e. that they behave like the similar things on the Hercules. Let me explain:<\/p>\n<p>The knobs on the Behringer CMD PL-1 behave like wheels more than how Px is expecting knobs to behave, i.e. with limits and values, like a slider. That&#8217;s why Px lumps knobs and sliders together.<\/p>\n<p>I changed the code to treat certain functions as wheels instead of knobs, and rewrote the handler code for those functions to properly process the code coming from the PL-1. When you turn a knob, it sends a value of 65 for clockwise and 63 for counterclockwise rotation.<\/p>\n<p>To make this change, two code changes are necessary:<br \/>\n1) In CatCmdDb.cs, change the desired command from ControlType.Knob_or_Slider, to ControlType.Wheel<br \/>\n2) In Midi2CatCommands.cs, modify the code handler for the corresponding command to do the right thing. In the case of the PL-1 wheels, this means increment the current value if rotating cw and decrement if ccw.<\/p>\n<p>You have to make these changes for each Px function you want to map to a knob which is really a mini-wheel. The function then becomes unavailable for mapping to a slider or a normal knob (which the PL-1 doesn&#8217;t have anyway). The result is that the mappings won&#8217;t work exactly for other controllers, particularly the Hercules.\u00a0 Perhaps later I&#8217;ll work on segmenting the code so it applies the right function for the controller being used.\u00a0 But right now my aim is to get the Behringer going.<\/p>\n<p>I also changed the behavior of the VFOA and B tuning so that the main large wheel on the PL-1 behaves correctly, and increments\/decrements the frequency in whatever step amount is set by the user.\u00a0 Px was already expecting a wheel-type of control device, but the data values being sent from the PL-1 aren&#8217;t the same as those from the Hercules &#8211; so I had to change that one too. Instead of triggering on 127 or 1, it now triggers on values less than 64 for counterclockwise rotation, and greater than 64 for clockwise.\u00a0 I limit the upper bound to roughly 40 below or above each value so that the code will ignore it when you touch the top surface of the PL-1&#8217;s big wheel, which is touch sensitive, and reports 127\/0 for touch\/untouch. (Maybe I&#8217;ll discover a use for this at some point.)\u00a0 At the moment there is no sensitivity to rotational speed.<\/p>\n<h4>Mapping<\/h4>\n<p>To map the Main wheel to tuning:<\/p>\n<ol>\n<li>Go thru the normal MIDI setup to map the big wheel, by rotating it in both directions &#8211; but be careful: Do not touch the top surface at all since doing so make it send a 127\/0 value as you touch and un-touch it, and screws up the max\/min values. Carefully rotate the wheel from its edge both up and down a bit. Don&#8217;t try to go very fast, just go fast enough for the min\/max values to get below, say, 64, and above, say, 67.<\/li>\n<li>Map the control to &#8220;Change Freq Vfo A&#8221;<\/li>\n<li>Save.<\/li>\n<li>NOTE: whenever you go back into MIDI setup, avoid touching the big knob&#8217;s top surface.\u00a0 That will trigger the 127\/0 values and mess up your setting, even if you click &#8220;Back&#8221; when it presents the setup window.\u00a0 You&#8217;ll have to delete the mapping and do it again.<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<p>To map the small knobs:<\/p>\n<ol>\n<li>In MIDI setup, rotate the knob you want as usual, making sure to rotate in both directions.\u00a0 The min should be 63 and the max, 65.<\/li>\n<li>Choose Wheel as the type of control<\/li>\n<li>Save<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<p>Thus far, I made this change for these controls, which now can be mapped to a PL-1 knob &#8220;wheel&#8221;:<\/p>\n<p>RX1 AF gain &#8211; also VFOA AF gain<br \/>\nRX2 AF gain &#8211; also VFOB AF gain<br \/>\nRIT (only works when on)<br \/>\nXIT (works whether on or off &#8211; need to look at this later, the code seems to be different)<br \/>\npush\/clicking the RIT and XIT knobs zeros them<\/p>\n<p>After each running of Px, MIDI mappings are stored by default in &#8230;\/AppData\/Roaming\/FlexRadio Systems\/PowerSDR mrx PS\/midi2cat.xml<\/p>\n<p>In the source code, the CAT command ID numbers are mapped to their descriptions also in CatCmdDb.cs, where the control type is specified as above in step #1.<\/p>\n<p>73, de W2PA<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The first thing of any complexity that I tried to do with the source code for PowerSDR OpenHPSDR mRX PS (hereafter referred to as Px) was to try getting my PL-1 controller to work properly.\u00a0 Although M0YGG&#8217;s code works quite <span class=\"excerpt-dots\">&hellip;<\/span> <a class=\"more-link\" href=\"http:\/\/w2pa.net\/SDR\/2017\/02\/13\/using-the-behringer-cmd-pl-1-controller-with-powersdr-openhpsdr-mrx-ps\/\"><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-95","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\/95","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=95"}],"version-history":[{"count":5,"href":"http:\/\/w2pa.net\/SDR\/wp-json\/wp\/v2\/posts\/95\/revisions"}],"predecessor-version":[{"id":107,"href":"http:\/\/w2pa.net\/SDR\/wp-json\/wp\/v2\/posts\/95\/revisions\/107"}],"wp:attachment":[{"href":"http:\/\/w2pa.net\/SDR\/wp-json\/wp\/v2\/media?parent=95"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/w2pa.net\/SDR\/wp-json\/wp\/v2\/categories?post=95"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/w2pa.net\/SDR\/wp-json\/wp\/v2\/tags?post=95"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}