OpenWebRx and KiwiSDR added to Max/MSP control program

The Max remote receiver project described in an earlier post: https://reactivemusic.net/?p=20965 now includes support for OpenWebRx and KiwiSDR sites.

When using OpenWebRx, you need to select a “profile” that supports the receive frequency range, before you can operate within that frequency.  Its an unusual system that uses an offset frequency within the selected profile, instead of a global “actual frequency” like the other platforms.

The KiwiSDR sites, in general, have very good quality reception and audio.

The next step in this project will be to consolidate a directory of sites that are useful for remote reception in the ham bands for various parts of the world.

files

See above linked post

Using hamlib to poll frequency data with Max/MSP

This Max patch connects to a radio transceiver and reads the frequency data using hamlib. Hamlib provides a common API for amateur radio devices. https://hamlib.github.io/. The hamllib server runs in the background using TCP/IP. This patch uses Jeremy Bernstein’s shell object. https://github.com/jeremybernstein/shell and the Sadam Library of externals, installed with the Max package manager.

Files

hamlibtcptest1.maxpat : select radio, starts rigcltd dameon, poll frequency via tcp/ip

launch-rigctld.sh : shell script to run rigctld

Libraries

Max: Jeremy Bernstein’s shell external, and the sadam library from Max package manager.

hamlib can be installed using homebrew

Notes

There is some latency when using the Elecraft K4. Need to look into the internal CAT settings.

Also, look into communication latency of TCP/IP and associated libraries.

I’m exploring a version of this that uses node.js instead of the shell external and tcp/ip library in Max. Initial problem is that the rigctld daemon stays active after Max is closed and needs to get killed manually.

Detect amplifier keying line (PTT) with Arduino

Use an Arduino to detect transmit/receive state.

Using an Arduino Uno to detect the transmit state of a radio. The amplifier keying line (PTT) is grounded on transmit. The Arduino sees it as a switch being pulled low. The keying line is connected to digital input 2 (D2) and ground. The digital input uses the builtin pullup resistor. The sketch is the Arduino digital | input pullup example. Max polls the serial data from the Arduino and displays the state of the keying line.

Websdr as a remote receiver with Max/MSP and Elecraft K4

Remote receiver project using Websdr as a remote alternative to a local receiver.

Demonstration of a Max/MSP program that connects an amateur radio transceiver to Websdr – transmitting locally from Maine (USA) while receiving remotely using a radio in the Netherlands. The Max program reads the frequency from a Elecraft K4 transceiver, to control the Websdr sites. It also loads the remote receivers, controls audio routing, mode, filter, and waterfall display settings. An iPad, running touchOSC, acts a a control panel. Up to 4 remote receivers operate at the same time. Websdr is a remarkable system, developed by PA3FWM at http://websdr.org/. It lets you control remote receivers worldwide, from your Web browser.

Components:

  • Max/MSP
  • Websdr
  • TouchOSC
  • Elecraft K4 transceiver with antenna system
  • Skookumlogger (logging software)

Max Patches:

websdrjweb7.maxpat : main control program. Contains [jweb] objects for launching websdr instances. Also code for injecting javascript to control parameters like frequency, filter, and volume. This patch acts as an intermediary between TouchOSC, WebSDR, and allows external MIDI control as well as getting frequency input from CAT controlled radios like the Elecraft K4.

websdrCATaudio.maxpat : handles serial port interaction for the K4. Also reads audio stream from either the K4 receiver (via USB) or the websdr receiver (via Blackhole.)  I created an aggregate audio device called K4sdr to allow Max to read both devices at the same time. Audio switching and levels are handled using a Korg nanoControl2. For example to switch between the audio streams or listen to both.

Optional: arduino-ptt-detect2.maxpat : reads serial data from an Arduino, connected to the amplifier keying line, to determine whether the radio is in transmit mode, so we can switch back to the local audio stream to eliminate latency of hearing your signal via websdr. See subsequent post about this setup…

TouchOSC

websdrCW3.touchOSC : controls all 4 websdr channels, ie,., volume, mute, filter, CW offset, filtershift, – Also handles window management, loading js code, zoom in/out websdr and selecting channel waterfall views or Max code views.

CW Offset

websdr doesn’t have a control for CW pitch offset. To sync the frequency of the K4, the websdr is run in LSB mode with a frequency offset equal to the CW pitch setting in the transceiver. eg., 450 Hz. This works for most of the websdr sites, but unfortunately some of the sdr’s are off-frequency. You can usually compensate by adjusting the CWfreqOffset for that channel (in Max or TouchOSC).

Setting the offset also requires shifting the filter so it is centered over the actual signal.

Files

This is currently a work in progress, not available on Github. Local files are in max teaching examples folder.

Videosync remix projects

New experiments using Videosync with Ableton Live.

A remix of “Gappa the Triphibian Monster”, 1967 directed by Haruyasu Noguchi. Produced using Ableton Live 12 and Videosync. Editing was done using LosslessCut for slicing and CapCut for editing. The underwater sequence uses the Ableton Audio Effects Rack: “Dawn Shimmers”.

Yet another remix of “Invasion of The Neptune Men” by Koji Ota. Produced with Videosync, Ableton Live, and Lossless Cut. The editing was done entirely in Live. Probably not a great way to do extensive video edits. And there was some trouble with Live 11, but the problems resolved by installing Live 12.

Another tribute to “The Invasion of The Neptune Men” by Koji Ota Produced with Videosync in Ableton Live. This was my first effort with Videosync. I tried to edit the video based on the sounds of the clips.

Capturing App/Screen video with Syphon and NDI

How to get video from applications, like a web browser, into Syphon.

