Open tmhglnd opened 4 years ago
Not yet possible with one function that works for all, but there are now several translate methods for different types of input. Using the Time Value Syntax of Cycling'74's MaxMSP
// format: TL.func(<Array>, <bpm>)
TL.divisionToMs(['1/4', ['1/8', ['3/16', '1/4']], '1/6', '2'], 100);
//=> [ 600, [ 300, [ 450, 600 ] ], 400, 4800 ]
// Alias: TL.dtoms()
TL.ratioToMs([0.25, [0.125, [0.1875, 0.25]], 0.1667, 2], 100);
//=> [ 600, [ 300, [ 450, 600 ] ], 400.08, 4800 ]
// Alias: TL.rtoms()
TL.timevalueToMs(['4n', ['8nt', ['16nd', '2nd']], '32n', '3m'], 100);
//=> [ 600, [ 200, [ 225, 1800 ] ], 75, 7200 ]
// Alias. TL.ttoms()
An enhancement to the Translate library of a method that converts various duration values from different platforms to a corresponding millisecond value based on a set tempo.
example
But could also work with division notation
Or with floating point ratio values