mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-08 04:36:45 +01:00
records looped
This commit is contained in:
parent
674f95fcd2
commit
a3f8f411ae
1 changed files with 7 additions and 6 deletions
|
|
@ -70,12 +70,13 @@ pub fn process (state: &mut Sequencer, client: &Client, scope: &ProcessScope) ->
|
||||||
}
|
}
|
||||||
|
|
||||||
fn process_in (state: &mut Sequencer, scope: &ProcessScope) {
|
fn process_in (state: &mut Sequencer, scope: &ProcessScope) {
|
||||||
let pos = state.transport.query().unwrap().pos;
|
let pos = state.transport.query().unwrap().pos;
|
||||||
let usecs = Frame(pos.frame()).to_usec(&state.rate).0;
|
let usecs = Frame(pos.frame()).to_usec(&state.rate).0;
|
||||||
let beat = usecs / state.tempo.usec_per_beat().0;
|
let step = state.tempo.usec_per_step(state.divisions as u64).0;
|
||||||
let step = usecs / state.tempo.usec_per_step(state.divisions as u64).0;
|
let steps = usecs / step;
|
||||||
let tick_usec = state.tempo.usec_per_step(state.ppq).0;
|
let step = steps % state.steps;
|
||||||
let tick = usecs / tick_usec;
|
let tick = step * state.ppq / state.divisions;
|
||||||
|
|
||||||
for event in state.input_port.iter(scope) {
|
for event in state.input_port.iter(scope) {
|
||||||
match midly::live::LiveEvent::parse(event.bytes).unwrap() {
|
match midly::live::LiveEvent::parse(event.bytes).unwrap() {
|
||||||
midly::live::LiveEvent::Midi { channel, message } => match message {
|
midly::live::LiveEvent::Midi { channel, message } => match message {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue