Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Sonic-Pi v4+ #43

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Support Sonic-Pi v4+ #43

wants to merge 5 commits into from

Conversation

mhl787156
Copy link

@mhl787156 mhl787156 commented Oct 1, 2023

The current version of python-sonic only support sonic-pi v3 as changes have been made to sonic-pi's treatment of non-cue OSC messages. This PR seeks to update python-sonic to support these new changes for v4+. This address #42 .

See this issue: sonic-pi-net/sonic-pi#3330 for further details.

In short, Sonic-Pi now randomises the GUI udp port and requires a Token to be sent with any non-cue OSC message like /run-code. Therefore this PR makes the following changes:

  1. Updates synth_server.py with a new token field. set_parameter now also takes a token as the second argument. send_command now inserts the token before a command instead of the old GUI_ID parameter.
  2. Updates psonic.py with a new function set_server_parameter_from_log which by default parses the file ~/.sonic-pi/log/spider.log, or allows the user to submit the spider.log file. The function parses the spider.log for the token, the server port and osc cues port and sets those as the server parameter.
  3. Adds a very simply example psonic_example.py for testing.
  4. Updates the README.md to reflect the above changes.

This has been tested on windows and linux.

Let me know if you want any other updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant