Skip to content

Sonic Pi 4.x #32

@porras

Description

@porras

Hi!

I was trying to update this mode to work with Sonic Pi 4. I was having a bit of a hard time so, to make it simpler, I decided to write it "from scratch" (not really, I copied parts of this mode, including the whole sonic-pi-console). I finally got it working! I think, now that I understand exactly what needs to be changed (the protocol to communicate with the daemon has changed a bit, I'll summarize the changes below), that I'll be able to contribute it back, while keeping it backwards compatible (my fork only works with Sonic Pi 4). I'll do that in the next days/weeks, depending on the time I have available.

The changes are (I got this by reading the sonic-pi code, and also the https://github.com/Bubobubobubobubo/sonic_pipe code):

  • Instead of having ports fixed by convention, the daemon chooses a set of free ports and prints a line with them. The caller needs to read that line and use those ports
  • On top of the former ports to send commands and listen to logs, there's an additional port where the client needs to send a keep-alive message from time to time (I don't know how much time but sending it each 30 seconds seems to work well), or the daemon closes itself
  • Together with the list of ports, the daemon prints a random token, that the client needs to add to all OSC commands

Anyway, in case it's useful for anyone in the meantime, here it is: https://github.com/porras/sonic-pi-mode. If there's any suggestion of how to integrate that back (I'm thinking on keeping it compatible with the old protocol too, by using two different classes), they're also welcome.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions