Qirky / Troop

Real-time Live Coding collaboration app
311 stars 37 forks source link

I have some questions and errors related to troop and tidalcycles. #62

Open dyedahee opened 3 years ago

dyedahee commented 3 years ago
  1. BootTidal.hs error

When running client.py, the following error occurs and the TidalCycles do not work properly.

in Troop client.py

GHCi, version 8.8.4: https://www.haskell.org/ghc/ :? for help Loaded package environment from /Users/mac/.ghc/x86_64-darwin-8.8.4/environments/default Prelude> Prelude| Prelude| IO error: "BootTidal.hs" does not exist

and terminal

ghc-pkg: cannot find package tidal Exception in Tkinter callback Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/tkinter/init.py", line 1892, in call return self.func(*args) File "/Applications/Troop/src/interface/interface.py", line 1512, in set_interpreter self.lang=langtypesname TypeError: init() missing 1 required positional argument: 'args'

So when I run client.py in the terminal with the following code, BootTidal.hs error message still pops up, but the sound is output normally. And the client terminal still says, 'ghc-pkg: cannot find package tidal.' Can I ignore this?

python3 /Applications/Troop/run-client.py -H 192.168.219.102 -s tidalcycles -m $(which ghci) -a "-ghci-script /Users/mac/.atom/packages/tidalcycles/lib/BootTidal.hs"

In this situation, if I select TidalCycles in 'Troop - Code - Choose Mode', it won't work properly. If i run TidalCycles with the code mentioned above, there is no check mark in Choose Mode. Is it stable even if the menu is not marked with a check mark? I'm planning a performance with this, just in case.

  1. Can I control SuperColider and TidalCycles at the same time in Troop? In my computer (OS), I can select several languages in Troop's 'Code - Choose Mode' at the same time. Can SuperCollider and TidalCycles be used in Troop at the same time? I tried it and I can't, but I'm asking if it's my own problem.

I have a lot of questions. Anyway, I'll be waiting for your answer. Thank you!

Qirky commented 3 years ago

Question 1)

So it might be useful to know how Troop boots up an interpreter, sprecifically Tidal, so you can find the best option for your own set up. So first it runs the command ghc-pkg field tidal data-dir to try and find out where the BootTidal.hs file is located. Troop should handle the exception if this fails e.g. ghc-pkg is not a known command. However it looks like it doesn't handle the case if tidal is not installed/not recognised by ghc-pkg which is what is happening here (hence the ghc-pkg: cannot find package tidal. error). The command doesn't raise but returns an empty string and ends up looking for BootTidal.hs in the current directory, but it isn't there (hence the Prelude> Prelude| Prelude| IO error: "BootTidal.hs" does not exist error).

So based on this it looks like you might have ghc-pkg and/or tidal set up in a way that Troop doesn't expect. If the issue is just that we can't find the BootTidal.hs file, you'll be pleased to know there is a config file for loading a bootfile from a custom path in Troop/src/conf/boot.json where you can set both the path to the interpreter (if it isn't just ghci) and the location of the BootTidal.hs.

I'm not 100% on what is causing the TypeError: init() missing 1 required positional argument: 'args' but might be related to how you are passing in the arguments via the cli using the -a flag but this might be resolved if the boot.json file configuration works for you. Let me know if it does/doesn't. As an aside: in the instance where you provide a -m flag with a path to Tidal, then TidalCycles won't be marked with a check mark as Troop sees this as a custom path i.e. a new interpreter

Question 2)

The issue must be OS related / the window library being used by Python to generate the widget for selecting an interpreter. It should be a drop down an only one value submitted (not sure which one will be used if you select multiple). If you want to use multiple languages simultaneously, have a look at my other project Polyglot

razzeee commented 3 years ago

For anyone else finding this, the ghc-pkg: cannot find package tidal is caused by this: https://gitlab.haskell.org/ghc/ghc/-/issues/17341

And some more about it https://github.com/haskell/cabal/issues/6262