Coder Social home page Coder Social logo

sonic-pi-vscode-editor's Introduction

Build Status

sonicpieditor README

This is an extension to work with Sonic Pi within vscode. It will launch Sonic Pi's backend when you open a ruby file.

At the moment this is run as an extension in development, so see the Requirements section below for instructions on how to run it.

Please feel free to contribute with your Pull Requests. Any help is welcome!

Also, if you like this project or are interested in its progress, it would be great if you star it in github to help spread the word! Thank you!

Features

This is just starting, but we already have enough features to have some fun!

  • Configurable Sonic Pi server launch options. Now you can choose between:
    • always: launches the server when vscode starts
    • ruby: launches the server when there is a ruby file visible in vscode (this is the default)
    • custom: launches the server when there is a file with your given custom extension visible in vscode
    • never: do not launch the server automatically (use the Sonic Pi: Start Server command)
  • Configurable Sonic Pi root path, in case the default does not work for you
  • Can run code pressing Alt-R (or Cmd-R on Mac, just like in Sonic Pi's editor) or with command palette "Sonic Pi: Run" (see Screenshot)
  • Can stop running audio with Alt-S (or Cmd-S on Mac) or "Sonic Pi: Stop"
  • Can run the selected code with Alt-T (or Cmd-T on Mac). If there is no code selected, it will offer to run the whole file instead (and persist the choice)
  • Shows logs and cues in the output panel (see logs and cues)
  • Some snippets like live_loop, effects, synths, samples, and possibly more coming soon. See the snippets directory for the full list and contribute new ones if you feel like it!
    • fx -> instantiate effect with autocomplete list chooser
    • fx x (where x is a letter) -> effect instantiation
    • us -> instantiate synth with autocomplete list chooser
    • us x (where x is a letter) -> specific synth instantiation
    • sa -> instantiate sample with autocomplete list chooser
  • Highlight errors as reported by the Sonic Pi server
  • And of course, you have syntax highlighting, autoformatting, all the goodies that you usually have with vscode!
  • See a very short video of Robin Newman's arrangement of "Pase El Agua" launched from this extension, showing the thing working, logs, etc: Video

(You can find Robin's original work here: https://in-thread.sonic-pi.net/t/three-more-pieces-for-sonic-pi/2434).

Requirements

The extension runs in development mode. Follow these steps:

  • Go to the extension directory (where this file is located)
  • run "npm install", to install the necessary node dependencies
  • run "code .", to open the extension directory in vscode
  • press F5 to run the extension
  • (optional) see the Sonic Settings in vscode and configure how you want to start the server, by default it will launch when there is a ruby file visible in the editor

If you run into problems, let me know, and I'll do my best to help you set this up.

Make sure you configure the Sonic Pi root path in the configuration if the default setting does not work for you Open Settings -> Extensions -> Sonic Pi -> Sonic Pi Root Directory

Known Issues

I have not tested this in Linux yet. Works nicely in Windows and Mac.

Open questions

sonic-pi-vscode-editor's People

Contributors

dependabot[bot] avatar emlyn avatar ethancrawford avatar kant2002 avatar llloret avatar mogimogitomato avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

sonic-pi-vscode-editor's Issues

Failure to get running in Windows

I am sorry this extension is failing to work for me. SonicPi is installed fresh and is working correctly. the extension appears to launch somewhat correctly, recognises the ruby file but does not appear do anything when I press alt R. I am also considering that the startup of scsynth is not complete. What I find odd is that I have to have jackd running if I fail to have this running see the additional error log below. this is not required when I run the Sonicpi IDE app. For a test I am just using play 70 as the ruby script. Look forward to getting your extension working thank you.
Happy to assist in any further debugging if you can point me to where to look !

Platform: windows 10.0.18363 Build 18363
Extension Sonic-pi-vscode-editor: commit: 7d0f522

The following are the logs and developer tool console session images at

1) Initial Extension Execution (F5)

image

log(extension host)

[2020-05-26 18:47:56.575] [exthost] [info] extension host started
[2020-05-26 18:47:56.704] [exthost] [info] ExtensionService#_doActivateExtension vscode.debug-auto-launch {"startup":true,"extensionId":{"value":"vscode.debug-auto-launch","_lower":"vscode.debug-auto-launch"},"activationEvent":"*"}
[2020-05-26 18:47:56.704] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Program Files/Microsoft VS Code/resources/app/extensions/debug-auto-launch/dist/extension
[2020-05-26 18:47:56.714] [exthost] [info] ExtensionService#_doActivateExtension vscode.emmet {"startup":true,"extensionId":{"value":"vscode.emmet","_lower":"vscode.emmet"},"activationEvent":"*"}
[2020-05-26 18:47:56.714] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Program Files/Microsoft VS Code/resources/app/extensions/emmet/dist/extension
[2020-05-26 18:47:56.789] [exthost] [info] ExtensionService#_doActivateExtension vscode.git {"startup":true,"extensionId":{"value":"vscode.git","_lower":"vscode.git"},"activationEvent":"*"}
[2020-05-26 18:47:56.789] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Program Files/Microsoft VS Code/resources/app/extensions/git/dist/main
[2020-05-26 18:47:56.954] [exthost] [info] ExtensionService#_doActivateExtension vscode.github-authentication {"startup":true,"extensionId":{"value":"vscode.github-authentication","_lower":"vscode.github-authentication"},"activationEvent":"*"}
[2020-05-26 18:47:56.954] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Program Files/Microsoft VS Code/resources/app/extensions/github-authentication/dist/extension.js
[2020-05-26 18:47:57.015] [exthost] [info] ExtensionService#_doActivateExtension vscode.merge-conflict {"startup":true,"extensionId":{"value":"vscode.merge-conflict","_lower":"vscode.merge-conflict"},"activationEvent":"*"}
[2020-05-26 18:47:57.015] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Program Files/Microsoft VS Code/resources/app/extensions/merge-conflict/dist/extension
[2020-05-26 18:47:57.027] [exthost] [info] ExtensionService#_doActivateExtension vscode.search-result {"startup":true,"extensionId":{"value":"vscode.search-result","_lower":"vscode.search-result"},"activationEvent":"*"}
[2020-05-26 18:47:57.028] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Program Files/Microsoft VS Code/resources/app/extensions/search-result/dist/extension.js
[2020-05-26 18:47:57.034] [exthost] [info] ExtensionService#_doActivateExtension vscode.vscode-account {"startup":true,"extensionId":{"value":"vscode.vscode-account","_lower":"vscode.vscode-account"},"activationEvent":"*"}
[2020-05-26 18:47:57.034] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Program Files/Microsoft VS Code/resources/app/extensions/vscode-account/dist/extension.js
[2020-05-26 18:47:57.085] [exthost] [info] ExtensionService#_doActivateExtension dbaeumer.vscode-eslint {"startup":true,"extensionId":{"value":"dbaeumer.vscode-eslint","_lower":"dbaeumer.vscode-eslint"},"activationEvent":"*"}
[2020-05-26 18:47:57.085] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/BSFau/.vscode/extensions/dbaeumer.vscode-eslint-2.1.5/client/out/extension
[2020-05-26 18:47:57.154] [exthost] [info] ExtensionService#_doActivateExtension donjayamanne.githistory {"startup":true,"extensionId":{"value":"donjayamanne.githistory","_lower":"donjayamanne.githistory"},"activationEvent":"*"}
[2020-05-26 18:47:57.154] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/BSFau/.vscode/extensions/donjayamanne.githistory-0.6.5/dist/src/extension
[2020-05-26 18:47:57.371] [exthost] [info] ExtensionService#_doActivateExtension Gruntfuggly.todo-tree {"startup":true,"extensionId":{"value":"Gruntfuggly.todo-tree","_lower":"gruntfuggly.todo-tree"},"activationEvent":"*"}
[2020-05-26 18:47:57.371] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/BSFau/.vscode/extensions/gruntfuggly.todo-tree-0.0.176/extension
[2020-05-26 18:47:57.528] [exthost] [info] ExtensionService#_doActivateExtension ivanhofer.git-assistant {"startup":true,"extensionId":{"value":"ivanhofer.git-assistant","_lower":"ivanhofer.git-assistant"},"activationEvent":"*"}
[2020-05-26 18:47:57.528] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/BSFau/.vscode/extensions/ivanhofer.git-assistant-1.3.3/dist/extension
[2020-05-26 18:47:57.562] [exthost] [info] ExtensionService#_doActivateExtension mdickin.markdown-shortcuts {"startup":true,"extensionId":{"value":"mdickin.markdown-shortcuts","_lower":"mdickin.markdown-shortcuts"},"activationEvent":"*"}
[2020-05-26 18:47:57.562] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/BSFau/.vscode/extensions/mdickin.markdown-shortcuts-0.12.0/extension
[2020-05-26 18:47:57.583] [exthost] [info] ExtensionService#_doActivateExtension streetsidesoftware.code-spell-checker {"startup":true,"extensionId":{"value":"streetsidesoftware.code-spell-checker","_lower":"streetsidesoftware.code-spell-checker"},"activationEvent":"*"}
[2020-05-26 18:47:57.583] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/BSFau/.vscode/extensions/streetsidesoftware.code-spell-checker-1.9.0/dist/extension
[2020-05-26 18:47:57.687] [exthost] [info] ExtensionService#_doActivateExtension zhoufeng.pyqt-integration {"startup":true,"extensionId":{"value":"zhoufeng.pyqt-integration","_lower":"zhoufeng.pyqt-integration"},"activationEvent":"*"}
[2020-05-26 18:47:57.687] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/BSFau/.vscode/extensions/zhoufeng.pyqt-integration-0.2.0/out/extension
[2020-05-26 18:47:57.830] [exthost] [info] ExtensionService#_doActivateExtension vscode.npm {"startup":true,"extensionId":{"value":"vscode.npm","_lower":"vscode.npm"},"activationEvent":"workspaceContains:package.json"}
[2020-05-26 18:47:57.830] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Program Files/Microsoft VS Code/resources/app/extensions/npm/dist/main
[2020-05-26 18:47:57.866] [exthost] [info] ExtensionService#_doActivateExtension alexkrechik.cucumberautocomplete {"startup":true,"extensionId":{"value":"alexkrechik.cucumberautocomplete","_lower":"alexkrechik.cucumberautocomplete"},"activationEvent":"workspaceContains:.vscode/settings.json"}
[2020-05-26 18:47:57.866] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/BSFau/.vscode/extensions/alexkrechik.cucumberautocomplete-2.14.1/out/src/extension
[2020-05-26 18:47:58.012] [exthost] [info] ExtensionService#_doActivateExtension yzhang.markdown-all-in-one {"startup":true,"extensionId":{"value":"yzhang.markdown-all-in-one","_lower":"yzhang.markdown-all-in-one"},"activationEvent":"workspaceContains:README.md"}
[2020-05-26 18:47:58.012] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/BSFau/.vscode/extensions/yzhang.markdown-all-in-one-3.0.0/dist/extension
[2020-05-26 18:47:58.275] [exthost] [info] ExtensionService#_doActivateExtension jebbs.plantuml {"startup":false,"extensionId":{"value":"yzhang.markdown-all-in-one","_lower":"yzhang.markdown-all-in-one"},"activationEvent":"api"}
[2020-05-26 18:47:58.275] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/BSFau/.vscode/extensions/jebbs.plantuml-2.13.11/out/src/extension
[2020-05-26 18:47:59.220] [exthost] [warning] [yzhang.markdown-all-in-one] Accessing a window scoped configuration for a resource is not expected. To associate 'markdown.extension.katex.macros' to a resource, define its scope to 'resource' in configuration contributions in 'package.json'.
[2020-05-26 18:47:59.304] [exthost] [info] eager extensions activated
[2020-05-26 18:48:01.183] [exthost] [error] {"message":"Git error","stdout":"","stderr":"fatal: c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor: 'c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor' is outside repository\n","exitCode":128}
[2020-05-26 18:48:01.183] [exthost] [error] {"message":"Git error","stdout":"","stderr":"fatal: c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor: 'c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor' is outside repository\n","exitCode":128}
[2020-05-26 18:48:01.183] [exthost] [error] {"message":"Git error","stdout":"","stderr":"fatal: c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor: 'c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor' is outside repository\n","exitCode":128}
[2020-05-26 18:48:01.183] [exthost] [error] {"message":"Git error","stdout":"","stderr":"fatal: c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor: 'c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor' is outside repository\n","exitCode":128}
[2020-05-26 18:48:01.183] [exthost] [error] {"message":"Git error","stdout":"","stderr":"fatal: c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor: 'c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor' is outside repository\n","exitCode":128}
[2020-05-26 18:48:01.183] [exthost] [error] {"message":"Git error","stdout":"","stderr":"fatal: c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor: 'c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor' is outside repository\n","exitCode":128}
[2020-05-26 18:48:01.183] [exthost] [error] {"message":"Git error","stdout":"","stderr":"fatal: c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor: 'c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor' is outside repository\n","exitCode":128}
[2020-05-26 18:48:01.183] [exthost] [error] {"message":"Git error","stdout":"","stderr":"fatal: c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor: 'c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor' is outside repository\n","exitCode":128}
[2020-05-26 18:48:01.183] [exthost] [error] {"message":"Git error","stdout":"","stderr":"fatal: c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor: 'c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor' is outside repository\n","exitCode":128}
[2020-05-26 18:48:01.183] [exthost] [error] {"message":"Git error","stdout":"","stderr":"fatal: c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor: 'c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor' is outside repository\n","exitCode":128}
[2020-05-26 18:48:01.184] [exthost] [error] {"message":"Git error","stdout":"","stderr":"fatal: c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor: 'c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor' is outside repository\n","exitCode":128}
[2020-05-26 18:48:02.347] [exthost] [error] {"message":"Git error","stdout":"","stderr":"fatal: c:\\Users\\BSFau\\Cloudstation\\SonicPi\\Trial20w22a: 'c:\\Users\\BSFau\\Cloudstation\\SonicPi\\Trial20w22a' is outside repository\n","exitCode":128}
[2020-05-26 18:48:02.347] [exthost] [error] {"message":"Git error","stdout":"","stderr":"fatal: c:\\Users\\BSFau\\Cloudstation\\SonicPi\\Trial20w22a: 'c:\\Users\\BSFau\\Cloudstation\\SonicPi\\Trial20w22a' is outside repository\n","exitCode":128}
[2020-05-26 18:48:02.347] [exthost] [error] {"message":"Git error","stdout":"","stderr":"fatal: c:\\Users\\BSFau\\Cloudstation\\SonicPi\\Trial20w22a: 'c:\\Users\\BSFau\\Cloudstation\\SonicPi\\Trial20w22a' is outside repository\n","exitCode":128}
[2020-05-26 18:48:02.347] [exthost] [error] {"message":"Git error","stdout":"","stderr":"fatal: c:\\Users\\BSFau\\Cloudstation\\SonicPi\\Trial20w22a: 'c:\\Users\\BSFau\\Cloudstation\\SonicPi\\Trial20w22a' is outside repository\n","exitCode":128}
[2020-05-26 18:48:02.347] [exthost] [error] {"message":"Git error","stdout":"","stderr":"fatal: c:\\Users\\BSFau\\Cloudstation\\SonicPi\\Trial20w22a: 'c:\\Users\\BSFau\\Cloudstation\\SonicPi\\Trial20w22a' is outside repository\n","exitCode":128}
[2020-05-26 18:48:02.347] [exthost] [error] {"message":"Git error","stdout":"","stderr":"fatal: c:\\Users\\BSFau\\Cloudstation\\SonicPi\\Trial20w22a: 'c:\\Users\\BSFau\\Cloudstation\\SonicPi\\Trial20w22a' is outside repository\n","exitCode":128}
[2020-05-26 18:48:02.347] [exthost] [error] {"message":"Git error","stdout":"","stderr":"fatal: c:\\Users\\BSFau\\Cloudstation\\SonicPi\\Trial20w22a: 'c:\\Users\\BSFau\\Cloudstation\\SonicPi\\Trial20w22a' is outside repository\n","exitCode":128}
[2020-05-26 18:48:02.358] [exthost] [error] {"message":"Git error","stdout":"","stderr":"fatal: c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor: 'c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor' is outside repository\n","exitCode":128}
[2020-05-26 18:48:02.358] [exthost] [error] {"message":"Git error","stdout":"","stderr":"fatal: c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor: 'c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor' is outside repository\n","exitCode":128}
[2020-05-26 18:48:02.358] [exthost] [error] {"message":"Git error","stdout":"","stderr":"fatal: c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor: 'c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor' is outside repository\n","exitCode":128}
[2020-05-26 18:48:02.358] [exthost] [error] {"message":"Git error","stdout":"","stderr":"fatal: c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor: 'c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor' is outside repository\n","exitCode":128}
[2020-05-26 18:48:02.358] [exthost] [error] {"message":"Git error","stdout":"","stderr":"fatal: c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor: 'c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor' is outside repository\n","exitCode":128}
[2020-05-26 18:48:02.358] [exthost] [error] {"message":"Git error","stdout":"","stderr":"fatal: c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor: 'c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor' is outside repository\n","exitCode":128}
[2020-05-26 18:48:02.358] [exthost] [error] {"message":"Git error","stdout":"","stderr":"fatal: c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor: 'c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor' is outside repository\n","exitCode":128}
[2020-05-26 18:48:02.358] [exthost] [error] {"message":"Git error","stdout":"","stderr":"fatal: c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor: 'c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor' is outside repository\n","exitCode":128}
[2020-05-26 18:48:02.359] [exthost] [error] {"message":"Git error","stdout":"","stderr":"fatal: c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor: 'c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor' is outside repository\n","exitCode":128}
[2020-05-26 18:48:02.359] [exthost] [error] {"message":"Git error","stdout":"","stderr":"fatal: c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor: 'c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor' is outside repository\n","exitCode":128}
[2020-05-26 18:48:02.359] [exthost] [error] {"message":"Git error","stdout":"","stderr":"fatal: c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor: 'c:\\Users\\BSFau\\Cloudstation\\BSFsoftDev\\axternal\\sonic-pi-vscode-editor' is outside repository\n","exitCode":128}

2) after test1.rb is loaded and alt-R is attempted

i have also attempted to run from command palette; SonicPi: Run

Log output: [Extension Development Host]

[GUI] - Cleaning old sessions...
[GUI] - Discovering port numbers...
stdout: Sonic Pi server booting...
This is version 3.2.0 running on Ruby 2.7.1.
The time is 2020-05-26 19:30:18 +1200
Using primary protocol: udp
Detecting port numbers...
Listen port: 51235
  - OK
Scsynth port: 51237
  - OK
Scsynth send port: 51237
  - OK
OSC cues port: 4560
  - OK
Erlang port: 51240
  - OK
OSC MIDI out port: 51238
  - OK
OSC MIDI in port: 51239
  - OK
Websocket port: 51241
  - OK
Opening UDP Server to listen to GUI on port: 51235

stdout: Started [35628] [-] "C:\Program Files\Sonic Pi\app\server\native\scsynth.exe" -u 51237 -m 131072 -a 1024 -D 0 -R 0 -l 1 -i 16 -o 16 -U "C:/Program Files/Sonic Pi/app/server/native/plugins/" -b 4096 -B 127.0.0.1 [-] C:/Users/BSFau/AppData/Local/Temp/sonic-pi-pids/35628


Console - [extension development host]
image

[2020-05-26 19:30:05.692] [exthost] [info] ExtensionService#_doActivateExtension Luis Lloret.sonicpieditor {"startup":false,"extensionId":{"value":"Luis Lloret.sonicpieditor","_lower":"luis lloret.sonicpieditor"},"activationEvent":"onLanguage:ruby"}
[2020-05-26 19:30:05.692] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/BSFau/Cloudstation/BSFsoftDev/axternal/sonic-pi-vscode-editor/out/extension.js
[2020-05-26 19:30:11.863] [exthost] [info] ExtensionService#_doActivateExtension rebornix.ruby {"startup":false,"extensionId":{"value":"rebornix.ruby","_lower":"rebornix.ruby"},"activationEvent":"onLanguage:ruby"}
[2020-05-26 19:30:11.863] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/BSFau/.vscode/extensions/rebornix.ruby-0.27.0/dist/client/ruby.js
[2020-05-26 19:30:12.168] [exthost] [warning] [rebornix.ruby] Accessing a resource scoped configuration without providing a resource is not expected. To get the effective value for 'ruby.format', provide the URI of a resource or 'null' for any resource.

