From 6c2c8cda8ac4a7eef34a5a74d395718865346a75 Mon Sep 17 00:00:00 2001 From: Micah Wylde Date: Sat, 30 Oct 2021 19:27:33 -0700 Subject: [PATCH] readme updates --- .github/workflows/rust.yml | 4 ++-- README.md | 40 +++++++++++++++++++++++++++------ loopers/Cargo.toml | 4 +++- loopers/src/looper_coreaudio.rs | 8 +++---- loopers/src/main.rs | 10 ++++----- 5 files changed, 47 insertions(+), 19 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index b0f63b0..0a96c1d 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -20,6 +20,6 @@ jobs: - name: Install dependencies run: brew install jack sdl2 - name: Build - run: cargo build -v --features=coreaudio-rs + run: cargo build -v - name: Run tests - run: cargo test --verbose --features=coreaudio-rs \ No newline at end of file + run: cargo test --verbose \ No newline at end of file diff --git a/README.md b/README.md index 0cc79ef..6b7bb76 100644 --- a/README.md +++ b/README.md @@ -7,10 +7,11 @@ written in Rust, designed for ease of use and rock-solid stability. It can be used as a practice tool, compositional aid, or for performing looped works in a live setting. -Currently it runs only on Linux as a standalone +Currently it runs on Linux as a standalone [Jack](https://jackaudio.org/) application, which allows it to interface with other Jack clients like effect racks, software -instruments, and DAWs. +instruments, and DAWs, or on MacOS using Jack or (experimentally) +directly with CoreAudio. ![video of loopers](docs/demo.gif) @@ -36,25 +37,27 @@ size, and loop lengths are limited only by available memory. ## Getting started +### Linux + To build loopers, you will need jack and sdl2. For Ubuntu/Debian these can be installed with: -``` bash +```bash $ sudo apt install jackd2 libjack-jackd2-dev libgl1-mesa-dev libsdl2-dev ``` Now you're ready to install loopers itself. First get a rust toolchain installed (https://rustup.rs), then: -``` bash -$ cargo install loopers-jack +```bash +$ cargo install loopers ``` Then start it with the command -``` bash -$ loopers-jack +```bash +$ loopers ``` (If you get an error about Jack not running, you will need to start @@ -65,6 +68,29 @@ This will create a Jack client, which can be hooked up to your inputs/outputs/effects with any number of tools (I recommend [Claudia](https://kx.studio/Applications:Claudia) from KXStudio). +Loopers should also be fully compatible with pipewire. + +### MacOS + +Loopers has experimental support for running on CoreAudio, the native +audio system for MacOS (you can also run it on top of [jack](https://jackaudio.org/) on +MacOS which is currently better supported). To build on Mac with coreaudio: + +```bash +$ brew install jack sdl2 +$ cargo install loopers +$ loopers +``` + +By default it will run using CoreAudio. To run with jack instead, + +```bash +$ loopers --driver jack +``` + +**Note: midi is not currently supported via coreaudio, and there is no ability to choose +audio sources and sinks (the default devices are used).** + ## Current state Loopers has just had its initial release, 0.1. The software is usable diff --git a/loopers/Cargo.toml b/loopers/Cargo.toml index aad4f0c..3309447 100644 --- a/loopers/Cargo.toml +++ b/loopers/Cargo.toml @@ -29,7 +29,9 @@ rand = "0.8" hound = "3.4.0" chrono = "0.4.11" dirs = "2" -coreaudio-rs = {version = "0.10.0", optional = true} + +[target.'cfg(target_os = "macos")'.dependencies] +coreaudio-rs = {version = "0.10.0"} [dependencies.loopers-common] path = "../loopers-common" diff --git a/loopers/src/looper_coreaudio.rs b/loopers/src/looper_coreaudio.rs index b62463b..c72db72 100644 --- a/loopers/src/looper_coreaudio.rs +++ b/loopers/src/looper_coreaudio.rs @@ -65,10 +65,10 @@ pub fn coreaudio_main(gui: Option, channels_per_frame: 2, }; - println!("input={:#?}", &in_stream_format); - println!("output={:#?}", &out_stream_format); - println!("input_asbd={:#?}", &in_stream_format.to_asbd()); - println!("output_asbd={:#?}", &out_stream_format.to_asbd()); + debug!("input={:#?}", &in_stream_format); + debug!("output={:#?}", &out_stream_format); + debug!("input_asbd={:#?}", &in_stream_format.to_asbd()); + debug!("output_asbd={:#?}", &out_stream_format.to_asbd()); let mut host = CoreAudioHost {}; diff --git a/loopers/src/main.rs b/loopers/src/main.rs index 7ffaaa1..49f93a2 100644 --- a/loopers/src/main.rs +++ b/loopers/src/main.rs @@ -12,7 +12,7 @@ extern crate log; mod loopers_jack; -#[cfg(feature = "coreaudio-rs")] +#[cfg(target_os = "macos")] mod looper_coreaudio; use clap::{App, Arg}; @@ -57,10 +57,10 @@ fn setup_logger(debug_log: bool) -> Result<(), fern::InitError> { Ok(()) } -#[cfg(feature = "coreaudio-rs")] +#[cfg(target_os = "macos")] const DEFAULT_DRIVER: &str = "coreaudio"; -#[cfg(not(feature = "coreaudio-rs"))] +#[cfg(not(target_os = "macos"))] const DEFAULT_DRIVER: &str = "jack"; @@ -139,8 +139,8 @@ fn main() { jack_main(gui, gui_sender, gui_to_engine_receiver, beat_normal, beat_emphasis, restore); } "coreaudio" => { - if cfg!(feature = "coreaudio-rs") { - #[cfg(feature = "coreaudio-rs")] + if cfg!(target_os = "macos") { + #[cfg(target_os = "macos")] crate::looper_coreaudio::coreaudio_main( gui, gui_sender, gui_to_engine_receiver, beat_normal, beat_emphasis, restore) .expect("failed to set up coreaudio");