// Rate5 returns the number of ticks in the last 5 minutes.
184685
func (m *CountMeter) Rate5() float64 {
	m.mtx.RLock()
	defer m.mtx.RUnlock()
	return m.rate5()
}
515019
func (t Trig) Rate(rate int8) Input {
	CheckRate(rate)
	(&t).defaults()
	return NewInput("Trig", rate, 0, 1, t.In, t.Dur)
}
507441
func (a *StandardEWMA) Rate() float64 {
	a.mutex.Lock()
	defer a.mutex.Unlock()
	return a.rate * float64(1e9)
}
1246380
func (sel Select) Rate(rate int8) Input {
	CheckRate(rate)
	inputs := append([]Input{sel.Which}, sel.Inputs...)
	return NewInput("Select", rate, 0, 1, inputs...)
}
1097622
func (l LFPar) Rate(rate int8) Input {
	CheckRate(rate)
	(&l).defaults()
	return NewInput("LFPar", rate, 0, 1, l.Freq, l.IPhase)
}
928701
func (s SoundIn) Rate(rate int8) Input {
	CheckRate(rate)

	var (
		nobs   = NumOutputBuses{}.Rate(IR)
		result Input
	)
	// TODO: simplify this.
	switch x := s.Bus.(type) {
	case C:
		first := NewUgen("In", rate, 0, 1, nobs)

		if x > 0 {
			result = NewUgen("In", rate, 0, 1, nobs.Add(x))
		} else if x == 0 {
			result = first
		} else {
			panic("SoundIn bus indices must not be negative")
		}
	case Inputs:
		var (
			curr   = soundInParams{numOutputs: 1}
			params = []soundInParams{}
			prev   C
		)
		for i, input := range x {
			switch y := input.(type) {
			case C:
				if i == 0 {
					prev = y
					continue
				}
				if prev+1 == y {
					curr.numOutputs++

					if i == len(x)-1 {
						params = append(params, curr)
					}
					continue
				}
				params = append(params, curr)

				if i == len(x)-1 {
					params = append(params, soundInParams{
						startBus:   y,
						numOutputs: 1,
					})
				} else {
					curr = soundInParams{startBus: y, numOutputs: 1}
				}
			default:
				panic("SoundIn busses must be constant or an array of constants")
			}
		}
		arr := make(Inputs, len(params))

		for i, params := range params {
			if params.startBus == 0 {
				arr[i] = NewUgen("In", rate, 0, params.numOutputs, nobs)
			} else {
				arr[i] = NewUgen("In", rate, 0, params.numOutputs, nobs.Add(params.startBus))
			}
		}
		result = arr
	default:
		panic("SoundIn busses must be constant or an array of constants")
	}
	return result
}
1033234
func (apc Allpass) Rate(rate int8) Input {
	if apc.In == nil {
		panic("Allpass expects In to not be nil")
	}
	CheckRate(rate)

	(&apc).defaults()

	switch apc.Interpolation {
	case InterpolationNone:
		return NewInput("AllpassN", rate, 0, 1, apc.In, apc.MaxDelayTime, apc.DelayTime, apc.DecayTime)
	case InterpolationLinear:
		return NewInput("AllpassL", rate, 0, 1, apc.In, apc.MaxDelayTime, apc.DelayTime, apc.DecayTime)
	case InterpolationCubic:
		return NewInput("AllpassC", rate, 0, 1, apc.In, apc.MaxDelayTime, apc.DelayTime, apc.DecayTime)
	default:
		panic(fmt.Errorf("invalid interpolation: %d", apc.Interpolation))
	}
}
380866
func (l LFClipNoise) Rate(rate int8) Input {
	CheckRate(rate)
	(&l).defaults()
	return NewInput("LFClipNoise", rate, 0, 1, l.Freq)
}
180200
func (lftri LFTri) Rate(rate int8) Input {
	CheckRate(rate)
	(&lftri).defaults()
	return NewInput("LFTri", rate, 0, 1, lftri.Freq, lftri.Iphase)
}
35450
func (g GrainIn) Rate(rate int8) Input {
	CheckRate(rate)
	if g.In == nil {
		panic("GrainIn requires an input signal")
	}
	(&g).defaults()

	in := NewInput("GrainIn", rate, 0, 1, g.Trigger, g.Dur, g.In, g.Pan, g.EnvBuf, g.MaxGrains)
	if g.NumChannels == 1 {
		return in
	}
	mult := make([]Input, g.NumChannels)
	for i := range mult {
		mult[i] = in
	}
	return Multi(mult...)
}
770315
func (d *Driver) Rate() (err error) {
	buf, _ := d.createPacket(videoRateQuery, 0x48, 0)
	d.seq++
	binary.Write(buf, binary.LittleEndian, d.seq)
	binary.Write(buf, binary.LittleEndian, CalculateCRC16(buf.Bytes()))

	_, err = d.cmdConn.Write(buf.Bytes())
	return
}
503663
func (white WhiteNoise) Rate(rate int8) Input {
	CheckRate(rate)
	return NewInput("WhiteNoise", rate, 0, 1)
}
1269798
func (s Slope) Rate(rate int8) Input {
	CheckRate(rate)
	(&s).defaults()
	return NewInput("Slope", rate, 0, 1, s.In)
}
120545
func (g Gendy3) Rate(rate int8) Input {
	CheckRate(rate)
	(&g).defaults()
	return NewInput("Gendy3", rate, 0, 1, g.AmpDist, g.DurDist, g.ADParam, g.DDParam, g.Freq, g.AmpScale, g.DurScale, g.InitCPs, g.KNum)
}
108660
func (integrator Integrator) Rate(rate int8) Input {
	CheckRate(rate)
	if integrator.In == nil {
		panic("Integrator expects In to not be nil")
	}
	(&integrator).defaults()
	return NewInput("Integrator", rate, 0, 1, integrator.In, integrator.Coef)
}
841906
func (s Slew) Rate(rate int8) Input {
	CheckRate(rate)
	(&s).defaults()
	return NewInput("Slew", rate, 0, 1, s.In, s.Up, s.Dn)
}
726508
func (l LFGauss) Rate(rate int8) Input {
	CheckRate(rate)
	(&l).defaults()
	done := C(float32(l.Done))
	return NewInput("LFGauss", rate, 0, 1, l.Duration, l.Width, l.IPhase, l.Loop, done)
}