mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
IT BOPS
This commit is contained in:
parent
0ba14bf2da
commit
3ba5e253b0
5 changed files with 120 additions and 59 deletions
85
src/main.rs
85
src/main.rs
|
|
@ -44,7 +44,7 @@ fn main () -> Result<(), Box<dyn Error>> {
|
|||
let (client, _) = Client::new("init", ClientOptions::NO_START_SERVER)?;
|
||||
let timebase = Arc::new(Timebase {
|
||||
rate: AtomicUsize::new(client.sample_rate()),
|
||||
tempo: AtomicUsize::new(113000),
|
||||
tempo: AtomicUsize::new(150000),
|
||||
ppq: AtomicUsize::new(96),
|
||||
});
|
||||
let ppq = timebase.ppq() as u32;
|
||||
|
|
@ -64,34 +64,6 @@ fn main () -> Result<(), Box<dyn Error>> {
|
|||
sample!(44, "Hihat", "/home/user/Lab/Music/pak/chh.wav"),
|
||||
])))?.boxed(),
|
||||
]), Some(vec![
|
||||
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() },
|
||||
|
|
@ -123,20 +95,57 @@ fn main () -> Result<(), Box<dyn Error>> {
|
|||
MidiMessage::NoteOn { key: 44.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() },
|
||||
]),
|
||||
]))),
|
||||
]))?,
|
||||
|
||||
Track::new("Helm", &timebase, Some(vec![
|
||||
Plugin::lv2("Helm", "file:///home/user/.lv2/Helm.lv2", &[1, 0, 0, 2])?.boxed(),
|
||||
//Plugin::lv2("Helm", "file:///home/user/.lv2/Helm.lv2", &[1, 0, 0, 2])?.boxed(),
|
||||
Plugin::lv2("Odin2", "file:///home/user/.lv2/Odin2.lv2", &[1, 0, 0, 2])?.boxed(),
|
||||
]), Some(vec![
|
||||
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() }] ),
|
||||
( 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() }] ),
|
||||
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() },
|
||||
]),
|
||||
])))
|
||||
]))?,
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue