Skip to content

stalexxx/tidalcycles-zed

Repository files navigation

TidalCycles for Zed Editor

This extension adds support for the TidalCycles live coding environment in the Zed Editor.

Note: This is an early prototype. Some functionality may not work as expected.

Features

  • Syntax highlighting for TidalCycles/Haskell code
  • Commands for evaluating code blocks and lines
  • Integration with the TidalCycles engine

Prerequisites

Before using this extension, you need to have:

  1. TidalCycles installed
  2. SuperCollider with SuperDirt installed
  3. Haskell and GHCi installed (comes with TidalCycles installation)

Installation

  1. Open Zed Editor
  2. Open the command palette (Cmd+Shift+P or Ctrl+Shift+P)
  3. Use the "Install Extension" command
  4. Choose this extension from the list or install it from source

Usage

Starting TidalCycles

To start the TidalCycles engine:

  1. Open a file with a .tidal extension
  2. Use the command palette (Cmd+Shift+P or Ctrl+Shift+P) to run the TidalCycles: Start command
  3. Make sure you have SuperDirt running in SuperCollider

Evaluating Code

There are several ways to evaluate code:

  • Place your cursor on a line of code and press Alt+Enter (or use command palette for TidalCycles: Evaluate Line)
  • Select a block of code and press Shift+Alt+Enter (or use command palette for TidalCycles: Evaluate Block)

Stopping All Sound

To stop all sound:

  • Run the TidalCycles: Hush command

Stopping TidalCycles

When you're done:

  • Run the TidalCycles: Stop command to shut down the TidalCycles engine

Keyboard Shortcuts

This extension adds the following keyboard shortcuts:

  • Alt+Enter: Evaluate the current line
  • Shift+Alt+Enter: Evaluate the selected code block or current paragraph
  • Alt+H: Hush (stop all sound)

Configuration

Currently, the extension searches for the BootTidal.hs file in common locations:

  1. ~/.ghci
  2. ~/.cabal/lib/tidal-1.9.4/BootTidal.hs
  3. /usr/local/lib/tidal-1.9.4/BootTidal.hs
  4. /usr/lib/tidal-1.9.4/BootTidal.hs

If your BootTidal.hs is in a different location, you'll need to modify the source code.

Troubleshooting

If you encounter issues:

  1. Make sure TidalCycles and SuperDirt are properly installed and working
  2. Ensure SuperCollider is running with SuperDirt started
  3. Try restarting the TidalCycles engine with the TidalCycles: Stop command followed by TidalCycles: Start
  4. Check Zed logs for any error messages
  5. Make sure you have GHCi (Glasgow Haskell Compiler interactive) installed and accessible in your PATH

If you're still having problems, you may need to modify the extension to match your specific setup.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request or open an issue on GitHub.

License

This extension is released under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published