Skip to content

Commit

Permalink
use floats for tempo calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
Kurausukun committed Jun 28, 2022
1 parent c2a08cc commit 2e7f500
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/mid2agb/agb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 2e7f500

Please sign in to comment.