Calculates processing sequence length according to tempo setting
7332
function() {
            var seq;
            var seek;

            if (this.bAutoSeqSetting) {
                seq = AUTOSEQ_C + AUTOSEQ_K * this._tempo;
                seq = this.checkLimits(seq, AUTOSEQ_AT_MAX, AUTOSEQ_AT_MIN);
                this.sequenceMs = Math.floor(seq + 0.5);
            }

            if (this.bAutoSeekSetting) {
                seek = AUTOSEEK_C + AUTOSEEK_K * this._tempo;
                seek = this.checkLimits(seek, AUTOSEEK_AT_MAX, AUTOSEEK_AT_MIN);
                this.seekWindowMs = Math.floor(seek + 0.5);
            }

            // Update seek window lengths
            this.seekWindowLength = Math.floor(
                (this.sampleRate * this.sequenceMs) / 1000
            );
            this.seekLength = Math.floor(
                (this.sampleRate * this.seekWindowMs) / 1000
            );
        }
128485
def set_itunes_duration(self):
        """"""
        try:
            self.itunes_duration = self.soup.find('itunes:duration').string
        except AttributeError:
            self.itunes_duration = None
517311
def sequence_length(fasta):
    
    sequences = SeqIO.parse(fasta, "fasta")
    records = {record.id: len(record) for record in sequences}
    return records
932606
function Sequence( ac, tempo, arr ) {
  this.ac = ac || new AudioContext();
  this.createFxNodes();
  this.tempo = tempo || 120;
  this.loop = true;
  this.smoothing = 0;
  this.staccato = 0;
  this.notes = [];
  this.push.apply( this, arr || [] );
}
360067
private static function inserir_tempo(int $tempo_da_sessao): int
    {
        $diferenca_tempo = time() - $tempo_da_sessao;
        $segundos = $diferenca_tempo;
        $minutos = round($diferenca_tempo / 60);
        $horas = round($diferenca_tempo / 3600);
        $dia = round($diferenca_tempo / 86400);
        $semana = round($diferenca_tempo / 604800);
        $mes = round($diferenca_tempo / 2592000);
        $ano = round($diferenca_tempo / 31536000);
        //segundos

        if ($segundos <= 60) {
            echo " $segundos segundos agora<br/>";
        }
        //minutos
        elseif ($minutos <= 60) {
            if ($minutos == 1) {
                echo "one minuto  e $segundos agora <br/>";
            } else {
                echo "$minutos minutos agora<br/>";
            }
        }

        //horas
        elseif ($horas <= 24) {
            if ($horas == 1) {
                echo "uma hora agora e $minutos minutos e $segundos segundos<br/>";
            } else {
                echo "$horas horas agora<br/>";
            }
        }

        // dias
        elseif ($dia <= 7) {
            if ($dia == 1) {
                echo 'um dia agora <br/>';
            } else {
                echo "$dia dias agora<br/>";
            }
        }

        //semanas
        elseif ($semana <= 4) {
            if ($semana == 1) {
                echo 'uma semana agora<br/>';
            } else {
                echo "$semana semanas agora<br/>";
            }
        }

        //mes
        elseif ($mes <= 12) {
            if ($mes == 1) {
                echo 'um mes agora<br/>';
            } else {
                echo "$mes meses agora<br/>";
            }
        }

        //semanas
        else {
            if ($ano == 1) {
                echo 'um ano agora<br/>';
            } else {
                echo "$ano anos agora<br/>";
            }
        }

        return $tempo_da_sessao;
    }
511286
def setStimDuration(self):
        """"""
        duration = self.ui.durSpnbx.value()
        self.tone.setDuration(duration)
958077
def fmt_duration(secs):
    """"""
    return ' '.join(fmt.human_duration(secs, 0, precision=2, short=True).strip().split())
141424
Rule Tempo() {
		//TODO Q:2/16 3/16=60
		//Q: "Brzo" 4/8 3/8 4/8=70 "kopanica"
		//Q:"faster"
		return FirstOf(
				SequenceS(NoteLengthStrict(),
					OptionalS(WSPS()),
					String("="),
					OptionalS(WSPS()),
					DIGITS(),
					OptionalS(WSPS()),
					OptionalS(TempoText())
				),
				SequenceS(
					String("C"),
					OptionalS(NoteLength()),
					OptionalS(WSPS()),
					String("="),
					OptionalS(WSPS()),
					DIGITS(),
					OptionalS(WSPS()),
					OptionalS(TempoText())
				),
				DIGITS()
		).label(Tempo);
	}
401066
def change_note_duration(self, at, to):
        """"""
        if valid_beat_duration(to):
            diff = 0
            for x in self.bar:
                if diff != 0:
                    x[0][0] -= diff
                if x[0] == at:
                    cur = x[0][1]
                    x[0][1] = to
                    diff = 1 / cur - 1 / to
