Assuming tempo is stable and you know beat positions you can average/sum onset value at beats, grouped by index modulo x. X could be from 2 to 8. Discovering downbeat would be to create some heuristics that compare these groups and select the one where 1 bin is evidently stronger than others. Bin number would give you position on which you have downbeat (bar start), while x value would give you meter. This is what I actually plan to do in my case.