Emacs Extension

Hi,

I managed to install Tidal and the atom extension in my Ubuntu 18.04.1 and seems to work (it produces the sound after following ’ Instructions for Atom’ in https://tidalcycles.org/index.php/Start_tidalcycles_and_superdirt_for_the_first_time).

But when I try to execute the same .tidal file in emacs, after C-c C-s I got the message: “GHCi, version 8.0.2: http://www.haskell.org/ghc/ :? for hel Prelude> IO error: “/home/USERNAME/.cabal/store/ghc-8.0.2/package.db/BootTidal.hs” does not exist” (although in my Ubuntu exists the file “/home/USERNAME/.cabal/share/x86_64-linux-ghc-8.0.2/tidal-1.4.8/BootTidal.hs”)

and then when I ‘C-return’ the tidal line I get “:3:1: error: Variable not in scope: d1 :: t0 -> t:3:6: error:• Variable not in scope: sound :: [Char] -> t0• Perhaps you meant ‘round’ (imported from Prelude)”

(I think it’s not related but in case it’s useful I have seen that I have ‘/usr/bin/jackd -T -ndefault -T -d alsa’ and /usr/bin/pulseaudio --daemonize=no’’ both running)

1 Like

I think this is the same problem that forced a long sabbatical from tidal on me - took half a day to figure out. Hack/fix that worked for me suggested here is to set the path to BootTidal.hs on your machine - I have this in my init.el:
(setq tidal-boot-script-path "/home/chris/.cabal/share/x86_64-linux-ghc-8.6.5/tidal-1.4.8/BootTidal.hs")

3 Likes

that worked perfectly @TSC67 ! Thanks a lot!

@yaxu I’m not sure if this is enough general, but maybe could be also added to the documentation

Ok the page needs a revamp, but I quickly updated this page:
https://tidalcycles.org/index.php/Emacs#Testing.2C_testing

It is a wiki if anyone has time to improve it!

Thanks @yaxu

The wiki doesn’t let edit it (not belonging to the “users” group https://tidalcycles.org/index.php/TidalCycles_userbase:Users)

I think it would be great if the general Emacs page https://tidalcycles.org/index.php/Emacs can be referenced in the “Instructions: Emacs Extension” of https://tidalcycles.org/index.php/Linux_installation (I totally missed that there was a general Emacs page)

Thanks.

Hm have you created an account? You can do that here https://tidalcycles.org/index.php?title=Special:CreateAccount&returnto=TidalCycles+userbase:Users

Ahm, I thought it was the same account as this forum. Got it! Thanks

1 Like

The wiki does need some proper gardening!

Thanks a lot ! Working for me within Doom-Emacs ! :grinning: :+1:

1 Like

If anyone happens to be using Spacemacs, about a month ago I upstreamed a TidalCycles layer, so if you’re using the develop branch you just need to add tidalcycles to dotspacemacs-configuration-layers and it should work out of the box.

1 Like

i was having trouble configuring emacs for tidal and saw your post, it seemed like an exciting path.
I decided to give spacemacs a try but for me it's a huge undertaking. could you give a little more info? how can i reach the dotspacemacs configuration-layers? where in the file does the tidalcycles tag go...?

First of all, I just want to clarify that you still have to install Tidal and SuperDirt in the usual way, the Spacemacs layer will just handle the editor integration.

You can find dotspacemacs-configuration-layers in the first lines of the .spacemacs file in your home folder (if you're in Spacemacs SPC f e d should open it for you).

You can see that between parenthesis there's a list of layers that Spacemacs will install for you, you just have to add a row with tidalcycles there and then reload the configuration with SPC f e R or just close and reopen Spacemacs.

Then you start SuperDirt the usual way, you open a random file with a .tidal extension and Spacemacs should load the Tidal mode for you, and with , t s you should be able to start the connection with Tidal.

From there you can use the usual Ctrl-Ret to evaluate a line, or you can use the alternative shortcuts defined with the major mode leader key (if you press , Spacemacs should show you a menu with all the possible combos).

1 Like

don't mean to resurrect this thread, I just want to express my appreciation for that! After a half hour of troubleshooting, adding the path to BootTidal.hs did the trick for me in Doom emacs. Thank you so much!

2 Likes

With Doom Emacs I have added the BootTidal.hs path to my config.el file. However, I'm getting this error:

 x There was an unexpected error
      Message: Symbol's value as variable is void
      Data: (void-variable . ~/\.cabal/share/x86_64-linux-ghc-8\.6\.5/tidal-1\.7\.8)
      Backtrace:
        (eval-buffer #<buffer  *load*-663969> nil "/home/hypostatic/.doom.d/config
        (load-with-code-conversion "/home/hypostatic/.doom.d/config.el" "/home/hyp
        (load "/home/hypostatic/.doom.d/config" t nomessage)
        (let (file-name-handler-alist) (load (expand-file-name "config" doom-priva
        (condition-case e (let (file-name-handler-alist) (load (expand-file-name "
        (if no-config-p nil (maphash (doom-module-loader doom-module-config-file) 
        (progn (if doom-debug-p (progn (let ((inhibit-message (active-minibuffer-w
        (if init-p (progn (if doom-debug-p (progn (let ((inhibit-message (active-m
        (let* ((init-p (and t (condition-case e (let (file-name-handler-alist) (lo
        (progn (setq doom-init-modules-p t) (if no-config-p nil (if doom-debug-p (
    ! Extended backtrace logged to ~/.emacs.d/.local/doom.error.log

with this in my config.el:

(setq tidal-script-boot-path "~/.cabal/share/x86_64-osx-ghc-8.6.5/tidal-1.7.8/BootTidal.hs")

And I have verified the file exists in that path.

Not sure what I may doing wrong.

if ghci is installed with ghcup* and BootTidal.hs exists, this minimal config should work...

(use-package tidal
  :mode ("\\.tidal\\’" . tidal-mode)
  :config (setq tidal-interpreter "~/.ghcup/bin/ghci"
                haskell-process-type 'auto
                ;; boot script from https://github.com/tidalcycles/Tidal/blob/main/BootTidal.hs
                tidal-boot-script-path "~/.config/tidal/BootTidal.hs"))

*otherwise try which ghci in eshell to get the correct path for tidal-interpreter

1 Like