mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
rudimentary input quantizer
This commit is contained in:
parent
665885f6ff
commit
f6a7cbf38e
8 changed files with 108 additions and 54 deletions
14
src/main.rs
14
src/main.rs
|
|
@ -53,6 +53,7 @@ pub fn main () -> Usually<()> {
|
|||
state.scene_cursor = 1;
|
||||
state.note_start = 12;
|
||||
state.time_zoom = 12;
|
||||
state.quant = 24;
|
||||
|
||||
let outputs: Vec<_> = ["Komplete.+:playback_FL", "Komplete.+:playback_FR"]
|
||||
.iter()
|
||||
|
|
@ -228,6 +229,10 @@ pub struct App {
|
|||
pub track_cursor: usize,
|
||||
/// Collection of tracks
|
||||
pub tracks: Vec<Track>,
|
||||
|
||||
pub chunk_size: usize,
|
||||
|
||||
pub quant: usize,
|
||||
}
|
||||
process!(App |self, _client, scope| {
|
||||
let transport = self.transport.as_ref().unwrap().query().unwrap();
|
||||
|
|
@ -235,9 +240,9 @@ process!(App |self, _client, scope| {
|
|||
if Some(transport.state) != self.playing {
|
||||
panic = true;
|
||||
}
|
||||
self.playing = Some(transport.state);
|
||||
self.playhead = transport.pos.frame() as usize;
|
||||
let frames = scope.n_frames() as usize;
|
||||
self.playing = Some(transport.state);
|
||||
self.playhead = transport.pos.frame() as usize;
|
||||
self.chunk_size = scope.n_frames() as usize;
|
||||
let CycleTimes {
|
||||
current_frames,
|
||||
current_usecs,
|
||||
|
|
@ -249,9 +254,10 @@ process!(App |self, _client, scope| {
|
|||
self.midi_in.as_ref().unwrap().iter(scope),
|
||||
&self.timebase,
|
||||
self.playing,
|
||||
self.quant,
|
||||
panic,
|
||||
&scope,
|
||||
(current_frames as usize, frames),
|
||||
(current_frames as usize, self.chunk_size),
|
||||
(current_usecs as usize, next_usecs.saturating_sub(current_usecs) as usize),
|
||||
period_usecs as f64
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue