Lines Matching defs:tick

125      * convert tick to microsecond with given tempo.
129 public static long ticks2microsec(long tick, double tempoMPQ, int resolution) {
130 return (long) (((double) tick) * tempoMPQ / resolution);
139 // do not round to nearest tick
145 * Given a tick, convert to microsecond
148 public static long tick2microsecond(Sequence seq, long tick, TempoCache cache) {
150 double seconds = ((double)tick / (double)(seq.getDivisionType() * seq.getResolution()));
173 || ticks[snapshotIndex] > tick) {
178 // this implementation needs a tempo event at tick 0!
180 while (i < cacheCount && ticks[i] <= tick) {
186 + ticks2microsec(tick - ticks[snapshotIndex],
196 * Given a microsecond time, convert to tick.
205 long tick = (long) dTick;
207 cache.currTempo = (int) cache.getTempoMPQAt(tick);
209 return tick;
221 long us = 0; long tick = 0; int newReadPos = 0; int i = 1;
224 // to find the right tick
236 tick = ticks[i - 1] + microsec2ticks(micros - us, tempos[i - 1], resolution);
237 if (Printer.debug) Printer.debug("microsecond2tick(" + (micros / 1000)+") = "+tick+" ticks.");
238 //if (Printer.debug) Printer.debug(" -> convert back = " + (tick2microsecond(seq, tick, null) / 1000)+" microseconds");
241 return tick;
247 * @param tick tick number of index to be found in array
248 * @return index in track which is on or after "tick".
249 * if no entries are found that follow after tick, track.size() is returned
251 public static int tick2index(Track track, long tick) {
253 if (tick > 0) {
259 // tick of estimate
261 if (t == tick) {
263 } else if (t < tick) {
266 // "or after tick"
271 } else { // if (t>tick)
352 float getTempoMPQAt(long tick) {
353 return getTempoMPQAt(tick, -1.0f);
356 synchronized float getTempoMPQAt(long tick, float startTempoMPQ) {
358 if (ticks[i] > tick) {