mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-08 04:36:45 +01:00
move project contents to main
This commit is contained in:
parent
8a8d7b8704
commit
1b7892d11f
4 changed files with 102 additions and 104 deletions
59
src/main.rs
59
src/main.rs
|
|
@ -20,12 +20,55 @@ fn main () -> Result<(), Box<dyn Error>> {
|
|||
let xdg = microxdg::XdgApp::new("tek")?;
|
||||
crate::config::create_dirs(&xdg)?;
|
||||
//run(Sampler::new("Sampler#000")?)
|
||||
run(Launcher::new_with_controller(
|
||||
"Launcher#0",
|
||||
".*nanoKEY.*",
|
||||
&[
|
||||
"Komplete.*:playback_FL",
|
||||
"Komplete.*:playback_FR",
|
||||
]
|
||||
)?)
|
||||
let input = ".*nanoKEY.*";
|
||||
let output = ["Komplete.*:playback_FL", "Komplete.*:playback_FR"];
|
||||
let (client, _) = Client::new("init", ClientOptions::NO_START_SERVER)?;
|
||||
let timebase = Arc::new(Timebase {
|
||||
rate: AtomicUsize::new(client.sample_rate()),
|
||||
tempo: AtomicUsize::new(113000),
|
||||
ppq: AtomicUsize::new(96),
|
||||
});
|
||||
let ppq = timebase.ppq() as u32;
|
||||
run(Launcher::new("Launcher#0", &timebase,
|
||||
Some(vec![
|
||||
Track::new("Kick", &timebase, Some(vec![
|
||||
//Sampler::new("Sampler")?.boxed(),
|
||||
Plugin::lv2("Kick/ChowKick", "file:///home/user/.lv2/ChowKick.lv2", &[1, 1, 0, 2])?.boxed(),
|
||||
]), Some(vec![
|
||||
Phrase::new("HelloKick", ppq * 4, Some(BTreeMap::from([
|
||||
( ppq * 0, vec![MidiMessage::NoteOn { key: 36.into(), vel: 100.into() }] ),
|
||||
( ppq * 1, vec![MidiMessage::NoteOn { key: 36.into(), vel: 100.into() }] ),
|
||||
( ppq * 2, vec![MidiMessage::NoteOn { key: 36.into(), vel: 100.into() }] ),
|
||||
( ppq * 3, vec![MidiMessage::NoteOn { key: 36.into(), vel: 100.into() }] ),
|
||||
])))
|
||||
]))?,
|
||||
|
||||
Track::new("Helm", &timebase, Some(vec![
|
||||
Plugin::lv2("Helm", "file:///home/user/.lv2/Helm.lv2", &[1, 0, 0, 2])?.boxed(),
|
||||
]), Some(vec![
|
||||
Phrase::new("HelloBass", ppq * 4, Some(BTreeMap::from([
|
||||
( ppq / 2 + ppq * 0, vec![MidiMessage::NoteOn { key: 36.into(), vel: 100.into() }] ),
|
||||
( ppq / 2 + ppq * 1 / 2, vec![MidiMessage::NoteOff { key: 36.into(), vel: 100.into() }] ),
|
||||
( ppq / 2 + ppq * 1, vec![MidiMessage::NoteOn { key: 39.into(), vel: 100.into() }] ),
|
||||
( ppq / 2 + ppq * 3 / 2, vec![MidiMessage::NoteOff { key: 39.into(), vel: 100.into() }] ),
|
||||
( ppq / 2 + ppq * 2, vec![MidiMessage::NoteOn { key: 41.into(), vel: 100.into() }] ),
|
||||
( ppq / 2 + ppq * 5 / 2, vec![MidiMessage::NoteOff { key: 41.into(), vel: 100.into() }] ),
|
||||
( ppq / 2 + ppq * 3, vec![MidiMessage::NoteOn { key: 42.into(), vel: 100.into() }] ),
|
||||
( ppq / 2 + ppq * 7 / 2 - 1, vec![MidiMessage::NoteOff { key: 42.into(), vel: 100.into() }] ),
|
||||
])))
|
||||
]))?,
|
||||
|
||||
//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#01", &[Some(0), None, None, None]),
|
||||
Scene::new(&"Scene#02", &[Some(0), Some(0), 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]),
|
||||
])
|
||||
|
||||
)?.connect(input, &output)?)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue