GHCi error when running .tidal file on VSCode IDE

Hello team,

I am trying to run my first .tidal file but I am having an issue.

Context:

  • On SuperCollider IDE, I run SuperDirt.start; then s.makeGui;, as I am following this tutorial.

  • These are the quarks I have installed on SuperCollider IDE:

  1. BatLib

  2. Dirt-Samples

  3. FoxDot

  4. SuperDirt

  5. Vowel

  • On VSCode, I have the TidalCycles for VSCodev1.4.1 extension.

  • On VSCode Tidalcycles settings I have the following ghci path set:
    The path or command used to run GHCi.
    /home/milan/.ghcup/bin/ghci

  • I have version 9.4.8 of ghci

milan@milan:~$ pwd
/home/milan
milan@milan:~$ ./.ghcup/bin/ghci
GHCi, version 9.4.8: https://www.haskell.org/ghc/  :? for help
  • On VSCode, I try to run a .tidal file with the following code:
    d1 $ sound 'cp'

  • And I get the following error:

GHCi, version 9.4.8: https://www.haskell.org/ghc/  :? for help
ghci> ghci> Warning: GHCi | 
Warning: GHCi | <no location info>: error:
Warning: GHCi |     Could not find module ‘Sound.Tidal.Context’
Warning: GHCi |     It is not a module in the current program, or in any known package.
Warning: GHCi | 
Warning: GHCi | <interactive>:6:39: error: Not in scope: ‘oLatency’
Warning: GHCi | 
Warning: GHCi | <interactive>:6:55: error: Not in scope: ‘oAddress’
Warning: GHCi | 
Warning: GHCi | <interactive>:6:79: error: Not in scope: ‘oPort’
Warning: GHCi | 
Warning: GHCi | <interactive>:6:111: error: Not in scope: ‘cFrameTimespan’
Warning: GHCi | 
Warning: GHCi | <interactive>:21:38: error:
Warning: GHCi |     Not in scope: ‘Sound.Tidal.Transition.xfadeIn’
Warning: GHCi |     NB: no module named ‘Sound.Tidal.Transition’ is imported.
Warning: GHCi | 
Warning: GHCi | <interactive>:22:42: error:
Warning: GHCi |     Not in scope: ‘Sound.Tidal.Transition.xfadeIn’
Warning: GHCi |     NB: no module named ‘Sound.Tidal.Transition’ is imported.
Warning: GHCi | 
Warning: GHCi | <interactive>:23:42: error:
Warning: GHCi |     Not in scope: ‘Sound.Tidal.Transition.histpan’
Warning: GHCi |     NB: no module named ‘Sound.Tidal.Transition’ is imported.
Warning: GHCi | 
Warning: GHCi | <interactive>:24:39: error:
Warning: GHCi |     Not in scope: ‘Sound.Tidal.Transition.wait’
Warning: GHCi |     NB: no module named ‘Sound.Tidal.Transition’ is imported.
Warning: GHCi | 
Warning: GHCi | <interactive>:25:42: error:
Warning: GHCi |     Not in scope: ‘Sound.Tidal.Transition.waitT’
Warning: GHCi |     NB: no module named ‘Sound.Tidal.Transition’ is imported.
Warning: GHCi | 
Warning: GHCi | <interactive>:26:37: error:
Warning: GHCi |     Not in scope: ‘Sound.Tidal.Transition.jump’
Warning: GHCi |     NB: no module named ‘Sound.Tidal.Transition’ is imported.
Warning: GHCi | 
Warning: GHCi | <interactive>:27:41: error:
Warning: GHCi |     Not in scope: ‘Sound.Tidal.Transition.jumpIn’
Warning: GHCi |     NB: no module named ‘Sound.Tidal.Transition’ is imported.
Warning: GHCi | 
Warning: GHCi | <interactive>:28:42: error:
Warning: GHCi |     Not in scope: ‘Sound.Tidal.Transition.jumpIn'’
Warning: GHCi |     NB: no module named ‘Sound.Tidal.Transition’ is imported.
Warning: GHCi | 
Warning: GHCi | <interactive>:29:42: error:
Warning: GHCi |     Not in scope: ‘Sound.Tidal.Transition.jumpMod’
Warning: GHCi |     NB: no module named ‘Sound.Tidal.Transition’ is imported.
Warning: GHCi | 
Warning: GHCi | <interactive>:30:56: error:
Warning: GHCi |     Not in scope: ‘Sound.Tidal.Transition.mortal’
Warning: GHCi |     NB: no module named ‘Sound.Tidal.Transition’ is imported.
Warning: GHCi | 
Warning: GHCi | <interactive>:31:44: error:
Warning: GHCi |     Not in scope: ‘Sound.Tidal.Transition.interpolate’
Warning: GHCi |     NB: no module named ‘Sound.Tidal.Transition’ is imported.
Warning: GHCi | 
Warning: GHCi | <interactive>:32:48: error:
Warning: GHCi |     Not in scope: ‘Sound.Tidal.Transition.interpolateIn’
Warning: GHCi |     NB: no module named ‘Sound.Tidal.Transition’ is imported.
Warning: GHCi | 
Warning: GHCi | <interactive>:33:39: error:
Warning: GHCi |     Not in scope: ‘Sound.Tidal.Transition.clutch’
Warning: GHCi |     NB: no module named ‘Sound.Tidal.Transition’ is imported.
Warning: GHCi | 
Warning: GHCi | <interactive>:34:43: error:
Warning: GHCi |     Not in scope: ‘Sound.Tidal.Transition.clutchIn’
Warning: GHCi |     NB: no module named ‘Sound.Tidal.Transition’ is imported.
Warning: GHCi | 
Warning: GHCi | <interactive>:35:43: error:
Warning: GHCi |     Not in scope: ‘Sound.Tidal.Transition.anticipate’
Warning: GHCi |     NB: no module named ‘Sound.Tidal.Transition’ is imported.
Warning: GHCi | 
Warning: GHCi | <interactive>:36:47: error:
Warning: GHCi |     Not in scope: ‘Sound.Tidal.Transition.anticipateIn’
Warning: GHCi |     NB: no module named ‘Sound.Tidal.Transition’ is imported.
Warning: GHCi | 
Warning: GHCi | <interactive>:37:41: error:
Warning: GHCi |     Not in scope: ‘Sound.Tidal.Transition.mortalOverlay’
Warning: GHCi |     NB: no module named ‘Sound.Tidal.Transition’ is imported.
Warning: GHCi | 
Warning: GHCi | <interactive>:56:12: error:
Warning: GHCi |     Variable not in scope: streamSetI :: t4 -> t
Warning: GHCi | 
Warning: GHCi | <interactive>:56:23: error: Variable not in scope: tidal
Warning: GHCi | 
Warning: GHCi | <interactive>:57:12: error:
Warning: GHCi |     Variable not in scope: streamSetF :: t3 -> t
Warning: GHCi | 
Warning: GHCi | <interactive>:57:23: error: Variable not in scope: tidal
Warning: GHCi | 
Warning: GHCi | <interactive>:58:12: error:
Warning: GHCi |     Variable not in scope: streamSetS :: t2 -> t
Warning: GHCi | 
Warning: GHCi | <interactive>:58:23: error: Variable not in scope: tidal
Warning: GHCi | 
Warning: GHCi | <interactive>:59:12: error:
Warning: GHCi |     Variable not in scope: streamSetI :: t1 -> t
Warning: GHCi | 
Warning: GHCi | <interactive>:59:23: error: Variable not in scope: tidal
Warning: GHCi | 
Warning: GHCi | <interactive>:60:12: error:
Warning: GHCi |     Variable not in scope: streamSetB :: t0 -> t
Warning: GHCi | 
Warning: GHCi | <interactive>:60:23: error: Variable not in scope: tidal
tidal> Warning: GHCi | 
Warning: GHCi | <interactive>:64:12: error:
Warning: GHCi |     • Syntax error on 'cp'
Warning: GHCi |       Perhaps you intended to use TemplateHaskell or TemplateHaskellQuotes
Warning: GHCi |     • In the Template Haskell quotation 'cp'
tidal> 
  • I see that although I have the TidalCycles for VSCode extension installed, the code from .tidal files do not appear marked, it appears displayed as plain text.

  • I already tried reinstalling the TidalCycles for VSCode extension and restarting the IDE.

