NeoVim Event Highlighting + custom keybindings

Sweet thanks for the update ! The issue with setting a colorscheme while in a tidal session arise when they don’t have the namespace (i.e CodeHighlight) referenced in their config. Maybe it is worth looking into neovim’s ColorScheme event and redefine the highlight group on those ? It’s a very minor issue tho so no worries :slight_smile:

Another small thing is that it may be not ideal to set the sc notification window filetype to supercollider IMO because the syntax here is quite different from sc code. Scnvim has a nice vim syntax file to parse this output.

Do you take pull requests ? I’d be happy to contribute if so !

Yes, of course I do take pull requests :slight_smile: What you wrote makes totally sense. So please go forward with these topics, if you don’t mind :slight_smile:

hey, thanks for posting this setup.I'll try it out when I get a chance.great vid, and syntax highlights are awesome!

Hey! It's great that you're working on this. I've been testing both b0id's and mrreason's plugins since yesterday. Thanks for your work! :+1: :+1: :+1: For now, thgrund/tidal.nvim is working, but I wanted to ask if you ever experience that sometimes SuperCollider keeps playing, but stops responding to messages from Neovim/Tidal. Changes in Neovim no longer affect what's sounding, and the highlighting stops updating. Only by closing and reopening everything does the connection get restored. If anyone has any idea what might be causing this, I’d love to hear it!

Cool work! I’m keen to take a look at what you (both - b0id, mrreason) did to get this working as it’s something I wanted to work into tidal.nvim.

I always stopped myself from getting into it though as I couldn’t help but get frustrated by parsing the code in tidal and then kind of parsing it again editor-side to match up events and buffer text. I got the feeling that there could be a cleaner approach that moves more work into a program (a tidal binary maybe?) running outside the editor that has access to the whole buffer, knows where in the buffer an event is from, and sends buffer locations and highlight durations (as OSC?) to a tiny listener on the editor.

1 Like

There is only one scenario that I am aware of. You could check this easily. Supercollider will still playback events, when you produced a syntax error in TidalCycles. This is because TidalCycles still sends the events based on the latest workin state. However I already do some calculations when you evaluated the pattern. This means, that the event highlight stops immediately for this part of the code. There is an ex command that you can use, to open the TidalCycles logs (something like :TidalNotification). Hope that helps!

Hi, I just started using this plugin, for the most part it was pretty convenient. For the life of me I can’t get the event highlighting to work. I’m new to Tidal in general so it could be I did something wrong, but I’m launching Tidal and Supercollider with the provided bootfiles and all the sounds are working. I’d love any advice on getting this working.

Thanks

Oh, could it be that I miss to explicitly explain the BootTidal.hs part?! So if you use your own BootTidal file, then you need to add a new target for the event highlighting. The example BootTidal file shows you an example for TidalCycles >1.10.0: tidal.nvim/bootfiles/BootTidal.hs at develop · thgrund/tidal.nvim · GitHub

Maybe this already helps?!

I’m using the bootfile from the repository already, would that not work?

I’m on tidal 1.10.1

Yes, that should work already. Because the event highlightings autostart is disabled by default, did you started it with the ex command :TidalStartEventHighlighting after you launched TidalCycles?

Yes, and I also enabled autostart in my config

Here’s my whole config if it helps:

I just looked into the TidalCycles config, the rest I ignored. I tried the default BootTidal on TidalCycles 1.10.1 as well and it works. Because you have a more complex setup, it could be, that a plugin has an impact on the event highlighting. This is what I am aware of:

This is not needed for me, but maybe this will lead you to a solution. Another point that I can imagine is, that the port 6013 is already in use.

The highlight groups are registered, I’ll check if the port is in use

The port is open, I’ll try a fresh nvim config to see if it’s a plugin conflict

A fresh install still doesn’t work, could it be an issue with my haskell environment? Sounds are playing perfectly well

Hmm there are just two other options that I know, otherwise I am lost. I tried your config and it works for me. Nevertheless, I didn’t added a check, whether the event highlighting was started already. I will definitely do this, but when you enabled the auto start for the highlighting, then you only need to call :TidalLaunch. If you start the highlighting Manuel anyway, then you have two competing clocks, that will interfere and cancel each other out. Second option, try to change the BootTidal.hs to an absolute path and point to somewhere outside the plugin scope. At least I faced latency issues, even when basically using the same content. Dunno. The whole event highlighting logic happens between the editor and TidalCycles with exchanging osc messages. There is nothing more going on. If you are an experienced user, you could check whether the osc messages are send properly.

Thank you so much for giving this a look. I’ll post back here when I figure out what’s going on.

Hey, yes, thanks… the file I was using has super long patterns with possible syntax errors. I know the plugin doesn’t stop on errors, but it seems to freeze in my case, which doesn’t happen in TidalVim. Could it be that “cpsfun” isn’t fully supported yet, or that there are still some things to tweak? I couldn’t get it to activate. Later I tried it in TidalVim and it’s still working. Today I tested it with shorter patterns, and it worked perfectly. I’ll keep testing, thanks…

About “cpsfun,” I mean… cps has nothing to do with this. I know that #cps worked for me, but I couldn’t get the example pattern p "cpsfun" $ s "bd sd(3,8)" # cps (slow 8 $ 0.5 + saw) to activate in TidalNvim. I just thought it might have something to do with this implementation… I’m using GHCi, version 9.6.3 [TidalCycles version 1.10.1]. Cheers

I thought I was having the same issue but it turned out to be a bit more silly. I was only testing with one line of tidal code and highlighting doesn’t seem to work on the first line. So when adding a line above it, it did start highlighting. And it’s really cool :).

1 Like