849563
def length_of_associated_transcript(effect):
    
    return apply_to_transcript_if_exists(
        effect=effect,
        fn=lambda t: len(t.sequence),
        default=0)
26052
function timeCalculator(progress, selfInvoker) {
        if (isStoppedTimer) return;

        var step = 1;

        var remainingProgress = 1.0 - progress.position;

        var estimatedCompletionTime = Math.round((remainingProgress / progress.position) * progressIterations);
        var estimatedHours, estimatedMinutes, estimatedSeconds, displayHours, displayMinutes, displaySeconds;
        progressIterations += step;

        if (progress.position < 1.0) {
            if (isFinite(estimatedCompletionTime)) {
                estimatedHours = Math.floor(estimatedCompletionTime / 3600);
                displayHours = estimatedHours > 9 ? estimatedHours : '0' + estimatedHours;
                estimatedMinutes = Math.floor((estimatedCompletionTime / 60) % 60);
                displayMinutes = estimatedMinutes > 9 ? estimatedMinutes : '0' + estimatedMinutes;
                estimatedSeconds = estimatedCompletionTime % 60;
                displaySeconds = estimatedSeconds > 9 ? estimatedSeconds : '0' + estimatedSeconds;
            }

            var output = '';
            if (displayHours > 0) {
                output += displayHours + ' hours ';
            }
            if (displayMinutes > 0) {
                output += displayMinutes + ' minutes ';
            }
            if (displaySeconds > 0) {
                output += displaySeconds + ' seconds ';
            }
            if (output.length) {
                progressHelper.callback(output);
            }
        }

        setTimeout(function() {
            timeCalculator(progress, true);
        }, step * ONE_SECOND);
    }
506515
def toStringDuration (duration):
    

    table = (
        ('%dms'      , 1e-3, 1e3),
        (u'%d\u03BCs', 1e-6, 1e6),
        ('%dns'      , 1e-9, 1e9)
    )

    if duration > 1:
        return '%fs' % duration

    for format, threshold, factor in table:
        if duration > threshold:
            return format % int(duration * factor)

    return '%fs' % duration
1241872
def drum_in_pattern_rate(pianoroll, beat_resolution, tolerance=0.1):
    """"""
    if beat_resolution not in (4, 6, 8, 9, 12, 16, 18, 24):
        raise ValueError("Unsupported beat resolution. Only 4, 6, 8 ,9, 12, "
                         "16, 18, 42 are supported.")
    _validate_pianoroll(pianoroll)

    def _drum_pattern_mask(res, tol):
        """Return a drum pattern mask with the given tolerance."""
        if res == 24:
            drum_pattern_mask = np.tile([1., tol, 0., 0., 0., tol], 4)
        elif res == 12:
            drum_pattern_mask = np.tile([1., tol, tol], 4)
        elif res == 6:
            drum_pattern_mask = np.tile([1., tol, tol], 2)
        elif res == 18:
            drum_pattern_mask = np.tile([1., tol, 0., 0., 0., tol], 3)
        elif res == 9:
            drum_pattern_mask = np.tile([1., tol, tol], 3)
        elif res == 16:
            drum_pattern_mask = np.tile([1., tol, 0., tol], 4)
        elif res == 8:
            drum_pattern_mask = np.tile([1., tol], 4)
        elif res == 4:
            drum_pattern_mask = np.tile([1., tol], 2)
        return drum_pattern_mask

    drum_pattern_mask = _drum_pattern_mask(beat_resolution, tolerance)
    n_in_pattern = np.sum(drum_pattern_mask * np.count_nonzero(pianoroll, 1))
    return n_in_pattern / np.count_nonzero(pianoroll)
1068790
function toMS(duration) {
    var i = duration;

    // Allow for string durations like 'fast'.
    if ($.fx.speeds[i]) { i = $.fx.speeds[i]; }

    return unit(i, 'ms');
  }
361091
function (duration, settings) {
  // If there's no swing ratio, assume straight eighths
  var ratio = settings && settings.swingRatio ? settings.swingRatio : 1;
  return Math.round(ticksPerBeat * duration.value(ratio));
}
616530
public int getTotalRecordingLengthTimer() {
        final String value = getParameter(SignalParameters.TOTAL_RECORDING_LENGTH_TIMER.symbol());
        return Integer.parseInt(value) * 100;
    }
258839
def set_pulse_duration(self, duration):
        
        if duration > 4294967295:
            raise ValueError('Duration is too long. Please choose a value '
                             'less than 4294967296.')

        big_endian = hex(duration)[2:]
        if len(big_endian) % 2 != 0:
            big_endian = '0'+big_endian

        little_endian = []

        for i in range(0, len(big_endian), 2):
            little_endian.insert(0, big_endian[i:i+2])

        for i in range(0, 4-len(little_endian)):
            little_endian.append('00')

        command = 'mp'
        for i in little_endian:
            command += chr(int(i, 16))

        self.con.send_xid_command(command, 0)