Welcome to the new FlexRadio Community! Please review the new Community Rules and other important new Community information on the Message Board.
If you are having a problem, please check the Help Center for known solutions.
Need technical support from FlexRadio? It's as simple as Creating a HelpDesk ticket.

Hercules MIDI with 6300

1356715

Comments

  • Ken - NM9PKen - NM9P Member ✭✭
    edited December 2016
    Last night I got things working, thanks. I have mapped out the layout on my Hercules DJControl MP3 LE, which is different from the Instinct, and will finish the programming Sunday afternoon, if all goes well.
  • W4WHLW4WHL Member
    edited July 2016
    did you get the VFO speed better?
  • W4WHLW4WHL Member
    edited July 2016
    New update.  Now pressing the Jog wheels down changes the step size.  Now you can tune across band fast.  Default step is 10hz, pressing either Jog wheel switches to 100hz, and pressing it again switches it back to 10hz.  A display was added to the main screen that shows active step

    image

    Updated code will be uploaded shortly

    William
  • W4WHLW4WHL Member
    edited July 2016
    Small update, I was constantly accidentally pushing down on the jog wheels so I moved the step buttons.


    image

    image
  • Ken - NM9PKen - NM9P Member ✭✭
    edited December 2016
    I have gotten almost everything working except the RIT/XIT and the PTT buttons.
    You are doing something on the PTT that I didn't quite catch, looks like it sends two different values, one on make and another on break.
    Your RIT controller is different, mine is a detented rotary knob, like on many 2 meter rigs.
    Yours seems to be a push lever.  I haven't traced down the different values to get them working yet, but I haven't run the utility program yet, either.

    My latest update is built upon your last file which includes changing the step size.
    I have found that with my controller I do not need the "slowdown" knob or routine, so I cut it out.

    I enhanced the CW speed with this little bit of math...

    if ((channel == 0) && (number == 58) && (value < 101)) {c.write("C44|cwx wpm "+(5+(value/3))+"
    ");}  

    By doing some math on the value reported by the control, I was able to reduce the span of the control from 5 WPM to 38 WPM, which is just about exactly where I wanted it.  As it was, it was too touchy and I didn't use about 2/3 of the range of the control.  I plan to do similar things with other controls as I need it.

    I have the whole control panel mapped out, with the exception of the RIT/XIT knobs.  I know what their number is, but not what values they send, yet.  But I will get it.
    I am confident that I will be able to completely customize the entire board with every function I wish.
    The more I look at your code, the more I am impressed with your work, and how easy this is, once we get over a few hurdles.  Thank you for leading the way!

    With that, I have a few basic questions:

    1) Which part of the code is the section you are using to display frequencies on the tuning dials?  My controller doesn't have any display, so I would like to cut it out.  I just don't want to cut out anything essential.

    2) Where did you get the lost of commands and addresses for the various functions for the flex API?  I haven't found a convenient list.

    3)  Is it possible on these controllers to control the various lights under the keys?  I would like to expand my controller to allow, for example, toggling RIT/XIT with a single button and turn the light on when active and off when inactive, or turning NB, ANF, NR, etc on and off with the light as feedback as to the state of the function.

    4)Would it be OK with you to link my version of this program with tutorial comments in this form and the PowerSDR-UI forum so the many people who have my particular controller can know they have this wonderful option for the 6000 Series?  (I don't want to steal any thunder from you and your efforts.)

    Thanks for your help.  This has been some of the most creative programming I have done in years.  It is very refreshing!

    Ken - NM9P
  • W4WHLW4WHL Member
    edited July 2016
    Sounds good, see my answers below.  It really is not hard to mod.  Once you have the basic idea, adding and changing becomes second nature.


    1) Which part of the code is the section you are using to display frequencies on the tuning dials?  My controller doesn't have any display, so I would like to cut it out.  I just don't want to cut out anything essential.


    It displays it on the APP window, but you can remove it if you wish. 

      fill(0);
      rect(95, 320, 100, 30);
      rect(310, 320, 100, 30);
      rect(510, 320, 100, 30); //This is for step display
      fill(255);
      textSize(14);
      text(nf(FreqA,1,5)+"0",107,338);
      text(nf(FreqB,1,5)+"0",535,338);
      text(" Step="+nf((Fstep*1000000),1,0)+"Hz",315,338);//This is for step display




    2) Where did you get the lost of commands and addresses for the various functions for the flex API?  I haven't found a convenient list.


    I just dug through the API files till I found what I needed.  Not exactly easy.  Look in the files for "sendcommand".  in void setup I run a command called "sub slice all".  This command subscribes to all slice related info.  So when a variable changes, it sends a string to the client.  Currently I only **** out the frequency for each slice.  But there is tons of info you can pull out.  However parsing strings is not very fun.  And too much can be a strain and slow down the program causing jittery controls.  I felt the only necessary info was the current frequency.


    3)  Is it possible on these controllers to control the various lights under the keys?  I would like to expand my controller to allow, for example, toggling RIT/XIT with a single button and turn the light on when active and off when inactive, or turning NB, ANF, NR, etc on and off with the light as feedback as to the state of the function.


    I have not found a way yet, But still looking.  If I find it I will let you know.


    for your controller the RIT /XIT uses encoders so you will want to slow it down a lot else it will ve very touch.  Start at 5 and adjust to you liking. Also adjust rit_freq+10 to your desired step size.

    if ((channel == 0) && (number == ??) && (value == 1)) { if (slowdown != 5) {slowdown=slowdown+1;} else {rit_freq=rit_freq+10;  c.write("C44|slice set 0 rit_freq="+rit_freq+"
    ");slowdown=0;}}
    if ((channel == 0) && (number == ??) && (value == 127)) { if (slowdown != 5) {slowdown=slowdown+1;} else {rit_freq=rit_freq-10;  c.write("C44|slice set 0 rit_freq="+rit_freq+"
    ");slowdown=0}
    if ((channel == 0) && (number == ??) && (value == 1)) { if (slowdown != 5) {slowdown=slowdown+1;} else {xit_freq=xit_freq+10;  c.write("C44|slice set 0 xit_freq="+xit_freq+"
    ");slowdown=0}
    if ((channel == 0) && (number == ??) && (value == 127)) { if (slowdown != 5) {slowdown=slowdown+1;} else {xit_freq=xit_freq-10;  c.write("C44|slice set 0 xit_freq="+xit_freq+"
    ");slowdown=0}


    If you want 1 button to toggle on and off, that is easy. something like this should toggle just fine;


    Under void setup

    int x=0;


    Under void noteOn;

    if ((channel == 0) && (pitch == ??))  {int x=x+1; if (x == 1) {c.write("C44|slice set 0 rit_on=1
    ");} else {c.write("c44|slice set 0 rit_on=0
    "); step = 0;}}




    4)Would it be OK with you to link my version of this program with tutorial comments in this form and the PowerSDR-UI forum so the many people who have my particular controller can know they have this wonderful option for the 6000 Series?  (I don't want to steal any thunder from you and your efforts.)


    Sure I don't care, but please through me some credit my way.



    William


    W4WHL


  • Ken - NM9PKen - NM9P Member ✭✭
    edited December 2016
    Thanks, William.
    As soon as I can master the RIT/XIT encoders, I am almost finished.

    I have already figured out a slightly better logic for changing modes by incrementing the counter and setting overrun values BEFORE the IF/THEN routines.  Also, it is possible to increment/decrement a counter simply by "COUNTER++" or "COUNTER--" instead of "COUNTER = COUNTER + 1" ,  etc.  This is a little cleaner in my book. 

    The math I added really smoothed out CW SPEED control.  I may apply this to other functions, too.

    When I find the commands in the API, I may try to add band up/down buttons, filter selection, or program a few function keys for favorite bands, using the shift function of the CWX send buttons.

    Then I hope to tackle some more complicated logic, such as using a single button to toggle RIT or XIT on and off instead of needing two buttons each.  This will free a couple of other buttons.  Then refining the tuning speed selections so that moving from 10 to 100 tuning speed doesn't leave me with hanging numbers, but that everything tunes on even 100's.

    Then perhaps having the TX buttons automatically select TX-A or TX-B respectively when pressed.  (If that will work)

    Or even auto-variable tuning steps?  
    The sky's the limit!
    You have unleashed a monster!

    Thanks,

    Ken - NM9P

    BTW...I just discovered this afternoon that your display is on the picture, not on the actual controller!  I always minimized this when working on it and noticed it by accident....Doh!  
  • W4WHLW4WHL Member
    edited July 2016
    yes Var++ is cleaner.  I plan to do a lot of cleanup.  Its composite of 5 days of my twisted mind.

    By the way the LEDs dont work via midi under Windows.  Under windows they are controlled via directdraw.  Under MAC driver they do work via Midi.  I'm not even tempted to go down that road LOL.

    Anyway enjoy, sounds like your having fun.  It was a way for me to **** a week of solar blackout.  Next is to make my own controller hardware.

    I'm going to clean up my program a bit, then let the community run with it.

    William
  • Ken - NM9PKen - NM9P Member ✭✭
    edited December 2016
    I got the RIT and XIT going last night...I had copied the wrong channel numbers into the program!

    I spent lots of time looking for solutions and trying various Coding variations. Then I saw my dumb error. Moral: never code when you are tired... This will probably take a while to "perfect" but it is completely usable right now. I need to do some cleaning up, documentation, and a few more additions that will require some API research. Then I will export it, compile it, or whatever it needs to do to make it a stand alone program. BTW... This code looks very similar in style to C#, that I have just started trying to learn. Are they related?

    I got the book, downloaded the Community Visual Studio 2013, and have only done the first two lessons, which let me open a window and print a sentence, and make a push button. So I have a long way to go. But using "Processing" makes me think that it can't be all that different, or all that hard. I was amazed that the logic and math came back to me so quickly. Again, thanks a lot for your help getting me started.
    I can use this as a basis for more utilities in the future, now that I know that I can really do this! This is one reason I got a Flex in the first place!
  • W4WHLW4WHL Member
    edited June 23
    Made a few small updates.  I did some optimization and updated the VFO code.  Now when using 100Hz stepping the frequency snaps to even 100hz increments.  Updated the WPM speed similar to Kens suggestion.

    https://www.dropbox.com/s/re9tlop8r7y7wje/FlexMidiTCP.zip?dl=0

    William

  • Ken - NM9PKen - NM9P Member ✭✭
    edited December 2016
    William,
    I looked at your code and you cleaned it up nicely.  I wouldn't have guessed that you haven't put any code down for 15-20 years!  

    I like the way you did the CW WPM line.  I didn't know you could separate the (value) out like that.  It is much cleaner.  This gives me some additional ideas for the future.

    I found that with my controller, I don't need the Slowdown routine, so I will drop it.
    I plan to use your cleaned up VFO and Tuning speed routine to make multiple tuning speeds of 10, 100, and 1K,  perhaps even 50, 250, and 500, too.  I am not sure the odd steps sizes will work, but I will play with some additional logic.

    On your mode changing routine, I noticed that you check for overrun/underrun and then reset the counter to 0.  This works for going UP, but when coming back down, I found it worked better to enter the MAX (10 in my case, because I added a few modes that you didn't have). It made the rollover work more smoothly.   The nice thing is that we can add as few or many modes as we want in any order we wish!

    When I put mine out, I plan to put some credit lines at the bottom.
    For the background picture and legend, I assume I should be able to simply edit my own picture of the controller, using the same resolution and dimensions and it should work?


  • W4WHLW4WHL Member
    edited July 2016
    Yep that's all you need to do.  You may have to shift around the text and rect boxes (freq and step displays) to line up with your image.

    Please share your mode code, yes I noticed mine was a bit finicky.

    William


  • Ken - NM9PKen - NM9P Member ✭✭
    edited December 2016
    Will do, as soon as I get home tonight and clean things up.
    Thanks,

    BTW, upon reading the API docs, I discovered that I don't need to add the +5 in my CW WPM statement, because 5 wpm is already the lower limit... Don't know if it will make any difference in the smoothness.  I like your method, and may simply tweak the adjustment number to set the range that I want.

    I finally found some of the documentation that I was looking for and it is very helpful.  There are even some things that cannot be adjusted with SSDR right now.  I don't know if that is for future use or whether the API gives us access to things like APF Gain and APF Q, etc. that are not in the current release.  I may play with that tonight.

    Ken - NM9P
  • W4WHLW4WHL Member
    edited July 2016
    I updated the Volume, AGC-T, RF Power and Balance controls for better granularity and smoother action.

    https://www.dropbox.com/s/re9tlop8r7y7wje/FlexMidiTCP.zip?dl=0

     William
  • W4WHLW4WHL Member
    edited June 23
    New update coming.  I updated XIT/RIT On/Off into one button.  Also added LED support.  Turning on XIT/RIT lights up the button.  Also TX select lights up the selected button.

    image
  • W4WHLW4WHL Member
    edited July 2016
    Ken, I know I said it LED control couldn't be done, well I figured it out for mine.  Will it work on yours, no clue.
    
  • W4WHLW4WHL Member
    edited July 2016
    Uploading now, give it 5 min before downloading :)

    https://www.dropbox.com/s/re9tlop8r7y7wje/FlexMidiTCP.zip?dl=0
  • Ken - NM9PKen - NM9P Member ✭✭
    edited December 2016
    Very neat!  I will look at it tonight.
    Thanks!
  • GI4FZDGI4FZD Member
    edited June 23
    Just a quickie, will any of this work on the older hercules mp3 e2 version of this controller
    cheers
    Paul GI4FZD
  • Ken - NM9PKen - NM9P Member ✭✭
    edited December 2016
    As Far as I know, the MP3 e2 is laid out the same as my MP3 LE controler and should work with either no or a few modifications.  The buttons, knobs, sliders and other functions on the one William is using all have different codes, which must be changed before it will work.  Once you learn how, it isn't a really big deal, if you aren't afraid of a little programming.

    Once I get my version of William's programmer cleaned up, I will publish it here.

    Ken - NM9P
  • GI4FZDGI4FZD Member
    edited June 2016
    Thanks Ken,
    I will give it a try when you publish it,
    Paul
    GI4FZD
  • W4WHLW4WHL Member
    edited September 2018
    I made a few more slight mods today.  I set it so when you change to CW mode it lights up the CWX memory keys.  I also changed the step keys from 2 toggles to separate keys, one for 10hz and the other for 100hz.  I find this easier than a toggle.

    I printed out and installed labels on my controller.  It looks really nice now.  Next thing I want to do is weight the jog wheels.

    I think I'm about done with this project.  Its time to start enjoying it..LOL.  I have only made 3 DX contacts since I started this. 

    I'll post up the code tomorrow.

    For the LED's I found that you need to send a message to the controller.

    myBus.sendMessage(144, xx, 127);  // xx = pitch, 127 turns on, 0 turns off

    Not sure if this works for the MP3 LE or not. 


    William





  • edited December 2016

    Keep up the good work, I am enjoying this.

    Jeff N3VE

  • Chris DL5NAMChris DL5NAM Member
    edited June 23
    Have orderd my Hercules last friday, DHL tracking shows should come today.

    Hope i get it started. I am not a programmer - i am in this case double left handed. Hope i found a small tutorial or any assistance.

    Thanks for good work


  • W4WHLW4WHL Member
    edited July 2016
    which one did you buy?


  • Chris DL5NAMChris DL5NAM Member
    edited December 2016
    I got it a hour b4. Hercules DJ Control Instinct from Amazon. Cost 89.-€ = 98$ incl. postage
  • W4WHLW4WHL Member
    edited July 2016
    Then you should be able to just run the program and use it right away.  I'm uploading a windows installer package as we speak.  I'll post link in a few min.  Its large because it includes Java runtime.  Just install the app and have fun.  Source is included if you want to try modifying it.

    William


  • Ken - NM9PKen - NM9P Member ✭✭
    edited December 2016
    Here is my latest effort.
    I spent several hours last night with some success and some frustration:

    I was finally able to get a routine going to toggle RIT & XIT ON/OFF with single buttons.

    I found that clearing the RIT/XIT didn't clear the memory it used to calculate the offset so it just picked up where it left off when you turned the knob again, so I added a statement to clear the memories used to enter RIT/XIT offsets.

    I was NOT able to get the buttons to light up.  I know it is possible because there is one that flashes constantly whenever the thing is plugged in.  It is probably a matter of finding the correct command or message channel to address, just I needed to reprogram all the other function channels.

    I am still cleaning it up and looking for a way to perfect the mode switching routines.  I may just leave it alone, it probably will add as much code is it takes to clean it up.

    I will tackle band switching and filter selection next.

    I was going to send you a copy last night but I was up WAY too late and had to quit as soon as I solved a particularly vexing problem caused by a syntax error that I accidently introduced up the line while trying to clean up my code.  Had to hit the sack!  Moral:  Programming when sleepy only takes you longer!

    I hope to put something up tonight.

    Ken - NM9P

  • Chris DL5NAMChris DL5NAM Member
    edited December 2016
    Not working proper. Will uninstall all DJ parts/driver and FlexMidi and start again at zero. Turning VFO A or B button change only in FlexMidi the freq. If i change band with SmartSDR it show my old QRG as used last time. If turn VFO A or B Flex jump to 21.000.000 in case of 15m or at 80m to 3.000.000 and then no changes possible with VFO button

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.