Example ====== Masters - BPM Master - Set Speed ====== ^ by: | Sebastian Beutel | ^ published: | February 2018 | ^ description: | taps/sets BPM masters to predefined BPM rates | ^ remarks: | Two possible ways - both have their pros and cons, and are discussed below. | {{tag>tap bpm master speed}} **The Titan IDs used in this example have changed in Titan v11 (and were different in v10), see [[macros:identifier:titanid|]]** **The former macro for v10 can be downloaded here: {{ :macros:example:tap85bpm.xml |}}** ==== functions ==== * [[:macros:function:Masters.TapTempo]] * [[:macros:function:Math.GetCurrentTimeStamp]] * [[:macros:function:Masters.SetSpeed]] ===== Code ===== Masters.TapTempo(1612, Math.GetCurrentTimeStamp()) Masters.TapTempo(1616, Math.GetCurrentTimeStamp()) Masters.TapTempo(1620, Math.GetCurrentTimeStamp()) Masters.TapTempo(1624, Math.GetCurrentTimeStamp()) Masters.TapTempo(1612, Math.GetCurrentTimeStamp()) Masters.TapTempo(1616, Math.GetCurrentTimeStamp()) Masters.TapTempo(1620, Math.GetCurrentTimeStamp()) Masters.TapTempo(1624, Math.GetCurrentTimeStamp()) Masters.TapTempo(1612, Math.GetCurrentTimeStamp()) Masters.TapTempo(1616, Math.GetCurrentTimeStamp()) Masters.TapTempo(1620, Math.GetCurrentTimeStamp()) Masters.TapTempo(1624, Math.GetCurrentTimeStamp()) Masters.TapTempo(1612, Math.GetCurrentTimeStamp()) Masters.TapTempo(1616, Math.GetCurrentTimeStamp()) Masters.TapTempo(1620, Math.GetCurrentTimeStamp()) Masters.TapTempo(1624, Math.GetCurrentTimeStamp()) Masters.SetSpeed(1612, 85.000) Masters.SetSpeed(1616, 85.000) Masters.SetSpeed(1620, 85.000) Masters.SetSpeed(1624, 85.000) Masters.SetSpeed(1612, 60.000) Masters.SetSpeed(1616, 60.000) Masters.SetSpeed(1620, 60.000) Masters.SetSpeed(1624, 60.000) Masters.SetSpeed(1612, 0.000) Masters.SetSpeed(1616, 0.000) Masters.SetSpeed(1620, 0.000) Masters.SetSpeed(1624, 0.000) ===== Explanation ===== This explains the functional steps within the sequence. For all the other XML details please refer to [[:macros:formats_and_syntax#xml_format|Formats and syntax]] The first two macros are essentially identical, except that their target BPM rate is different. What they do is: * tap all four BPM masters once * wait a specific time using [[macros:step_pause]] * tap all masters the 2nd time Waiting time must be calculated like this: waiting time = 60 / target BPM rate e.g. target BPM rate = 85 => waiting time = 60/85 = 0.706 The next macros directly set the designated speed. ==== Pros and Cons ==== Masters.TapTempo() also sets the edge of the tap as this does exactly as like really tapping the master. But there might be slight deviations since this involves real time on the console - and if there is heavy calculation load, it might happen that the time is not taken too precisely. More importantly, this macro involves a rather long waiting time - and if you trigger the macro again in this time, the result is a completely wrong BPM rate. Masters.SetSpeed() hasn't the second tap and no waiting time - it always sets an exact BPM rate at once. But it doesn't set the edge. And, even more importantly, it sets the master value to the target value (in this case, 85.000) - regardless what the master is currently set to show. This is, if the masters is set to have BPM on fader then it is all good. But if instead the Multiplier is on the fader then this is set to the value - most likely you'll end with a very high multiplier. ===== How to use it ===== * [[:macros:deploying|make this macro available]] * tap when you need to set the BPM masters to a specific speed ~~DISCUSSION~~