when --debug print note name
This commit is contained in:
@@ -74,7 +74,11 @@ impl Syn {
|
|||||||
match self {
|
match self {
|
||||||
Syn::Real(syn) => syn.render(a, b),
|
Syn::Real(syn) => syn.render(a, b),
|
||||||
Syn::Text { m, i } => {
|
Syn::Text { m, i } => {
|
||||||
eprintln!("{} | render[{}]({:?})", chrono::prelude::Utc::now(), i, m);
|
eprintln!("{} | render[{}]({:?})", chrono::prelude::Utc::now(), i, m
|
||||||
|
.iter()
|
||||||
|
.map(|tuple| (tuple.0, tuple.1.iter().map(|v| tone::new(v.0.to_string()).string()).collect::<Vec<_>>()))
|
||||||
|
.collect::<Vec<_>>(),
|
||||||
|
);
|
||||||
*i += 1;
|
*i += 1;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
18
src/tone.rs
18
src/tone.rs
@@ -82,6 +82,24 @@ impl Tone {
|
|||||||
pub fn i32(&self) -> i32 {
|
pub fn i32(&self) -> i32 {
|
||||||
self.0
|
self.0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn string(&self) -> String {
|
||||||
|
match self.i32() {
|
||||||
|
57|69 => "a",
|
||||||
|
58|70 => "a+",
|
||||||
|
59|71 => "b",
|
||||||
|
60|72 => "c",
|
||||||
|
61|73 => "c+",
|
||||||
|
62|74 => "d",
|
||||||
|
63|75 => "d+",
|
||||||
|
64|76 => "e",
|
||||||
|
65|77 => "f",
|
||||||
|
66|78 => "f+",
|
||||||
|
67|79 => "g",
|
||||||
|
68|80 => "g+",
|
||||||
|
_ => "?",
|
||||||
|
}.to_string()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|||||||
Reference in New Issue
Block a user