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(
match note {
100 => Note::NoteOff,
1 => Note::CSharp( octave ),
2 => Note::D( octave ),
3 => Note::DSharp( octave ),
4 => Note::E( octave ),
5 => Note::F( octave ),
6 => Note::FSharp( octave ),
7 => Note::G( octave ),
8 => Note::GSharp( octave ),
9 => Note::A( octave ),
10 => Note::ASharp( octave ),
11 => Note::B( octave ),
12 => Note::C( octave + 1 ), // deflemask y u shift the octave down 1 for C??
// check: do these octave shifts make sense for all dmf modules?
// they were needed on the test dmf but no documentation supports it
// test dmf sounds off key otherwise...
1 => Note::CSharp( if channel > 5 { octave - 1 } else { octave } ),
2 => Note::D( if channel > 5 { octave - 1 } else { octave } ),
3 => Note::DSharp( if channel > 5 { octave - 1 } else { octave } ),
4 => Note::E( if channel > 5 { octave - 1 } else { octave } ),
5 => Note::F( if channel > 5 { octave - 1 } else { octave } ),
6 => Note::FSharp( if channel > 5 { octave - 1 } else { octave } ),
7 => Note::G( if channel > 5 { octave - 1 } else { octave } ),
8 => Note::GSharp( if channel > 5 { octave - 1 } else { octave } ),
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 ) )?
}
)