3) Error when JackD is not running

[GUI] - Cleaning old sessions...
[GUI] - Discovering port numbers...
stdout: Sonic Pi server booting...
This is version 3.2.0 running on Ruby 2.7.1.
The time is 2020-05-26 16:36:21 +1200
Using primary protocol: udp
Detecting port numbers...
Listen port: 51235
  - OK
Scsynth port: 51237
  - OK
Scsynth send port: 51237
  - OK
OSC cues port: 4560
  - OK
Erlang port: 51240
  - OK
OSC MIDI out port: 51238
  - OK
OSC MIDI in port: 51239
  - OK
Websocket port: 51241
  - OK
Opening UDP Server to listen to GUI on port: 51235
Started [22796] [-] "C:\Program Files\Sonic Pi\app\server\native\scsynth.exe" -u 51237 -m 131072 -a 1024 -D 0 -R 0 -l 1 -i 16 -o 16 -U "C:/Program Files/Sonic Pi/app/server/native/plugins/" -b 4096 -B 127.0.0.1 [-] C:/Users/BSFau/AppData/Local/Temp/sonic-pi-pids/22796
stderr: Cannot connect to named pipe after wait = \\.\pipe\server_jack_default_0 err = 2
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
stdout: Started [21604] [-] "C:/Program Files/Sonic Pi/app/server/native/erlang/bin/erl.exe" -noshell -pz "C:/Program Files/Sonic Pi/app/server/erlang" -s pi_server start 51240 4560 51235 [-] C:/Users/BSFau/AppData/Local/Temp/sonic-pi-pids/21604