Can someone please assist?

hi Milan, did you solve this? I've been using tidal forever but suddenly got these same errors pretty much :frowning:

Looks like this is linked to the latest Tidalcycles package update. What worked for me was selecting Install Specific Version and then select 1.4.1 and it should work again!

1 Like

The original error was from 2024, back when v1.4.1 of the extension was published. I'm skeptical that v2.0.0 is causing the error, but @blizzy seems to suddenly have issues after the v2.0.0 extension update.

Perhaps the biggest change in the extension is that it dynamically looks for Tidal's BootTidal.hs file in the cabal installation location.

@blizzy @liimxa @Milan can you provide a screenshot of the very beginning of the extension bootup process? I'm interested in seeing these lines on your systems:

1 Like

hey there! so after updating the extension, oddly enough I get this error when initially trying to boot tidal, but if I evaluate a code block a second time everything seems to work & sound fine. (also, minor issue, but my code evaluation highlight color seems to have changed with the update. not sure if I'm misremembering though)

2025-05-03 12:17:08.566 [info] Custom Tidal boot path is not configured

2025-05-03 12:17:08.566 [info] Local Tidal boot file was found: /Users/may/Documents/music-tools/tidal/BootTidal.hs
2025-05-03 12:17:08.566 [info] custom GHCI base path configured at ghci
2025-05-03 12:17:08.566 [info] GHCI path: ghci
2025-05-03 12:17:08.566 [info] Tidal boot path: /Users/may/Documents/music-tools/tidal/BootTidal.hs
2025-05-03 12:17:08.703 [info] t>  Loaded package environment from /Users/may/.ghc/aarch64-darwin-9.6.7/environments/default

2025-05-03 12:17:09.432 [info] t>  ghci> ghci>
2025-05-03 12:17:09.497 [info] t>  [TidalCycles version 1.9.5]
Installed in /Users/may/.local/state/cabal/store/ghc-9.6.7/tdl-1.9.5-54e109f8/share
Listening for external controls on 127.0.0.1:6010
ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci|C ongnheccit|e d gthoc iS|u pegrhDciir|t .
ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci|
2025-05-03 12:17:09.571 [info] t>  ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci| ghci|
2025-05-03 12:17:09.580 [info] t>     
2025-05-03 12:17:09.589 [info] t>              
2025-05-03 12:17:09.590 [info] t>  
2025-05-03 12:17:09.631 [error] t>  
 [GHC-58481] parse error on input ‘:’

 [GHC-39999]
    • No instance for ‘Show (Pattern ValueMap -> IO ())’
        arising from a use of ‘print’
        (maybe you haven't applied a function to enough arguments?)
    • In a stmt of an interactive GHCi command: print it

 [GHC-58481]
    parse error on input ‘$’
    Suggested fix: Perhaps you intended to use TemplateHaskell

 [GHC-58481]
    parse error on input ‘$’
    Suggested fix: Perhaps you intended to use TemplateHaskell

 [GHC-58481]
    parse error on input ‘$’
    Suggested fix: Perhaps you intended to use TemplateHaskell

 [GHC-58481]
    parse error on input ‘$’
    Suggested fix: Perhaps you intended to use TemplateHaskell

 [GHC-58481] parse error on input ‘#’

 [GHC-58481] parse error on input ‘#’

 [GHC-58481] parse error on input ‘#’

 [GHC-58481] parse error on input ‘#’

 [GHC-58481] parse error on input ‘#’

 [GHC-58481] parse error on input ‘#’
unknown command ':}'
use :? for help.

Hm that's strange, if you don't mind sharing the contents of this BootTidal.hs file, we could have a look to see what's wrong.

Sure thing, thanks! Here's my BootTidal.hs :

:set -XOverloadedStrings
:set prompt ""

import Sound.Tidal.Context

import System.IO (hSetEncoding, stdout, utf8)
hSetEncoding stdout utf8

tidal <- startTidal (superdirtTarget {oLatency = 0.05, oAddress = "127.0.0.1", oPort = 57120}) (defaultConfig {cVerbose = True, cFrameTimespan = 1/20})

:{
let only = (hush >>)
    p = streamReplace tidal
    hush = streamHush tidal
    panic = do hush
               once $ sound "superpanic"
    list = streamList tidal
    mute = streamMute tidal
    unmute = streamUnmute tidal
    unmuteAll = streamUnmuteAll tidal
    unsoloAll = streamUnsoloAll tidal
    solo = streamSolo tidal
    unsolo = streamUnsolo tidal
    once = streamOnce tidal
    first = streamFirst tidal
    asap = once
    nudgeAll = streamNudgeAll tidal
    all = streamAll tidal
    resetCycles = streamResetCycles tidal
    setCycle = streamSetCycle tidal
    setcps = asap . cps
    setbpm bpm = setcps (bpm/60/4)
    getcps = streamGetcps tidal
    getnow = streamGetnow tidal
    revOn' vs f = foldr (\x -> inside x rev . rev) f vs
    revOn x = revOn' [x]
    xfade i = transition tidal True (Sound.Tidal.Transition.xfadeIn 4) i
    xfadeIn i t = transition tidal True (Sound.Tidal.Transition.xfadeIn t) i
    histpan i t = transition tidal True (Sound.Tidal.Transition.histpan t) i
    wait i t = transition tidal True (Sound.Tidal.Transition.wait t) i
    waitT i f t = transition tidal True (Sound.Tidal.Transition.waitT f t) i
    jump i = transition tidal True (Sound.Tidal.Transition.jump) i
    jumpIn i t = transition tidal True (Sound.Tidal.Transition.jumpIn t) i
    jumpIn' i t = transition tidal True (Sound.Tidal.Transition.jumpIn' t) i
    jumpMod i t = transition tidal True (Sound.Tidal.Transition.jumpMod t) i
    jumpMod' i t p = transition tidal True (Sound.Tidal.Transition.jumpMod' t p) i
    mortal i lifespan release = transition tidal True (Sound.Tidal.Transition.mortal lifespan release) i
    interpolate i = transition tidal True (Sound.Tidal.Transition.interpolate) i
    interpolateIn i t = transition tidal True (Sound.Tidal.Transition.interpolateIn t) i
    clutch i = transition tidal True (Sound.Tidal.Transition.clutch) i
    clutchIn i t = transition tidal True (Sound.Tidal.Transition.clutchIn t) i
    anticipate i = transition tidal True (Sound.Tidal.Transition.anticipate) i
    anticipateIn i t = transition tidal True (Sound.Tidal.Transition.anticipateIn t) i
    forId i t = transition tidal False (Sound.Tidal.Transition.mortalOverlay t) i
    d1 = p 1 . (|< orbit 0)
    d2 = p 2 . (|< orbit 1)
    d3 = p 3 . (|< orbit 2)
    d4 = p 4 . (|< orbit 3)
    d5 = p 5 . (|< orbit 4)
    d6 = p 6 . (|< orbit 5)
    d7 = p 7 . (|< orbit 6)
    d8 = p 8 . (|< orbit 7)
    d9 = p 9 . (|< orbit 8)
    d10 = p 10 . (|< orbit 9)
    d11 = p 11 . (|< orbit 10)
    d12 = p 12 . (|< orbit 11)
    d13 = p 13
    d14 = p 14
    d15 = p 15
    d16 = p 16
:}

