Code Monkey home page Code Monkey logo

ansible-tidalcycles's Introduction

simplify installation of tidalcycles and editor(s) with ansible

ansible playbooks for installing the Tidal Cycles live coding environment with a single command, supporting multiple editors commonly used with Tidal.

Common Tidal-related modifications to the SuperCollider startup.scd are also supported, see vars/all.yml below

NOTE: if you are upgrading from Tidal <= 1.8.1

tidal 1.9.0 (and later) brings some big changes in the cabal package handling, working best with cabal >= 3.0.0.0 and a different install command.

You need to move/delete ~/.ghc and ~/.cabal directories, ie completely reset your haskell package environment.

I have now added a remove function to this tool which can setup a clean tidal slate for you

supported distros

  • ubuntu 22.04, 20.04 (and derivatives ie studio kubuntu lubuntu xubuntu etc)
  • debian 11
  • Linux Mint 21, 20
  • ansible >= 2.5

legacy (Tidal <= 1.8.1)

  • debian 10

probably also works

  • any other debian based distribution with cabal >= 3.0.0.0 available

Unsupported:

  • non-linux environments
  • Archlinux/Manjaro (some attempts were made, please check the arch_support branch)
  • other non-debian based linux distributions (patches welcome!)
  • feedforward is no longer receiving maintenance, I recommend following progress on text.management which has similar goals/features

usage:

initial installation

This repository uses git-submodules for roles, so the following clone command is required:

sudo apt install ansible git
git clone --recurse-submodules https://github.com/cleary/ansible-tidalcycles.git
cd ansible-tidalcycles/

To apply the setup to a local machine, pick a playbook (please note they are not mutually exclusive - try them all out!):

for tidalcycles standalone

sudo ansible-playbook --connection=local -i localhost, tidal.play.yml

for tidalcycles + vscode

sudo ansible-playbook --connection=local -i localhost, tidal_vscode.play.yml

for tidalcycles + pulsar (was: atom)

sudo ansible-playbook --connection=local -i localhost, tidal_pulsar.play.yml

for tidalcycles + emacs

sudo ansible-playbook --connection=local -i localhost, tidal_emacs.play.yml

for tidalcycles + neovim

sudo ansible-playbook --connection=local -i localhost, tidal_neovim.play.yml

for tidalcycles + vim

sudo ansible-playbook --connection=local -i localhost, tidal_vim.play.yml

for text.management (experimental)

sudo ansible-playbook --connection=local -i localhost, tidal_textmanagement.play.yml

upgrading

The playbooks are designed to be run and re-run, so just run them again to get latest versions of repository packages, haskell packages, git repos etc.

This repo is under active development, so grabbing the latest changes is recommended (remember the --recurse-submodules option):

git pull --recurse-submodules

The only minor gotcha is if you significantly modify any config files that are templated, eg .vimrc, startup.scd (please see vars/all.yml below), or settings.json (vscode) you will need to restore the backed up version (from the install directory) after running - alternatively, you can exclude the config writing tasks via the config tag:

sudo ansible-playbook --connection=local -i localhost, tidal.play.yml --skip-tags "config"

removal

There is a very raw tool for doing removal of tidal related directories.

It is useful when upgrades are failing, cabal isn't playing ball, or you may have used the rainbow of install commands available and be in an unknown state.

It will double confirm with you before deleting anything - make sure you understand the message, consequence and have taken care of your own backups of the affected folders.

sudo ansible-playbook --connection=local -i localhost, tidal_remove.play.yml

The tool does not touch packages installed by the package manager, or editor plugins. They are up to you to deal with.

roles

tidal

