Skip to content

Commit

Permalink
optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
ddiakopoulos committed Dec 30, 2015
1 parent 7c1a144 commit 86bf609
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/midi_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,11 @@ namespace mm
for (auto & event_list : tracks)
{
int lastTickValue = 0;
int tmpTick = 0;
for (auto & event : event_list)
{
const auto msg = event->m;
int tmpTick = event->tick;
tmpTick = event->tick;
event->tick -= lastTickValue;
lastTickValue = tmpTick;
}
Expand All @@ -77,10 +78,11 @@ namespace mm
for (auto & event_list : tracks)
{
int runningTickCounter = 0;
int tmpTick = 0;
for (auto & event : event_list)
{
const auto msg = event->m;
int tmpTick = event->tick;
tmpTick = event->tick;
event->tick = runningTickCounter;
runningTickCounter += tmpTick;
}
Expand Down

0 comments on commit 86bf609

Please sign in to comment.