A python api for steelseries' sonar software. An advanced form of Mark7888's sonar api including the possibility to change audio devices and use a hardware controller to interface with sonar.
If something does not work properly feel free to open an issue.
- Python 3.9 or above
- rtmidi (pip3 install rtmidi) (might be broken since a new version released and need a manual install)
- Some kind of usb-midi controller capable of sending controlchange commands is required as a hardware interface.
The device changing function also works without this controller if you just want to use this as an inspiration. However I do not provide a version of the code without the controller implemented as this is the only reason this project exists.
This will ONLY work with streamer (for now) because I use streamer mode.
-
Create a new folder anywhere you want, it will later be filled with all the files.
-
Download Nirsoft's SoundVolumeView from here and place it into your folder. It should now look something like this:
-
Download this repo and unpack it somewhere else than this folder.
-
Copy the file 'dump_devices.bat' into the folder, like this:
-
Verify everything is working by running the file from step 4, it should create a new file called 'dump.txt':
-
You can now insert the files 'main.py', 'sonar.py' and 'devices.py' into your folder
-
Open the windows 'Sound output' menu (CTRL+WIN+V) and check for the device you want to use. For me it would be 'Lautsprecher (Realtek(R) Audio)', note this.
-
Start SoundVolumeView.exe It will look like this:
-
Now check for the first part of your audio devices name ('Lautsprecher'). Look at the one with 'Device' and 'Render' in the following two collumns. The fourth column should include the second part of its name '(Realtek(R) Audio)'. (It is visible in the image from 2. near the bottom)
-
Piece these together like this: 'Lautsprecher,Device,Render,Realtek(R) Audio'
-
Open devices.py and navigate to the function 'getSecondary' and location the line 'location = file_text.find(...)'
-
Now replace the text in the brackets with the String you got out of 6.
Just repeat the steps for the primary device and use the device you want as a secondary output instead. It will then go into the function 'getSecondary', also into the 'location' variable.
The file 'sonarController.ino' runs on my version of the controller. The hidden analog Inputs on the micro can be found by searching for 'arduino micro pinout'. Ignore the switch on my controller, it is not included in the code.
My midi controller looks something like this, a arduino micro with 10 sliding potentiometers attached to it.