octave shifts that may or may not be needed for all dmf files

master
Ashley N. 2023-08-26 22:07:56 -04:00
parent eda1518833
commit 8459028858
1 changed files with 15 additions and 12 deletions

View File

@ -469,18 +469,21 @@ impl DmfModule {
Some( Some(
match note { match note {
100 => Note::NoteOff, 100 => Note::NoteOff,
1 => Note::CSharp( octave ), // check: do these octave shifts make sense for all dmf modules?
2 => Note::D( octave ), // they were needed on the test dmf but no documentation supports it
3 => Note::DSharp( octave ), // test dmf sounds off key otherwise...
4 => Note::E( octave ), 1 => Note::CSharp( if channel > 5 { octave - 1 } else { octave } ),
5 => Note::F( octave ), 2 => Note::D( if channel > 5 { octave - 1 } else { octave } ),
6 => Note::FSharp( octave ), 3 => Note::DSharp( if channel > 5 { octave - 1 } else { octave } ),
7 => Note::G( octave ), 4 => Note::E( if channel > 5 { octave - 1 } else { octave } ),
8 => Note::GSharp( octave ), 5 => Note::F( if channel > 5 { octave - 1 } else { octave } ),
9 => Note::A( octave ), 6 => Note::FSharp( if channel > 5 { octave - 1 } else { octave } ),
10 => Note::ASharp( octave ), 7 => Note::G( if channel > 5 { octave - 1 } else { octave } ),
11 => Note::B( octave ), 8 => Note::GSharp( if channel > 5 { octave - 1 } else { octave } ),
12 => Note::C( octave + 1 ), // deflemask y u shift the octave down 1 for C?? 9 => Note::A( if channel > 5 { octave - 1 } else { octave } ),
10 => Note::ASharp( if channel > 5 { octave - 1 } else { octave } ),
11 => Note::B( if channel > 5 { octave - 1 } else { octave } ),
12 => Note::C( if channel > 5 { octave } else { octave + 1 } ), // deflemask y u shift the octave down 1 for C??
_ => return Err( format!( "invalid file: invalid note id {}", note ) )? _ => return Err( format!( "invalid file: invalid note id {}", note ) )?
} }
) )