Issue importing Sound.Tidal.Chords (hidden package error in Pulsar/Atom)

Hello everyone,

I hope this post finds you well.

I am trying to learn a bit more about the internal workings of Tidal Cycles and explore some of the advanced harmony features. Following the documentation reference for harmony and melody ( Harmony & Melody | Tidal Cycles ), I'm attempting to import the Sound.Tidal.Chords module to use functions like chordTable within my own definitions.

However, when I try to run import Sound.Tidal.Chords in my Atom/Pulsar editor environment (using the standard TidalCycles plugin setup), I receive the following GHC error:

t> 
: error: [GHC-87110]
    Could not load module `Sound.Tidal.Chords'.
    It is a member of the hidden package `tidal-core-1.10.1'.
    You can run `:set -package tidal-core' to expose it.
    (Note: this unloads all the modules in the current scope.)

The error suggests running :set -package tidal-core in the console. When I do this, it successfully exposes the module and I can access chordTable. But, as the warning states, it unloads everything else in the scope, and I lose the standard Tidal functionality (e.g., d1, s, sound commands stop working).

My goal is simply to be able to import Sound.Tidal.Chords alongside the main Tidal environment so I can use its functions in custom patterns.

Is there a standard or recommended way to resolve this and have everything working together?

Thank you very much for your time and help.

Best regards,

Luis

I've run into a similar problem with tidal's emacs mode before (when I want to import Data.Map, I need to :set -package containers and this kills the tidal session (tidal emacs mode) how to import from hidden packages? ) and I'd like to know how this should be dealt with properly.

I can think of these work-arounds:

  • do cabal install --lib tidal-core (run from a console, once.) This will expose all modules from that package, so you can import them from ghci, without any -package declaration.

  • add a line :set -package tidal-core to BootTidal.hs

both are quite heavy-handed, and would have to be repeated for any extra package that I might want to use.

1 Like