:{
let fmamp op = pF ("amp" ++ show op)
    fmratio op = pF ("ratio" ++ show op)
    fmdt op = pF ("detune" ++ show op)
    fmmod opa opb = pF ("mod" ++ show opa ++ show opb)
    fmegrate op step = pF ("egrate" ++ show op ++ show step)
    fmeglevel op step = pF ("eglevel" ++ show op ++ show step)
    fmfb = pF "feedback"
    lfof = pF "lfofreq"
    lfod = pF "lfodepth" --amplitude 0 - 1
    fmparam function = foldr (#) (gain 1) . zipWith function [1..]
    fma = fmparam fmamp
    fmr = fmparam fmratio
    fmd = fmparam fmdt
    fmer op = fmparam (fmegrate op) -- higher nr = faster
    fmel op = fmparam (fmeglevel op)
    fmm opa = fmparam (fmmod opa)
:}


-- lessDense function https://club.tidalcycles.org/t/limit-events-based-on-delta-time/3121
import Data.List(sortOn)
:{
densityFilter:: Eq a => Double -> [Event a] -> [Event a]
densityFilter density events = foldl (fi density) events [0..length events -1]
                      where fi density es n | length es > n = filter (\e -> e == es!!n || abs ((eventPartStart e) - (eventPartStart (es!!n))) >= toRational density ) es
                                            | otherwise = es

lessDense :: Eq a => Double -> Pattern a -> Pattern a
lessDense density p = p {query = (densityFilter density). sortOn whole . query p}
:}

-- tidal-looper
:{
    linput = pI "linput" -- change input bus
    lname = pS "lname" -- change buffer name
:}

:{
let getState = streamGet tidal
    setI = streamSetI tidal
    setF = streamSetF tidal
    setS = streamSetS tidal
    setR = streamSetR tidal
    setB = streamSetB tidal
:}

:script /Users/may/Library/Application\ Support/SuperCollider/synthdefs/mi-ugens-params.hs
:set prompt "tidal> "
:set prompt-cont ""

default (Pattern String, Integer, Double)

Hmm that file works fine for me. The error message is complaining about a line print it which isn't in that file. Unless it's in /Users/may/Library/Application\ Support/SuperCollider/synthdefs/mi-ugens-params.hs ?

Unfortunately there doesn't seem to be a print it statement in mi-ugens-params.hs either:

let
-- mutable synths
    timbre = pF "timbre"
    color = pF "color"
    model = pI "model"
    mode = pI "mode"
    tidesshape = pF "tidesshape"
    tidessmooth = pF "tidessmooth"
    slope = pF "slope"
    shift = pF "shift"
    engine = pI "engine"
    harm = pF "harm"
    morph = pF "morph"
    level = pF "level"
    lpgdecay = pF "lpgdecay"
    lpgcolour = pF "lpgcolour"
    lpg d c = lpgdecay d # lpgcolour c
-- mutable effects
    cloudspitch = pF "cloudspitch"
    cloudspos = pF "cloudspos"
    cloudssize = pF "cloudssize"
    cloudsdens = pF "cloudsdens"
    cloudstex = pF "cloudstex"
    cloudswet = pF "cloudswet"
    cloudsgain = pF "cloudsgain"
    cloudsspread = pF "cloudsspread"
    cloudsrvb = pF "cloudsrvb"
    cloudsfb = pF "cloudsfb"
    cloudsfreeze = pI "cloudsfreeze"
    cloudsmode = pI "cloudsmode"
    cloudslofi = pF "cloudslofi"
    clouds p s d t = cloudsgain 1 # cloudspos p # cloudssize s # cloudsdens d # cloudstex t
    cloudsblend w s f r = cloudsgain 1 # cloudswet w # cloudsspread s # cloudsfb f # cloudsrvb r
    elementspitch = pF "elementspitch"
    elementsstrength = pF "elementsstrength"
    elementscontour = pF "elementscontour"
    elementsbowlevel = pF "elementsbowlevel"
    elementsblowlevel = pF "elementsblowlevel"
    elementsstrikelevel = pF "elementsstrikelevel"
    elementsflow = pF "elementsflow"
    elementsmallet = pF "elementsmallet"
    elementsbowtimb = pF "elementsbowtimb"
    elementsblowtimb = pF "elementsblowtimb"
    elementsstriketimb = pF "elementsstriketimb"
    elementsgeom = pF "elementsgeom"
    elementsbright = pF "elementsbright"
    elementsdamp = pF "elementsdamp"
    elementspos = pF "elementspos"
    elementsspace = pF "elementsspace"
    elementsmodel = pI "elementsmodel"
    elementseasteregg = pI "elementseasteregg"
    mu = pF "mu"
    ringsfreq = pF "ringsfreq"
    ringsstruct = pF "ringsstruct"
    ringsbright = pF "ringsbright"
    ringsdamp = pF "ringsdamp"
    ringspos = pF "ringspos"
    ringsmodel = pF "ringsmodel"
    ringspoly = pI "ringspoly"
    ringsinternal = pI "ringsinternal"
    ringseasteregg = pI "ringseasteregg"
    rings f s b d p = ringsfreq f # ringsstruct s # ringsbright b # ringsdamp d # ringspos p
    ripplescf = pF "ripplescf"
    ripplesreson = pF "ripplesreson"
    ripplesdrive = pF "ripplesdrive"
    ripples c r d = ripplescf c # ripplesreson r # ripplesdrive d
    verbgain = pF "verbgain"
    verbwet = pF "verbwet"
    verbtime = pF "verbtime"
    verbdamp = pF "verbdamp"
    verbhp = pF "verbhp"
    verbfreeze = pI "verbfreeze"
    verbdiff = pF "verbdiff"
    verb w t d h = verbgain 1 # verbwet w # verbtime t # verbdamp d # verbhp h
    warpsalgo = pI "warpsalgo"
    warpstimb = pF "warpstimb"
    warpsosc = pI "warpsosc"
    warpsfreq = pF "warpsfreq"
    warpsvgain = pF "warpsvgain"
    warpseasteregg = pI "warpseasteregg"