// Rate creates a new ugen at a specific rate.
// If rate is an unsupported value this method will cause a runtime panic.
182594
func (rand Rand) Rate(rate int8) Input {
	CheckRate(rate)
	(&rand).defaults()
	return NewInput("Rand", rate, 0, 1, rand.Lo, rand.Hi)
}
363132
func (x LinXFade2) Rate(rate int8) Input {
	CheckRate(rate)
	(&x).defaults()
	// Not sure why Level doesn't show up in sclang's synthdefs that use LinXFade2
	return NewInput("LinXFade2", rate, 0, 1, x.A, x.B, x.Pan)
}
126528
func (b Ball) Rate(rate int8) Input {
	CheckRate(rate)
	(&b).defaults()
	return NewInput("Ball", rate, 0, 1, b.In, b.Gravity, b.Damp, b.Friction)
}
515019
func (t Trig) Rate(rate int8) Input {
	CheckRate(rate)
	(&t).defaults()
	return NewInput("Trig", rate, 0, 1, t.In, t.Dur)
}
420608
func (pd PulseDivider) Rate(rate int8) Input {
	CheckRate(rate)
	(&pd).defaults()
	return NewInput("PulseDivider", rate, 0, 1, pd.Trig, pd.Div, pd.Start)
}
755252
func (s Silent) Rate(rate int8) Input {
	CheckRate(rate)
	(&s).defaults()
	return NewInput("DC", rate, 0, s.NumChannels, C(0))
}
1106247
func (r Ringz) Rate(rate int8) Input {
	CheckRate(rate)
	(&r).defaults()
	return NewInput("Ringz", rate, 0, 1, r.In, r.Freq, r.DecayTime)
}
380866
func (l LFClipNoise) Rate(rate int8) Input {
	CheckRate(rate)
	(&l).defaults()
	return NewInput("LFClipNoise", rate, 0, 1, l.Freq)
}
49184
func (maxLocalBufs) Rate(rate int8) Input {
	CheckRate(rate)
	return NewInput("MaxLocalBufs", rate, 0, 1, C(1))
}
841906
func (s Slew) Rate(rate int8) Input {
	CheckRate(rate)
	(&s).defaults()
	return NewInput("Slew", rate, 0, 1, s.In, s.Up, s.Dn)
}
326276
func (lfnoise LFNoise) Rate(rate int8) Input {
	CheckRate(rate)
	(&lfnoise).defaults()
	switch lfnoise.Interpolation {
	case NoiseStep:
		return NewInput("LFNoise0", rate, 0, 1, lfnoise.Freq)
	case NoiseLinear:
		return NewInput("LFNoise1", rate, 0, 1, lfnoise.Freq)
	case NoiseQuadratic:
		return NewInput("LFNoise2", rate, 0, 1, lfnoise.Freq)
	default:
		panic(fmt.Sprintf("Unknown Interpolation value for LFNoise: %d", lfnoise.Interpolation))
	}
}
238944
func (wrp Warp1) Rate(rate int8) Input {
	CheckRate(rate)
	(&wrp).defaults()
	return NewInput("Warp1", rate, 0, wrp.NumChannels, wrp.BufNum, wrp.Pointer, wrp.FreqScale, wrp.WindowSize, wrp.EnvBufNum, wrp.Overlaps, wrp.WindowRandRatio, wrp.Interp)
}
479665
func (r Resonz) Rate(rate int8) Input {
	CheckRate(rate)
	(&r).defaults()
	return NewInput("Resonz", rate, 0, 1, r.In, r.Freq, r.BWR)
}
60416
func (p PSinGrain) Rate(rate int8) Input {
	CheckRate(rate)
	(&p).defaults()
	return NewInput("PSinGrain", rate, 0, 1, p.Freq, p.Dur, p.Amp)
}
1097622
func (l LFPar) Rate(rate int8) Input {
	CheckRate(rate)
	(&l).defaults()
	return NewInput("LFPar", rate, 0, 1, l.Freq, l.IPhase)
}
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)))
}
689585
func (k Klang) Rate(rate int8) Input {
	CheckRate(rate)
	(&k).defaults()

	specs := getArraySpecInputs(k.Spec)

	if len(specs) == 1 {
		ins := append(specs[0].inputs(false), k.FreqScale, k.FreqOffset)
		return NewInput("Klang", rate, 0, 1, ins...)
	}
	var klangs []Input
	for _, spec := range specs {
		ins := append(spec.inputs(false), k.FreqScale, k.FreqOffset)
		klangs = append(klangs, NewInput("Klang", rate, 0, 1, ins...))
	}
	return Multi(klangs...)
}