// Rate creates a new ugen at a specific rate.
// If rate is an unsupported value this method will cause a runtime panic.
420608
func (pd PulseDivider) Rate(rate int8) Input {
	CheckRate(rate)
	(&pd).defaults()
	return NewInput("PulseDivider", rate, 0, 1, pd.Trig, pd.Div, pd.Start)
}
380866
func (l LFClipNoise) Rate(rate int8) Input {
	CheckRate(rate)
	(&l).defaults()
	return NewInput("LFClipNoise", rate, 0, 1, l.Freq)
}
1156516
func (formlet Formlet) Rate(rate int8) Input {
	CheckRate(rate)
	if formlet.In == nil {
		panic("Formlet expects In to not be nil")
	}
	(&formlet).defaults()
	return NewInput("Formlet", rate, 0, 1, formlet.In, formlet.Freq, formlet.AttackTime, formlet.DecayTime)
}
704040
func (c CoinGate) Rate(rate int8) Input {
	CheckRate(rate)
	(&c).defaults()
	return NewInput("CoinGate", rate, 0, 1, c.Prob, c.In)
}
77892
func (xline XLine) Rate(rate int8) Input {
	CheckRate(rate)
	(&xline).defaults()
	return NewInput("XLine", rate, 0, 1, xline.Start, xline.End, xline.Dur, C(float32(xline.Done)))
}
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)
}
740721
func (bpf BPF) Rate(rate int8) Input {
	if bpf.In == nil {
		panic("BPF expects In to not be nil")
	}
	CheckRate(rate)
	(&bpf).defaults()
	return NewInput("BPF", rate, 0, 1, bpf.In, bpf.Freq, bpf.RQ)
}
1005216
func (envgen EnvGen) Rate(rate int8) Input {
	CheckRate(rate)
	(&envgen).defaults()
	ins := []Input{
		envgen.Gate,
		envgen.LevelScale,
		envgen.LevelBias,
		envgen.TimeScale,
		C(float32(envgen.Done)),
	}
	ins = append(ins, envgen.Env.Inputs()...)
	return NewInput("EnvGen", rate, 0, 1, ins...)
}
173891
func (sin SinOsc) Rate(rate int8) Input {
	CheckRate(rate)
	(&sin).defaults()
	return NewInput("SinOsc", rate, 0, 1, sin.Freq, sin.Phase)
}
366414
func (decay2 Decay2) Rate(rate int8) Input {
	CheckRate(rate)
	if decay2.In == nil {
		panic("Decay2 expects In to not be nil")
	}
	(&decay2).defaults()
	return NewInput("Decay2", rate, 0, 1, decay2.In, decay2.Attack, decay2.Decay)
}
137628
func (pc PulseCount) Rate(rate int8) Input {
	CheckRate(rate)
	(&pc).defaults()
	return NewInput("PulseCount", rate, 0, 1, pc.Trig, pc.Reset)
}
534006
func (pan PanB2) Rate(rate int8) Input {
	CheckRate(rate)
	if pan.In == nil {
		panic("PanB2 requires an input")
	}
	(&pan).defaults()
	return NewInput("PanB2", rate, 0, 3, pan.In, pan.Azimuth, pan.Gain)

}
565592
func (cosc COsc) Rate(rate int8) Input {
	CheckRate(rate)
	if cosc.BufNum == nil {
		panic("COsc requires a buffer number")
	}
	(&cosc).defaults()
	return NewInput("COsc", rate, 0, 1, cosc.BufNum, cosc.Freq, cosc.Beats)
}
153654
func (comb Comb) Rate(rate int8) Input {
	CheckRate(rate)
	if comb.In == nil {
		panic("Comb expects In to not be nil")
	}
	if comb.MaxDelayTime == nil {
		comb.MaxDelayTime = C(0.2)
	}
	if comb.DelayTime == nil {
		comb.DelayTime = C(0.2)
	}
	if comb.DecayTime == nil {
		comb.DecayTime = C(1)
	}
	switch comb.Interpolation {
	case InterpolationNone:
		return NewInput("CombN", rate, 0, 1, comb.In, comb.MaxDelayTime, comb.DelayTime, comb.DecayTime)
	case InterpolationLinear:
		return NewInput("CombL", rate, 0, 1, comb.In, comb.MaxDelayTime, comb.DelayTime, comb.DecayTime)
	case InterpolationCubic:
		return NewInput("CombC", rate, 0, 1, comb.In, comb.MaxDelayTime, comb.DelayTime, comb.DecayTime)
	default:
		panic(fmt.Errorf("invalid interpolation: %d", comb.Interpolation))
	}
}
204367
func (s SyncSaw) Rate(rate int8) Input {
	CheckRate(rate)
	(&s).defaults()
	return NewInput("SyncSaw", rate, 0, 1, s.SyncFreq, s.SawFreq)
}
405646
func (s *Sample) Rate() int64 {
	return int64(float64(s.JobMsgCnt) / s.Duration().Seconds())
}
806562
func (out Out) Rate(rate int8) Ugen {
	CheckRate(rate)
	u := NewUgen("Out", rate, 0, 1, out.Bus, out.Channels)
	return *u
}