Norns REPL (VSCode Extension)

Norns REPL

This is a very simple extension that allows you to interact with Norns in a VSCode terminal, much like you would from the Maiden web interface.

The extension connects to Matron on Norns using a websocket. Lua code entered in the terminal is sent to Matron when you press return, and the results are printed in the terminal. There is basic support for command history using the up/down arrows.

Please file any bugs you find as a GitHub Issue!

Commands

nornsREPL.matron.connect

  • Connect to the Matron REPL at the configured Norns host and port
  • Command Palette: “Norns REPL: Connect to Matron…”

nornsREPL.matron.send

  • Send a command to the Matron REPL at the configured Norns host and port
  • Command Palette: “Norns REPL: Send Command to Matron…”

nornsREPL.crone.connect

  • Connect to the Crone REPL at the configured Norns host and port
  • Command Palette: “Norns REPL: Connect to Crone…”

nornsREPL.crone.send

  • Send a command to the Crone REPL at the configured Norns host and port
  • Command Palette: “Norns REPL: Send Command to Crone…”

nornsREPL.script.reload

  • Reload the current script using norns.script.load(norns.state.script)
  • Command Palette: “Norns REPL: Reload Script”

nornsREPL.sleep

  • Put Norns to sleep using norns.shutdown()
  • Command Palette: “Norns REPL: Sleep”

Configuration

nornsREPL.host

  • Norns hostname to connect to
  • Default: norns.local

nornsREPL.matron.port

  • Matron websocket port to connect to
  • Default: 5555

nornsREPL.crone.port

  • Crone websocket port to connect to
  • Default: 5556

nornsREPL.maxHistory

  • Maximum number of previous commands to store in history
  • Default: 100

New in Latest Version (1.4.0)

Dedicated commands for reloading the current script and shutting down Norns, as well as commands for sending arbitrary one-off messages to Matron/Crone. These can be used to set up custom tasks that communicate with Norns like so:

// tasks.json
{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "Play Note",
      "command": "${command:nornsREPL.matron.send}",
      "args": ["engine.hz(440)"]
    }
  ]
}
41 Likes

Instant install. Thank you!

2 Likes

whoa! been talking to some people about this… and now, here it is. thank you so much for sharing.

3 Likes

wow, this is great! many thanks

1 Like

Pushed up a new version. You can now navigate the prompt using the arrow keys and insert/delete at the current cursor position.

3 Likes

One more small update to add a Crone REPL command :slight_smile:

Pushed up another update with some more commands. See the original post for more information.

I also added support for ;restart and ;install commands in Matron, and made some fixes to the command prompt.

Enjoy!

5 Likes