Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
magnetophon committed Oct 29, 2024
1 parent cea5794 commit 52fe02f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1046,23 +1046,25 @@ impl Del2 {
let mut block_end = block_len;
// if no events
if index == 0 {
// println!("no events: tap {}, index: {}", tap, index);
let tap_state = self.tap_states[tap].1;
let state_toggled = tap_state != self.tap_was_muted[tap];
if tap_state != self.tap_was_muted[tap] {
println!("set tap {} to {}", tap, tap_state);
// println!("set tap {} to {}", tap, tap_state);
self.mute_out(tap, tap_state);
self.tap_was_muted[tap] = tap_state;
}
self.amp_envelopes[tap].next_block(
&mut self.envelope_block[tap][block_start..block_end],
block_end - block_start,
);
// println!("no events: tap {}, index: {}", tap, index);
} else {
let (end_time, state) = self.amp_envelope_states[tap].raw_at(0);
block_end = *end_time as usize;
if block_end == 0 {
block_end = block_len
}
// TODO: put back, or handle it on the next call?
// if block_end == 0 {
// block_end = block_len
// }
self.mute_out(tap, *state);
self.amp_envelopes[tap].next_block(
&mut self.envelope_block[tap][block_start..block_end],
Expand Down

0 comments on commit 52fe02f

Please sign in to comment.