A 3 voice FFT based additive synthesizer with 20 oscillators/voice.
By Tadej Droljc
By Tadej Droljc
CubicSDR uses the SoapySDR library as generic tool for extracting realtime IQ data streams from common SDR devices. It also provides TCP external frequency control using HAMLIB.
Although its not the main purpose of CubicSDR, the IQ streaming capability will connect SDR devices to Max, Pd, and other DSP platforms, to build experimental radios. All without building external objects or hardware device drivers. The convenience of using CubicSDR for this purpose far outweighs the overhead.
How to use CubicSDR as a front-end for SDR experiments in Max.
The signal path for this test is:
Running in the other direction, the frequency control path is:
There’s a lot of stuff going on here, so the choice to use hardware audio routing instead of Soundflower and netcat instead of TCP in Max, is an effort toward simplicity.
This starts the rigctl daemon (server) in the background using the HAMLIB test dummy rig
echo “\set_freq 7010000” | nc -w 1 localhost 4532
For this test, you can use any of the MaxSDR tutorials available at https://github.com/tkzic/maxradio but I chose to use the main program, currently maxsdr7a.maxpat. The key is to choose the default audio input device and set it to be the same as what is coming out of CubicSDR. I used a stereo patch cord to connect the line output of my Apollo Twin interface to the input jacks – but you can also use Soundflower.
Installing Hamlib: http://reactivemusic.net/?p=19402
Installing CubicSDR: https://github.com/cjcliffe/CubicSDR/releases
Supported SDR devices: http://reactivemusic.net/?p=19746
I had some success using the Max TCP external described at the Installing Hamlib link above, but temporarily abandoned it due to some latency and dropouts.
Local version of this patch is: tcpClient-small2.maxpat
by Jerobeam Fenderson
update: 9/2017 – this has turned out to be an unworkable solution – short of reassigning the color scheme for every possible UI object. The main reason being that the default text color UI objects in Max 7 is white. So, if you cut and paste or load another patch you will need to change each UI object by hand.
The UI in Max 7 reverses foreground and background from previous versions of Max (and Pd). Additionally, a secondary toolbar menu frames the patcher and all sub-patchers. For example, here is a simple Max 6 patch and its Max 7 equivalent.
Regardless of which look you find more appealing, the new UI is problematic in several ways.
Max 7 doesn’t include a black-on-white style, but you can make your own. And lose the toolbar. Here is a new and improved version of the patch:
The process is arcane. But it took less than a half hour to get results. Then I wasted time endlessly tweaking.
The secret recipe came from a 2014 Cycling 74 forum post by Phiol, with assistance from Ben Bracken. Everything you need to know is explained in Phiol’s first 2 posts in the thread. https://cycling74.com/forums/topic/custom-color-scheme-layout-setup-walkthrough/#.V6oHMZMrIcg
I encourage you to read both posts and follow the steps precisely. There are no shortcuts. I will paraphrase Phiol’s method here:
And then the bad news:
Then do all the steps mentioned in the previous thread.
-Gradients objects do not work.
For example, [message and umenu] would not keep my custom colors.
Workaround: Once you have started a new patch, reselect your “custom_style” in patch inspector window or the ‘format’ sub menu. That is, click the style that should already be selected/checked – and now it should work.
So yes, for now, as we start a new patch we will we have to make it a habit to always select our “custom_style” in patcher inspector window or the format sub-menu.
(click the paintbucket icon on the top toolbar)
Also, when you open older Max6 patches and/or the help patch and want to apply your new custom style template, make sure that in the “Format” dropdown menu you have selected the “copy style to library”.
Once you’ve done this, you will be able to apply you’re custom style to older/help patchers and resave them with your custom look. To do so, you open Inpector’s Appearance again, and select your “custom_style” that will be in the Library style.
If you are totally confused at this point, so was I.
Starting with step one above, make a patch with common objects, that looks something like this:
Select each object individually, then with inspector, change the background color to white, or a lighter shade, and the text color to black.
You may need to experiment. Try with a small number of objects at first – because you will probably need to do the whole process several times. As noted above, you have start from the begining each time by hand. You can’t modify a style after you save it.
Then, you should be able to follow the rest of the steps from Phiol’s post.
The objects used for this style are:
*these objects use gradients
The procedure is basically the same as setting the white background.
Note: you can toggle the toolbar anytime with <cmd>8
If you create a subpatch and it reverts back to the default style then…
Check out the Cycling 74 vignettes about styles and templates to get a better understanding of what’s going on here:
Using Virtual Serial Port Manager
Setting a local bridge to connect the 2 virtual serial ports allows a Max patch to communicate with a radio on a real serial port and pass through the data to a virtual serial port that can be used by another program, such as a logger. The patch looks like this:
Its looks like a feedback loop but its not. In this case the bridge is: com1 <-> com2. Com1 is port a in the above patch. Data sent to com1 can be read from com2 and vice versa.
Tables can be created and maintained outside of Max using the command line (sqlite3) or database apps like SQLiteStudio.
(not yet available on github:
The database is called newtestDB1
You can see the table schema in the screenshots. The tables were created using command line sqlite3 and SQLiteStudio.
One record for each stored frequency. This table retains its state from each previous use, but new records can be added using the Max patch, or the Launchpad.
xtime: Timestamp in UTC.
filter: bandpass filter setting in Hz. (default is 6000)
0 : unknown
1 : AM/SW broadcast
2 : clock
3 : digital mode
4 : local broadcast
5 : mostly noise
zone: cq zone number
rating: 0-5 (0 = unrated)
confidence: 0-5 (0 = unknown)
tags: (general text notes)
The preset table contains one record for each 8×8 launchpad button, for each of 3 screens.
Data from each of theses screens is also displayed in jit.cellblock objects in the Max patch. All of the fields correspond to the fields in the freq table – except for screen, row, and col which are locators for the launchpad.
There are three screens of presets color coded using the Launchpad mixer button (upper right). Press it to cycle through the 3 screens.
The fixed presets are static. But can be changed using SQLiteStudio. They contain commonly used radio frequencies, like the SW, Ham, and CB bands. And clock stations.
To select a preset, press its button on the Launchpad.
Currently assigned presets:
Time presets are frequencies with Timestamps that match a selected range. For example, every frequency within one hour of the current time. These can be selected with a query in the Max patch, or using default values from the Launchpad. The query will randomly match up to 64 records. If the query returns less than 64 records, you will get all matching records, but in random order.
From the Max patch:
Match hours plus/minus current time (0-12).
Type the number of hours in the number box and press the button under the delay object. This reloads the presets.
You can view the results in the jit.cellblock:
Match a specific time range:
Enter the start/end times and press the button.
Selecting from launchpad
trk button: re-runs query using last set number of hours plus/minus current time. Default is one.
solo button: select one random preset using current hour range, and play it?
The user presets work like the pushbuttons on a car radio. Press to select. Hold to save the currently tuned radio frequency.
The learn button (upper left) gives feedback. If you press a pad for which no frequency has been assigned, the learn button will flash red. When you save a new preset, the learn button flashes green to indicated that the saving is done. If you press a pad for a preset that has already been saved, there will be no flash, but the radio frequency will change.
You can add records using the Max patch or the Launchpad, or from SQLiteStudio.
Tunning the radio fills in all of the fields except for typecode. Tune the radio. Then press one of the typecode buttons. Then press the big green button. You have added a new record.
Press the Arm button (lower right) to add a record for the currently tuned frequency, using an ‘unknown typecode’
Just do it.
By Stefan Brunner
Solves focus problem.
By Johannes Hoffman
I used this method as an alternative frequency controller for the remote radio project. It uses Applescript and Midi-pipe http://www.subtlesoft.square7.net/MidiPipe.html
The left and right encoder values are assigned to MIDI control messages.
How to set up the client side of the remote radio system.
(under construction) patches have not been uploaded to github
This client works with the sever described in the previous post. We are running a MacBook Pro OSx 10.11.4. with the following:
Install and set up LogMein Hamachi. It is free, for a limited number of computers. Set up a Hamachi server on both the server and client. It should look something like this:
We are using Soundjack VOIP. It is also free. Use the following parameters on the client side.
You can ignore the rest of the settings, since we are not sending audio. Most of the configuration is done on the server side.
We are using several patches, depending on which hardware controllers you are using. Make sure that the hardware controllers are connected before opening Max.
After the max patches are loaded, you should be able to control the radio using the UI and the CDJ-101 controller. The red Mixer button in the upper right corner of the Launchpad should be lit.
to be continued…