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 refer to the product documentation or check the Help Center for known solutions.
Need technical support from FlexRadio? It's as simple as Creating a HelpDesk ticket.

Flex SmartSDR API for Dummies

K4SC
K4SC Member
edited June 2020 in SmartSDR API

I want to learn how to use the API library but know nothing about it and programming in general.  Actually I want to learn how use what is available to interface a MIDI controller to my 6500.  Is there now a primer available at a "For Dummies" level?  If not can someone recommend a path towards acquiring the knowledge to do so?

I did manage to find the Wiki and look at it, but it made my head hurt.  I'm sure it will be useful, but apparently I need to learn how to use it first.

Answers

  • Walt - KZ1F
    Walt - KZ1F Member ✭✭
    edited November 2016
    It's so easy to give a really snarky answer. Let's see if I can do better than that. While I am sure someone wrote a "Programming for Dummies" book, there is no programming for dummies any more than there is a "Back Belt in Kung Fu for Dummies" book. Some things just take a lot of time and a lot of effort. I've been developing and designing software for over 43 years, I've been a licensed Commercial Pilot w/IFR for about 20 years. Both took time and effort to achieve. To be sure, there are others on here with +/- my same story, time and effort. I suspect that is equally true to be a good lawyer or doctor, or welder. In none of those professions can someone declare, tomorrow I will be one. That said, there is nothing to say you couldn't take the approach 'tomorrow I launch my next career'. My advice, take a class at a local community college. If reading a wiki make your brain hurt, that should tell you something. A single class won't set you back much and it will be either something you sincerely enjoy or it, too, will make your head hurt. If it makes your head hurt, I respectfully submit it is not something you really want to learn. To be competent at writing software, I submit it will take more than one course. Not necessarily a degree major but some number of courses and many many hours writing code.

    Walt  - kz1f
  • rfoust
    rfoust Member ✭✭
    edited March 2017
    I'd suggest picking up a book (or two) on C# programming and get through several chapters before trying to figure out how to use the SmartSDR API.  Gotta have some of the basic understanding so you'll know how to put it to use.  In fact I think you can download a free 'personal' version of Visual Studio from Microsoft to compile your C# code.

    But having said that, the fastest way to learn programming is to have a reason to use it.  If you have an idea of an application you would like to write, that is a great start. A lot of people want to learn how to program but have no idea what they want to use it for or what application they want to develop so it never really "clicks" in their mind for them.

    The classroom idea that Walt suggested is a good idea too, but studying a book lets you go at your own pace.  There might also be some free tutorials online, search for those and see what you can find.  

    Be a sponge, soak up all programming knowledge you can from all sources (books, internet, classroom, etc) and you'll do great!
  • Gary L. Robinson
    Gary L. Robinson Member ✭✭
    edited February 2016
    I echo the sentiments of the other answers. It takes a lot of time and effort to learn how to write useful programming code. You don't need to take classes to learn it BUT taking classes is a smart way to do it. I have been writing code for only 25 years and completely taught my self. THEN I took classes and had to UN-learn some bad habits. I would have saved time and learned better coding habits IF I had taken the classes to begin with hihi
  • Peter K1PGV
    Peter K1PGV Member ✭✭✭
    edited June 2020
    Learning how to program CAN be a lifetime job.

    But it IS just like welding: You can learn how tack a few pieces together at home with little serious study if you have the right natural skills. OTOH, if you want to learn how to weld on an oil pipeline you're going to need to go to school, AND you're going to need a LOT of experience.

    If your goal is to fix a few things around the house, and you look at it like a hobby, learning how to weld can be both fun and useful.

    Programming is exactly the sample: You can fool around and learn enough on your own to do some useful things pretty quickly... especially if you have some innate talent and you understand deductive logic.  If you want to make a career of it, well... perhaps that's a different story.

    How do you know if you have the innate talent and requisite level of interest?  Ah, there's the rub.

    One way is to take a class, like Walt suggested.  Another would be to get a good book that explains computer programming and study that way.  A pretty good one is "A Natural Introduction to Computer Programming with C#"  https://books.google.com/books?id=wVlm5xwMp7YC&printsec=frontcover&dq=A+Natural+Introduction... -- I have no connection to this book or the author, I just found it (and read a couple of chapters) after some searching on your behalf.  It is well written, it is clear, and it is correct (not something I can say for a lot of the tutorials I found).  You can even read some of it online (Google books is great like that). The only PROBLEM with this book is that it's 8 years old... and that's a lifetime when it comes to computers.  The tools are a little different now... but if you post questions here, we can probably help you.

    That's what I would suggest.  C# is a great language to start learning with, by the way.
  • Stan VA7NF
    Stan VA7NF Member ✭✭✭
    edited June 2020

    Quick background:  Started programming in 1965 on IBM scientific machines then joined IBM maintaining the mainframe assembler operating system.

    It is great to see the API available and so many people interested.

    Rule of Thumb (ROT for short) 1:  EVERY first time larger program, per language, is a throw away and at some point must be rewritten. 

    To ignore this ROT is to court disaster at some later point.  That is presented not to discourage but to point out how much a learning process is involved from "reading the book" to productive coding.

    After 50 years I have found little more fulfilling than seeing your efforts appreciated by others.  A special call-out for those working with the Flex API and enhancing the radio for all.

    73 - Stan VA7NF
    (active) Master Programmer at HP Canada

  • Peter K1PGV
    Peter K1PGV Member ✭✭✭
    edited December 2016
    "Inside every large program, there's a small elegant program trying to get out."  I think it was Lao Tzu who said that ;-)
  • Andrew VK5CV
    Andrew VK5CV Member ✭✭
    edited June 2020

    Gentlemen,

    What is the best programming language to look at for SSDR and or PSDR?

    I had bit of talent 30-40years ago with home made and early computers.

    I still dabble in microcontrollers but this is not my day job and I am more of a hardware guy for radio.

    Object Orientated languages seem opaque.

    A work colleague who is a programmer has recently retired and got his ham ticket.

    He recommends .NET or C# but not C++.

    What is most useful in the Flex universal to spend my time on?

    Andrew de VK5CV.


  • Ken - NM9P
    Ken - NM9P Member ✭✭✭
    edited December 2016
    As I have been involved in playing with the MIDI Controller project that William began a few weeks ago, I have taken the plunge and started learning "Processing" which is relatively simple. Like many in this community, I did some programming in college, then a fair bit of GW-Basic in the 90's. So the logic has come back quickly. I have figured out how to modify and augment what William has done and customize and expand my own MIDI interfaces. This has whet my appetite and now I think I want to try to do the same thing in C#. If I can find processes already made to read the MIDI codes and read/write to the rig, then I should be able to learn enough to port my controller over to C#. This would be a good starter project to help me learn. My question... Are such libraries easily accessible for C#, and hoe different is the command structure and syntax going to be as I make the move? My question
  • Walt - KZ1F
    Walt - KZ1F Member ✭✭
    edited November 2016
    C+ has one audience, Microsoft.
    C++ many audiences, every modern computer, pc to mainframe supports it
    Java many audiences, every modern computer pc to mainfraome supports it

    C# or Java, that's like talking politics. Ironically, they are both incredibly similar. Both camps have very loyal very ardent supporters. Most websites you'll hit are running Java, a few very large are running C++.  A few have .NET
    Flexlib is C# as is, I believe, PSDR and it's open source equivalent.

    Ruby, Scala, Closure - they have their following.

    Ken, Java has a rich MIDI subset. I am not sure what C# has even comes close.
    Let google be your friend
  • James Whiteway
    edited April 2015
    Ken, here's one resource that may help you on the C# side of things:
    https://code.google.com/p/midi-dot-net/

    I ordered one of the Midi controllers today and plan to tinker with it as well.
    William has done an outstanding job with all the hard work he has provided the community.
    james
    WD5GWY
  • rfoust
    rfoust Member ✭✭
    edited December 2016
    I'd start with C# if you are interested in Windows programming. Once you learn one language, the others aren't quite so hard to learn. It's mostly a syntax change to go from one programming language to another.
  • Walt - KZ1F
    Walt - KZ1F Member ✭✭
    edited November 2016
    That's a reasonable choice if you are only going to be using Windows. I would still take a class. If looking at the wiki made your head hurt, looking at code samples with give you a migraine. An instructor is right there to make technical jargon english and answer questions while they are fresh in you mind. If you do it on your own and ask questions here, this is not the best forum for "I want to learn to program", you are likely to get multiple answers that may seemingly contridict. There is a site called stackoverflow.com which is very good about answering questions. I don't know how 'beginner' they go though.
    Basically, that first step, by yourself, is a doosy. You'll move up the learning curve WAY faster and you will know in a reasonable time if this is for you.
  • K4SC
    K4SC Member
    edited September 2017
    OK, maybe I missed the boat somewhere.  I thought given some functions on the Flex 6000 series that I want to assign to buttons or controls on a MIDI controller would be reasonably straight forward and be a beginning step into possibly more.  It sounds like I need to take a programming course to use the API library?  I somehow thought it wouldn't be more straightforward.
  • Walt - KZ1F
    Walt - KZ1F Member ✭✭
    edited November 2016
    A good person to talk to perhaps is William Hemmingsen who wrote a MIDI interface in some language called "Processing". Personally, I never heard of that. I believe what all these folks are doing is you have to, effectively, hook an interrupt (callback) which will give you an object called Radio, You'll probably want to get a list of in use slice receivers so you know what to issue commands to. What I am doing is way different than others, I am rewriting the base code of the control surface, so what is referred to as FlexLib, I am rewriting as well as a new and portable control surface for virtually any OS, IOS, Android, Raspberry Pi, Linux and, oh yes, even WIndows. So yes, what I am doing does require something more involved than what others might be doing but I don't believe what William has done is 'trivial'. You would need to ask him. Much of my advice to you was predicated one what already 'makes your head hurt'. There are a lot of things in this world that make my head hurt too. So I totally get that. Were you in the Navy?

    Walt - kz1f
  • rfoust
    rfoust Member ✭✭
    edited March 2017
    Well, yes the API library provides an interface to the Flex, but if you don't already know how to use the API (or *any* api), you're missing the fundamentals of programming.  There's nothing wrong with that, it's just a knowledge gap to fill.

    By the way, heres an online course on C# for anyone who happens to come across this thread, it looks to be free:  http://www.microsoftvirtualacademy.com/training-courses/c-fundamentals-for-absolute-beginners

    -Robbie

  • Walt - KZ1F
    Walt - KZ1F Member ✭✭
    edited November 2016
    Yes, I believe that was my opening comment. But where you, or Ken, or William can provide some insight is, for what William is doing how far up the food chain would Charles need to go. My sense is that is not beginner level but I haven't done MIDI controllers and barely know how to spell "Processing" - the language. I just took a peek at Processing and it looks like you get a PRM, not good for beginners. That's Program Reference Manual. It's a dictionary as opposed to an encyclopedia.

    Charles and Ken, the first thing you need to get your head around is object oriented. The older you are, the harder this will be. The way I explained it back in the 80's was, is the world full of nouns each with their own behavior or verbs that act on nouns.In languages like Fortran, Cobol, Assembler, the world is full of verbs that act upon things. In the here-and-now, specifically for Flex library, be it .NET or something else, the universe is Radio object, Slice object, Panadapter object, a list of radios, list of panadapters, list of Slices etc and each object (noun) has certain predefined behavior. If you are coming from Fortran, that will be a big gulp. That may actually be more than you need. The other alternative is to become fluent in telnet. Telnet is a program that uses tcp/ip to connect to other things, computers, programs or, in this case, your radio. Once it connects you can just, 'chat' with it. There is a series of defined commands you can give to tell the radio to do stuff, like go to a certain frequency. Ultimately what happens whether it is done from a MIDI device or smartsdr program or web application is it is telling the radio to do stuff. Everything else is User Interface to the radio, which can be pretty switches, sliders, displays or physical things like a midi controller. No, there is nothing wrong with not knowing a software language. But, it is something akin to learning a spoken language. If you want to converse with another person, you really need to understand the language they use, otherwise it will be a difficult conversation. Regardless of whether the desired outcome originates from a graphical program running in Windows or another OS, a non-graphical program running in some other OS, even sliding the frequency across a panadapter or turning a dial on a midi controller. What goes transmitted to the radio is an english like command that you could type into telnet. Each command is numbered, it has an object and a verb. after you type it, the radio will give you a reply, with the same number which will tell you whether it did what you asked. Everything else is a function of how creative do you want to get.

    I still strongly suggest if this is something you think you might enjoy, take an intro class in it, there will be instructor(s) to answer questions as they come up. As far as this being 'easy', it is 'easier' if you are fluent in the language. If you don't know the language there will be nothing quick or easy about it. As you can see, there are people on this forum that know how to do it. The essential question is, how badly do you want to be like us. It's OK to say that isn't why you bought the radio.

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.