Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Use ableton link for scheduling #898

Merged
merged 1 commit into from
Jul 8, 2022

Conversation

Zalastax
Copy link
Collaborator

Continues from #891

@yaxu
Copy link
Member

yaxu commented Feb 17, 2022

Is this ready to merge now @Zalastax ? As far as I can tell the automated build failures are down to a weirdo cabal path change. Hopefully an easy fix and can be done post merge.

@Zalastax
Copy link
Collaborator Author

Hi @yaxu! This is fairly ready. The core of the Haskell code should be good now. However, if you look at the last commit you'll notice that I just now managed to (hopefully) squash a pretty huge bug. I therefore believe it would be best if someone else can try out some tricky cases before we merge, but it's up to you. We can also opt to squash the bugs after merging.

I have removed some functionality along the way. The getcps / getnow functions for example. Is it important to add them back before we merge? What about the destroyed functionality in tidal-listener?

OSX has not been tested. I'm fairly certain we need to change the compilation flags and tell link we're building on OSX. I can add this soon but I can't test that it actually works. An OSX user should preferably test before merging.

Finally, https://gitlab.haskell.org/ghc/ghc/-/issues/20918 has forced me to use a shared library on Windows. This will be problematic in that users might need to edit their PATH and the ghci command will be different. I'd prefer if we can find what causes this and fix it so that shared library is not used on any platform.

@yaxu yaxu mentioned this pull request Feb 21, 2022
@Zalastax
Copy link
Collaborator Author

As a reference for anyone who wants to test this, I simply use cabal v1-install --force-reinstalls . ./tidal-link/ to build. On Windows I have also ensured that the shared library that gets built is on PATH, which for me means C:\cabal\bin. Other platforms don't use a shared library.

@Zalastax
Copy link
Collaborator Author

I have prepared a branch where Windows does not use a DLL: https://github.com/Zalastax/Tidal/tree/tidal-link-no-dll. It compiles, but crashes in runtime. Windows users, please try to reproduce the issue reported in https://gitlab.haskell.org/ghc/ghc/-/issues/20918 and report your findings!

@Zalastax Zalastax force-pushed the tidal-link branch 4 times, most recently from 838b563 to e3e399a Compare July 3, 2022 18:20
@Zalastax Zalastax requested a review from yaxu July 3, 2022 18:25
@Zalastax Zalastax force-pushed the tidal-link branch 2 times, most recently from 8ceffbb to d74e57b Compare July 3, 2022 19:25
@Zalastax
Copy link
Collaborator Author

Zalastax commented Jul 3, 2022

Hi @yaxu,

This is ready for merging in my view.
It seems like the c++ options didn't work well in some CI-targets, so I removed the failing targets - I hope that's an OK resolution.

@yaxu
Copy link
Member

yaxu commented Jul 4, 2022

Hey it seems like the listener binary still isn't building for windows, is that right?

It would be best to try to support older ghc versions. So I think best add the ci checks back even if we merge them failing.

@yaxu
Copy link
Member

yaxu commented Jul 4, 2022

This is amazing work by the way, thanks very much! Looking forward to trying it out. I'd generally favour merge now and do any further dev later but it would be good to get the listener binaries building first

@Zalastax
Copy link
Collaborator Author

Zalastax commented Jul 4, 2022

Thanks for the kind words @yaxu!

Let me see what I can do. These are the things I know or will follow up on:

  1. The tidal-link library requires GHC 9.2.4 on Windows.
  2. hint does not yet support GHC 9.2.4.
  3. tidal-listener uses hint.
  4. cxx-options are not handled correctly in Cabal without Pass -optcxx for GHC >= 8.10 haskell/cabal#7072.
    • I need to check what versions of Cabal it's included in and update CI to use those Cabal versions. I tried Cabal 3.2.1.0 which should contain a backport of that pull request but CI was still failing so it seems like 3.4.0.0 will from now on be the minimum supported Cabal version.
  5. Executable version might work on Windows with GHC older than 9.2.4.
    • I should check if the binaries work on Windows with old versions of GHC and update the cabal files accordingly. The executables build but I faced some (unrelated?) errors when running:
Listening for external controls on 127.0.0.1:6010
[tidal] starting...

WontCompile [GhcError {errMsg = "<no location info>: error:\n    Could not find module \8216Sound.Tidal.Safe.Context\821...

@Zalastax
Copy link
Collaborator Author

Zalastax commented Jul 7, 2022

Hi @yaxu, the CI is now passing. Can I squash and merge?

@yaxu
Copy link
Member

yaxu commented Jul 7, 2022 via email

https://www.ableton.com/en/link/
Ableton Link keeps devices in time over a local network.

This change replaces other methods of synchronizing Tidal sessions with
each other. Tidal sessions (and other Link enabled units) will now
automatically connect and synchronize their timelines.

To stop Tidal from connecting to other peers,
configure cEnableLink = False.

Ableton Link has a 20 bpm lower limit:
Ableton/link#59

COMPATIBILITY NOTE:
Ableton Link is a C++ library. The support for using C++ libraries in
Haskell has improved over time, but toolchains that are still in use by
many might not be compatible with this change.

To ensure compatibility, please update your Haskell toolchain.
Use Cabal version 3.4.0.0 or later.
On Windows, use GHC 9.4.1.
  (see https://gitlab.haskell.org/ghc/ghc/-/issues/20918)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants