Skip to content

Make a usable interface for the link protocol via hylia #1

Description

@yaxu

Ref tidal ticket tidalcycles/Tidal#660

and short discussion here Ableton/link#71 (comment)

Lets make Haskell bindings to the lovely https://github.com/falkTX/Hylia

I don't really know what I'm doing, but the current WIP in this repo seems to be basically functional.

alex@teff:~/src/hylia-haskell$ cat examples/test.hs 
import Network.Hylia

import Foreign
import Foreign.Ptr
import Foreign.C.Types

main = alloca $
  \timeinfoPtr -> do hylia <- hylia_create
                     hylia_enable hylia (CBool 1)
                     hylia_process hylia 1 timeinfoPtr
                     timeinfo <- peek timeinfoPtr
                     putStrLn $ show timeinfo
                     hylia_set_beats_per_bar hylia (CDouble 3)
                     hylia_process hylia 1 timeinfoPtr
                     timeinfo <- peek timeinfoPtr
                     putStrLn $ show timeinfo
                     return ()
alex@teff:~/src/hylia-haskell$ cabal v1-install
Warning: The package list for 'hackage.haskell.org' is 64 days old.
Run 'cabal update' to get the latest list of available packages.
Resolving dependencies...
In order, the following will be installed:
hylia-0.1.0.0 (reinstall)
Warning: Note that reinstalls are always dangerous. Continuing anyway...
Starting     hylia-0.1.0.0
Building     hylia-0.1.0.0
Completed    hylia-0.1.0.0
alex@teff:~/src/hylia-haskell$ runhaskell examples/test.hs
TimeInfo {beatsPerBar = 4.0, beatsPerMinute = 120.0, beat = 2.48e-4, phase = 2.48e-4, playing = 0}
TimeInfo {beatsPerBar = 3.0, beatsPerMinute = 120.0, beat = 3.368e-3, phase = 3.368e-3, playing = 0}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions