// Rate creates a new ugen at a specific rate.
// If rate is an unsupported value this method will cause
// a runtime panic.
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))
	}
}
103526
func (pulse Pulse) Rate(rate int8) Input {
	CheckRate(rate)
	(&pulse).defaults()
	return NewInput("Pulse", rate, 0, 1, pulse.Freq, pulse.Width)
}
1275880
func (l Lag) Rate(rate int8) Input {
	CheckRate(rate)
	if l.In == nil {
		panic("Lag requires an input signal")
	}
	return NewInput("Lag", rate, 0, 1, l.In, l.LagTime)
}
70942
func (pan Pan2) Rate(rate int8) Input {
	CheckRate(rate)
	(&pan).defaults()
	in := NewInput("Pan2", rate, 0, 1, pan.In, pan.Pos, pan.Level)
	return Multi(in, 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)))
}
642706
func (dust Dust) Rate(rate int8) Input {
	CheckRate(rate)
	(&dust).defaults()
	return NewInput("Dust", rate, 0, 1, dust.Density)
}
515019
func (t Trig) Rate(rate int8) Input {
	CheckRate(rate)
	(&t).defaults()
	return NewInput("Trig", rate, 0, 1, t.In, t.Dur)
}
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...)
}
374730
func (x XFade2) Rate(rate int8) Input {
	CheckRate(rate)
	(&x).defaults()
	return NewInput("XFade2", rate, 0, 1, x.A, x.B, x.Pan, x.Level)
}
60416
func (p PSinGrain) Rate(rate int8) Input {
	CheckRate(rate)
	(&p).defaults()
	return NewInput("PSinGrain", rate, 0, 1, p.Freq, p.Dur, p.Amp)
}
173891
func (sin SinOsc) Rate(rate int8) Input {
	CheckRate(rate)
	(&sin).defaults()
	return NewInput("SinOsc", rate, 0, 1, sin.Freq, sin.Phase)
}
274146
func (fft FFT) Rate(rate int8) Input {
	CheckRate(rate)
	if fft.Buffer == nil {
		panic("FFT expects Buffer to not be nil")
	}
	if fft.In == nil {
		panic("FFT expects In to not be nil")
	}
	(&fft).defaults()
	return NewInput("FFT", rate, 0, 1, fft.Buffer, fft.In, fft.Hop, fft.WinType, fft.Active, fft.WinSize)
}
1225637
func (dc DC) Rate(rate int8) Input {
	CheckRate(rate)
	(&dc).defaults()
	return NewInput("DC", rate, 0, 1, dc.In)
}
995244
func (ifft IFFT) Rate(rate int8) Input {
	CheckRate(rate)
	(&ifft).defaults()
	return NewInput("IFFT", rate, 0, 1, ifft.Buffer, ifft.WinType, ifft.WinSize)
}
758128
func (tg TGrains) Rate(rate int8) Input {
	CheckRate(rate)
	(&tg).defaults()
	return NewInput("TGrains", rate, 0, tg.NumChannels, tg.Trigger, tg.BufNum, tg.GRate, tg.CenterPos, tg.Dur, tg.Pan, tg.Amp, tg.Interp)
}
1224734
func (bal Balance2) Rate(rate int8) Input {
	if bal.L == nil || bal.R == nil {
		panic("Balance2 expects L and R to not be nil")
	}
	CheckRate(rate)
	(&bal).defaults()
	return NewInput("Balance2", rate, 0, 2, bal.L, bal.R, bal.Pos, bal.Level)
}
732799
func (gate Gate) Rate(rate int8) Input {
	CheckRate(rate)
	if gate.In == nil {
		panic("Gate expects In to not be nil")
	}
	(&gate).defaults()
	return NewInput("Gate", rate, 0, 1, gate.In, gate.Trig)
}