"I exported midi at 70 bpm, ...Same file imports in Guitar Pro at 69 bpm. Then I exported a file at 80, and it imports correctly at 80, both in Reaper and GP"
this has nothing to do with the ppqn.
I wanted to say for a long time why fp calculation for exporting microticks is not really
the optimal way
but I have always forget.
This has to do with the how REAPER calculated the microticks/quarter for export.
REAPER calculate with FP and use microticks=ceil(time/tempo).
And mostly all Hardware and it seams also GP use simple integer calculation for
showing the resulting BPM...(time/microticks)
And now the example for your 70 BPM.
REAPER microticks= 60.000.000/70 = ceil(857.142,857.....)
means rounding up
microticks per quarter=857.143 for export within the midifile
If GP and mostly all Hardware use simple integer calculation for viewing the tempo
that would result in 69 BPM instead of 70
BPM=int(60.000.000/857143) = 69
If REAPER would not rounding up things(int(time/tempo))
then the result would be
int(60.000.000/857142)=70 BPM
And for the 80 BPM ceil(60.000.000/80) = exact 750.000 microticks
So no rounds up
But both do not matter for the tempo The microticks are the same
only the visible BPM is of course false..
110.05 would for example result in 110.04
110 in 109 and so on and so on.
But a more compatible way would be integer calculation (or floor(x)) to calculate the
microticks for export/import instead of rounding up.
----------------------
EDIT:
and normally the right /spec way!!
microticks is integer, like all other MIDI values, so I should also calculate with simple int^^
Another example:
Hardware with one BPM display XXX plus 3 decimals
XXX,YYY BPM
REAPER should export 75,689 BPM to MIDI
60.000.000.000:75689=792.717,567....
ceil(792.717,567)
REAPER export 792.718 microticks/quarter
but should export 792.717 ;without ceil(x)
--
Import within above Hardware with 3 decimals for viewing BPM from microticks
int(60.000.000.000/792.718)=75688
BPM Display show:
BPM 75,688
int(60.000.000.000/792.717)=75689
BPM Display show:
BPM 75.689
....exported 75,689 BPM to microticks
BTW:
this has nothing special to do with Hardware or not:
rounding up BPM <> microticks is simply not correct.
All prog which rounding up BPM <> microticks do it wrong.
All prog which use integer or floor(x) do it right..
the compatible spec way
BPM 75.689
|Tempo | BPM=75 | micros\quarter=792718
Display 75,688
vs
|Tempo | BPM=75 | micros\quarter=792717
Display 75,689