mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 11:46:41 +01:00
wip3 (33e): ermh...
This commit is contained in:
parent
b028dc41a3
commit
1bb0107485
135 changed files with 590 additions and 654 deletions
35
crates/tek.old/Cargo.toml
Normal file
35
crates/tek.old/Cargo.toml
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
[package]
|
||||
name = "tek"
|
||||
edition = "2021"
|
||||
version = "0.1.0"
|
||||
|
||||
[dependencies]
|
||||
clojure-reader = "0.1.0"
|
||||
microxdg = "0.1.2"
|
||||
|
||||
tek_core = { path = "../tek_core" }
|
||||
#tek_sequencer = { path = "../tek_sequencer" }
|
||||
#tek_mixer = { path = "../tek_mixer" }
|
||||
#jack = "0.10"
|
||||
#crossterm = "0.27"
|
||||
#ratatui = { version = "0.26.3", features = [ "unstable-widget-ref", "underline-color" ] }
|
||||
#backtrace = "0.3.72"
|
||||
#toml = "0.8.12"
|
||||
#better-panic = "0.3.0"
|
||||
#midly = "0.5"
|
||||
|
||||
#vst = "0.4.0"
|
||||
##vst3 = "0.1.0"
|
||||
#livi = "0.7.4"
|
||||
##atomic_enum = "0.3.0"
|
||||
#wavers = "1.4.3"
|
||||
#music-math = "0.1.1"
|
||||
#fraction = "0.15.3"
|
||||
#rlsf = "0.2.1"
|
||||
#r8brain-rs = "0.3.5"
|
||||
|
||||
#symphonia = { version = "0.5.4", features = [ "all" ] }
|
||||
|
||||
#dasp = { version = "0.11.0", features = [ "all" ] }
|
||||
|
||||
#rubato = "0.15.0"
|
||||
3
crates/tek.old/README.md
Normal file
3
crates/tek.old/README.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# `tek`
|
||||
|
||||
This crate unifies the `tek_*` subcrates into a single application.
|
||||
|
|
@ -1,35 +1,60 @@
|
|||
[package]
|
||||
name = "tek"
|
||||
edition = "2021"
|
||||
version = "0.1.0"
|
||||
version = "0.2.0"
|
||||
|
||||
[dependencies]
|
||||
#no_deadlocks = "1.3.2"
|
||||
#vst3 = "0.1.0"
|
||||
atomic_float = "1.0.0"
|
||||
backtrace = "0.3.72"
|
||||
better-panic = "0.3.0"
|
||||
clap = { version = "4.5.4", features = [ "derive" ] }
|
||||
clojure-reader = "0.1.0"
|
||||
microxdg = "0.1.2"
|
||||
crossterm = "0.27"
|
||||
jack = "0.13"
|
||||
livi = "0.7.4"
|
||||
midly = "0.5"
|
||||
once_cell = "1.19.0"
|
||||
palette = { version = "0.7.6", features = [ "random" ] }
|
||||
quanta = "0.12.3"
|
||||
rand = "0.8.5"
|
||||
ratatui = { version = "0.26.3", features = [ "unstable-widget-ref", "underline-color" ] }
|
||||
suil-rs = { path = "../suil" }
|
||||
symphonia = { version = "0.5.4", features = [ "all" ] }
|
||||
toml = "0.8.12"
|
||||
uuid = { version = "1.10.0", features = [ "v4" ] }
|
||||
vst = "0.4.0"
|
||||
wavers = "1.4.3"
|
||||
winit = { version = "0.30.4", features = [ "x11" ] }
|
||||
|
||||
tek_core = { path = "../tek_core" }
|
||||
#tek_sequencer = { path = "../tek_sequencer" }
|
||||
#tek_mixer = { path = "../tek_mixer" }
|
||||
#jack = "0.10"
|
||||
#crossterm = "0.27"
|
||||
#ratatui = { version = "0.26.3", features = [ "unstable-widget-ref", "underline-color" ] }
|
||||
#backtrace = "0.3.72"
|
||||
#toml = "0.8.12"
|
||||
#better-panic = "0.3.0"
|
||||
#midly = "0.5"
|
||||
[dev-dependencies]
|
||||
#tek_app = { version = "0.1.0", path = "../tek_app" }
|
||||
|
||||
#vst = "0.4.0"
|
||||
##vst3 = "0.1.0"
|
||||
#livi = "0.7.4"
|
||||
##atomic_enum = "0.3.0"
|
||||
#wavers = "1.4.3"
|
||||
#music-math = "0.1.1"
|
||||
#fraction = "0.15.3"
|
||||
#rlsf = "0.2.1"
|
||||
#r8brain-rs = "0.3.5"
|
||||
[[bin]]
|
||||
name = "tek_arranger"
|
||||
path = "src/cli_arranger.rs"
|
||||
|
||||
#symphonia = { version = "0.5.4", features = [ "all" ] }
|
||||
[[bin]]
|
||||
name = "tek_sequencer"
|
||||
path = "src/cli_sequencer.rs"
|
||||
|
||||
#dasp = { version = "0.11.0", features = [ "all" ] }
|
||||
[[bin]]
|
||||
name = "tek_transport"
|
||||
path = "src/cli_transport.rs"
|
||||
|
||||
#rubato = "0.15.0"
|
||||
#[[bin]]
|
||||
#name = "tek_mixer"
|
||||
#path = "src/cli_mixer.rs"
|
||||
|
||||
#[[bin]]
|
||||
#name = "tek_track"
|
||||
#path = "src/cli_track.rs"
|
||||
|
||||
#[[bin]]
|
||||
#name = "tek_sampler"
|
||||
#path = "src/cli_sampler.rs"
|
||||
|
||||
#[[bin]]
|
||||
#name = "tek_plugin"
|
||||
#path = "src/cli_plugin.rs"
|
||||
|
|
|
|||
|
|
@ -1,3 +1,46 @@
|
|||
# `tek`
|
||||
|
||||
This crate unifies the `tek_*` subcrates into a single application.
|
||||
# `tek_sequencer`
|
||||
|
||||
This crate implements a MIDI sequencer and arranger with clip launching.
|
||||
|
||||
---
|
||||
|
||||
# `tek_arranger`
|
||||
|
||||
---
|
||||
|
||||
# `tek_timer`
|
||||
|
||||
This crate implements time sync and JACK transport control.
|
||||
|
||||
* Warning: If transport is set rolling by qjackctl, this program can't pause it
|
||||
* Todo: bpm: shift +/- 0.001
|
||||
* Todo: quant/sync: shift = next/prev value of same type (normal, triplet, dotted)
|
||||
* Or: use shift to switch between inc/dec top/bottom value?
|
||||
* Todo: focus play button
|
||||
* Todo: focus time position
|
||||
* Todo: edit numeric values
|
||||
* Todo: jump to time/bbt markers
|
||||
* Todo: count xruns
|
||||
|
||||
---
|
||||
|
||||
# `tek_mixer`
|
||||
|
||||
// TODO:
|
||||
// - Meters: propagate clipping:
|
||||
// - If one stage clips, all stages after it are marked red
|
||||
// - If one track clips, all tracks that feed from it are marked red?
|
||||
|
||||
# `tek_track`
|
||||
|
||||
---
|
||||
|
||||
# `tek_sampler`
|
||||
|
||||
This crate implements a sampler device which plays audio files
|
||||
in response to MIDI notes.
|
||||
|
||||
---
|
||||
|
||||
# `tek_plugin`
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
|
@ -1,22 +1,14 @@
|
|||
pub(crate) use tek_core::*;
|
||||
pub(crate) use tek_core::midly::{*, live::LiveEvent, num::u7};
|
||||
pub(crate) use std::thread::JoinHandle;
|
||||
pub(crate) use std::fmt::{Debug, Formatter, Error};
|
||||
pub(crate) use tek_core::jack::{
|
||||
Client, ProcessScope, Control, CycleTimes,
|
||||
Port, MidiIn, MidiOut, AudioIn, AudioOut, Unowned,
|
||||
Transport, TransportState, MidiIter, RawMidi
|
||||
};
|
||||
use crate::*;
|
||||
|
||||
submod! {
|
||||
api_clip
|
||||
api_clock
|
||||
api_color
|
||||
api_jack
|
||||
api_phrase
|
||||
api_player
|
||||
api_scene
|
||||
api_track
|
||||
clip
|
||||
clock
|
||||
color
|
||||
jack
|
||||
phrase
|
||||
player
|
||||
scene
|
||||
track
|
||||
|
||||
//api_mixer
|
||||
//api_channel
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
use tek_api::JackActivate;
|
||||
use tek_core::{*, jack::{MidiIn, MidiOut}, clap::{self, Parser}};
|
||||
use crate::{*, jack::{MidiIn, MidiOut}, clap::{self, Parser}};
|
||||
|
||||
pub fn main () -> Usually<()> {
|
||||
SequencerCli::parse().run()
|
||||
21
crates/tek/src/core/mod.rs
Normal file
21
crates/tek/src/core/mod.rs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
use crate::*;
|
||||
|
||||
submod! {
|
||||
//tui
|
||||
audio
|
||||
color
|
||||
collect
|
||||
command
|
||||
edn
|
||||
engine
|
||||
focus
|
||||
input
|
||||
output
|
||||
pitch
|
||||
space
|
||||
time
|
||||
}
|
||||
|
||||
testmod! {
|
||||
test
|
||||
}
|
||||
33
crates/tek/src/layout/map_reduce.rs
Normal file
33
crates/tek/src/layout/map_reduce.rs
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
use crate::*;
|
||||
|
||||
impl<E: Engine, I: Iterator<Item=T>+Send+Sync, T, R: Render<E>> LayoutMapReduce<E, I, T, R> for E {}
|
||||
|
||||
pub trait LayoutMapReduce<E: Engine, I: Iterator<Item = T>+Send+Sync, T, R: Render<E>> {
|
||||
fn map <F: Fn(T)->R> (iterator: I, callback: F) -> Map<E, T, I, R, F> {
|
||||
Map(Default::default(), iterator, callback)
|
||||
}
|
||||
fn reduce <F: Fn(&dyn Render<E>, T)->R+Send+Sync> (iterator: I, callback: F) -> Reduce<E, T, I, R, F> {
|
||||
Reduce(Default::default(), iterator, callback)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Map<E: Engine, T, I: Iterator<Item=T>, R: Render<E>, F: Fn(T)->R>(
|
||||
PhantomData<E>,
|
||||
I,
|
||||
F
|
||||
);
|
||||
|
||||
pub struct Reduce<E: Engine, T, I: Iterator<Item=T>, R: Render<E>, F: Fn(&dyn Render<E>, T)->R>(
|
||||
PhantomData<(E, R)>,
|
||||
I,
|
||||
F
|
||||
);
|
||||
|
||||
impl<E: Engine, T, I: Iterator<Item=T>+Send+Sync, R: Render<E>, F: Fn(&dyn Render<E>, T)->R+Send+Sync> Render<E> for Reduce<E, T, I, R, F> {
|
||||
fn min_size (&self, to: E::Size) -> Perhaps<E::Size> {
|
||||
todo!()
|
||||
}
|
||||
fn render (&self, to: &mut E::Output) -> Usually<()> {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
pub(crate) use tek_core::*;
|
||||
use crate::*;
|
||||
|
||||
submod! {
|
||||
align
|
||||
|
|
@ -16,7 +16,7 @@ submod! {
|
|||
scroll
|
||||
shrink_grow
|
||||
split
|
||||
//stack
|
||||
stack
|
||||
}
|
||||
|
||||
#[macro_export] macro_rules! lay {
|
||||
75
crates/tek/src/lib.rs
Normal file
75
crates/tek/src/lib.rs
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
pub(crate) use ratatui;
|
||||
|
||||
pub(crate) use jack;
|
||||
pub(crate) use jack::{
|
||||
Client, ProcessScope, Control, CycleTimes,
|
||||
Port, MidiIn, MidiOut, AudioIn, AudioOut, Unowned,
|
||||
Transport, TransportState, MidiIter, RawMidi
|
||||
};
|
||||
|
||||
pub(crate) use midly;
|
||||
pub(crate) use midly::{
|
||||
*, live::LiveEvent, num::u7
|
||||
};
|
||||
|
||||
pub(crate) use clap;
|
||||
|
||||
pub(crate) use std::sync::{Arc, Mutex, RwLock};
|
||||
pub(crate) use std::sync::atomic::{Ordering, AtomicBool, AtomicUsize};
|
||||
pub(crate) use std::collections::BTreeMap;
|
||||
pub(crate) use std::marker::PhantomData;
|
||||
pub(crate) use std::error::Error;
|
||||
|
||||
pub(crate) use crossterm::{ExecutableCommand};
|
||||
pub(crate) use crossterm::terminal::{EnterAlternateScreen, LeaveAlternateScreen, enable_raw_mode, disable_raw_mode};
|
||||
pub(crate) use crossterm::event::{KeyCode, KeyModifiers, KeyEvent, KeyEventKind, KeyEventState};
|
||||
pub(crate) use tek_core::midly::{num::u7, MidiMessage};
|
||||
pub(crate) use std::sync::{Arc, RwLock};
|
||||
pub(crate) use std::path::PathBuf;
|
||||
pub(crate) use std::ffi::OsString;
|
||||
pub(crate) use better_panic::{Settings, Verbosity};
|
||||
pub(crate) use std::thread::{spawn, JoinHandle};
|
||||
pub(crate) use std::time::Duration;
|
||||
pub(crate) use ratatui::prelude::{Style, Color, Buffer};
|
||||
pub(crate) use ratatui::style::{Stylize, Modifier};
|
||||
pub(crate) use ratatui::backend::{Backend, CrosstermBackend, ClearType};
|
||||
pub(crate) use std::io::{Stdout, stdout};
|
||||
|
||||
pub(crate) use atomic_float::*;
|
||||
pub(crate) use palette::{*, convert::*, okhsl::*};
|
||||
|
||||
use std::ops::{Add, Sub, Mul, Div, Rem};
|
||||
use std::cmp::{Ord, Eq, PartialEq};
|
||||
use std::fmt::{Debug, Display};
|
||||
|
||||
/// Standard result type.
|
||||
pub type Usually<T> = Result<T, Box<dyn Error>>;
|
||||
|
||||
/// Standard optional result type.
|
||||
pub type Perhaps<T> = Result<Option<T>, Box<dyn Error>>;
|
||||
|
||||
/// Define and reexport submodules.
|
||||
#[macro_export] macro_rules! submod {
|
||||
($($name:ident)*) => { $(mod $name; pub use self::$name::*;)* };
|
||||
}
|
||||
|
||||
/// Define public modules.
|
||||
#[macro_export] macro_rules! pubmod {
|
||||
($($name:ident)*) => { $(pub mod $name;)* };
|
||||
}
|
||||
|
||||
/// Define test modules.
|
||||
#[macro_export] macro_rules! testmod {
|
||||
($($name:ident)*) => { $(#[cfg(test)] mod $name;)* };
|
||||
}
|
||||
|
||||
submod! {
|
||||
api
|
||||
core
|
||||
layout
|
||||
tui
|
||||
}
|
||||
|
||||
testmod! {
|
||||
test
|
||||
}
|
||||
|
|
@ -169,7 +169,7 @@ render!(|self: ArrangerStatus|{
|
|||
|
||||
let mode_bg = TuiTheme::mode_bg();
|
||||
let mode_fg = TuiTheme::mode_fg();
|
||||
let mode = TuiStyle::bold(format!(" {label} "), true).bg(mode_bg).fg(mode_fg);
|
||||
let mode = Tui::fg(mode_fg, Tui::bg(mode_bg, Tui::bold(true, format!(" {label} "))));
|
||||
|
||||
let commands = match self {
|
||||
Self::ArrangerMix => Self::command(&[
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue