mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
big ass refactor (rip client)
This commit is contained in:
parent
94c1f83ef2
commit
8c3cf53c67
56 changed files with 2232 additions and 1891 deletions
543
src/main.rs
543
src/main.rs
|
|
@ -6,256 +6,321 @@ extern crate clap;
|
|||
extern crate jack;
|
||||
extern crate crossterm;
|
||||
|
||||
use clap::{Parser};
|
||||
use std::error::Error;
|
||||
|
||||
pub mod core;
|
||||
pub mod cli;
|
||||
pub mod config;
|
||||
pub mod device;
|
||||
pub mod layout;
|
||||
pub mod control;
|
||||
pub mod core;
|
||||
pub mod model;
|
||||
pub mod view;
|
||||
|
||||
use crate::core::*;
|
||||
use crate::device::*;
|
||||
use crate::model::*;
|
||||
use crate::view::*;
|
||||
|
||||
mod new {
|
||||
use crate::core::*;
|
||||
use crate::layout::Stack;
|
||||
type Phrase = (String, usize, BTreeMap<usize, Vec<MidiMessage>>);
|
||||
type Scene = (String, Option<usize>, Vec<Option<usize>>);
|
||||
type Track = (String, usize);
|
||||
#[derive(Default)]
|
||||
pub struct App {
|
||||
client: Option<DynamicAsyncClient>,
|
||||
phrases: BTreeMap<usize, Phrase>,
|
||||
scenes: BTreeMap<usize, Scene>,
|
||||
tracks: BTreeMap<usize, Track>,
|
||||
frame: usize,
|
||||
scene: Vec<usize>,
|
||||
timebase: Arc<Timebase>,
|
||||
}
|
||||
struct SceneGrid {}
|
||||
impl Render for SceneGrid {}
|
||||
struct Chains {}
|
||||
impl Render for Chains {}
|
||||
struct Sequencer {}
|
||||
impl Render for Sequencer {}
|
||||
impl Render for App {
|
||||
fn render (&self, buf: &mut Buffer, area: Rect) -> Usually<Rect> {
|
||||
crate::device::Transport {
|
||||
timebase: &self.timebase,
|
||||
playing: TransportState::Stopped,
|
||||
record: false,
|
||||
overdub: false,
|
||||
monitor: false,
|
||||
frame: 0,
|
||||
}.render(buf, area)?;
|
||||
SceneGrid {
|
||||
}.render(buf, area)?;
|
||||
Chains {}.render(buf, area)?;
|
||||
Sequencer {}.render(buf, area)?;
|
||||
Ok(area)
|
||||
pub fn main () -> Usually<()> {
|
||||
App::default().run(Some(|app: Arc<Mutex<App>>|{
|
||||
let mut state = app.lock().unwrap();
|
||||
let xdg = Arc::new(microxdg::XdgApp::new("tek")?);
|
||||
state.xdg = Some(xdg.clone());
|
||||
if crate::config::AppPaths::new(&xdg)?.should_create() {
|
||||
state.modal = Some(Box::new(crate::config::SetupModal(Some(xdg.clone()))));
|
||||
}
|
||||
}
|
||||
impl Handle for App {
|
||||
fn handle (&mut self, _e: &AppEvent) -> Usually<bool> {
|
||||
Ok(true)
|
||||
}
|
||||
}
|
||||
impl Process for App {
|
||||
fn process (&mut self, _c: &Client, _s: &ProcessScope) -> Control {
|
||||
Control::Continue
|
||||
}
|
||||
}
|
||||
pub fn main () -> Usually<()> {
|
||||
App::default().run(Some(|app: Arc<Mutex<App>>|{
|
||||
app.lock().unwrap().client = Some(jack_run("tek", &app)?);
|
||||
Ok(())
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
macro_rules! sample {
|
||||
($note:expr, $name:expr, $src:expr) => {
|
||||
{
|
||||
let mut channels: Vec<wavers::Samples<f32>> = vec![];
|
||||
for channel in wavers::Wav::from_path($src)?.channels() {
|
||||
channels.push(channel);
|
||||
}
|
||||
let mut end = 0;
|
||||
let mut data: Vec<Vec<f32>> = vec![];
|
||||
for samples in channels.iter() {
|
||||
let channel = Vec::from(samples.as_ref());
|
||||
end = end.max(channel.len());
|
||||
data.push(channel);
|
||||
}
|
||||
(u7::from_int_lossy($note).into(), Sample::new($name, 0, end, data).into())
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
fn main () -> Usually<()> {
|
||||
let _cli = cli::Cli::parse();
|
||||
let xdg = microxdg::XdgApp::new("tek")?;
|
||||
crate::config::create_dirs(&xdg)?;
|
||||
//run(Sampler::new("Sampler#000")?)
|
||||
let (client, _) = Client::new("init", ClientOptions::NO_START_SERVER)?;
|
||||
let timebase = Arc::new(Timebase::new(client.sample_rate() as f64, 125.0, 96.0));
|
||||
let ppq = timebase.ppq() as usize;
|
||||
macro_rules! play {
|
||||
($t1:expr => [ $($msg:expr),* $(,)? ]) => {
|
||||
( $t1 * ppq / 4, vec![ $($msg),* ] )
|
||||
}
|
||||
}
|
||||
macro_rules! phrase {
|
||||
($($t:expr => $msg:expr),* $(,)?) => {{
|
||||
let mut phrase = BTreeMap::new();
|
||||
$(phrase.insert($t, vec![]);)*
|
||||
$(phrase.get_mut(&$t).unwrap().push($msg);)*
|
||||
phrase
|
||||
}}
|
||||
}
|
||||
Launcher::new("Launcher#0", &timebase,
|
||||
Some(vec![
|
||||
|
||||
Track::new("Drums", &timebase, Some(vec![
|
||||
|
||||
state.scenes = vec![
|
||||
Scene::new("Intro", vec![None, None, None, None]),
|
||||
];
|
||||
state.phrases = vec![
|
||||
Phrase::new("4 kicks", state.timebase.ppq() as usize * 4, None),
|
||||
];
|
||||
state.tracks = vec![
|
||||
Track::new("Drums", &state.timebase, Some(vec![
|
||||
Sampler::new("Sampler", Some(BTreeMap::from([
|
||||
sample!(36, "Kick", "/home/user/Lab/Music/pak/kik.wav"),
|
||||
sample!(40, "Snare", "/home/user/Lab/Music/pak/sna.wav"),
|
||||
sample!(44, "Hihat", "/home/user/Lab/Music/pak/chh.wav"),
|
||||
])))?.boxed(),
|
||||
|
||||
//Plugin::lv2("Panagement", "file:///home/user/.lv2/Auburn Sounds Panagement 2.lv2")?.boxed(),
|
||||
|
||||
]), Some(vec![
|
||||
|
||||
Phrase::new("KSH", ppq * 4, Some(phrase! {
|
||||
00 * ppq/4 => MidiMessage::NoteOn { key: 36.into(), vel: 100.into() },
|
||||
00 * ppq/4 => MidiMessage::NoteOn { key: 44.into(), vel: 100.into() },
|
||||
01 * ppq/4 => MidiMessage::NoteOn { key: 44.into(), vel: 100.into() },
|
||||
02 * ppq/4 => MidiMessage::NoteOn { key: 44.into(), vel: 100.into() },
|
||||
04 * ppq/4 => MidiMessage::NoteOn { key: 40.into(), vel: 100.into() },
|
||||
04 * ppq/4 => MidiMessage::NoteOn { key: 44.into(), vel: 100.into() },
|
||||
06 * ppq/4 => MidiMessage::NoteOn { key: 44.into(), vel: 100.into() },
|
||||
08 * ppq/4 => MidiMessage::NoteOn { key: 44.into(), vel: 100.into() },
|
||||
10 * ppq/4 => MidiMessage::NoteOn { key: 36.into(), vel: 100.into() },
|
||||
10 * ppq/4 => MidiMessage::NoteOn { key: 44.into(), vel: 100.into() },
|
||||
11 * ppq/4 => MidiMessage::NoteOn { key: 44.into(), vel: 100.into() },
|
||||
12 * ppq/4 => MidiMessage::NoteOn { key: 40.into(), vel: 100.into() },
|
||||
12 * ppq/4 => MidiMessage::NoteOn { key: 44.into(), vel: 100.into() },
|
||||
14 * ppq/4 => MidiMessage::NoteOn { key: 40.into(), vel: 100.into() },
|
||||
14 * ppq/4 => MidiMessage::NoteOn { key: 44.into(), vel: 100.into() }
|
||||
})),
|
||||
|
||||
Phrase::new("4K", ppq * 4, Some(phrase! {
|
||||
00 * ppq/4 => MidiMessage::NoteOn { key: 36.into(), vel: 100.into() },
|
||||
04 * ppq/4 => MidiMessage::NoteOn { key: 36.into(), vel: 100.into() },
|
||||
08 * ppq/4 => MidiMessage::NoteOn { key: 36.into(), vel: 100.into() },
|
||||
12 * ppq/4 => MidiMessage::NoteOn { key: 36.into(), vel: 100.into() },
|
||||
})),
|
||||
|
||||
Phrase::new("KS", ppq * 4, Some(phrase! {
|
||||
00 * ppq/4 => MidiMessage::NoteOn { key: 36.into(), vel: 100.into() },
|
||||
04 * ppq/4 => MidiMessage::NoteOn { key: 40.into(), vel: 100.into() },
|
||||
10 * ppq/4 => MidiMessage::NoteOn { key: 36.into(), vel: 100.into() },
|
||||
12 * ppq/4 => MidiMessage::NoteOn { key: 40.into(), vel: 100.into() },
|
||||
})),
|
||||
|
||||
]))?,
|
||||
|
||||
Track::new("Odin2", &timebase, Some(vec![
|
||||
|
||||
Plugin::lv2("Odin2", "file:///home/user/.lv2/Odin2.lv2")?.boxed(),
|
||||
|
||||
]), Some(vec![
|
||||
Phrase::new("E G A Bb", ppq * 4, Some(BTreeMap::from([
|
||||
play!(2 => [
|
||||
MidiMessage::NoteOff { key: 42.into(), vel: 100.into() },
|
||||
MidiMessage::NoteOn { key: 36.into(), vel: 100.into() },
|
||||
]),
|
||||
play!(6 => [
|
||||
MidiMessage::NoteOff { key: 36.into(), vel: 100.into() },
|
||||
MidiMessage::NoteOn { key: 39.into(), vel: 100.into() },
|
||||
]),
|
||||
play!(10 => [
|
||||
MidiMessage::NoteOff { key: 39.into(), vel: 100.into() },
|
||||
MidiMessage::NoteOn { key: 41.into(), vel: 100.into() },
|
||||
]),
|
||||
play!(14 => [
|
||||
MidiMessage::NoteOff { key: 41.into(), vel: 100.into() },
|
||||
MidiMessage::NoteOn { key: 42.into(), vel: 100.into() },
|
||||
]),
|
||||
]))),
|
||||
Phrase::new("E E G Bb", ppq * 4, Some(BTreeMap::from([
|
||||
play!(2 => [
|
||||
MidiMessage::NoteOff { key: 42.into(), vel: 100.into() },
|
||||
MidiMessage::NoteOn { key: 36.into(), vel: 100.into() },
|
||||
]),
|
||||
play!(6 => [
|
||||
MidiMessage::NoteOff { key: 36.into(), vel: 100.into() },
|
||||
MidiMessage::NoteOn { key: 36.into(), vel: 100.into() },
|
||||
]),
|
||||
play!(10 => [
|
||||
MidiMessage::NoteOff { key: 36.into(), vel: 100.into() },
|
||||
MidiMessage::NoteOn { key: 39.into(), vel: 100.into() },
|
||||
]),
|
||||
play!(14 => [
|
||||
MidiMessage::NoteOff { key: 39.into(), vel: 100.into() },
|
||||
MidiMessage::NoteOn { key: 42.into(), vel: 100.into() },
|
||||
]),
|
||||
]))),
|
||||
Phrase::new("E E E E", ppq * 4, Some(BTreeMap::from([
|
||||
play!(0 => [
|
||||
MidiMessage::NoteOff { key: 36.into(), vel: 100.into() },
|
||||
]),
|
||||
play!(2 => [
|
||||
MidiMessage::NoteOn { key: 36.into(), vel: 100.into() },
|
||||
]),
|
||||
play!(4 => [
|
||||
MidiMessage::NoteOff { key: 36.into(), vel: 100.into() },
|
||||
]),
|
||||
play!(6 => [
|
||||
MidiMessage::NoteOn { key: 36.into(), vel: 100.into() },
|
||||
]),
|
||||
play!(8 => [
|
||||
MidiMessage::NoteOff { key: 36.into(), vel: 100.into() },
|
||||
]),
|
||||
play!(10 => [
|
||||
MidiMessage::NoteOn { key: 36.into(), vel: 100.into() },
|
||||
]),
|
||||
play!(12 => [
|
||||
MidiMessage::NoteOff { key: 36.into(), vel: 100.into() },
|
||||
]),
|
||||
play!(14 => [
|
||||
MidiMessage::NoteOn { key: 36.into(), vel: 100.into() },
|
||||
]),
|
||||
])))
|
||||
]))?,
|
||||
|
||||
//Plugin::lv2("Helm", "file:///home/user/.lv2/Helm.lv2", &[1, 0, 0, 2])?.boxed(),
|
||||
//Plugin::lv2("Kick/ChowKick", "file:///home/user/.lv2/ChowKick.lv2", &[1, 1, 0, 2])?.boxed(),
|
||||
//Plugin::lv2("Bass/Helm", "file:///home/user/.lv2/Helm.lv2", &[1, 0, 0, 2])?.boxed(),
|
||||
//Plugin::lv2("Pads/Odin2", "file:///home/user/.lv2/Odin2.lv2", &[1, 0, 0, 2])?.boxed(),
|
||||
]),
|
||||
Some(vec![
|
||||
Scene::new(&"Scene 1", &[Some(0), None, None, None]),
|
||||
Scene::new(&"Scene 2", &[Some(0), Some(0), None, None]),
|
||||
Scene::new(&"Scene 3", &[Some(1), Some(1), None, None]),
|
||||
Scene::new(&"Scene 4", &[Some(2), Some(2), None, None]),
|
||||
//Scene::new(&"Scene#03", &[None, Some(0), None, None]),
|
||||
//Scene::new(&"Scene#04", &[None, None, None, None]),
|
||||
//Scene::new(&"Scene#05", &[None, None, None, None]),
|
||||
])
|
||||
|
||||
)?
|
||||
.run(Some(init))
|
||||
]), None)?,
|
||||
];
|
||||
state.jack = Some(jack_run("tek", &app)?);
|
||||
Ok(())
|
||||
}))
|
||||
}
|
||||
|
||||
fn init (state: Arc<Mutex<DynamicDevice<Launcher>>>) -> Usually<()> {
|
||||
let input = ".*nanoKEY.*";
|
||||
let output = ["Komplete.*:playback_FL", "Komplete.*:playback_FR"];
|
||||
let state = state.lock().unwrap();
|
||||
state.connect(input, &output)?;
|
||||
Ok(())
|
||||
#[derive(Default)]
|
||||
pub struct App {
|
||||
pub xdg: Option<Arc<XdgApp>>,
|
||||
pub jack: Option<DynamicAsyncClient>,
|
||||
pub phrases: Vec<Phrase>,
|
||||
pub scenes: Vec<Scene>,
|
||||
pub tracks: Vec<Track>,
|
||||
pub frame: usize,
|
||||
pub scene: Vec<usize>,
|
||||
pub timebase: Arc<Timebase>,
|
||||
pub modal: Option<Box<dyn Component>>,
|
||||
}
|
||||
|
||||
process!(App);
|
||||
|
||||
render!(App |self, buf, area| {
|
||||
let Rect { x, mut y, width, height } = area;
|
||||
|
||||
y = y + TransportView {
|
||||
timebase: &self.timebase,
|
||||
playing: TransportState::Stopped,
|
||||
record: false,
|
||||
overdub: false,
|
||||
monitor: false,
|
||||
frame: 0,
|
||||
}.render(buf, area)?.height;
|
||||
|
||||
y = y + SceneGridView {
|
||||
buf,
|
||||
area: Rect { x, y, width, height: height / 3 },
|
||||
name: "",
|
||||
focused: true,
|
||||
scenes: &self.scenes,
|
||||
tracks: &self.tracks,
|
||||
cursor: &(0, 0)
|
||||
}.draw()?.height;
|
||||
|
||||
y = y + ChainView {
|
||||
focused: true,
|
||||
chain: None
|
||||
}.render(buf, Rect { x, y, width, height: height / 3 })?.height;
|
||||
|
||||
y = y + SequencerView {
|
||||
focused: true,
|
||||
ppq: self.timebase.ppq() as usize,
|
||||
track: None,
|
||||
phrase: None,
|
||||
}.render(buf, Rect { x, y, width, height })?.height;
|
||||
|
||||
if let Some(ref modal) = self.modal {
|
||||
for cell in buf.content.iter_mut() {
|
||||
cell.fg = ratatui::style::Color::Gray;
|
||||
cell.modifier = ratatui::style::Modifier::DIM;
|
||||
}
|
||||
modal.render(buf, area)?;
|
||||
}
|
||||
|
||||
Ok(area)
|
||||
});
|
||||
|
||||
handle!(App |self, e| {
|
||||
if let Some(ref mut modal) = self.modal {
|
||||
if modal.handle(e)? {
|
||||
self.modal = None;
|
||||
return Ok(true)
|
||||
};
|
||||
}
|
||||
handle_keymap(self, e, keymap!(App {
|
||||
[F(1), NONE, "toggle_help", "toggle help", toggle_help],
|
||||
|
||||
[Up, NONE, "cursor_up", "move cursor up", cursor_up],
|
||||
[Down, NONE, "cursor_down", "move cursor down", cursor_down],
|
||||
[Left, NONE, "cursor_left", "move cursor left", cursor_left],
|
||||
[Right, NONE, "cursor_right", "move cursor right", cursor_right],
|
||||
[Char('.'), NONE, "increment", "increment value at cursor", increment],
|
||||
[Char(','), NONE, "decrement", "decrement value at cursor", decrement],
|
||||
[Delete, CONTROL, "delete", "delete track", delete],
|
||||
[Char('d'), CONTROL, "duplicate", "duplicate scene or track", duplicate],
|
||||
[Enter, NONE, "activate", "activate item at cursor", activate],
|
||||
|
||||
[Tab, NONE, "focus_next", "focus next area", focus_next],
|
||||
[Tab, SHIFT, "focus_prev", "focus previous area", focus_prev],
|
||||
[Char(' '), NONE, "play_toggle", "play or pause", play_toggle],
|
||||
[Char('r'), NONE, "record_toggle", "toggle recording", record_toggle],
|
||||
[Char('d'), NONE, "overdub_toggle", "toggle overdub", overdub_toggle],
|
||||
[Char('m'), NONE, "monitor_toggle", "toggle input monitoring", monitor_toggle],
|
||||
[Char('r'), CONTROL, "rename", "rename current element", rename],
|
||||
[Char('t'), CONTROL, "add_track", "add a new track", add_track],
|
||||
//[Char(' '), SHIFT, "play_start", "play from start", play_start],
|
||||
}))
|
||||
});
|
||||
|
||||
fn increment (_: &mut App) -> Usually<bool> { Ok(true) }
|
||||
fn decrement (_: &mut App) -> Usually<bool> { Ok(true) }
|
||||
fn delete (_: &mut App) -> Usually<bool> { Ok(true) }
|
||||
fn duplicate (_: &mut App) -> Usually<bool> { Ok(true) }
|
||||
fn activate (_: &mut App) -> Usually<bool> { Ok(true) }
|
||||
fn rename (_: &mut App) -> Usually<bool> { Ok(true) }
|
||||
fn add_track (_: &mut App) -> Usually<bool> { Ok(true) }
|
||||
fn delete_track (_: &mut App) -> Usually<bool> { Ok(true) }
|
||||
fn cursor_up (_: &mut App) -> Usually<bool> { Ok(true) }
|
||||
fn cursor_down (_: &mut App) -> Usually<bool> { Ok(true) }
|
||||
fn cursor_left (_: &mut App) -> Usually<bool> { Ok(true) }
|
||||
fn cursor_right (_: &mut App) -> Usually<bool> { Ok(true) }
|
||||
fn toggle_help (_: &mut App) -> Usually<bool> { Ok(true) }
|
||||
fn focus_next (_: &mut App) -> Usually<bool> { Ok(true) }
|
||||
fn focus_prev (_: &mut App) -> Usually<bool> { Ok(true) }
|
||||
fn clip_next (_: &mut App) -> Usually<bool> { Ok(true) }
|
||||
fn clip_prev (_: &mut App) -> Usually<bool> { Ok(true) }
|
||||
fn play_toggle (_: &mut App) -> Usually<bool> { Ok(true) }
|
||||
fn record_toggle (_: &mut App) -> Usually<bool> { Ok(true) }
|
||||
fn overdub_toggle (_: &mut App) -> Usually<bool> { Ok(true) }
|
||||
fn monitor_toggle (_: &mut App) -> Usually<bool> { Ok(true) }
|
||||
|
||||
//fn main () -> Usually<()> {
|
||||
//let _cli = cli::Cli::parse();
|
||||
//let xdg = microxdg::XdgApp::new("tek")?;
|
||||
//crate::config::create_dirs(&xdg)?;
|
||||
////run(Sampler::new("Sampler#000")?)
|
||||
//let (client, _) = Client::new("init", ClientOptions::NO_START_SERVER)?;
|
||||
//let timebase = Arc::new(Timebase::new(client.sample_rate() as f64, 125.0, 96.0));
|
||||
//let ppq = timebase.ppq() as usize;
|
||||
//macro_rules! play {
|
||||
//($t1:expr => [ $($msg:expr),* $(,)? ]) => {
|
||||
//( $t1 * ppq / 4, vec![ $($msg),* ] )
|
||||
//}
|
||||
//}
|
||||
//macro_rules! phrase {
|
||||
//($($t:expr => $msg:expr),* $(,)?) => {{
|
||||
//let mut phrase = BTreeMap::new();
|
||||
//$(phrase.insert($t, vec![]);)*
|
||||
//$(phrase.get_mut(&$t).unwrap().push($msg);)*
|
||||
//phrase
|
||||
//}}
|
||||
//}
|
||||
//Launcher::new("Launcher#0", &timebase,
|
||||
//Some(vec![
|
||||
|
||||
//Track::new("Drums", &timebase, Some(vec![
|
||||
|
||||
//Sampler::new("Sampler", Some(BTreeMap::from([
|
||||
//sample!(36, "Kick", "/home/user/Lab/Music/pak/kik.wav"),
|
||||
//sample!(40, "Snare", "/home/user/Lab/Music/pak/sna.wav"),
|
||||
//sample!(44, "Hihat", "/home/user/Lab/Music/pak/chh.wav"),
|
||||
//])))?.boxed(),
|
||||
|
||||
////Plugin::lv2("Panagement", "file:///home/user/.lv2/Auburn Sounds Panagement 2.lv2")?.boxed(),
|
||||
|
||||
//]), Some(vec![
|
||||
|
||||
//Phrase::new("KSH", ppq * 4, Some(phrase! {
|
||||
//00 * ppq/4 => MidiMessage::NoteOn { key: 36.into(), vel: 100.into() },
|
||||
//00 * ppq/4 => MidiMessage::NoteOn { key: 44.into(), vel: 100.into() },
|
||||
//01 * ppq/4 => MidiMessage::NoteOn { key: 44.into(), vel: 100.into() },
|
||||
//02 * ppq/4 => MidiMessage::NoteOn { key: 44.into(), vel: 100.into() },
|
||||
//04 * ppq/4 => MidiMessage::NoteOn { key: 40.into(), vel: 100.into() },
|
||||
//04 * ppq/4 => MidiMessage::NoteOn { key: 44.into(), vel: 100.into() },
|
||||
//06 * ppq/4 => MidiMessage::NoteOn { key: 44.into(), vel: 100.into() },
|
||||
//08 * ppq/4 => MidiMessage::NoteOn { key: 44.into(), vel: 100.into() },
|
||||
//10 * ppq/4 => MidiMessage::NoteOn { key: 36.into(), vel: 100.into() },
|
||||
//10 * ppq/4 => MidiMessage::NoteOn { key: 44.into(), vel: 100.into() },
|
||||
//11 * ppq/4 => MidiMessage::NoteOn { key: 44.into(), vel: 100.into() },
|
||||
//12 * ppq/4 => MidiMessage::NoteOn { key: 40.into(), vel: 100.into() },
|
||||
//12 * ppq/4 => MidiMessage::NoteOn { key: 44.into(), vel: 100.into() },
|
||||
//14 * ppq/4 => MidiMessage::NoteOn { key: 40.into(), vel: 100.into() },
|
||||
//14 * ppq/4 => MidiMessage::NoteOn { key: 44.into(), vel: 100.into() }
|
||||
//})),
|
||||
|
||||
//Phrase::new("4K", ppq * 4, Some(phrase! {
|
||||
//00 * ppq/4 => MidiMessage::NoteOn { key: 36.into(), vel: 100.into() },
|
||||
//04 * ppq/4 => MidiMessage::NoteOn { key: 36.into(), vel: 100.into() },
|
||||
//08 * ppq/4 => MidiMessage::NoteOn { key: 36.into(), vel: 100.into() },
|
||||
//12 * ppq/4 => MidiMessage::NoteOn { key: 36.into(), vel: 100.into() },
|
||||
//})),
|
||||
|
||||
//Phrase::new("KS", ppq * 4, Some(phrase! {
|
||||
//00 * ppq/4 => MidiMessage::NoteOn { key: 36.into(), vel: 100.into() },
|
||||
//04 * ppq/4 => MidiMessage::NoteOn { key: 40.into(), vel: 100.into() },
|
||||
//10 * ppq/4 => MidiMessage::NoteOn { key: 36.into(), vel: 100.into() },
|
||||
//12 * ppq/4 => MidiMessage::NoteOn { key: 40.into(), vel: 100.into() },
|
||||
//})),
|
||||
|
||||
//]))?,
|
||||
|
||||
//Track::new("Odin2", &timebase, Some(vec![
|
||||
|
||||
//Plugin::lv2("Odin2", "file:///home/user/.lv2/Odin2.lv2")?.boxed(),
|
||||
|
||||
//]), Some(vec![
|
||||
//Phrase::new("E G A Bb", ppq * 4, Some(BTreeMap::from([
|
||||
//play!(2 => [
|
||||
//MidiMessage::NoteOff { key: 42.into(), vel: 100.into() },
|
||||
//MidiMessage::NoteOn { key: 36.into(), vel: 100.into() },
|
||||
//]),
|
||||
//play!(6 => [
|
||||
//MidiMessage::NoteOff { key: 36.into(), vel: 100.into() },
|
||||
//MidiMessage::NoteOn { key: 39.into(), vel: 100.into() },
|
||||
//]),
|
||||
//play!(10 => [
|
||||
//MidiMessage::NoteOff { key: 39.into(), vel: 100.into() },
|
||||
//MidiMessage::NoteOn { key: 41.into(), vel: 100.into() },
|
||||
//]),
|
||||
//play!(14 => [
|
||||
//MidiMessage::NoteOff { key: 41.into(), vel: 100.into() },
|
||||
//MidiMessage::NoteOn { key: 42.into(), vel: 100.into() },
|
||||
//]),
|
||||
//]))),
|
||||
//Phrase::new("E E G Bb", ppq * 4, Some(BTreeMap::from([
|
||||
//play!(2 => [
|
||||
//MidiMessage::NoteOff { key: 42.into(), vel: 100.into() },
|
||||
//MidiMessage::NoteOn { key: 36.into(), vel: 100.into() },
|
||||
//]),
|
||||
//play!(6 => [
|
||||
//MidiMessage::NoteOff { key: 36.into(), vel: 100.into() },
|
||||
//MidiMessage::NoteOn { key: 36.into(), vel: 100.into() },
|
||||
//]),
|
||||
//play!(10 => [
|
||||
//MidiMessage::NoteOff { key: 36.into(), vel: 100.into() },
|
||||
//MidiMessage::NoteOn { key: 39.into(), vel: 100.into() },
|
||||
//]),
|
||||
//play!(14 => [
|
||||
//MidiMessage::NoteOff { key: 39.into(), vel: 100.into() },
|
||||
//MidiMessage::NoteOn { key: 42.into(), vel: 100.into() },
|
||||
//]),
|
||||
//]))),
|
||||
//Phrase::new("E E E E", ppq * 4, Some(BTreeMap::from([
|
||||
//play!(0 => [
|
||||
//MidiMessage::NoteOff { key: 36.into(), vel: 100.into() },
|
||||
//]),
|
||||
//play!(2 => [
|
||||
//MidiMessage::NoteOn { key: 36.into(), vel: 100.into() },
|
||||
//]),
|
||||
//play!(4 => [
|
||||
//MidiMessage::NoteOff { key: 36.into(), vel: 100.into() },
|
||||
//]),
|
||||
//play!(6 => [
|
||||
//MidiMessage::NoteOn { key: 36.into(), vel: 100.into() },
|
||||
//]),
|
||||
//play!(8 => [
|
||||
//MidiMessage::NoteOff { key: 36.into(), vel: 100.into() },
|
||||
//]),
|
||||
//play!(10 => [
|
||||
//MidiMessage::NoteOn { key: 36.into(), vel: 100.into() },
|
||||
//]),
|
||||
//play!(12 => [
|
||||
//MidiMessage::NoteOff { key: 36.into(), vel: 100.into() },
|
||||
//]),
|
||||
//play!(14 => [
|
||||
//MidiMessage::NoteOn { key: 36.into(), vel: 100.into() },
|
||||
//]),
|
||||
//])))
|
||||
//]))?,
|
||||
|
||||
////Plugin::lv2("Helm", "file:///home/user/.lv2/Helm.lv2", &[1, 0, 0, 2])?.boxed(),
|
||||
////Plugin::lv2("Kick/ChowKick", "file:///home/user/.lv2/ChowKick.lv2", &[1, 1, 0, 2])?.boxed(),
|
||||
////Plugin::lv2("Bass/Helm", "file:///home/user/.lv2/Helm.lv2", &[1, 0, 0, 2])?.boxed(),
|
||||
////Plugin::lv2("Pads/Odin2", "file:///home/user/.lv2/Odin2.lv2", &[1, 0, 0, 2])?.boxed(),
|
||||
//]),
|
||||
//Some(vec![
|
||||
//Scene::new(&"Scene 1", &[Some(0), None, None, None]),
|
||||
//Scene::new(&"Scene 2", &[Some(0), Some(0), None, None]),
|
||||
//Scene::new(&"Scene 3", &[Some(1), Some(1), None, None]),
|
||||
//Scene::new(&"Scene 4", &[Some(2), Some(2), None, None]),
|
||||
////Scene::new(&"Scene#03", &[None, Some(0), None, None]),
|
||||
////Scene::new(&"Scene#04", &[None, None, None, None]),
|
||||
////Scene::new(&"Scene#05", &[None, None, None, None]),
|
||||
//])
|
||||
|
||||
//)?
|
||||
//.run(Some(init))
|
||||
//}
|
||||
|
||||
//fn init (state: Arc<Mutex<DynamicDevice<Launcher>>>) -> Usually<()> {
|
||||
//let input = ".*nanoKEY.*";
|
||||
//let output = ["Komplete.*:playback_FL", "Komplete.*:playback_FR"];
|
||||
//let state = state.lock().unwrap();
|
||||
//state.connect(input, &output)?;
|
||||
//Ok(())
|
||||
//}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue