Arduino MIDI controller

97 views
Skip to first unread message

David Wilde

unread,
Jul 12, 2019, 3:43:29 AM7/12/19
to SparkSDR
Hi Alan,

I have been thinking about making an Arduino based MIDi controller to interface with SparkSDR and enable simple VFO tuning and also a PTTfootswitch.  Last night found some Arduino code, downloaded to a Nano and tried it.  
The Arduino sends the data via the serial port (over USB) and another piece of downloaded software (https://projectgus.github.io/hairless-midiserial/)  coverts the serial data to midi.  It has selection boxes to choose the midi device where data from the Arduino will go, and also to select a device that creates midi commands to be sent to the Arduino.
I can connect the output to a midi loop device, and using the debug check box I can see commands and notes coming from the Arduino as I toggle buttons or change analogue values.
Unfortunately SparkSDR does not appear in the list of MIDI devices, and no midi data is seen in the Spark MIDI settings window.  What am I doing wrong or missed?
It might be nice to have a check box to enable a serial port to be used directly without the serial-midi software, a selector for the serial port to be used, possibly with baud rate would then be needed.  Could be handy for any one else homebrewing a controller.

Operating System is Win10 pro 64 bit.

73

Dave M0WID

Alan Hopper

unread,
Jul 12, 2019, 5:29:38 AM7/12/19
to SparkSDR
Hi Dave,
that sounds like a good project. I currently just assume a single midi device and maybe you have more than one and I'm picking the wrong one.  I'm no midi expert and may have missed something else, I'll create a version with some debug output. With the midi keyboard I tested on I did not have to route/connect the midi. 
I like the idea of the direct serial port input and will add it to the list.
73 Alan M0NNB

Alan Hopper

unread,
Jul 12, 2019, 6:57:52 AM7/12/19
to SparkSDR
Hi Dave,
http://www.ihopper.org/radio/SparkSDR2_0_0_7beta_win64.zip tries all midi devices and lists the ones found when you enable in the midi panel, this might at least give us some clues.

It also fixes the low sound after ptt and a bug that only affected the win64 version and stopped file and directory names showing in the gateware dialog.
73 Alan M0NNB

David Wilde

unread,
Jul 12, 2019, 1:22:14 PM7/12/19
to SparkSDR


Briliant!

That helped.

What was missing was another piece of software called loopMidi.  The serial to MIDI is connected to loopMidi and then loopMidi appears as channel 0 in the list.  I don't really understand what is happening but it seems to work, and I can toggle the PTT from the Arduino.

Incidentally the USB Midi Cable device is connected to the XYL's keyboard, (she was not impressed at me trying to use it for radio stuff).  Anything played on the keyboard does not appear in Spark, but I can play the keyboard from my Arduino if I map the serial port to the USB Midi Cable, and I can see notes being sent to the Arduino if I use the Midi Cable as an input.  Strange.

Anyway, now to make something better than a wire loop onto the Arduino pin!

Thanks for the rapid response.  Re the low sound after PTT - now there are a few milliseconds of noise before it settles down again, but better than missing the answer.  Perhaps rather than turning the ALC/AGC off it would be best to freeze it at the value when the PTT is pressed and hold it at that for a short time when released.

I have not tried the firmware update yet.

Is there a way of doing Split?

73

Dave M0WID


Hairless.JPG


 loopMidi.JPG  
SparkMidi.JPG

Alan Hopper

unread,
Jul 12, 2019, 2:30:50 PM7/12/19
to SparkSDR
Dave,
that's great, I wonder if that something similar is needed on linux. Odd the keyboard does not work in Spark.
the ptt stuff is really only half done and was a work in progress, I actually operate agc as you describe but there is still a brief period where tx packets are duplex'd back after ptt up and create the click.

I've been waiting for someone to ask about split for 4 years :), it does not exist yet, I've considered a few things like split across multiple radios and receivers, all ideas welcome.
73 Alan M0NNB

David Wilde

unread,
Jul 12, 2019, 6:55:41 PM7/12/19
to SparkSDR
I rarely use split as any station that is working a pile up is unlikely to hear my QRP signal, but have occasionally been successful in the past with the FT817.  It should not be high up in the to do list, at least in my view.

Thinking aloud:
If split is checked, then create a dedicated slave virtual receiver linked to the master receiver selected.  Or allow the user to link a receiver to another one already opened using a selection box or similar.  The master could then be tuned to the tx frequency, while the slave is tuned to the receive frequency, or vice versa.  PTT toggles between the receivers.  In receive some may want to be able to hear the tx frequency in one ear, and the receive in the other to be able to work out where the station is listening.  When split is unchecked the slave is deleted.

Alternative, perhaps easier and more intuitive for a user, when split checked, two frequency displays appear, one for tx, the other for receive, maybe with a default 5k offset to start from.  Different mouse buttons, or shift/ctrl click to set the alternative frequency from the waterfall.  Mouse scroll can change the digit hovered over in either frequency display.  Similar to the A/B VFO used in most rigs.  Check boxes could enable a user to choose to listen on either or both frequencies when not transmitting.  

No doubt getting a nice interface is harder than coding something that just works.

Another thought - as most SSB appears to be channelised to 2.5kHz intervals, eg 14.200, 14.202.5, 14.205 etc, it would be handy to be able to set the mouse scroll wheel tuning (or encoder from midi controller..) to optionally jump in channels, or when clicking on the water fall to default to the closest "channel". 

Briliant work, great software.

Alan Hopper

unread,
May 4, 2020, 2:51:20 PM5/4/20
to SparkSDR
Hi David,
this http://www.ihopper.org/radio/sparksdr2_0_1_3_linux.tar.gz now should allow your controller to connect direct by serial.
73 Alan M0NNB

Alan Hopper

unread,
May 4, 2020, 2:53:44 PM5/4/20
to SparkSDR
Hi David,
sorry just realised you are using windows, will publish that soon.

Alan Hopper

unread,
May 4, 2020, 3:23:13 PM5/4/20
to SparkSDR

David Wilde

unread,
May 6, 2020, 2:47:02 AM5/6/20
to SparkSDR
Downloaded last night and MIDI via the com port works very well, much better than all the serial to midi stuff I had to use before.
I did have a problem when starting the first time. The first time it started with no complaints, but nothing on the receivers. Stopped and restarted a few times and everything started to work. Any logs I or tests I should do? I left it running overnight monitoring 80/40/20 bands and all seems OK.

Many thanks

Dave

Alan Hopper

unread,
May 7, 2020, 4:48:50 AM5/7/20
to SparkSDR
Hi Dave,
good to here it works, if there is anything in you errorlogs directory that might give a clue to the start failure.
Alan
Reply all
Reply to author
Forward
0 new messages