Lines Matching refs:tick

112      * convert tick to microsecond with given tempo.
116 public static long ticks2microsec(long tick, double tempoMPQ, int resolution) {
117 return (long) (((double) tick) * tempoMPQ / resolution);
126 // do not round to nearest tick
133 * Given a tick, convert to microsecond
136 public static long tick2microsecond(Sequence seq, long tick, TempoCache cache) {
138 double seconds = ((double)tick / (double)(seq.getDivisionType() * seq.getResolution()));
161 || ticks[snapshotIndex] > tick) {
166 // this implementation needs a tempo event at tick 0!
168 while (i < cacheCount && ticks[i] <= tick) {
174 + ticks2microsec(tick - ticks[snapshotIndex],
184 * Given a microsecond time, convert to tick.
193 long tick = (long) dTick;
195 cache.currTempo = (int) cache.getTempoMPQAt(tick);
197 return tick;
209 long us = 0; long tick = 0; int newReadPos = 0; int i = 1;
212 // to find the right tick
224 tick = ticks[i - 1] + microsec2ticks(micros - us, tempos[i - 1], resolution);
225 if (Printer.debug) Printer.debug("microsecond2tick(" + (micros / 1000)+") = "+tick+" ticks.");
226 //if (Printer.debug) Printer.debug(" -> convert back = " + (tick2microsecond(seq, tick, null) / 1000)+" microseconds");
229 return tick;
236 * @param tick - tick number of index to be found in array
237 * @return index in track which is on or after "tick".
238 * if no entries are found that follow after tick, track.size() is returned
240 public static int tick2index(Track track, long tick) {
242 if (tick > 0) {
248 // tick of estimate
250 if (t == tick) {
252 } else if (t < tick) {
255 // "or after tick"
260 } else { // if (t>tick)
343 float getTempoMPQAt(long tick) {
344 return getTempoMPQAt(tick, -1.0f);
347 synchronized float getTempoMPQAt(long tick, float startTempoMPQ) {
349 if (ticks[i] > tick) {