diff --git a/interface/src/main.rs b/interface/src/main.rs index 1de1628..35d0a9e 100644 --- a/interface/src/main.rs +++ b/interface/src/main.rs @@ -20,7 +20,7 @@ fn main() -> Result<()> { let (sender, notes) = mpsc::channel(); const POWER_THRESHOLD: f32 = 5.0; - const CLARITY_THRESHOLD: f32 = 0.7; + const CLARITY_THRESHOLD: f32 = 0.85; const PACKET_LEN: usize = 2204; let stream = device.build_input_stream(&config.into(), @@ -42,8 +42,8 @@ fn main() -> Result<()> { for (note,vol) in notes { if let Some(note) = note { //dbg!(note.frequency); - dbg!(note.clarity); - dbg!(vol); + //dbg!(note.clarity); + //dbg!(vol); let note = Note::from_freq(note.frequency, Tuning::EqualTemperament); match note.pitch { Pitch { letter: NoteLetter::A, accidental: 0} => { @@ -61,8 +61,15 @@ fn main() -> Result<()> { Pitch { letter: NoteLetter::G, accidental: 0} => { println!("fire"); } + Pitch { letter: NoteLetter::E, accidental: 0} => { + println!("fire"); + } pitch => { - dbg!(pitch); + if vol > 3000. { + println!("fire"); + } else { + //dbg!(pitch); + } } }