fix note timings (#449)

This commit is contained in:
Keagan McClelland
2021-09-07 12:58:46 -06:00
committed by GitHub
parent 2dfd5d994f
commit b23d46f254

View File

@@ -86,9 +86,9 @@ impl SoundInterface {
) -> Result<(), Error> {
{
self.play(note).await?;
tokio::time::sleep(time_slice.to_duration((tempo_qpm as u64 * 19 / 20) as u16)).await;
tokio::time::sleep(time_slice.to_duration(tempo_qpm) * 19 / 20).await;
self.stop().await?;
tokio::time::sleep(time_slice.to_duration(tempo_qpm / 20)).await;
tokio::time::sleep(time_slice.to_duration(tempo_qpm) / 20).await;
Ok(())
}
.or_else(|e: Error| {