Install Tidal Cycles (http://tidalcycles.org) and dependencies (SuperCollider, haskell, SuperDirt, SuperDirt-samples etc).

This role automates the installation of SuperDirt, and SuperDirt samples in SuperCollider. It also writes a basic startup.scd as per this recommendation.

If you provide a list of samples paths via the variable custom_sample_paths in vars/all.yml, these will be added to your startup.scd and loaded on SuperCollider boot.

Please note, this will replace any existing startup.scd, but keep a backup in the same directory, to allow merge/revert. This can be excluded with --skip-tags "config"

It will also check for a newer version of sclang (eg if installed from source) and skip package installation if a newer version is found

This is a git submodule: https://github.com/cleary/ansible-tidalcycles-base

vscode

Install the vscode editor from microsoft, including useful plugins for Tidal Cycles and Haskell.

If you provide a list of samples paths via the variable custom_sample_paths in vars/all.yml, these will be added to your settings.json for the Sound Browser in the tidalcycles plugin.

Please note, this will replace any existing settings.json, but keep a backup in the same directory, to allow merge/revert. This can be excluded with --skip-tags "config"

This is a git submodule: https://github.com/cleary/ansible-tidalcycles-editor-vscode

pulsar (was: atom)

Install the pulsar editor, including useful plugins for Tidal Cycles.

If you provide a list of samples paths via the variable custom_sample_paths in vars/all.yml, these will be added to your config.cson for the Sound Browser in the tidalcycles plugin.

This is a git submodule: https://github.com/cleary/ansible-tidalcycles-editor-pulsar

emacs

Install the emacs editor, including the tidal.el plugin for Tidal Cycles.

Please note, this will replace any existing ~/.emacs, but keep a backup in the same directory, to allow merge/revert. This can be excluded with --skip-tags "config"

This is a git submodule: https://github.com/cleary/ansible-tidalcycles-editor-emacs

neovim

Install the neovim editor, including the tidal-vim plugin (sans tmux) for Tidal Cycles.

Please note, this will replace any existing init.vim, but keep a backup in the same directory, to allow merge/revert. This can be excluded with --skip-tags "config"

This is a git submodule: https://github.com/cleary/ansible-tidalcycles-editor-neovim

vim

Install the vim-nox editor, including the tidal-vim plugin (and dependencies) for Tidal Cycles.

Please note, this will replace any existing .vimrc, but keep a backup in the same directory, to allow merge/revert. This can be excluded with --skip-tags "config"

This is a git submodule: https://github.com/cleary/ansible-tidalcycles-editor-vim

text.management

Install the (currently experimental) text.management livecode editor by Matthew Kaney, intended as a dedicated livecode editor, currently supporting tidalcycles out of the box.

This is a git submodule: https://github.com/cleary/ansible-tidalcycles-editor-text_management

ugens-mutable-instruments

Install the open source Mutable Instruments Ugens for SuperCollider, configures autoloading required parameter mappings in all editors.

To enable, create/edit vars/all.yml (see vars/all.yml.ex for examples), and uncomment the lines:

sc_ugens: 
    - "mutable-instruments"
  • For available Synths, have a look at the SynthDef
  • For available options and effects, check out the parameters.hs

This is a git submodule: https://github.com/cleary/ansible-tidalcycles-synth-mi-ugens

vars

all.yml.ex

Support for various custom config attributes can be provided by copying this file to vars/all.yml and uncommenting. A summary of options:

  • add a list of paths to local Samples directories, which will be picked up and included in the startup.scd file for supercollider, and the Sound Browsers in vscode/pulsar
  • source sample sets/directories from git repositories (curated examples provided)
  • startup.scd defaults can be modified here, including sc.numOutputBusChannels commonly used for splitting audio outputs to a DAW
  • MIDI clients can be defined with a simple syntax, which then generates the needed entries in startup.scd

It is possible to use ansible tags to only update the configs (eg if you add a new Sample dir to vars/all.yml):

sudo ansible-playbook --connection=local -i localhost, tidal_vscode.play.yml --tags "config"

vagrant

Vagrant config files for testing our supported distros. Provisions each of the playbooks against a vagrant box (virtualbox provider) running the specified distro.

See vagrant/README.md for usage

todo

  • investigate $ QT_QPA_PLATFORM=offscreen sclang for starting sc instead of virt display
  • add vars for loading custom .hs files to boottidal.hs
  • add vars for loading custom .scd files to startup.scd
  • add custom synthdefs to vars
  • piv4 support cabal install tidal --lib --ghc-options=-opta-march=armv8.4a ref jarm@discord
  • sc load more file extensions
  • sc change recordings dir
  • investigate custom quarks

notes to self:

  • git pull --recurse-submodules
  • git submodule update --remote [--merge]

ansible-tidalcycles's People

Contributors

cleary avatar gilfuser avatar treethought avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ansible-tidalcycles's Issues

haskell-platform is being deprecated (from debian/bookworm)

https://www.haskell.org/platform/

Ref discussion with @ritchse on discord

ritchse — Yesterday at 06:53
@cleary had this problem on debian bookworm:

TASK [roles/tidal : install haskell packages (debian)] *******************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "No package matching 'haskell-platform' is available"}

any ideas?
(ansible)
mhmhm maybe i should add bullseye stable to my apt sources

Possible replacement:
https://packages.debian.org/source/bookworm/haskell-cabal-install

miPlaits plays through one channel only

from discord:

bromethazine — Today at 07:54
For those like me who were hitting the problem where certain Plaits engines were only outputting to the left channel: you can fix it in the SynthDef by adding sig = SplayAz.ar(~dirt.numChannels, sig); after the MiPlaits call.

hosc-0.18 fails to install on older distros

Ref: https://github.com/rd--/hosc/pull/2

 Building hosc-0.18...
Preprocessing library hosc-0.18...
[ 1 of 18] Compiling Sound.OSC.Wait   ( Sound/OSC/Wait.hs, dist/build/Sound/OSC/Wait.o )
[ 2 of 18] Compiling Sound.OSC.Coding.Convert ( Sound/OSC/Coding/Convert.hs, dist/build/Sound/OSC/Coding/Convert.o )
[ 3 of 18] Compiling Sound.OSC.Time   ( Sound/OSC/Time.hs, dist/build/Sound/OSC/Time.o )
[ 4 of 18] Compiling Sound.OSC.Datum  ( Sound/OSC/Datum.hs, dist/build/Sound/OSC/Datum.o )
[ 5 of 18] Compiling Sound.OSC.Packet ( Sound/OSC/Packet.hs, dist/build/Sound/OSC/Packet.o )
[ 6 of 18] Compiling Sound.OSC.Transport.FD ( Sound/OSC/Transport/FD.hs, dist/build/Sound/OSC/Transport/FD.o )
[ 7 of 18] Compiling Sound.OSC.Transport.Monad ( Sound/OSC/Transport/Monad.hs, dist/build/Sound/OSC/Transport/Monad.o )
[ 8 of 18] Compiling Sound.OSC.Coding.Cast ( Sound/OSC/Coding/Cast.hs, dist/build/Sound/OSC/Coding/Cast.o )
[ 9 of 18] Compiling Sound.OSC.Coding.Byte ( Sound/OSC/Coding/Byte.hs, dist/build/Sound/OSC/Coding/Byte.o )
[10 of 18] Compiling Sound.OSC.Coding.Decode.Base ( Sound/OSC/Coding/Decode/Base.hs, dist/build/Sound/OSC/Coding/Decode/Base.o )
[11 of 18] Compiling Sound.OSC.Coding.Decode.Binary ( Sound/OSC/Coding/Decode/Binary.hs, dist/build/Sound/OSC/Coding/Decode/Binary.o )
[12 of 18] Compiling Sound.OSC.Coding.Encode.Base ( Sound/OSC/Coding/Encode/Base.hs, dist/build/Sound/OSC/Coding/Encode/Base.o )
[13 of 18] Compiling Sound.OSC.Coding.Encode.Builder ( Sound/OSC/Coding/Encode/Builder.hs, dist/build/Sound/OSC/Coding/Encode/Builder.o )

Sound/OSC/Coding/Encode/Builder.hs:33:36: error:
    • Variable not in scope:
        (<>) :: B.Builder -> B.Builder -> B.Builder
    • Perhaps you meant one of these:
        ‘<$>’ (imported from Prelude), ‘*>’ (imported from Prelude),
        ‘<$’ (imported from Prelude)

Sound/OSC/Coding/Encode/Builder.hs:37:33: error:
    • Variable not in scope:
        (<>) :: B.Builder -> B.Builder -> B.Builder
    • Perhaps you meant one of these:
        ‘<$>’ (imported from Prelude), ‘*>’ (imported from Prelude),
        ‘<$’ (imported from Prelude)

Sound/OSC/Coding/Encode/Builder.hs:42:55: error:
    • Variable not in scope: (<>) :: B.Builder -> B.Builder -> t0
    • Perhaps you meant one of these:
        ‘<$>’ (imported from Prelude), ‘*>’ (imported from Prelude),
        ‘<$’ (imported from Prelude)

Sound/OSC/Coding/Encode/Builder.hs:43:26: error:
    • Variable not in scope: (<>) :: t0 -> B.Builder -> B.Builder
    • Perhaps you meant one of these:
        ‘<$>’ (imported from Prelude), ‘*>’ (imported from Prelude),
        ‘<$’ (imported from Prelude)
cabal: Leaving directory '/tmp/cabal-tmp-14650/hosc-0.18'
Building vector-0.12.1.2...
Installed distributive-0.6.2
Downloading comonad-5.0.6...
Configuring comonad-5.0.6...
Building comonad-5.0.6...
Installed comonad-5.0.6
Downloading bifunctors-5.5.7...
Configuring bifunctors-5.5.7...
Building bifunctors-5.5.7...
Installed bifunctors-5.5.7
Installed vector-0.12.1.2
cabal: Error: some packages failed to install:
hosc-0.18 failed during the building phase. The exception was:
ExitFailure 1
tidal-1.6.0 depends on hosc-0.18 which failed to install.

Cabal version check fails

Hi, I'm trying to install the VSCode ansible version and at the point where it gets the cabal version it failswith the following output:

TASK [roles/tidal : get cabal version] ********************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "cmd": "cabal --numeric-version", "delta": "0:00:00.002904", "end": "2023-01-27 18:34:05.578829", "msg": "non-zero return code", "rc": 127, "start": "2023-01-27 18:34:05.575925", "stderr": "/bin/sh: 1: cabal: not found", "stderr_lines": ["/bin/sh: 1: cabal: not found"], "stdout": "", "stdout_lines": []}

