glicol cli: cross-platform music live coding in terminal

Overview

glicol-cli

What's this?

It's a command line interface that you can use for music live coding with Glicol.

It watches a file changes and then update the music in real-time.

How to use it?

Step 1

You need to have cargo installed (see here).

Step 2

In your Terminal:

cargo install --git https://github.com/glicol/glicol-cli.git

Step 3

Create a new file called test.glicol, then run this command in your Terminal:

glicol-cli test.glicol

For more OPTIONS, call --help in your terminal:

~ glicol-cli --help                                    

Glicol cli tool. This tool will watch the changes in a .glicol file

Usage: glicol-cli [OPTIONS] <FILE>

Arguments:
  <FILE>  path to the .glicol file

Options:
  -b, --bpm <BPM>        Set beats per minute (BPM) [default: 120]
  -d, --device <DEVICE>  The audio device to use [default: default]
  -h, --help             Print help
  -V, --version          Print version

Step 4

Start live coding. Edit test.glicol with your favourite editor:

// test.glicol
~t1: speed 4.0 >> seq 60 >> bd 0.2 >> mul 0.6
    
~t2: seq 33_33_ _33 33__33 _33
>> sawsynth 0.01 0.1
>> mul 0.5 >> lpf 1000.0 1.0

out: mix ~t.. >> plate 0.1

Todos

  • Remove unnecessary print
  • Support sample adding
  • Error handling (so far when there is an error, the previous music continues but no report)
  • Linux/Windows test; PR welcomed!
  • Improve TUI
Comments
  • Startup error

    Startup error

    Hey!

    I'm getting the following error on glicol-cli launch:

    capture

    Then my terminal gets corrupted.

    It points to this line (131):

    https://github.com/glicol/glicol-cli/blob/c5f6493a6dac0f9ff65b59179f6c7c5b65fa4fce/src/main.rs#L127-L133

    Not sure why it happens but is it related to my audio device? Any help is appreciated.

    P.S. I'm using test.glicol from this repository.

    opened by orhun 2
  • Create releases on GitHub

    Create releases on GitHub

    Hey, nice project! 🐻

    I would like to package it for the AUR but there is no releases available on GitHub. Are you planning to push tags anytime soon?

    In the meantime, I created the following VCS package:

    • https://aur.archlinux.org/packages/glicol-cli-git
    opened by orhun 2
  • Panic at head when running in dev mode

    Panic at head when running in dev mode

    Fresh clone, just a bare cargo run at head panics:

    % cargo run -- 1.glicol
    warning: unused import: `Sample`
      --> src/main.rs:10:17
       |
    10 |     FromSample, Sample, SizedSample,
       |                 ^^^^^^
       |
       = note: `#[warn(unused_imports)]` on by default
    
    warning: `glicol-cli` (bin "glicol-cli") generated 1 warning
        Finished dev [unoptimized + debuginfo] target(s) in 0.05s
         Running `target/debug/glicol-cli 1.glicol`
    thread 'main' panicked at 'Argument 'file' is a positional argument and can't have short or long name versions', /Users/rich/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-4.1.8/src/builder/debug_asserts.rs:731:9
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    

    Looks like this is in dev mode only -- cargo run --release works fine.

    Full backtrace

    stack backtrace:
       0: rust_begin_unwind
                 at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/panicking.rs:575:5
       1: core::panicking::panic_fmt
                 at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/panicking.rs:64:14
       2: clap::builder::debug_asserts::assert_arg
                 at /Users/rich/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-4.1.8/src/builder/debug_asserts.rs:731:9
       3: clap::builder::debug_asserts::assert_app
                 at /Users/rich/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-4.1.8/src/builder/debug_asserts.rs:61:9
       4: clap::builder::command::Command::_build_self
                 at /Users/rich/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-4.1.8/src/builder/command.rs:3920:13
       5: clap::builder::command::Command::_do_parse
                 at /Users/rich/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-4.1.8/src/builder/command.rs:3790:9
       6: clap::builder::command::Command::try_get_matches_from_mut
                 at /Users/rich/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-4.1.8/src/builder/command.rs:708:9
       7: clap::builder::command::Command::get_matches_from
                 at /Users/rich/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-4.1.8/src/builder/command.rs:578:9
       8: clap::builder::command::Command::get_matches
                 at /Users/rich/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-4.1.8/src/builder/command.rs:490:9
       9: clap::derive::Parser::parse
                 at /Users/rich/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-4.1.8/src/derive.rs:82:27
      10: glicol_cli::main
                 at ./src/main.rs:53:16
      11: core::ops::function::FnOnce::call_once
                 at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/ops/function.rs:507:5
    

    opened by capslock 1
  • [Bug] optional dependency `jack` is not included in any feature

    [Bug] optional dependency `jack` is not included in any feature

    Hi!

    I just tried to install glicol-cli, with the command in the README:

    cargo install --git https://github.com/glicol/glicol-cli.git
    

    and was greeted with this error:

        Updating git repository `https://github.com/glicol/glicol-cli.git`
    error: failed to parse manifest at `/home/XXXXX/.cargo/git/checkouts/glicol-cli-b10f0cfdae7f5c00/d3f80b8/Cargo.toml`
    
    Caused by:
      optional dependency `jack` is not included in any feature
      Make sure that `dep:jack` is included in one of features in the [features] table.
    

    I noticed there was a commit 13 hours ago adding jack as an optional dependency. Maybe it was related?

    opened by Jeansidharta 4
  • Ableton Link time synchronization

    Ableton Link time synchronization

    Ableton Link is an open protocol for time synchronization, so that multiple disparate programs, devices, or instruments can sync up over the network to a common session that synchronizes musical time, so each connection knows the bpm and the exact moment to start the next measure, so everyone starts or stops at the correct time.

    I have been interested in the glicol VST for syncing time in my DAW, but I think it would be more powerful for glicol-cli to have ableton link support, then you could sync with pretty much anything, not just a DAW.

    Heres how I imagine it would work:

    glicol-cli --link --sync-start 4 --file test.glicol
    

    That would start the glicol engine loading the file, it would connect to ableton link, and then it would wait until the current beat is a modulus of 4, before starting. glicol wouldn't necessarily need to track time internally, and you would still use whatever speed parameters in your code, etc. But glicol would only respect the link time for the transport, to start and stop the DSP graph engine.

    You could even trap the SIGINT (Ctrl-C) signal of glicl-cli, to tell it to stop playback at the next --sync-start bar and then quit, so that way you could start and stop glicol-cli in time with your other music.

    I think this would be great for live music, but I am mostly interested in this for recording stems of several tracks in my DAW (my DAW controls the transport through Ableton Link), and by manually muting things in glicol code. So I can record the process N times for N tracks (unmuting each track), and have each recording start and stop in the same time frame (unless glicol can already map to multiple sound devices?)

    References:

    • https://ableton.github.io/link/
    • https://docs.rs/ableton-link/latest/ableton_link/
    • https://github.com/Deep-Symmetry/carabiner
    opened by EnigmaCurry 0
Releases(v0.2.0)
Owner
Glicol
Glicol is a graph-oriented live coding language written in Rust.
Glicol
on-screen keyboard display for your coding streams.

⌨ OSKD (On-screen key display) OSKD is an on-screen keyboard display that can be used during streams. It provides an intuitive and easy-to-use interfa

Sammwy 46 May 6, 2023
Cross-platform Rust library for coloring and formatting terminal output

Coloring terminal output Documentation term-painter is a cross-platform (i.e. also non-ANSI terminals) Rust library for coloring and formatting termin

Lukas Kalbertodt 75 Jul 28, 2022
Cross platform terminal library rust

Cross-platform Terminal Manipulation Library Crossterm is a pure-rust, terminal manipulation library that makes it possible to write cross-platform te

crossterm-rs 2.1k Jan 2, 2023
Alacritty - A fast, cross-platform, OpenGL terminal emulator

Alacritty is a modern terminal emulator that comes with sensible defaults, but allows for extensive configuration. By integrating with other applications, rather than reimplementing their functionality, it manages to provide a flexible set of features with high performance. The supported platforms currently consist of BSD, Linux, macOS and Windows.

