separate input handling for sampler

This commit is contained in:
🪞👃🪞 2025-04-25 20:50:32 +03:00
parent b58fbdfd30
commit b376d75396
11 changed files with 114 additions and 36 deletions

View file

@ -1,21 +0,0 @@
(@u undo 1)
(@shift-u redo 1)
(@space clock toggle)
(@shift-space clock toggle 0)
(@t select :track 0)
(@tab edit :clip)
(@c color)
(@q launch)
(@shift-I input add)
(@shift-O output add)
(@shift-S scene add)
(@shift-T track add)
(@up select :scene-prev)
(@w select :scene-prev)
(@down select :scene-next)
(@s select :scene-next)
(@left select :track-prev)
(@a select :track-prev)
(@right select :track-next)
(@d select :track-next)

View file

@ -1,8 +0,0 @@
(@g clip get)
(@p clip put)
(@delete clip del)
(@comma clip prev)
(@period clip next)
(@lt clip swap-prev)
(@gt clip swap-next)
(@l clip loop-toggle)

View file

@ -1,7 +0,0 @@
(@q scene launch :scene)
(@c scene color :scene)
(@comma scene prev)
(@period scene next)
(@lt scene swap-prev)
(@gt scene swap-next)
(@delete scene delete)

View file

@ -1,12 +0,0 @@
(@q track launch :track)
(@c track color :track)
(@comma track prev)
(@period track next)
(@lt track swap-prev)
(@gt track swap-next)
(@delete track delete)
(@r track rec)
(@m track mon)
(@p track play)
(@P track solo)

View file

@ -1,10 +1,12 @@
pub(crate) use tek::*;
pub(crate) use std::sync::{Arc, RwLock};
pub(crate) use clap::{self, Parser, Subcommand};
/// Application entrypoint.
pub fn main () -> Usually<()> {
Cli::parse().run()
}
#[derive(Debug, Parser)]
#[command(version, about = Some(HEADER), long_about = Some(HEADER))]
pub struct Cli {
@ -37,7 +39,10 @@ pub struct Cli {
/// Audio ins to connect from right output
#[arg(short='R', long)] right_to: Vec<String>,
}
#[derive(Debug, Clone, Subcommand)] pub enum Mode {
/// Application modes
#[derive(Debug, Clone, Subcommand)]
pub enum Mode {
/// ⏯️ A standalone transport clock.
Clock,
/// 🎼 A MIDI sequencer.
@ -62,6 +67,7 @@ pub struct Cli {
/// TODO: An audio plugin host
Plugin,
}
impl Cli {
pub fn run (&self) -> Usually<()> {
let name = self.name.as_ref().map_or("tek", |x|x.as_str());
@ -122,11 +128,12 @@ impl Cli {
},
color: ItemPalette::random(),
clock: Clock::new(jack, self.bpm)?,
keys: SourceIter(include_str!("./edn/arranger_keys.edn")),
keys_clip: SourceIter(include_str!("./edn/arranger_keys_clip.edn")),
keys_track: SourceIter(include_str!("./edn/arranger_keys_track.edn")),
keys_scene: SourceIter(include_str!("./edn/arranger_keys_scene.edn")),
keys_mix: SourceIter(include_str!("./edn/arranger_keys_mix.edn")),
handler: Some(match mode {
Mode::Sampler => handle_sampler,
_ => handle_arranger,
}),
tracks: match mode {
Mode::Sequencer => vec![
@ -196,6 +203,7 @@ impl Cli {
}
}
/// CLI header
const HEADER: &'static str = r#"