Integration advice

Hello!

I'm working on an extension for Sonic Pi language support in VS Code (it's very POC right now, but the basics are down at https://github.com/JacksonKearl/vscode-sonic-pi). I'm a big fan of the work you've done here, and I'd love to integrate it into my extension.

To unblock me for right now I've dropped the source files from here over to my repo, prepended your license to the files, and added your name to the readme; I'm wondering what your thoughts are going forward for how our two contributions can work together.

Jackson

update README.md. Sonic Pi must be open when running the code from VS Code using the extension

Sometimes one struggles with the most obvious things,

After cloning this repo, setting up my Sonic Pi Root Dir, and reading like 10 times the README.md I wasn't getting to work the extension. The issue was that I had to boot the actual Sonic Pi app to hear the code that I was running.

Of course once you get it working then the documentation (README.md) makes sense, but before that, even though the documentation is pretty clear and straight forward I was getting confused by little things. Maybe because I was overthinking it but in order to avoid these noob confusions I would say that the README.md might need an update.

Fails to run code initially at startup

If I start the extension, and there is already a ruby tab open (from the previous run), and I hit alt+R without first clicking in the open tab, it doesn't play it but instead logs:

stdout: Studio - Pausing SuperCollider Audio Server

stderr: workspace_nine: warning: ... at EOL, should be parenthesized?
workspace_nine:1: warning: ... at EOL, should be parenthesized?

