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

SonicPi REPL support #29

Open
munshkr opened this issue Mar 10, 2020 · 4 comments
Open

SonicPi REPL support #29

munshkr opened this issue Mar 10, 2020 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@munshkr
Copy link
Owner

munshkr commented Mar 10, 2020

No description provided.

@munshkr munshkr added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Mar 10, 2020
@carltesta
Copy link

What's the first step to getting Sonic Pi connected to flok? I'm interested in looking into how to make this happen.

@munshkr
Copy link
Owner Author

munshkr commented Nov 27, 2020

Hi @carltesta , for starters, it would be nice to know if there is a way to send code to Sonic PI from another process, as in a REPL by writing to its standard input. I remember that SonicPi was written in Ruby so I think it should be possible, but I'm not sure if this is still the case (I know it has some bits of Erlang now...). I also don't have it installed right now, but I'll try to do that this weekend.

@munshkr
Copy link
Owner Author

munshkr commented Dec 4, 2020

Looking up how Troop communicates with SonicPi, apparently there is an OSC protocol for evaluating code in SonicPi:
https://github.com/Qirky/Troop/blob/529c5eb14e456f683e6d23fd4adcddc8446aa115/src/interpreter.py#L614-L666

We can do the same, by creating a custom REPL class (e.g. SonicPiREPL), similar to the RemoteSclangREPL class, that uses OSC to send messages to SonicPI.

Another thing to be aware of is that on SonicPI you usually evaluate the whole code instead of blocks or paragraphs (like in Tidal or FoxDot).

@munshkr
Copy link
Owner Author

munshkr commented Jan 23, 2021

Ok, I added support for sonicpi target in flok-repl, it's still in the 29-sonicpi branch.

Apparently as of Sonic Pi 3.1, the OSC Control Port number changes randomly at boot, so I had to make flok-repl read through the SonicPi log files and look up the port number there. I'm following what sonic-pi-cli does. Still I haven't been able to control it (nothing happens when I send a block of code), maybe a Windows permission issue?

It'd be great if someone can help me test this! I have SonicPi installed only on a Windows machine (still not working), and a simple test on Linux and Mac would be nice to have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants