mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
more scenes and clips
This commit is contained in:
parent
b9018c774b
commit
27529da08d
3 changed files with 82 additions and 10 deletions
81
src/main.rs
81
src/main.rs
|
|
@ -48,28 +48,87 @@ fn main () -> Result<(), Box<dyn Error>> {
|
|||
ppq: AtomicUsize::new(96),
|
||||
});
|
||||
let ppq = timebase.ppq() as u32;
|
||||
macro_rules! play {
|
||||
($t1:expr => [ $($msg:expr),* $(,)? ]) => {
|
||||
( $t1 * ppq / 4, vec![ $($msg),* ] )
|
||||
}
|
||||
}
|
||||
let app = Launcher::new("Launcher#0", &timebase,
|
||||
Some(vec![
|
||||
|
||||
Track::new("Kick", &timebase, Some(vec![
|
||||
Track::new("Drums", &timebase, Some(vec![
|
||||
//Plugin::lv2("Kick/ChowKick", "file:///home/user/.lv2/ChowKick.lv2", &[1, 1, 0, 2])?.boxed(),
|
||||
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(),
|
||||
]), 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: 40.into(), vel: 100.into() }] ),
|
||||
( ppq * 5 / 2, vec![MidiMessage::NoteOn { key: 36.into(), vel: 100.into() }] ),
|
||||
( ppq * 3, vec![MidiMessage::NoteOn { key: 40.into(), vel: 100.into() }] ),
|
||||
])))
|
||||
Phrase::new("4K", ppq * 4, Some(BTreeMap::from([
|
||||
play!(0 => [
|
||||
MidiMessage::NoteOn { key: 36.into(), vel: 100.into() },
|
||||
] ),
|
||||
play!(4 => [
|
||||
MidiMessage::NoteOn { key: 36.into(), vel: 100.into() },
|
||||
]),
|
||||
play!(8 => [
|
||||
MidiMessage::NoteOn { key: 36.into(), vel: 100.into() },
|
||||
]),
|
||||
play!(12 => [
|
||||
MidiMessage::NoteOn { key: 36.into(), vel: 100.into() },
|
||||
]),
|
||||
]))),
|
||||
Phrase::new("KS", ppq * 4, Some(BTreeMap::from([
|
||||
play!(0 => [
|
||||
MidiMessage::NoteOn { key: 36.into(), vel: 100.into() },
|
||||
] ),
|
||||
play!(4 => [
|
||||
MidiMessage::NoteOn { key: 40.into(), vel: 100.into() },
|
||||
]),
|
||||
play!(10 => [
|
||||
MidiMessage::NoteOn { key: 36.into(), vel: 100.into() },
|
||||
]),
|
||||
play!(12 => [
|
||||
MidiMessage::NoteOn { key: 40.into(), vel: 100.into() },
|
||||
]),
|
||||
]))),
|
||||
Phrase::new("KSH", ppq * 4, Some(BTreeMap::from([
|
||||
play!(0 => [
|
||||
MidiMessage::NoteOn { key: 36.into(), vel: 100.into() },
|
||||
MidiMessage::NoteOn { key: 44.into(), vel: 100.into() },
|
||||
] ),
|
||||
play!(2 => [
|
||||
MidiMessage::NoteOn { key: 44.into(), vel: 100.into() },
|
||||
]),
|
||||
play!(4 => [
|
||||
MidiMessage::NoteOn { key: 40.into(), vel: 100.into() },
|
||||
MidiMessage::NoteOn { key: 44.into(), vel: 100.into() },
|
||||
]),
|
||||
play!(6 => [
|
||||
MidiMessage::NoteOn { key: 44.into(), vel: 100.into() },
|
||||
]),
|
||||
play!(8 => [
|
||||
MidiMessage::NoteOn { key: 44.into(), vel: 100.into() },
|
||||
]),
|
||||
play!(10 => [
|
||||
MidiMessage::NoteOn { key: 36.into(), vel: 100.into() },
|
||||
MidiMessage::NoteOn { key: 44.into(), vel: 100.into() },
|
||||
]),
|
||||
play!(12 => [
|
||||
MidiMessage::NoteOn { key: 40.into(), vel: 100.into() },
|
||||
MidiMessage::NoteOn { key: 44.into(), vel: 100.into() },
|
||||
]),
|
||||
play!(14 => [
|
||||
MidiMessage::NoteOn { key: 40.into(), vel: 100.into() },
|
||||
MidiMessage::NoteOn { key: 44.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([
|
||||
Phrase::new("E G A Bb", 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() }] ),
|
||||
|
|
@ -86,8 +145,10 @@ fn main () -> Result<(), Box<dyn Error>> {
|
|||
//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 1", &[Some(0), None, None, None]),
|
||||
Scene::new(&"Scene 2", &[Some(0), Some(0), None, None]),
|
||||
Scene::new(&"Scene 3", &[Some(1), Some(0), None, None]),
|
||||
Scene::new(&"Scene 4", &[Some(2), 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]),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue