Last active
December 4, 2021 16:38
-
-
Save alanwhite/19c4c465241f28f3a3e3ee40644f8980 to your computer and use it in GitHub Desktop.
Helper class for exposing characteristics of a time signature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TimeSigUtil { | |
public static boolean isCompoundTime(TimeSigModel model) { | |
if ( model.getTop() == 3 ) | |
return false; | |
if ( model.getTop() % 3 == 0 ) | |
return true; | |
return false; | |
} | |
public static int beatsPerBar(TimeSigModel ts) { | |
if ( TimeSigUtil.isCompoundTime(ts) ) | |
return ts.getTop() / 3; | |
return ts.getTop(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment