diff --git a/src/blip.rs b/src/blip.rs new file mode 100644 index 0000000..163ceb5 --- /dev/null +++ b/src/blip.rs @@ -0,0 +1,18 @@ +use crate::note::Note; + +/// thanks to Rumple_Frumpkins from Bitsy Talk for his help in figuring out the blip format. +#[derive(Debug, Clone, PartialEq)] +pub struct Blip { + id: String, + notes: Vec, + name: Option, + /// Attack (ms), Decay (ms), Sustain (level: 1-15), Hold (sustain duration, ms), Release (ms) + envelope: [u8; 5], + /// first value is milliseconds per note; + /// second value is a modifier to the first note (add or subtract milliseconds) + beat: [i16; 2], + /// I think this is probably pulse width. apparently the potential values are P2, P4 and P8. + square: String, + /// Notes can sound repeatedly, or just once as the blip fades out. + repeat: bool, +}