This example shows how to get a Youtube video from Firefox into Max/MSP Vizzie.

  • Use NDI Scan Converter (From NDI Tools https://ndi.video/tools/ ) and select Firefox from the Capture menu
  • Use NDISyphon to convert the NDI stream to Syphon. Use virtual audio routing (eg., black hole) for system audio, or route audio directly into Max.

  • In Max, use the Syphon client from the package manager to receive video. Here is an example using Vizzie abstractions described in previous posts:

notes:

NDI scan converter allows screen capture from apps and broadcasts in NDI format over the LAN. Then NDISyphon app converts NDI stream into Syphon. For youtube, use theatre mode to fill the window – full screen doesn’t really work. see this link: https://support.telestream.net/s/article/Wirecast-Remote-Computer-Screen-Capture-with-NDI-macOS

Recording Ableton Videosync output

Video recording options for Videosync in Ableton Live

Syphon Recorder.

https://syphon.github.io/recorder

  1. In Videosync preferences, set master Syphon out.
  2. In syphonrecorder set Videosync master as input.
  3. In syphonrecorder set virtual audio as input (eg., blackhole 2ch)
  4. In Ableton, set blackhole 2ch as audio output (or make a multioutput device in audoMidiSetup, combining headphones and blackhole.)

Vizzie Recorder.

(see this post about Vizzie Syphon abstractions https://reactivemusic.net/wp-admin/post.php?post=20896&action=edit)

  1. setup a Syphon client in Max
  2. Use abstractions to bring video into Vizzie. and use Vizzie recorder object.
  3. Route audio as described above.

Screenflick (or other screen recording software)

  1. Set screenflick to overlay videosync output window in Ableton Live
  2. Route audio as described above.

Amateur radio contesting time-lapse map

Mapping geocoded  contest log data using node.js and openlayers.

The goal was to make something that looks like the Reverse Beacon Network map, only for contest log files. I use RBN for testing antennas now. That map display gives you a pretty good idea of your actual antenna pattern.

Code is written in node.js (javascript) and html.

Part 1: Read a Cabrillo log file containing QSO: records. Look up each callsign, get latitude and longitude, and rewrite the file as json data, tagged with geo coordinates. I originally tried getting the data from hamQTH but it was not current, so ended up using the qrz.com xml callsign lookup. For callsigns “not found” I used the qrz.com dxcc prefix lookup to get general coordinates for the country. There are still a few bad/missing data issues to resolve. Like European stations with coordinates at the South Pole.

Part 2: Tried various mapping frameworks – like leaflet, arcgis, and openlayers. Wanted to use a great-circle projection (azimuthal equidistant) like the big ARRL world map. And may still figure this out. But working with map projections and coordinate transforms is way worse than doing a Smith Chart.  I ended up hacking a flight tracking example from openlayers.org and basically replacing airplanes with QSO’s. That is why the lines are animated from source to destination.  Also added a layer for day/night, and QSO/time status display.

It probably makes sense to get rid of the flight animation and just display the entire path in sync with the QSO data – with color code for each band (K1KP) – and speed control on the time lapse, etc., So you can get a better sense of rate and propagation.

It would be cool to have a website where you could upload a log file and generate maps.

Note: this project is not yet available

Files

local files:

generating data:

internetsensors/cabrillomap

put the cabrillo data in testdata.cbr (use QSO: records only for now) should be sorted chronologically.

run:  node index.js

the output file will be: geocab.json (which is used as input to the mapping program)

mapping

internetsensors/oltest

main.js = node source with ol mapping and data processing

index.html = web page for map

geocab.json = geocoded cabrillo json test data

to run, type: npm start

Then open: http://localhost:5173/ in a browser

Additional work / current issues

Some of the qrz.com callsign data has bad geo coordinates. In particular some of the records show a latitude of -89 and longitute -179 – need to check for these numbers and replace with dxcc coordinates.

There should be an argument on the node program to pass in the datafile. Also the program should clean up any non QSO: records, like the file header info and any X-QSO recs.

Also need to clean up the async/await stuff – currently there are several methods for handling state transitions.

mapping ideas:

As mentioned above, its probably a good idea to make a version of the code without the flight animation, and have various controls to stop/start the data playback to look at individual qso’s do speed control, etc.,

azimuthal equidistant projection: there are some links to examples in leaflet, and arcgis to handle complex projections. In documents, look at:  “map links for projection stuff.txt”

leaflet test version:

in the internetsensors/cabrillomap folder there’s a test file: cbworld1.html that works using websockets when you run the index.js file to generate test data. It uses a leaflet map, but the lines don’t adapt to great circle polar paths.

arcgis

I believe the arcgis examples are in internetsensors/projected geometries

And: internetsensors/pe-gs-projection

The former is a a very nice world projection with some point markers. The latter is an example that shows how to switch out various projections in realtime.

11 Km feedback delay

Using 40 meter SSB, Max/MSP, and Websdr to build a feedback delay from Maine to the Netherlands.

A Max patch plays an audio file into the transmitter in Maine. Then, using a websdr receiver in the Netherlands, the received signal is amplified and mixed back into the audio to be retransmitted. Effectively creating a feedback delay line.

Here is an example of what it sounds like on 40 meters.

http://www.pr0jex.com/longdelayline.mp3

This is the Max patch

The audio from Websdr is routed to the input of Max by creating a multi-output device (In Audio Midi Setup) combining “Blackhole 2ch” and external headphone output (for monitoring). The audio output of Max is assigned to the transmitter SSB input.

Patch not yet available. Local version is in max teaching examples.

Max/MSP Vizzie abstractions for Syphon

Vizzie objects can connect directly to Syphon clients and servers.

(work in progress – not available yet)

Syphon video as input to Vizzie

vizziesyphonclient.maxpat that gets syphon into vizzie. look at vizzieexamplewithsyphon.maxpat to see how it works.

Syphon as output from Vizzie

Use vizziesyphonserver.maxpat. Example: vizzieexamplewithsyphonserver.maxpat

(local files in maxteachingexamples)