experimental SVG-based video rendering engine made for music videos. React to MIDI or arbitrary signals from your DAW through "probe" VSTs
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

✨ StemAtInstant#playcount

gwen.works cacf4a58 4833c5d7

verified
+13
+4
src/synchronization/audio.rs
··· 112 112 pub duration: usize, 113 113 pub velocity_max: u8, 114 114 pub notes: Vec<Note>, 115 + /// How many instants (individual ms values) 116 + /// have occurred where this stem played notes 117 + /// before this instant (not counting the current instant) 118 + pub playcount: usize, 115 119 } 116 120 impl StemAtInstant { 117 121 pub fn amplitude_relative(&self) -> f32 {
+9
src/video/context.rs
··· 77 77 .unwrap_or(0), 78 78 duration: stems[name].duration_ms, 79 79 notes: stems[name].notes.get(&self.ms).cloned().unwrap_or(vec![]), 80 + playcount: stems[name] 81 + .notes 82 + .iter() 83 + .filter(|&(&ms, notes)| { 84 + ms < self.ms 85 + && !notes.is_empty() 86 + && notes.iter().any(|note| note.is_on()) 87 + }) 88 + .count(), 80 89 } 81 90 } 82 91