reenable phrase recording/playback, pt.1

This commit is contained in:
🪞👃🪞 2024-10-27 16:53:05 +02:00
parent b60aca88d3
commit eba7044916
3 changed files with 92 additions and 70 deletions

View file

@ -119,6 +119,8 @@ pub struct PhrasePlayer<E: Engine> {
pub clock: Arc<TransportTime>,
/// Start time and phrase being played
pub phrase: Option<(AtomicUsize, Option<Arc<RwLock<Phrase>>>)>,
/// Start time (FIXME move into phrase, using Instant)
pub started: Option<(usize, usize)>,
/// Start time and next phrase
pub next_phrase: Option<(AtomicUsize, Option<Arc<RwLock<Phrase>>>)>,
/// Play input through output.
@ -129,8 +131,10 @@ pub struct PhrasePlayer<E: Engine> {
pub overdub: bool,
/// Send all notes off
pub reset: bool, // TODO?: after Some(nframes)
/// Output from current sequence.
pub midi_out: Option<Port<MidiOut>>,
/// Record from MIDI ports to current sequence.
pub midi_inputs: Vec<Port<MidiIn>>,
/// Play from current sequence to MIDI ports
pub midi_outputs: Vec<Port<MidiOut>>,
/// MIDI output buffer
pub midi_out_buf: Vec<Vec<Vec<u8>>>,
/// Notes currently held at input
@ -333,13 +337,15 @@ impl<E: Engine> PhrasePlayer<E> {
_engine: Default::default(),
clock: clock.clone(),
phrase: None,
started: None,
next_phrase: None,
notes_in: Arc::new(RwLock::new([false;128])),
notes_out: Arc::new(RwLock::new([false;128])),
monitoring: false,
recording: false,
overdub: true,
midi_out: None,
midi_inputs: vec![],
midi_outputs: vec![],
midi_out_buf: vec![Vec::with_capacity(16);16384],
reset: true,
}