MCPcopy Create free account
hub / github.com/CoderLine/alphaTab / valueToTicks

Method valueToTicks

packages/alphatab/src/midi/MidiUtils.ts:43–49  ·  view source on GitHub ↗

* Converts a numerical value to its ticks equivalent. * @param duration the numerical proportion to convert. (i.E. timesignature denominator, note duration,...)

(duration: number)

Source from the content-addressed store, hash-verified

41 * @param duration the numerical proportion to convert. (i.E. timesignature denominator, note duration,...)
42 */
43 public static valueToTicks(duration: number): number {
44 let denomninator: number = duration;
45 if (denomninator < 0) {
46 denomninator = 1 / -denomninator;
47 }
48 return (MidiUtils.QuarterTime * (4.0 / denomninator)) | 0;
49 }
50
51 public static applyDot(ticks: number, doubleDotted: boolean): number {
52 if (doubleDotted) {

Callers 3

toTicksMethod · 0.80
getDurationAsTicksMethod · 0.80
calculateDurationMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected