first version of blip

This commit is contained in:
Max Bradbury 2022-10-30 20:18:27 +00:00
parent 9363be8254
commit 5577a05191
1 changed files with 18 additions and 0 deletions

18
src/blip.rs Normal file
View File

@ -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<Note>,
name: Option<String>,
/// 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,
}