Introducing CycSeq: a cycle sequencer for tidal

I wrote a piece of software to run TidalCycles code sequentially and automatically. I did this because I found it interesting to change the sound of a guitar (or any other input signal) with effects that are changed live by patterns while playing.

Maybe one or the other has a use for such an application. I can imagine that you can also use it for other purposes. Of course you can also use the program to do live coding with it and use it to manage the written code live and let the computer execute it with a time delay. Or this could also become interesting for live sampling.

If you are interested, you can find the project on my GitHub page:

I have created a small demo video about it:

Btw. it is also my debut to present some music created with TidalCycles to the community (exciting!)

26 Likes

That was super cool!

I understand the software is providing a similar function to seqP, and it has some nice visual cues for indicating section -

Is there something the software does related to the live guitar input that I'm missing though?

This is very cool! Can you explain a bit what's going on behind the scenes ? Specifically, what parts are communicating with each other and via what protocol ?

It seems like you have logic in there specific for abelton live (the caribiner) but I also see there is an install instruction for Linux, so I'm a little confused how it all fits together.

I love this, though - very nice effect and great playing!

Thank you very much! Exactly it works similar to seqP.

With a lot of sequentially executed code (I think) it remains traceable where you are currently located. I also use the application in principle to automate and visualize my recording process.
Furthermore, with the UI you can start the sequencer at any time at any place and it will always be triggered at the start of a cycle.

Otherwise, the input signal in the video is only modified using the tidals pattern, the application does nothing else but execute it.

1 Like

Of course I can explain a little bit more!

I forked the extramuros project and played a little with the code.
On the browser side, I send (and could receive to control the application) osc messages wich are send to a server via websockets. When starting the application a ghci session is created (see client) and connects to SuperCollider, an ableton link connection is established and the server is started (except for the link support extramuros does the same).
So basically I send osc messages once to a client (containing the tidal code), which is then processed as usual and the result is sent to SuperCollider and I send osc messages directly to SuperCollider (this is new).

Ableton Link can also be used completely independently of Ableton Live. As far as I understand it, this is simply a C++ library. And SuperCollider has had link support since version 3.10.4 (see LinkClock).
There should be no reason why it should not work on Linux (on my Ubuntu 18.04 at least it works in SuperCollider). I used the packet Ableton Link node add-on from npm to realise the link connection in the browser side (used in sequencer.js)

Even though you can use Ableton Link without the DAW, I use Ableton Live and CycSeq to simplify my recording process so I could mix in Ableton later (See https://info-grund.com/owncloud/index.php/s/y2CEwOi4hrjremf -> I think you have to download the gif to see the animation). But in the demo video I only used it once for recording.

I hope I could clarify things a bit, but if there are still open questions, feel free to ask.

And thanks! I also plan to experiment more with pattern based synchronous effect changes of input signals with tidal!

5 Likes

Hello,

New to Tidal, I find CycSeq for sequencing written code very interesting.

I've tried to install it to see if it it can achieve what I want :-> triggering written code in Tidal with a MIDI controller, by:

  1. selecting code snippets though an indexed library thanks to an encoder (code snippets could be written in different files to be easily selected if it is easier)
  2. triggering the code (or file) thanks to a button or a pad.

But I could not make CycSeq work from github, to check if it could achieve what I want.

After node start, I've got in the terminal window:

> internal/modules/cjs/loader.js:1083

throw err;
^

Error: Cannot find module '/Users/xon/cycseq/start'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1080:15)
at Function.Module._load (internal/modules/cjs/loader.js:923:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack:
}

And after installing node.js, and evaluating npm install, I had in the terminal window:

@serialport/bindings@8.0.8 install /Users/xon/cycseq/node_modules/@serialport/bindings
prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild

prebuild-install WARN install No prebuilt binaries found (target=14.8.0 runtime=node arch=x64 libc= platform=darwin)
CXX(target) Release/obj.target/bindings/src/serialport.o
CXX(target) Release/obj.target/bindings/src/serialport_unix.o
CXX(target) Release/obj.target/bindings/src/poller.o
CXX(target) Release/obj.target/bindings/src/darwin_list.o
SOLINK_MODULE(target) Release/bindings.node

abletonlink-addon@0.2.6 install /Users/xon/cycseq/node_modules/abletonlink-addon
npm run build

abletonlink-addon@0.2.6 build /Users/xon/cycseq/node_modules/abletonlink-addon
node-gyp configure && node-gyp rebuild

CXX(target) Release/obj.target/AbletonLinkAddon/src/myLink.o
../src/myLink.cpp:125:21: warning: unused variable 'status' [-Wunused-variable]
napi_status status = numPeersCallback.BlockingCall([numPeers](Na...
^
../src/myLink.cpp:148:21: warning: unused variable 'status' [-Wunused-variable]
napi_status status = tempoCallback.BlockingCall([tempo](Napi::En...
^
../src/myLink.cpp:171:21: warning: unused variable 'status' [-Wunused-variable]
napi_status status = startStopCallback.BlockingCall([isPlaying](...
^
3 warnings generated.
CXX(target) Release/obj.target/AbletonLinkAddon/src/index.o
SOLINK_MODULE(target) Release/AbletonLinkAddon.node

serialport@8.0.6 postinstall /Users/xon/cycseq/node_modules/serialport
node thank-you.js

Thank you for using serialport!
If you rely on this package, please consider supporting our open collective:
Contribute - Open Collective

npm WARN cycseq@0.1.0 No repository field.
npm WARN cycseq@0.1.0 No license field.

added 252 packages from 230 contributors and audited 253 packages in 32.236s

4 packages are looking for funding
run npm fund for details

found 1 low severity vulnerability
run npm audit fix to fix them, or npm audit for details

Maybe, someone has an idea how to make it work or how I can achieve what I wanted at the beginning?

Many thanks,
Christophe

Hello @Xon and many thanks for your interest in CycSeq!

I don't know if CycSeq can do what you want it to do right now, but feel free to try it out.
There was a failure in the README, because you start the sofware with npm start (I adjusted that in the documentation)

On the subject of MIDI control of the software: I plan to implement this in the near future (see MIDI control project). So if there is something I have not considered or if functionality is missing, then I would appreciate feedback.

Thanks, @mrreason,

By evaluating npm start, I've got this error in the terminal window :
I can provide the log file if necessary.

cycseq@0.1.0 start /Users/xon/cycseq
concurrently --default-input-target 1 -i --kill-others -n "server,client,link" "npm run start:server" "npm run start:client -f" "npm run start:linkserver"

[client] npm WARN using --force I sure hope you know what you are doing.
[link]
[link] > cycseq@0.1.0 start:linkserver /Users/xon/cycseq
[link] > node linkserver.js
[link]
[client]
[client] > cycseq@0.1.0 start:client /Users/xon/cycseq
[client] > node client.js --server 127.0.0.1 --tidalCabal
[client]
[server]
[server] > cycseq@0.1.0 start:server /Users/xon/cycseq
[server] > node server.js --password p -o 57121 -s 57120
[server]
[client] extramuros: connecting to ws://127.0.0.1:8000...
[client] events.js:291
[client] throw er; // Unhandled 'error' event
[client] ^
[client]
[client] Error: spawn ghci ENOENT
[client] at Process.ChildProcess._handle.onexit (internal/child_process.js:268:19)
[client] at onErrorNT (internal/child_process.js:468:16)
[client] at processTicksAndRejections (internal/process/task_queues.js:80:21)
[client] Emitted 'error' event on ChildProcess instance at:
[client] at Process.ChildProcess._handle.onexit (internal/child_process.js:274:12)
[client] at onErrorNT (internal/child_process.js:468:16)
[client] at processTicksAndRejections (internal/process/task_queues.js:80:21) {
[client] errno: -2,
[client] code: 'ENOENT',
[client] syscall: 'spawn ghci',
[client] path: 'ghci',
[client] spawnargs: [ '-XOverloadedStrings' ]
[client] }
[client] npm run start:client -f exited with code 0
--> Sending SIGTERM to other processes..
[server] extramuros: listening for OSC on UDP port 57121
[server] extramuros: send osc messages on UDP port 57120
[link] Link server is listening on port 8001
[server] extramuros server, listening on TCP port 8000 (http/WebSockets)
[server] npm run start:server exited with code SIGTERM
--> Sending SIGTERM to other processes..
[link] npm run start:linkserver exited with code SIGTERM
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! cycseq@0.1.0 start: concurrently --default-input-target 1 -i --kill-others -n "server,client,link" "npm run start:server" "npm run start:client -f" "npm run start:linkserver"
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the cycseq@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/xon/.npm/_logs/2020-08-22T16_00_03_498Z-debug.log

I'm not sure, but it looks like your ghci is not configured properly. When I usually send TidalCycles code from VScode or Atom and a noise comes from SuperCollider, I usually can use CycSeq.

Btw. the server was started and the link connection was established. The problem definitely lies in establishing the ghci session.

Could you please enter npm run start:client in the console and send me the log?

Many thanks,

Here is the log :

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'start:client' ]
2 info using npm@6.14.7
3 info using node@v14.8.0
4 verbose run-script [ 'prestart:client', 'start:client', 'poststart:client' ]
5 info lifecycle cycseq@0.1.0~prestart:client: cycseq@0.1.0
6 info lifecycle cycseq@0.1.0~start:client: cycseq@0.1.0
7 verbose lifecycle cycseq@0.1.0~start:client: unsafe-perm in lifecycle true
8 verbose lifecycle cycseq@0.1.0~start:client: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/xon/cycseq/node_modules/.bin:/Users/xon/opt/miniconda3/bin:/Users/xon/opt/miniconda3/condabin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/Users/xon/cdpr7/_cdp/_cdprogs
9 verbose lifecycle cycseq@0.1.0~start:client: CWD: /Users/xon/cycseq
10 silly lifecycle cycseq@0.1.0~start:client: Args: [ '-c', 'node client.js --server 127.0.0.1 --tidalCabal' ]
11 silly lifecycle cycseq@0.1.0~start:client: Returned: code: 1 signal: null
12 info lifecycle cycseq@0.1.0~start:client: Failed to exec start:client script
13 verbose stack Error: cycseq@0.1.0 start:client: node client.js --server 127.0.0.1 --tidalCabal
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:314:20)
13 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:314:20)
13 verbose stack at maybeClose (internal/child_process.js:1051:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
14 verbose pkgid cycseq@0.1.0
15 verbose cwd /Users/xon/cycseq
16 verbose Darwin 18.7.0
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "start:client"
18 verbose node v14.8.0
19 verbose npm v6.14.7
20 error code ELIFECYCLE
21 error errno 1
22 error cycseq@0.1.0 start:client: node client.js --server 127.0.0.1 --tidalCabal
22 error Exit status 1
23 error Failed at the cycseq@0.1.0 start:client script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

And the error in the terminal window withnpm run start:client:

(base) xon-5:cycseq xon$ npm run start:client

cycseq@0.1.0 start:client /Users/xon/cycseq
node client.js --server 127.0.0.1 --tidalCabal

extramuros: connecting to ws://127.0.0.1:8000...
events.js:291
throw er; // Unhandled 'error' event
^

Error: spawn ghci ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:268:19)
at onErrorNT (internal/child_process.js:468:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:274:12)
at onErrorNT (internal/child_process.js:468:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn ghci',
path: 'ghci',
spawnargs: [ '-XOverloadedStrings' ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! cycseq@0.1.0 start:client: node client.js --server 127.0.0.1 --tidalCabal
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the cycseq@0.1.0 start:client script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/xon/.npm/_logs/2020-08-22T16_58_52_299Z-debug.log

For me it clearly looks like the application can not find ghci.
When you type ghci in the console, does something similar to this come up?

And can you import Sound.Tidal.Context?

Bildschirmfoto 2020-08-22 um 19.20.04

If you can answer both of these questions with 'yes', then you should look where your ghci path lies. You can do this in the console with which ghci

If you can use ghci and import Sound.Tidal.Context then please download the latest version of CycSeq again or if you have git locally installed then do a git pull.
I have now implemented that you can manually specify the path to the ghci with -g for the client in the package.json file.

The line with "start:client" could look like this, if which ghci returns the path /Users/xon/.ghcup/bin/ghci:

"start:client": "node client.js --server 127.0.0.1 --tidalCabal -g /Users/xon/.ghcup/bin/ghci",

Hope this helps!

In fact, ghci does not seem to be installed.
For now, I've just followed the instructions to make work Tidal with Haskell stuff.

(base) xon-5:~ xon$ ghci
-bash: ghci: command not found

and Sound.Tidal.Context does nothing

(base) xon-5:~ xon$ import Sound.Tidal.Context
-bash: import: command not found

That's good news, though!

CycSeq assumes that TidalCycles was installed with cabal and SuperCollider was started with SuperDirt.

It doesn't seem to be a problem with CycSeq, but with your Tidal environment. This page should help you: https://tidalcycles.org/index.php/Installation

Btw. you should enter import Sound.Tidal.Context in a ghci session to test, if ghci can find your Tidal module and not in your console directly.

Can you pls share your installation source, so I can check what is going on? And do you try it under Linux, MacOS or Windows?

I've installed Tidal with the script mentioned with Tidal installation and SC is well installed :

curl https://tidalcycles.org/tidal-bootstrap.sh -sSf | sh

But it does not seem to install ghci (nothing in the terminal window).
I don't know exactly how to install it. Sorry!

Christophe

No problem, I assume that you are using macOS. Could you pls type ls -l ~/.ghcup/bin in your console? The tidal-bootstrap.sh script normally installs Haskell via ghcup for you if it is not installed on your system.

On my system the command from above shows me this result:

ghci seems here, but does nothing in the terminal window.
I tried also to install Haskell directly, but seems I have somewhat messed my Tidal environment

(base) xon-5:~ xon$ ls -l ~/.ghcup/bin
total 65448
lrwxr-xr-x 1 xon staff 13 22 aoĆ» 15:46 cabal -> cabal-3.2.0.0
-rwxr-xr-x 1 xon staff 24583760 22 aoĆ» 15:46 cabal-3.2.0.0
lrwxr-xr-x 1 xon staff 20 22 aoĆ» 15:45 ghc -> ../ghc/8.8.4/bin/ghc
lrwxr-xr-x 1 xon staff 20 22 aoĆ» 15:45 ghc-8.8 -> ../ghc/8.8.4/bin/ghc
lrwxr-xr-x 1 xon staff 20 22 aoĆ» 15:45 ghc-8.8.4 -> ../ghc/8.8.4/bin/ghc
lrwxr-xr-x 1 xon staff 24 22 aoĆ» 15:45 ghc-pkg -> ../ghc/8.8.4/bin/ghc-pkg
lrwxr-xr-x 1 xon staff 24 22 aoĆ» 15:45 ghc-pkg-8.8 -> ../ghc/8.8.4/bin/ghc-pkg
lrwxr-xr-x 1 xon staff 24 22 aoĆ» 15:45 ghc-pkg-8.8.4 -> ../ghc/8.8.4/bin/ghc-pkg
lrwxr-xr-x 1 xon staff 21 22 aoĆ» 15:45 ghci -> ../ghc/8.8.4/bin/ghci
lrwxr-xr-x 1 xon staff 21 22 aoĆ» 15:45 ghci-8.8 -> ../ghc/8.8.4/bin/ghci
lrwxr-xr-x 1 xon staff 21 22 aoĆ» 15:45 ghci-8.8.4 -> ../ghc/8.8.4/bin/ghci
-rwxr-xr-x 1 xon staff 8545768 22 aoĆ» 15:43 ghcup
lrwxr-xr-x 1 xon staff 24 22 aoĆ» 15:45 haddock -> ../ghc/8.8.4/bin/haddock
lrwxr-xr-x 1 xon staff 24 22 aoĆ» 15:45 haddock-8.8 -> ../ghc/8.8.4/bin/haddock
lrwxr-xr-x 1 xon staff 24 22 aoĆ» 15:45 haddock-8.8.4 -> ../ghc/8.8.4/bin/haddock
lrwxr-xr-x 1 xon staff 22 22 aoĆ» 15:45 hp2ps -> ../ghc/8.8.4/bin/hp2ps
lrwxr-xr-x 1 xon staff 22 22 aoĆ» 15:45 hp2ps-8.8 -> ../ghc/8.8.4/bin/hp2ps
lrwxr-xr-x 1 xon staff 22 22 aoĆ» 15:45 hp2ps-8.8.4 -> ../ghc/8.8.4/bin/hp2ps
lrwxr-xr-x 1 xon staff 20 22 aoĆ» 15:45 hpc -> ../ghc/8.8.4/bin/hpc
lrwxr-xr-x 1 xon staff 20 22 aoĆ» 15:45 hpc-8.8 -> ../ghc/8.8.4/bin/hpc
lrwxr-xr-x 1 xon staff 20 22 aoĆ» 15:45 hpc-8.8.4 -> ../ghc/8.8.4/bin/hpc
lrwxr-xr-x 1 xon staff 23 22 aoĆ» 15:45 hsc2hs -> ../ghc/8.8.4/bin/hsc2hs
lrwxr-xr-x 1 xon staff 23 22 aoĆ» 15:45 hsc2hs-8.8 -> ../ghc/8.8.4/bin/hsc2hs
lrwxr-xr-x 1 xon staff 23 22 aoĆ» 15:45 hsc2hs-8.8.4 -> ../ghc/8.8.4/bin/hsc2hs
lrwxr-xr-x 1 xon staff 23 22 aoĆ» 15:45 runghc -> ../ghc/8.8.4/bin/runghc
lrwxr-xr-x 1 xon staff 23 22 aoĆ» 15:45 runghc-8.8 -> ../ghc/8.8.4/bin/runghc
lrwxr-xr-x 1 xon staff 23 22 aoĆ» 15:45 runghc-8.8.4 -> ../ghc/8.8.4/bin/runghc
lrwxr-xr-x 1 xon staff 27 22 aoĆ» 15:45 runhaskell -> ../ghc/8.8.4/bin/runhaskell
lrwxr-xr-x 1 xon staff 27 22 aoĆ» 15:45 runhaskell-8.8 -> ../ghc/8.8.4/bin/runhaskell
lrwxr-xr-x 1 xon staff 27 22 aoĆ» 15:45 runhaskell-8.8.4 -> ../ghc/8.8.4/bin/runhaskell
(base) xon-5:~ xon$ ghci
-bash: ghci: command not found
(base) xon-5:~ xon$

Well, that's good. Your ghci is installed, but apparently not included in the PATH variable.
Unfortunately I don't know if you use bash or zsh. But either you have to append the line export PATH="/Users/xon/.ghcup/bin/:$PATH" under ~/.bashrc or ~/.zshrc.
Then restart your console and now you should be able to use ghci.

Hello @mrreason
Under ~/.bashrc, I've added your line.

And the file looks like this now:

[ -f "/Users/xon/.ghcup/env" ] && source "/Users/xon/.ghcup/env" # ghcup-env
. $HOME/.ghcup/env
. $HOME/.ghcup/env
. $HOME/.ghcup/env
export PATH="/Users/xon/.ghcup/bin/:$PATH"

But I am still unable to use ghci by restarting the terminal. still sorry

And it's still not a problem :slight_smile:
What happens when you type export PATH="$HOME/.ghcup/bin/:$PATH" directly in your console? This should temporarely add the ghci path - just for testing.

After typing export PATH="$HOME/.ghcup/bin/:$PATH"
I've got this now with ghci :

(base) xon-5:~ xon$ ghci

GHCi, version 8.8.4: Glasgow Haskell Compiler ā€” The Glasgow Haskell Compiler :? for help

Loaded package environment from /Users/xon/.ghc/x86_64-darwin-8.8.4/environments/default

Prelude>