StepManiaX SDK for Python
Currently fairly incomplete. A lot of core functionality exists, but the rest of the SDK needs to be finished. At some point I can write out a list of functions currently enabled and which ones have yet to be added.
- Get Device Info: Get basic stage information such as Player jumper, serial number, firmware version
- Get Config v5: Get the stage configuration (version 5 and up)
- Write Config v5: Write the stage configuration (version 5 and up)
- Factory Reset: Factory reset the stage to original settings
- Set Light Strip: Set the color of the underglow light strips (Currently only used in factory_reset function)
- Force Recalibration: Force the stage to perform a recalibration
- Get Sensor Test Data: Get sensor test data for modes [uncalibrated, calibrated, noise, tare]
- Set Serial Numbers: Sets a stage serial if it doesn't exist yet. Does nothing if one exists
- Set Panel Test Mode: Turn on/off panel test mode
- Get Config <v5: Get the stage configuration (version 4 and lower)
- Write Config <v5: Write the stage configuration (version 4 and lower)
- Set Lights: Set panel lights (This seems fairly complicated at a quick glance)
- Upload GIF Data: Upload GIF Data to Panels
- Re-Enable Auto Lights: Assume this just turns auto GIFs on the pads back on to default?
These are the instructions that I have been using to run this on my system so far.
- Use pyenv to install Python 3.10.x or use System Python if its 3.10.x or greater (This will probably work on newer pythons, but I don't know personally).
- Use Homebrew to install
libusb
brew install libusb
- Make sure to add the following lines to your
~/.zshrc
or~/.bashrc
# LibUSB Settings
export DYLD_LIBRARY_PATH=/opt/homebrew/lib
- Maybe restart here just to make sure everything is installed properly
- Download this repo onto your macOS system somewhere
- Inside this repo set up a python venv, activate it, and install the software into the venv
python -m venv venv
. venv/bin/activate
pip install --upgrade pip
pip install -e .
- Now you can play around with the code. The following script will show you the configs for the 2 connected pads. If you have just one, leave out the last line:
from pysmx.sdk.api import SMXAPI
smxapi = SMXAPI()
print(smxapi.get_stage_config(1))
print(smxapi_get_stage_config(2))
- Run your script with
python script_name.py
. This assumes you have thevenv
still activated.
As this API/SDK is still unfinished, you can use the included script to set your stages sensor values to whatever you want.
Following the above instructions to set this repo up and use the code, you can then do the following.
- Modify the
set_stage_configs.py
python file to your specified SMX Config. - Look at the
make_new_config
function and follow modification instructions. - If you need help with this, just reach out and I can probably help.
- Make sure you have the venv activated and run the script.
python set_stage_configs.py
You need to have libUSB
installed to run this. I have personally installed it with Homebrew and added export DYLD_LIBRARY_PATH=/opt/homebrew/lib
to my zshrc
file.
This SDK is hevily based on the official open source StepManiaX-SDK: https://github.com/steprevolution/stepmaniax-sdk
pysmx is provided under an MIT License.