In some current professional projects, I have been really utilizing my Agilent 33220A function generator, but when I got tired of manualy scaling and configuring the thing,
I decided it was finaly time to learn how to program the function generator. The Agilent 33220A features a USB, NETWORK, and GPIB interface, but no linux support. PyVISA and USBTMC
to the rescue. While I found the syntax of USBTMC simpler perhaps, the project is also severely dated, and out of support. While all it may really need is a plucky hacker to rewrite modern package support and documentation, ( yeah I forked it ) PYVISA works out of the box.
$pip install pyvisa pyvisa-py
$ pip show pyvisa
Name: PyVISA
Version: 1.14.1
Summary: Python VISA bindings for GPIB, RS232, TCPIP and USB instruments
Home-page:
Author: Gregor Thalhammer
Author-email: Torsten Bronger <bronger@physik.rwth-aachen.de>, "Hernan E. Grecco" <hernan.grecco@gmail.com>
License: The MIT License
....
This particular project uses the USB interface, for the function generator, though I am also very interested in the Networked implementation as well.
( Not that I can use it remotely, but it sounds super cool )
This project utilizes midi input via the mido python library, in conjunction with pyvisa sending commands to the function generator, to translate keyboard key presses into function generator sounds. pretty simple and a whole lot of fun.
Source code here:
https://raw.githubusercontent.com/FOSSBOSS/midi2function/main/midi.py