Skip to content

Commit

Permalink
wip DelayTap
Browse files Browse the repository at this point in the history
  • Loading branch information
magnetophon committed Oct 29, 2024
1 parent 5a549d6 commit b03c319
Show file tree
Hide file tree
Showing 2 changed files with 244 additions and 38 deletions.
26 changes: 26 additions & 0 deletions src/delay_tap.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
use nih_plug::prelude::*;

pub struct DelayTap {
/// The identifier for this delay tap. Polyphonic modulation events are linked to a delay tap based on
/// these IDs. If the host doesn't provide these IDs, then this is computed through
/// `compute_fallback_delay_tap_id()`. In that case polyphonic modulation will not work, but the
/// basic note events will still have an effect.
pub delay_tap_id: i32,
/// The note's channel, in `0..16`. Only used for the delay tap terminated event.
pub channel: u8,
/// The note's key/note, in `0..128`. Only used for the delay tap terminated event.
pub note: u8,
/// The delay taps internal ID. Each delay tap has an internal delay tap ID one higher than the previous
/// delay tap. This is used to steal the last delay tap in case all 16 delay taps are in use.
pub internal_delay_tap_id: u64,
/// The note's velocity. This is used to interpollate it's dsp parameters.
pub velocity: f32,
/// Whether the key has been released and the delay tap is in its release stage. The delay tap will be
/// terminated when the amplitude envelope hits 0 while the note is releasing.
pub releasing: bool,
/// Fades between 0 and 1 with timings based on the global attack and release settings.
pub amp_envelope: Smoother<f32>,
/// If this delay tap has polyphonic gain modulation applied, then this contains the normalized
/// offset and a smoother.
pub delay_tap_gain: Option<(f32, Smoother<f32>)>,
}
Loading

0 comments on commit b03c319

Please sign in to comment.