PLAY RECAP ************************************************************************************************************

I have the Haskell toolchain installed including GHC version 9.2.5 and Cabal version 3.6.2.0.

My OS is elementary OS 6.1 Jólnir (based on Ubuntu 20.04).

vagrant testing: move the ansible run command from the Vagrantfile provisioner (host ansible) to inside the guest vm (guest ansible)

currently, I run ansible external to the vagrant box, which means the host ansible version is used

on the older distros, particularly debian 9 and ubuntu 18.04 based, the version of ansible will be significantly lower, which affects module compatibility.

Rather than run the ansible provisioner from within the Vagrantfile, it should be sufficient to run a shell provisioner which kicks of the ansible command listed in the README

investigate handling legacy ansible with conditional tasks

for example, include_tasks: is not supported in the tasks/main.yml syntax on legacy ansible - maybe this can be run conditionally depending on versions.

Not sure about the rest of the tasks, but I don't have high hopes for compatibility -

might need to investigate pip install ansible, or handling an inline upgrade?

Failure to install on Ubuntu 22.04

Running:

sudo ansible-playbook --connection=local -i localhost, tidal_vim.play.yml

Produces the following error:

TASK [roles/tidal : install ansible task dependencies (debian)] ****************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failed to update apt cache: unknown reason"}

The same happens with:

sudo ansible-playbook --connection=local -i localhost, tidal.play.yml

Ubuntu 23.10 vscode no sound

Hello
I have run the ansible palybook with
sudo ansible-playbook --connection=local -i localhost, tidal_vscode.play.yml

I can play samples in the list in vscode, but I cant run my code, there is just empty output, something like this:

Loaded package environment from /home/jerabekluk/.ghc/x86_64-linux-9.0.2/environments/default
GHCi, version 9.0.2: https://www.haskell.org/ghc/  :? for help
ghci> ghci> [TidalCycles version 1.9.4]
Installed in /home/jerabekluk/.cabal/store/ghc-9.0.2/tidal-1.9.4-deefedab3084f37052b90cca25906d4ac87389bea3f7694ad9f719f3d84aac30/share
Listening for external controls on 127.0.0.1:6010
tidal> tidal> Waiting for SuperDirt (v.1.7.2 or higher)..
tidal> tidal> 

My suspicion is on the Waiting for SuperDirt (v.1.7.2 or higher)
Also because in supercollider everytime I run Superdirt.start I get:

-> SuperDirt
Booting server 'localhost' on address 127.0.0.1:57110.
Found 0 LADSPA plugins
jackdmp 1.9.21
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2016 Grame.
Copyright 2016-2022 Filipe Coelho.
jackdmp comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
JACK server starting in realtime mode with priority 10
self-connect-mode is "Don't restrict self connect requests"
audio_reservation_init
Acquire audio card Audio0
creating alsa driver ... hw:0|hw:0|1024|2|48000|0|0|nomon|swmeter|-|32bit
Released audio card Audio0
audio_reservation_finish
could not initialize audio.
Server 'localhost' exited with exit code 0.

And here the suspicious part is could not initialize audio.

Any idea what to do with that? I am using Ubuntu 23.10

Post-install fixes on i386 gnu/*nux

Thanks again for the ansible script. As said on Discord, i've installed it again last week on a fresher Devuan 4 install for i386.
After a tidal_vim installation, i've encountered issues with the tidalvim command.

In ghci

Prelude> import Sound.Tidal.Cabal

<no location info>: error:
  Could not find module 'Sound.Tidal.Cabal'

In tmux :

<interactive>:0:1: error:
  Not in scope: `Paths_tidal.getDataDir`
  No module named 'Paths_tidal' is imported.

what worked for me

  • delete all tidal-related dirs in ~/.cabal/share, ~/.cabal/lib (there were 2 tidal-1.8.0-longhash already, which could maybe have lead to a conflict?), ~/.cabal/packages/hackage.haskell.org
  • run cabal v1-update then cabal v1-install tidal
  • check in Emacs > 26 (else you'll struggle with the GNU keyring update) if it works after editing ~/.emacs, installing the Melpa package, and setting things up.
  • If it does, head up to ~/.vim/plugged/vim-tidal, run sudo make uninstall, crawl up a dir via cd ../ then sudo make install again.

Have a nice weekend

nuke option(s) for userspace packages (.cabal, .ghc etc)?

Hi Alex - just posting this for discussion when you get some free space/time (no urgency)

It seems that getting stuck in haskell dependency hell is relatively common, going by reports on the forums. The only way I know of to resolve this is by nuking directories in my userspace, and re-installing -

When in cabal dependency hell, is there a better way out than a nuke-those-dirs option?

Either way, do you think there's value offering an opt-in (and potentially slightly hidden) fix/nuke option as part of this ansible setup/set of tasks?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.