Starting run 7
Completed run 7
All runs completed
Pausing SuperCollider Audio Server

It looks like it is sending something other than the contents of the tab to Sonic Pi.
Probably it should either use the open tab, or at least refuse to run until the a compatible tab is focussed.

Some notes for Linux/Ubuntu folks on setup

Working through setting this up, ran into a few things and took notes. Thought I would post them here for anyone running across the same.

  1. This needs Sonic PI cloned from Github, not the Debian apt repo. You also may need to run sonic-pi/app/server/ruby/bin/compile-extensions.rb

  2. It may fail due to missing libaubio (note the "b", not "d"). You will need to sudo apt install libaubio-dev.

  3. But there's a good chance that this won't install in one of the places the Ruby FFI gem is looking for that library, so it'll still tell you that you don't have it:

ruby-ffi-err

As you can see, the files it say are non-existent are clearly there, it just (as it states) needs better search heuristics. So we cp them to one of the folders it actually looks in 🙄

libaubio-gnu

  1. After this, running the extension from VS Code and opening your Ruby file should actually start Sonic Pi. But you may get flooded with this error:

stderr: Cannot create RT messagebuffer thread: Operation not permitted (1)

To fix this, you need to install + open qjackctl and press "Start" prior to running the extension:

Screenshot from 2020-06-12 19-41-25

I'm running Ubuntu 19.10 for reference.

How to get this extension working on .rb files ?

Hi,

I'm not able to get the Run command working on ruby languages files

I prefer to use the syntax coloration from ruby but I cannot run sonic-pi for this files, any workaround ?

Nice extension by the way ^^

Cannot get server loaded: `The Sonic Pi root path is not properly configured.`

[GUI] - Cleaning old sessions...
[GUI] - Discovering port numbers...
stderr: /Applications/Sonic Pi.app/Contents/Resources/app/server/native/ruby/bin/ruby: Not a directory -- /Applications/Sonic Pi.app/Contents/Resources/app/server/ruby/bin/sonic-pi-server.rb (LoadError)

I have tried setting the sonicPiRootDirectory in the extension preferences and in the settings.json inside the examples directory, with variations on the empty string in Sonic Pi.app to no avail.

image

image

Needs updating to work with Sonic-PI 4.x

Sonic-PI 4.x has significant changes which result in the incompatibility with the current version of this extension.
Note sure that the API has change much not looked at the actual code yet but the scripts available which this extension relies upon have.

example

  • port-discovery.rb is no longer available
  • sonic-pi-server.rb seems to be now spider-server.rb
    ......

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.