Alacritty 43.8k Dec 31, 2022
Cross-platform terminal screen clearing library

ClearScreen Cross-platform terminal screen clearing library. API documentation. Dual-licensed with Apache 2.0 and MIT. Uses Caretaker Maintainership.

null 23 Dec 30, 2022
Cross-platform terminal program to download IEEE journals

IEEE Journal Downloader A cross-platform terminal program which tries to download every article in a specified journal and merge the documents into on

Fong Chien Yoong 18 Jul 23, 2022
Native cross-platform full feature terminal-based sequence editor for git interactive rebase.

Native cross-platform full feature terminal-based sequence editor for git interactive rebase.

Tim Oram 1.2k Jan 2, 2023
Simple macros to write colored and formatted text to a terminal. Based on `termcolor`, thus also cross-platform.

Bunt: simple macro-based terminal colors and styles bunt offers macros to easily print colored and formatted text to a terminal. It is just a convenie

Lukas Kalbertodt 202 Dec 22, 2022
CLI app to display list of trending anime, music charts or recommend anime to watch or song to listen to.

Description Anitrendz is a cli app that uses data from the anitiop api to list the top anime and songs or recommend a random anime to watch or song to

Jimmy 9 Jun 11, 2022
A cli utility for playing music mixes for programming & focus from musicforprogramming.net

mfp: music for programming A command-line utility for playing music mixes for programming & focus (from musicforprogramming.net), unlocking the flow s

Rohit Gupta 10 Jul 12, 2023
A beautiful and feature-packed Apple Music CLI

am A beautiful and feature-packed Apple Music CLI! Written in Rust. Installation Nix (recommended) This GitHub repository contains a flake. Add github

Ryan Cao 5 Sep 21, 2023
📺(tv) Tidy Viewer is a cross-platform CLI csv pretty printer that uses column styling to maximize viewer enjoyment.

??(tv) Tidy Viewer is a cross-platform CLI csv pretty printer that uses column styling to maximize viewer enjoyment.

Alex Hallam 1.8k Jan 2, 2023
Cross-platform CLI Rimworld Mod manager. Still under development

rwm Inspired by Spoons rmm. This is a cross-platform Mod Manager for RimWorld intended to work with macOS, linux and Windows Up to now, you must have

Alejandro O 7 Sep 5, 2022
Safe Unix shell-like parameter expansion/variable substitution via cross-platform CLI or Rust API

Safe Unix shell-like parameter expansion/variable substitution for those who need a more powerful alternative to envsubst but don't want to resort to

Isak Wertwein 4 Oct 4, 2022
A simple cross-platform easy to use STL Viewer with GUI and CLI options

Stlvi STL viewer written in Rust. This project is still in development. It is available in both CLI and GUI mode. Supported OS Linux Windows Mac Scree

Mantresh Khurana 4 Mar 2, 2023
Coinlive is an interactive command line tool that displays live cryptocurrency prices.

Coinlive is an interactive command line tool that displays live cryptocurrency prices. It can also display simple historical price charts.

Mayer Analytics 9 Dec 7, 2022
Rust-advent - Learning Rust by solving advent of code challenges (Streaming live on Twitch every Monday)

Rust advent ?? ?? Learning Rust by implementing solutions for Advent of Code problems. ?? HEY, we are live-streaming our attempts to solve the exercis

Luciano Mammino 20 Nov 11, 2022
Open-source Rust framework for building event-driven live-trading & backtesting systems

Barter Barter is an open-source Rust framework for building event-driven live-trading & backtesting systems. Algorithmic trade with the peace of mind

Barter 157 Feb 18, 2023
zkPoEX enables white hat hackers to report live vulnerabilities in smart contracts while maintaining the confidentiality of the exploit

zkPoEX enables white hat hackers to report live vulnerabilities in smart contracts while maintaining the confidentiality of the exploit, facilitating efficient communication and collaboration between hackers and project owners for a more secure DeFi ecosystem.

zkoranges 135 Apr 16, 2023