Merge pull request #1697 from Kurausukun/bpm

Use Floats and Round Correctly in Tempo Calculation
This commit is contained in:
GriffinR 2022-06-28 00:27:44 -04:00 committed by GitHub
commit 06c9e0eb99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,6 +18,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#include <cmath>
#include <cstdio>
#include <cstdarg>
#include <cstring>
@ -503,7 +504,7 @@ void PrintAgbTrack(std::vector<Event>& events)
ResetTrackVars();
break;
case EventType::Tempo:
PrintByte("TEMPO , %u*%s_tbs/2", 60000000 / event.param2, g_asmLabel.c_str());
PrintByte("TEMPO , %u*%s_tbs/2", static_cast<int>(round(60000000.0f / static_cast<float>(event.param2))), g_asmLabel.c_str());
PrintWait(event.time);
break;
case EventType::InstrumentChange: