use crate::semitone;
use crate::MusicBox;
use crate::_1;
#[derive(Debug)]
pub struct Guitar {
pub tuning: Vec<f64>,
pub tones: Vec<Vec<f64>>,
pub positions: Vec<[f64; 6]>,
}
impl Guitar {
pub fn standard_tuning() -> Self {
let music = MusicBox::new();
let e = music.notary.get("E1").unwrap(); let a = music.notary.get("A2").unwrap();
let d = music.notary.get("D2").unwrap();
let g = music.notary.get("G2").unwrap();
let b = music.notary.get("B3").unwrap();
let high_e = music.notary.get("E3").unwrap();
let tuning = vec![*e, *a, *d, *g, *b, *high_e];
let mut tones = vec![];
for i in 0..tuning.len() {
let mut string = vec![];
for fret in 0..=24 {
string.push(semitone(tuning[i], fret as i64));
}
tones.push(string);
}
let mut positions = vec![];
let mut position0: [f64; 6] = [*e, *a, *d, *g, *b, *high_e];
position0.iter_mut().for_each(|tonic| _1(music.tonic));
dbg!(position0);
Self { tuning, tones , positions}
}
}