diff --git a/src/reskit/soundtrack/engines/echo.rs b/src/reskit/soundtrack/engines/echo.rs index 9093e6f..3e6b789 100644 --- a/src/reskit/soundtrack/engines/echo.rs +++ b/src/reskit/soundtrack/engines/echo.rs @@ -82,6 +82,27 @@ fn get_semitone( note: &Note ) -> Result> { } ) } +/** + * Notes are used to index PCM sample playback. C = 1, etc. + */ +fn get_pcm_index( note: &Note ) -> Result> { + Ok( match note { + Note::NoteOff => return Err( "internal error: attempted to get pcm index for a Note::NoteOff" )?, + Note::C(_) => 0, + Note::CSharp(_) => 1, + Note::D(_) => 2, + Note::DSharp(_) => 3, + Note::E(_) => 4, + Note::F(_) => 5, + Note::FSharp(_) => 6, + Note::G(_) => 7, + Note::GSharp(_) => 8, + Note::A(_) => 9, + Note::ASharp(_) => 10, + Note::B(_) => 11 + } ) +} + /** Gets the semitone frequency used by Echo. https://github.com/sikthehedgehog/Echo/blob/master/doc/esf.txt#L243 @@ -235,23 +256,19 @@ fn get_events_for_channel( channel: &mut Channel, row: &PatternRow ) -> Result