From f8cf52fa4b2bbaff5627fa397a26589070084d3e Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Fri, 25 Nov 2022 23:34:51 -0500 Subject: Actually produce some valid midi output. Major restructure in the IT player: No more custom trait objects, let's just use closures instead... Basic note handling. Fixes to the midi file modules so the output is now valid. Other fixes to appease the Rust Gods. Current converter handles no IT effects (except timing effects like Axx, Bxx, Cxx, SBx and SEx, as those are handled as a part of the player). But this is a start. --- src/main.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 0b76033..728c3e2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,8 +9,10 @@ fn main() -> Result<(), itfile::Error> { { Ok(f) => { - let mut conv = convert::Converter::new(&f); - conv.convert(); + let mut conv = convert::Converter::new(); + conv.convert(&f); + let mf = conv.result(); + midifile::write_file("output.mid", &mf)?; Ok(()) } Err(e) => Err(e) -- cgit v1.2.3